Documentation ¶
Index ¶
- Constants
- Variables
- func AddressEncodeDecoder(chain multichain.Chain, network multichain.Network) multichain.AddressEncodeDecoder
- func IsShiftIn(addr Address) bool
- func NetParams(chain multichain.Chain, net multichain.Network) *chaincfg.Params
- func ToFromV1Selector(sel tx.Selector) string
- func V1QueryTxFromQueryTx(queryTx ParamsQueryTx) jsonrpc.ParamsQueryTx
- func V1TxFromV0Burn(ctx context.Context, v0tx Tx, bindings *binding.Binding, ...) (tx.Tx, error)
- func V1TxParamsFromTx(ctx context.Context, params ParamsSubmitTx, bindings *binding.Binding, ...) (jsonrpc.ParamsSubmitTx, error)
- func ValidateAddress(addr Address) error
- func ValidateV0Tx(tx Tx) error
- func ZcashNetParams(network multichain.Network) *zcash.Params
- type Address
- type Arg
- type Args
- type B
- type B32
- func B32FromHex(str string) (B32, error)
- func BurnTxHash(sel tx.Selector, ref pack.U256) B32
- func MintTxHash(sel tx.Selector, ghash pack.Bytes32, txid pack.Bytes, txindex pack.U32) B32
- func V0TxHashFromTx(tx Tx) (B32, error)
- func V1TxFromV0Mint(ctx context.Context, v0tx Tx, bindings *binding.Binding, pubkey *id.PubKey) (tx.Tx, B32, error)
- type CompatShard
- type CompatStore
- type Contract
- type Contracts
- type ExtBtcCompatUTXO
- type ExtBtcCompatUTXOs
- func (extBtcCompatUTXOs ExtBtcCompatUTXOs) Amount() U256
- func (utxos ExtBtcCompatUTXOs) Equal(other Value) bool
- func (extBtcCompatUTXOs ExtBtcCompatUTXOs) MarshalBinary() ([]byte, error)
- func (utxos ExtBtcCompatUTXOs) Sort()
- func (ExtBtcCompatUTXOs) Type() Type
- func (extBtcCompatUTXOs *ExtBtcCompatUTXOs) UnmarshalBinary(data []byte) error
- type ExtEthCompatAddress
- func (extEthCompatAddress ExtEthCompatAddress) Equal(other Value) bool
- func (extEthCompatAddress ExtEthCompatAddress) MarshalBinary() ([]byte, error)
- func (extEthCompatAddress ExtEthCompatAddress) MarshalJSON() ([]byte, error)
- func (extEthCompatAddress ExtEthCompatAddress) String() string
- func (ExtEthCompatAddress) Type() Type
- func (extEthCompatAddress *ExtEthCompatAddress) UnmarshalBinary(data []byte) error
- func (extEthCompatAddress *ExtEthCompatAddress) UnmarshalJSON(data []byte) error
- type ExtEthCompatPayload
- type ExtEthCompatTx
- type Fees
- type Formal
- type Formals
- type Gateway
- type I128
- type I16
- type I256
- type I32
- type I64
- type I8
- type List
- type MintAndBurnFees
- type ParamsQueryTx
- type ParamsSubmitTx
- type Record
- func (record Record) Clone() Record
- func (record Record) Compatible(other Value) bool
- func (record Record) Equal(other Value) bool
- func (record Record) MarshalBinary() ([]byte, error)
- func (record Record) MarshalJSON() ([]byte, error)
- func (Record) Type() Type
- func (record *Record) UnmarshalBinary(data []byte) error
- func (record *Record) UnmarshalJSON(data []byte) error
- type ResponseQueryFees
- type ResponseQueryShards
- type ResponseQueryTx
- type ResponseSubmitTx
- type Shard
- type Store
- type Str
- type Tx
- type TxStatus
- type TxStatuses
- type Txs
- type Type
- type U128
- type U16
- type U256
- type U32
- type U64
- type U8
- type Value
Constants ¶
const ( TypeAddress = "address" TypeStr = "str" TypeB32 = "b32" TypeB = "b" TypeI8 = "i8" TypeI16 = "i16" TypeI32 = "i32" TypeI64 = "i64" TypeI128 = "i128" TypeI256 = "i256" TypeU8 = "u8" TypeU16 = "u16" TypeU32 = "u32" TypeU64 = "u64" TypeU128 = "u128" TypeU256 = "u256" TypeRecord = "record" TypeList = "list" )
Enumeration of standard types.
const ( ExtTypeEthCompatAddress = "ext_ethCompatAddress" ExtTypeBtcCompatUTXO = "ext_btcCompatUTXO" ExtTypeBtcCompatUTXOs = "ext_btcCompatUTXOs" ExtTypeEthCompatTx = "ext_ethCompatTx" ExtTypeEthCompatPayload = "ext_ethCompatPayload" )
Enumeration of extended types. Extended types are implemented whenever a new distributed ledger is introduced to RenVM, and no standard type can be used to represent values needed by the shifter contracts.
const ( // MethodQueryShards returns information about the currently online/offline // Shards. // Deprecated in v1 by queryState MethodQueryShards = "ren_queryShards" // MethodQueryFees returns information about the current RenVM fees and // undelrying blockchain fees. This information cannot be verified. // Deprecated in v1 by query MethodQueryFees = "ren_queryFees" )
const ( TxStatusNil = TxStatus(0) // TxStatusConfirming = TxStatus(1) TxStatusPending = TxStatus(2) TxStatusExecuting = TxStatus(3) TxStatusDone = TxStatus(4) )
Variables ¶
var ( // IntrinsicDefault is the default Shard. IntrinsicDefault = Shard(sha3.Sum256([]byte{})) // IntrinsicBtc is the Shard for all assets that originate on the Bitcoin // blockchain. IntrinsicBtc = Shard(sha3.Sum256([]byte("Btc"))) // IntrinsicZec is the Shard for all assets that originate on the ZCash // blockchain. IntrinsicZec = Shard(sha3.Sum256([]byte("Zec"))) // IntrinsicBch is the Shard for all assets that originate on the Bitcoin // cash blockchain. IntrinsicBch = Shard(sha3.Sum256([]byte("Bch"))) // IntrinsicEth is the Shard for all assets that originate on the Ethereum // blockchain. IntrinsicEth = Shard(sha3.Sum256([]byte("Eth"))) )
var ErrNotFound = errors.New("compatstore: not found")
ErrNotFound wraps redis errors to hide implementation details
var IntrinsicBCH0Bch2Eth = Contract{ Address: "BCH0Bch2Eth", In: Formals{ {"p", ExtTypeEthCompatPayload}, {"token", ExtTypeEthCompatAddress}, {"to", ExtTypeEthCompatAddress}, {"n", TypeB32}, {"utxo", ExtTypeBtcCompatUTXO}, }, Autogen: Formals{ {"ghash", TypeB32}, {"nhash", TypeB32}, {"phash", TypeB32}, {"sighash", TypeB32}, {"amount", TypeU256}, {"utxo", ExtTypeBtcCompatUTXO}, }, Out: Formals{ {"r", TypeB32}, {"s", TypeB32}, {"v", TypeU8}, }, }
IntrinsicBCH0Bch2Eth transfers BCH from the BitcoinCash blockchain to the Ethereum blockchain.
var IntrinsicBCH0Eth2Bch = Contract{ Address: "BCH0Eth2Bch", In: Formals{ {"ref", TypeU64}, }, Out: Formals{ {"txhash", TypeB}, }, }
IntrinsicBCH0Eth2Bch transfers BCH from the Ethereum blockchain to the BitcoinCash blockchain.
var IntrinsicBTC0Btc2Eth = Contract{ Address: "BTC0Btc2Eth", In: Formals{ {"p", ExtTypeEthCompatPayload}, {"token", ExtTypeEthCompatAddress}, {"to", ExtTypeEthCompatAddress}, {"n", TypeB32}, {"utxo", ExtTypeBtcCompatUTXO}, }, Autogen: Formals{ {"ghash", TypeB32}, {"nhash", TypeB32}, {"phash", TypeB32}, {"sighash", TypeB32}, {"amount", TypeU256}, {"utxo", ExtTypeBtcCompatUTXO}, }, Out: Formals{ {"r", TypeB32}, {"s", TypeB32}, {"v", TypeU8}, }, }
IntrinsicBTC0Btc2Eth transfers BTC from the Bitcoin blockchain to the Ethereum blockchain.
var IntrinsicBTC0Eth2Btc = Contract{ Address: "BTC0Eth2Btc", In: Formals{ {"ref", TypeU64}, }, Out: Formals{ {"txhash", TypeB}, }, }
IntrinsicBTC0Eth2Btc transfers BTC from the Ethereum blockchain to the Bitcoin blockchain.
var IntrinsicZEC0Eth2Zec = Contract{ Address: "ZEC0Eth2Zec", In: Formals{ {"ref", TypeU64}, }, Out: Formals{ {"txhash", TypeB}, }, }
IntrinsicZEC0Eth2Zec transfers ZEC from the Ethereum blockchain to the ZCash blockchain.
var IntrinsicZEC0Zec2Eth = Contract{ Address: "ZEC0Zec2Eth", In: Formals{ {"p", ExtTypeEthCompatPayload}, {"token", ExtTypeEthCompatAddress}, {"to", ExtTypeEthCompatAddress}, {"n", TypeB32}, {"utxo", ExtTypeBtcCompatUTXO}, }, Autogen: Formals{ {"ghash", TypeB32}, {"nhash", TypeB32}, {"phash", TypeB32}, {"sighash", TypeB32}, {"amount", TypeU256}, {"utxo", ExtTypeBtcCompatUTXO}, }, Out: Formals{ {"r", TypeB32}, {"s", TypeB32}, {"v", TypeU8}, }, }
IntrinsicZEC0Zec2Eth transfers ZEC from the ZCash blockchain to the Ethereum blockchain.
var Intrinsics = map[Address]Contract{ IntrinsicBTC0Btc2Eth.Address: IntrinsicBTC0Btc2Eth, IntrinsicBTC0Eth2Btc.Address: IntrinsicBTC0Eth2Btc, IntrinsicZEC0Zec2Eth.Address: IntrinsicZEC0Zec2Eth, IntrinsicZEC0Eth2Zec.Address: IntrinsicZEC0Eth2Zec, IntrinsicBCH0Bch2Eth.Address: IntrinsicBCH0Bch2Eth, IntrinsicBCH0Eth2Bch.Address: IntrinsicBCH0Eth2Bch, }
Intrinsics are Contracts that are always known to RenVM.
Functions ¶
func AddressEncodeDecoder ¶
func AddressEncodeDecoder(chain multichain.Chain, network multichain.Network) multichain.AddressEncodeDecoder
func IsShiftIn ¶
IsShiftIn returns if the given contract address is a shiftIn contract. Please only use this function when you know the contract exists, otherwise it will panic.
func NetParams ¶
func NetParams(chain multichain.Chain, net multichain.Network) *chaincfg.Params
func ToFromV1Selector ¶
ToFromV1Selector creates the "to" field in the v0 tx The "to" field in the v0 tx is the equivalent of a selector here we convert the v1 selector into the v0 format
func V1QueryTxFromQueryTx ¶
func V1QueryTxFromQueryTx(queryTx ParamsQueryTx) jsonrpc.ParamsQueryTx
V1QueryTxFromQueryTx casts a v0 ParamsQueryTx to a v1 ParamsQueryTx by encoding the txhash in the appropriate manner
func V1TxFromV0Burn ¶
func V1TxParamsFromTx ¶
func V1TxParamsFromTx(ctx context.Context, params ParamsSubmitTx, bindings *binding.Binding, pubkey *id.PubKey, store CompatStore, network multichain.Network) (jsonrpc.ParamsSubmitTx, error)
V1TxParamsFromTx will create a v1 Tx from a v0 Tx Will attempt to check if we have already constructed the parameters previously, otherwise will construct a v1 tx using v0 parameters, and persist a mapping so that a v0 queryTX can find them
func ValidateAddress ¶
func ValidateV0Tx ¶
ValidateV0Tx check the tx has a valid contract address and has all the required input fields.
func ZcashNetParams ¶
func ZcashNetParams(network multichain.Network) *zcash.Params
Types ¶
type Address ¶
type Address string
Address is a address on RenVM.
func (Address) MarshalBinary ¶
MarshalBinary implements the `encoding.BinaryMarshaler` interface for the Address type.
func (*Address) UnmarshalBinary ¶
UnmarshalBinary implements the `encoding.BinaryUnmarshaler` interface for the Address type.
func (*Address) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface for the Address type.
type Arg ¶
An Arg defines a Value that can fulfil a Formal. It is used to align a Value in a Tx to an expected Value in a Contract.
func (Arg) MarshalBinary ¶
MarshalBinary implements the `encoding.BinaryMarshaler` interface for the Arg type.
func (*Arg) UnmarshalBinary ¶
UnmarshalBinary implements the `encoding.BinaryUnmarshaler` interface for the Arg type.
func (*Arg) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler for the Arg type.
type Args ¶
type Args []Arg
Args is a wrapper type for the Arg slice type.
type B ¶
type B []byte
B is a slice of bytes.
func BFromHex ¶
BFromHex returns a B Value decoded from a hex encoded string. The "0x" prefix is optional.
func (B) MarshalBinary ¶
MarshalBinary implements the `encoding.BinaryMarshaler` interface for the B type.
func (*B) UnmarshalBinary ¶
UnmarshalBinary implements the `encoding.BinaryMarshaler` interface for the B type.
func (*B) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface for the B type.
type B32 ¶
type B32 [32]byte
B32 is a slice of 32 bytes.
func B32FromHex ¶
B32FromHex returns a B32 Value decoded from a hex encoded string. The "0x" prefix is optional.
func BurnTxHash ¶
BurnTxHash creates V0 BurnTxHash from params available in V1
func MintTxHash ¶
MintTxHash creates V0 MintTxHash from params available in V1
func V0TxHashFromTx ¶
func V1TxFromV0Mint ¶
func (B32) MarshalBinary ¶
MarshalBinary implements the `encoding.BinaryMarshaler` interface for the B32 type.
func (B32) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface for the B32 type.
func (*B32) UnmarshalBinary ¶
UnmarshalBinary implements the `encoding.BinaryMarshaler` interface for the B32 type.
func (*B32) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface for the B32 type.
type CompatShard ¶
type CompatStore ¶
type CompatStore interface { // PersistTxMappings maps the v0 tx to the v1 tx for future querying. PersistTxMappings(v0tx Tx, v1tx tx.Tx) error // GetV1TxFromTx gets the v1 transaction from v0 transaction GetV1TxFromTx(tx Tx) (tx.Tx, error) // GetV1HashFromHash gets the v1 transaction hash from v0 transaction hash. GetV1HashFromHash(hash B32) (id.Hash, error) }
CompatStore aims to abstract compat persistence mappings
type Contract ¶
type Contract struct { Address Address `json:"address"` In Formals `json:"in"` Autogen Formals `json:"autogen"` Out Formals `json:"out"` }
A Contract ABI defines the expected components of a Contract. It must have a unique Addr, a slice of expected input Formals, and a slice of expected output Formals. Any Tx that is sent to a Contract must have Args that are compatible with the its input Formals.
type ExtBtcCompatUTXO ¶
type ExtBtcCompatUTXO struct { TxHash B32 `json:"txHash"` VOut U32 `json:"vOut"` ScriptPubKey B `json:"scriptPubKey,omitempty"` Amount U256 `json:"amount,omitempty"` GHash B32 `json:"ghash,omitempty"` }
ExtBtcCompatUTXO is a Bitcoin compatible UTXO. It is used for transactions on Bitcoin (and forks).
func (ExtBtcCompatUTXO) Equal ¶
func (utxo ExtBtcCompatUTXO) Equal(other Value) bool
Equal implements the Value interface for the ExtBtcCompatUTXO type.
func (ExtBtcCompatUTXO) MarshalBinary ¶
func (extBtcCompatUTXO ExtBtcCompatUTXO) MarshalBinary() ([]byte, error)
MarshalBinary implements the `encoding.BinaryMarshaler` interface for the ExtBtcCompatUTXO type.
func (ExtBtcCompatUTXO) Type ¶
func (ExtBtcCompatUTXO) Type() Type
Type implements the Value interface for the ExtBtcCompatUTXO type.
func (*ExtBtcCompatUTXO) UnmarshalBinary ¶
func (extBtcCompatUTXO *ExtBtcCompatUTXO) UnmarshalBinary(data []byte) error
UnmarshalBinary implements the `encoding.BinaryMarshaler` interface for the ExtBtcCompatUTXO type.
type ExtBtcCompatUTXOs ¶
type ExtBtcCompatUTXOs []ExtBtcCompatUTXO
ExtBtcCompatUTXOs is a wrapper type.
func (ExtBtcCompatUTXOs) Amount ¶
func (extBtcCompatUTXOs ExtBtcCompatUTXOs) Amount() U256
Amount returns the sum of all amounts in the UTXOs.
func (ExtBtcCompatUTXOs) Equal ¶
func (utxos ExtBtcCompatUTXOs) Equal(other Value) bool
Equal implements the Value interface for the ExtBtcCompatUTXOs type.
func (ExtBtcCompatUTXOs) MarshalBinary ¶
func (extBtcCompatUTXOs ExtBtcCompatUTXOs) MarshalBinary() ([]byte, error)
MarshalBinary implements the `encoding.BinaryMarshaler` interface for the ExtBtcCompatUTXOs type.
func (ExtBtcCompatUTXOs) Sort ¶
func (utxos ExtBtcCompatUTXOs) Sort()
Sort the UTXOs by amount, from smallest to largest.
func (ExtBtcCompatUTXOs) Type ¶
func (ExtBtcCompatUTXOs) Type() Type
Type implements the Value interface for the ExtBtcCompatUTXOs type.
func (*ExtBtcCompatUTXOs) UnmarshalBinary ¶
func (extBtcCompatUTXOs *ExtBtcCompatUTXOs) UnmarshalBinary(data []byte) error
UnmarshalBinary implements the `encoding.BinaryMarshaler` interface for the ExtBtcCompatUTXOs type.
type ExtEthCompatAddress ¶
ExtEthCompatAddress is an Ethereum compatible address.
func ExtEthCompatAddressFromHex ¶
func ExtEthCompatAddressFromHex(str string) (ExtEthCompatAddress, error)
ExtEthCompatAddressFromHex returns a ExtEthCompatAddress value decoded from a hex encoded string. The "0x" prefix is optional.
func (ExtEthCompatAddress) Equal ¶
func (extEthCompatAddress ExtEthCompatAddress) Equal(other Value) bool
Equal implements the Value interface for the B20 type.
func (ExtEthCompatAddress) MarshalBinary ¶
func (extEthCompatAddress ExtEthCompatAddress) MarshalBinary() ([]byte, error)
MarshalBinary implements the `encoding.BinaryMarshaler` interface for the ExtEthCompatAddress type.
func (ExtEthCompatAddress) MarshalJSON ¶
func (extEthCompatAddress ExtEthCompatAddress) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Unmarshaler interface for the ExtEthCompatAddress type.
func (ExtEthCompatAddress) String ¶
func (extEthCompatAddress ExtEthCompatAddress) String() string
String implements the Stringer interface for the ExtEthCompatAddress type.
func (ExtEthCompatAddress) Type ¶
func (ExtEthCompatAddress) Type() Type
Type implements the Value interface for the ExtEthCompatAddress type.
func (*ExtEthCompatAddress) UnmarshalBinary ¶
func (extEthCompatAddress *ExtEthCompatAddress) UnmarshalBinary(data []byte) error
UnmarshalBinary implements the `encoding.BinaryMarshaler` interface for the ExtEthCompatAddress type.
func (*ExtEthCompatAddress) UnmarshalJSON ¶
func (extEthCompatAddress *ExtEthCompatAddress) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface for the ExtEthCompatAddress type.
type ExtEthCompatPayload ¶
ExtEthCompatPayload is an Ethereum compatible packed payload.
func (ExtEthCompatPayload) Equal ¶
func (payload ExtEthCompatPayload) Equal(other Value) bool
Equal implements the Value interface for the ExtEthCompatPayload type.
func (*ExtEthCompatPayload) Hash ¶
func (payload *ExtEthCompatPayload) Hash() B32
Hash returns the keccak hash of the payload.
func (ExtEthCompatPayload) MarshalBinary ¶
func (payload ExtEthCompatPayload) MarshalBinary() ([]byte, error)
MarshalBinary implements the `encoding.BinaryMarshaler` interface for the ExtEthCompatPayload type.
func (ExtEthCompatPayload) Type ¶
func (ExtEthCompatPayload) Type() Type
Type implements the Value interface for the ExtEthCompatPayload type.
func (*ExtEthCompatPayload) UnmarshalBinary ¶
func (payload *ExtEthCompatPayload) UnmarshalBinary(data []byte) error
UnmarshalBinary implements the `encoding.BinaryMarshaler` interface for the ExtEthCompatPayload type.
type ExtEthCompatTx ¶
type ExtEthCompatTx struct {
TxHash B32 `json:"txHash"`
}
ExtEthCompatTx is an Ethereum compatible transaction. It is used to representation transactions on Ethereum (and forks).
func (ExtEthCompatTx) Equal ¶
func (tx ExtEthCompatTx) Equal(other Value) bool
Equal implements the Value interface for the ExtEthCompatTx type.
func (ExtEthCompatTx) MarshalBinary ¶
func (extEthCompatTx ExtEthCompatTx) MarshalBinary() ([]byte, error)
MarshalBinary implements the `encoding.BinaryMarshaler` interface for the ExtEthCompatTx type.
func (ExtEthCompatTx) Type ¶
func (ExtEthCompatTx) Type() Type
Type implements the Value interface for the ExtEthCompatTx type.
func (*ExtEthCompatTx) UnmarshalBinary ¶
func (extEthCompatTx *ExtEthCompatTx) UnmarshalBinary(data []byte) error
UnmarshalBinary implements the `encoding.BinaryMarshaler` interface for the ExtEthCompatTx type.
type Fees ¶
type Fees struct { Lock U64 `json:"lock"` Release U64 `json:"release"` Ethereum MintAndBurnFees `json:"ethereum"` }
type Formal ¶
A Formal defines the expected name and type of a Value that will be passed in/out of a Contract. A Formal has no Value, because it is only a definition of the expected form of a Value.
func (Formal) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface for the Formal type.
func (*Formal) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface for the Formal type.
type I128 ¶
I128 stores a big.Int representing a 128 bit unsigned integer.
func (I128) MarshalBinary ¶
MarshalBinary implements the `encoding.BinaryMarshaler` interface for the I128 type.
func (I128) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface for the I128 type.
func (*I128) UnmarshalBinary ¶
UnmarshalBinary implements the `encoding.BinaryMarshaler` interface for the I128 type.
func (*I128) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface for the I128 type.
type I16 ¶
I16 stores a big.Int representing a 16 bit unsigned integer.
func (I16) MarshalBinary ¶
MarshalBinary implements the `encoding.BinaryMarshaler` interface for the I16 type.
func (I16) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface for the I16 type.
func (*I16) UnmarshalBinary ¶
UnmarshalBinary implements the `encoding.BinaryMarshaler` interface for the I16 type.
func (*I16) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface for the I16 type.
type I256 ¶
I256 stores a big.Int representing a 256 bit unsigned integer.
func (I256) MarshalBinary ¶
MarshalBinary implements the `encoding.BinaryMarshaler` interface for the I256 type.
func (I256) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface for the I256 type.
func (*I256) UnmarshalBinary ¶
UnmarshalBinary implements the `encoding.BinaryMarshaler` interface for the I256 type.
func (*I256) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface for the I256 type.
type I32 ¶
I32 stores a big.Int representing a 32 bit unsigned integer.
func (I32) MarshalBinary ¶
MarshalBinary implements the `encoding.BinaryMarshaler` interface for the I32 type.
func (I32) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface for the I32 type.
func (*I32) UnmarshalBinary ¶
UnmarshalBinary implements the `encoding.BinaryMarshaler` interface for the I32 type.
func (*I32) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface for the I32 type.
type I64 ¶
I64 stores a big.Int representing a 64 bit unsigned integer.
func (I64) MarshalBinary ¶
MarshalBinary implements the `encoding.BinaryMarshaler` interface for the I64 type.
func (I64) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface for the I64 type.
func (*I64) UnmarshalBinary ¶
UnmarshalBinary implements the `encoding.BinaryMarshaler` interface for the I64 type.
func (*I64) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface for the I64 type.
type I8 ¶
I8 stores a big.Int representing a 8 bit unsigned integer.
func (I8) MarshalBinary ¶
MarshalBinary implements the `encoding.BinaryMarshaler` interface for the I8 type.
func (I8) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface for the I8 type.
func (*I8) UnmarshalBinary ¶
UnmarshalBinary implements the `encoding.BinaryMarshaler` interface for the I8 type.
func (*I8) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface for the I8 type.
type List ¶
type List []Value
func (List) MarshalBinary ¶
func (List) MarshalJSON ¶
func (*List) UnmarshalBinary ¶
func (*List) UnmarshalJSON ¶
type MintAndBurnFees ¶
type ParamsQueryTx ¶
type ParamsQueryTx struct {
TxHash B32 `json:"txHash"`
}
type ParamsSubmitTx ¶
type ParamsSubmitTx struct {
Tx Tx `json:"tx"`
}
type Record ¶
func (Record) Clone ¶
Clone returns a deep clone of the original Record. Modifying this deep clone will not modify the original Record.
func (Record) Compatible ¶
Compatible returns true when the two Records have the field Types. Otherwise, it returns false.
func (Record) MarshalBinary ¶
MarshalBinary implements the `encoding.BinaryMarshaler` interface for the Record type.
func (Record) MarshalJSON ¶
MarshalJSON implements the `json.Marshaler` interface for the Record type.
func (*Record) UnmarshalBinary ¶
UnmarshalBinary implements the `encoding.BinaryMarshaler` interface for the Record type.
func (*Record) UnmarshalJSON ¶
UnmarshalJSON implements the `json.Unmarshaler` interface for the Record type.
type ResponseQueryFees ¶
func QueryFeesResponseFromState ¶
func QueryFeesResponseFromState(state map[string]engine.XState) (ResponseQueryFees, error)
ShardsResponseFromState takes a QueryState rpc response and converts it into a QueryShards rpc response It can be a standalone function as it has no dependencies
type ResponseQueryShards ¶
type ResponseQueryShards struct {
Shards []CompatShard `json:"shards"`
}
ResponseQueryShards defines the response of the MethodQueryShards.
func ShardsResponseFromSystemState ¶
func ShardsResponseFromSystemState(state engine.SystemState) (ResponseQueryShards, error)
ShardsResponseFromState takes a QueryState rpc response and converts it into a QueryShards rpc response It can be a standalone function as it has no dependencies
type ResponseQueryTx ¶
type ResponseSubmitTx ¶
type ResponseSubmitTx struct {
Tx Tx `json:"tx"`
}
type Shard ¶
type Shard [32]byte
A Shard stores multiple Contracts. The Txs sent to a Shard are guaranteed to be strictly ordered within that Shard.
type Str ¶
type Str string
Str is a dynamically sized string.
func (Str) MarshalBinary ¶
MarshalBinary implements the `encoding.BinaryMarshaler` interface for the Str type.
func (*Str) UnmarshalBinary ¶
UnmarshalBinary implements the `encoding.BinaryMarshaler` interface for the Str type.
func (*Str) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface for the Str type.
type Tx ¶
type Tx struct { Hash B32 `json:"hash"` To Address `json:"to"` In Args `json:"in"` Autogen Args `json:"autogen,omitempty"` Out Args `json:"out,omitempty"` }
A Tx ABI defines the expected components of a Tx. It must have the Contract Address, to which it will be sent, and a slice of Args that it will pass to the Contract. The Args must be compatible with the input Formals of the Contract.
func TxFromV1Tx ¶
TxFromV1Tx takes a V1 Tx and converts it to a V0 Tx.
func (Tx) MarshalBinary ¶
MarshalBinary implements the `encoding.BinaryMarshaler` interface for the Tx type.
func (*Tx) UnmarshalBinary ¶
UnmarshalBinary implements the `encoding.BinaryUnmarshaler` interface for the Tx type.
type TxStatus ¶
type TxStatus uint8
func (TxStatus) MarshalBinary ¶
MarshalBinary implements the `encoding.BinaryMarshaler` interface for the TxStatus type.
func (*TxStatus) UnmarshalBinary ¶
UnmarshalBinary implements the `encoding.BinaryUnmarshaler` interface for the TxStatus type.
type TxStatuses ¶
type TxStatuses []TxStatus
TxStatuses is a wrapper type for the TxStatus slice type.
func (TxStatuses) MarshalBinary ¶
func (txStatuses TxStatuses) MarshalBinary() ([]byte, error)
MarshalBinary implements the `encoding.BinaryMarshaler` interface for the TxStatuses type.
func (*TxStatuses) UnmarshalBinary ¶
func (txStatuses *TxStatuses) UnmarshalBinary(data []byte) error
UnmarshalBinary implements the `encoding.BinaryUnmarshaler` interface for the TxStatuses type.
type Txs ¶
type Txs []Tx
Txs is a wrapper type for the Tx slice type.
func (Txs) MarshalBinary ¶
MarshalBinary implements the `encoding.BinaryMarshaler` interface for the Txs type.
func (*Txs) UnmarshalBinary ¶
UnmarshalBinary implements the `encoding.BinaryUnmarshaler` interface for the Txs type.
type Type ¶
type Type string
A Type is a constant string that uniquely identifies the type of a Value.
type U128 ¶
U128 stores a big.Int representing a 128 bit unsigned integer.
func (U128) MarshalBinary ¶
MarshalBinary implements the `encoding.BinaryMarshaler` interface for the U128 type.
func (U128) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface for the U128 type.
func (*U128) UnmarshalBinary ¶
UnmarshalBinary implements the `encoding.BinaryMarshaler` interface for the U128 type.
func (*U128) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface for the U128 type.
type U16 ¶
U16 stores a big.Int representing a 16 bit unsigned integer.
func (U16) MarshalBinary ¶
MarshalBinary implements the `encoding.BinaryMarshaler` interface for the U16 type.
func (U16) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface for the U16 type.
func (*U16) UnmarshalBinary ¶
UnmarshalBinary implements the `encoding.BinaryMarshaler` interface for the U16 type.
func (*U16) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface for the U16 type.
type U256 ¶
U256 stores a big.Int representing a 256 bit unsigned integer.
func (U256) MarshalBinary ¶
MarshalBinary implements the `encoding.BinaryMarshaler` interface for the U256 type.
func (U256) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface for the U256 type.
func (*U256) UnmarshalBinary ¶
UnmarshalBinary implements the `encoding.BinaryMarshaler` interface for the U256 type.
func (*U256) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface for the U256 type.
type U32 ¶
U32 stores a big.Int representing a 32 bit unsigned integer.
func (U32) MarshalBinary ¶
MarshalBinary implements the `encoding.BinaryMarshaler` interface for the U32 type.
func (U32) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface for the U32 type.
func (*U32) UnmarshalBinary ¶
UnmarshalBinary implements the `encoding.BinaryMarshaler` interface for the U32 type.
func (*U32) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface for the U32 type.
type U64 ¶
U64 stores a big.Int representing a 64 bit unsigned integer.
func (U64) MarshalBinary ¶
MarshalBinary implements the `encoding.BinaryMarshaler` interface for the U64 type.
func (U64) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface for the U64 type.
func (*U64) UnmarshalBinary ¶
UnmarshalBinary implements the `encoding.BinaryMarshaler` interface for the U64 type.
func (*U64) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface for the U64 type.
type U8 ¶
U8 stores a big.Int representing a 8 bit unsigned integer.
func (U8) MarshalBinary ¶
MarshalBinary implements the `encoding.BinaryMarshaler` interface for the U8 type.
func (U8) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface for the U8 type.
func (*U8) UnmarshalBinary ¶
UnmarshalBinary implements the `encoding.BinaryMarshaler` interface for the U8 type.
func (*U8) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface for the U8 type.