Documentation ¶
Index ¶
Constants ¶
const ( // Cryptographic types. TypeCrypto = abi.Type(1000) TypeCryptoS256N = TypeCrypto + abi.Type(1) TypeCryptoS256P = TypeCrypto + abi.Type(2) TypeCryptoS256PubKey = TypeCrypto + abi.Type(3) TypeCryptoS256PrivKey = TypeCrypto + abi.Type(4) TypeCryptoShamirS256N = TypeCrypto + abi.Type(5) TypeCryptoShamirS256P = TypeCrypto + abi.Type(6) TypeCryptoShamirS256PrivKey = TypeCrypto + abi.Type(7) // RenVM types. Type = abi.Type(1100) TypeTx = Type + abi.Type(1) TypeArgument = Type + abi.Type(2) TypeArguments = Type + abi.Type(3) // Ethereum types. TypeEthereum = abi.Type(1200) TypeEthereumAddress = TypeEthereum + abi.Type(1) TypeEthereumTx = TypeEthereum + abi.Type(2) // Bitcoin types. TypeBitcoin = abi.Type(1300) TypeBitcoinAddress = TypeBitcoin + abi.Type(1) TypeBitcoinUTXOIndex = TypeBitcoin + abi.Type(2) TypeBitcoinUTXO = TypeBitcoin + abi.Type(3) // ZCash types. TypeZCash = abi.Type(1400) TypeZCashAddress = TypeZCash + abi.Type(1) // Bitcoin Cash types. TypeBitcoinCash = abi.Type(1500) TypeBitcoinCashAddress = TypeBitcoinCash + abi.Type(1) // Litecoin types. TypeLitecoin = abi.Type(1700) TypeLitecoinAddress = TypeLitecoin + abi.Type(1) )
Extension types. The standard unmarshaler will not check these extension types. Instead, you must use the unmarshalers in this packages (and sub-packages).
Variables ¶
This section is empty.
Functions ¶
func EncodeArguments ¶ added in v0.2.0
EncodeArguments into an Ethereum ABI compatible byte slice.
func NewTxHash ¶ added in v0.2.0
NewTxHash returns the Sum256 hash of the To address and In arguments for a RenVM transaction. Autogen arguments are ignored because they are deterministically generated from the In arguments, and the Out arguments are ignored because they do not exist until the transaction has been fully executed.
Types ¶
type Address ¶ added in v0.2.0
func (Address) MarshalJSON ¶ added in v0.2.0
func (*Address) UnmarshalJSON ¶ added in v0.2.0
type Argument ¶ added in v0.2.0
func (Argument) MarshalJSON ¶ added in v0.2.0
func (*Argument) UnmarshalJSON ¶ added in v0.2.0
type Arguments ¶ added in v0.2.0
type Arguments []Argument
type Tx ¶ added in v0.2.0
type Tx struct { // Hash of the to address and the inputs arguments. Hash abi.Bytes32 `json:"hash"` // To address specifies the RenVM address that will be receiving the // transaction. For cross-chain transactions, this will be the unique // human-readable address that identifies the specific cross-chain gateway // being used. To abi.String `json:"to"` // In argumenst are provided by the transaction sender. These arguments may, // or may not, need to be validated by the receiver. Either way, it is // impossible for the receiver to generate these arguments. In Arguments `json:"in"` // Autogen arguments are can be generated from the input arguments. If these // arguments were provided as input, then they would need to be validated by // the receiver (which usually involves autogenerating the arguments from // scratch, and comparing them against the originally provided ones). Autogen Arguments `json:"autogen"` // Out arguments are produced by executing the transaction. Out Arguments `json:"out"` }
Tx represents a RenVM transaction. It may, or may not, include transactions from other blockchains (if it does, then they are usually included as part of the RenVM transaction inputs).
func NewTx ¶ added in v0.2.0
NewTx computes the transaction hash and returns a filled in RenVM transaction.
func (Tx) Marshal ¶ added in v0.2.0
Marshal the transaction into binary. A maximum number of bytes can be allocated while marshaling (this maximum is not strict).
type UTXO ¶ added in v0.2.0
type UTXO struct { UTXOIndex Amount abi.U64 `json:"amount"` ScriptPubKey abi.Bytes `json:"scriptPubKey"` }
A UTXO is the complete information of an unspent transaction output. It includes the UTXOIndex.