Documentation ¶
Index ¶
- Constants
- func IsSortedAndUniqueInitialStates(iss []*InitialState) bool
- func IsSortedAndUniqueOperations(ops []*Operation, c codec.Manager) bool
- func SortInitialStates(iss []*InitialState)
- func SortOperations(ops []*Operation, c codec.Manager)
- func SortOperationsWithSigners(ops []*Operation, signers [][]*crypto.PrivateKeySECP256K1R, ...)
- type BaseTx
- type CreateAssetTx
- func (t *CreateAssetTx) InitCtx(ctx *snow.Context)
- func (t *CreateAssetTx) InitialStates() []*InitialState
- func (t *CreateAssetTx) Sort()
- func (t *CreateAssetTx) SyntacticVerify(ctx *snow.Context, c codec.Manager, txFeeAssetID ids.ID, _ uint64, ...) error
- func (t *CreateAssetTx) Visit(v Visitor) error
- type ExportTx
- type ImportTx
- func (t *ImportTx) AssetIDs() ids.Set
- func (t *ImportTx) ConsumedAssetIDs() ids.Set
- func (t *ImportTx) InputUTXOs() []*avax.UTXOID
- func (t *ImportTx) NumCredentials() int
- func (t *ImportTx) SyntacticVerify(ctx *snow.Context, c codec.Manager, txFeeAssetID ids.ID, txFee uint64, ...) error
- func (t *ImportTx) Visit(v Visitor) error
- type InitialState
- type Operation
- type OperationTx
- func (t *OperationTx) AssetIDs() ids.Set
- func (t *OperationTx) ConsumedAssetIDs() ids.Set
- func (t *OperationTx) InitCtx(ctx *snow.Context)
- func (t *OperationTx) InputUTXOs() []*avax.UTXOID
- func (t *OperationTx) NumCredentials() int
- func (t *OperationTx) Operations() []*Operation
- func (t *OperationTx) SyntacticVerify(ctx *snow.Context, c codec.Manager, txFeeAssetID ids.ID, txFee uint64, ...) error
- func (t *OperationTx) Visit(v Visitor) error
- type Parser
- type Tx
- func (t *Tx) Bytes() []byte
- func (t *Tx) ID() ids.ID
- func (t *Tx) Initialize(unsignedBytes, signedBytes []byte)
- func (t *Tx) SignNFTFx(c codec.Manager, signers [][]*crypto.PrivateKeySECP256K1R) error
- func (t *Tx) SignPropertyFx(c codec.Manager, signers [][]*crypto.PrivateKeySECP256K1R) error
- func (t *Tx) SignSECP256K1Fx(c codec.Manager, signers [][]*crypto.PrivateKeySECP256K1R) error
- func (t *Tx) SyntacticVerify(ctx *snow.Context, c codec.Manager, txFeeAssetID ids.ID, txFee uint64, ...) error
- func (t *Tx) UTXOs() []*avax.UTXO
- type UnsignedTx
- type Visitor
Constants ¶
const CodecVersion = 0
Variables ¶
This section is empty.
Functions ¶
func IsSortedAndUniqueInitialStates ¶
func IsSortedAndUniqueInitialStates(iss []*InitialState) bool
func SortInitialStates ¶
func SortInitialStates(iss []*InitialState)
func SortOperations ¶
func SortOperationsWithSigners ¶
func SortOperationsWithSigners(ops []*Operation, signers [][]*crypto.PrivateKeySECP256K1R, codec codec.Manager)
Types ¶
type BaseTx ¶
BaseTx is the basis of all transactions.
func (*BaseTx) Initialize ¶ added in v1.7.14
func (*BaseTx) SyntacticVerify ¶
type CreateAssetTx ¶
type CreateAssetTx struct { BaseTx `serialize:"true"` Name string `serialize:"true" json:"name"` Symbol string `serialize:"true" json:"symbol"` Denomination byte `serialize:"true" json:"denomination"` States []*InitialState `serialize:"true" json:"initialStates"` }
CreateAssetTx is a transaction that creates a new asset.
func (*CreateAssetTx) InitCtx ¶
func (t *CreateAssetTx) InitCtx(ctx *snow.Context)
func (*CreateAssetTx) InitialStates ¶
func (t *CreateAssetTx) InitialStates() []*InitialState
InitialStates track which virtual machines, and the initial state of these machines, this asset uses. The returned array should not be modified.
func (*CreateAssetTx) Sort ¶
func (t *CreateAssetTx) Sort()
func (*CreateAssetTx) SyntacticVerify ¶
func (*CreateAssetTx) Visit ¶
func (t *CreateAssetTx) Visit(v Visitor) error
type ExportTx ¶
type ExportTx struct { BaseTx `serialize:"true"` // Which chain to send the funds to DestinationChain ids.ID `serialize:"true" json:"destinationChain"` // The outputs this transaction is sending to the other chain ExportedOuts []*avax.TransferableOutput `serialize:"true" json:"exportedOutputs"` }
ExportTx is a transaction that exports an asset to another blockchain.
func (*ExportTx) SyntacticVerify ¶
type ImportTx ¶
type ImportTx struct { BaseTx `serialize:"true"` // Which chain to consume the funds from SourceChain ids.ID `serialize:"true" json:"sourceChain"` // The inputs to this transaction ImportedIns []*avax.TransferableInput `serialize:"true" json:"importedInputs"` }
ImportTx is a transaction that imports an asset from another blockchain.
func (*ImportTx) ConsumedAssetIDs ¶
ConsumedAssetIDs returns the IDs of the assets this transaction consumes
func (*ImportTx) InputUTXOs ¶
InputUTXOs track which UTXOs this transaction is consuming.
func (*ImportTx) NumCredentials ¶
NumCredentials returns the number of expected credentials
type InitialState ¶
type InitialState struct { FxIndex uint32 `serialize:"true" json:"fxIndex"` FxID ids.ID `serialize:"false" json:"fxID"` Outs []verify.State `serialize:"true" json:"outputs"` }
func (*InitialState) InitCtx ¶
func (is *InitialState) InitCtx(ctx *snow.Context)
func (*InitialState) Sort ¶
func (is *InitialState) Sort(c codec.Manager)
type Operation ¶
type OperationTx ¶
type OperationTx struct { BaseTx `serialize:"true"` Ops []*Operation `serialize:"true" json:"operations"` }
OperationTx is a transaction with no credentials.
func (*OperationTx) AssetIDs ¶
func (t *OperationTx) AssetIDs() ids.Set
AssetIDs returns the IDs of the assets this transaction depends on
func (*OperationTx) ConsumedAssetIDs ¶
func (t *OperationTx) ConsumedAssetIDs() ids.Set
ConsumedAssetIDs returns the IDs of the assets this transaction consumes
func (*OperationTx) InitCtx ¶
func (t *OperationTx) InitCtx(ctx *snow.Context)
func (*OperationTx) InputUTXOs ¶
func (t *OperationTx) InputUTXOs() []*avax.UTXOID
func (*OperationTx) NumCredentials ¶
func (t *OperationTx) NumCredentials() int
NumCredentials returns the number of expected credentials
func (*OperationTx) Operations ¶
func (t *OperationTx) Operations() []*Operation
Operations track which ops this transaction is performing. The returned array should not be modified.
func (*OperationTx) SyntacticVerify ¶
func (t *OperationTx) SyntacticVerify( ctx *snow.Context, c codec.Manager, txFeeAssetID ids.ID, txFee uint64, _ uint64, numFxs int, ) error
SyntacticVerify that this transaction is well-formed.
func (*OperationTx) Visit ¶
func (t *OperationTx) Visit(v Visitor) error
type Parser ¶
type Parser interface { Codec() codec.Manager GenesisCodec() codec.Manager Parse(bytes []byte) (*Tx, error) ParseGenesis(bytes []byte) (*Tx, error) InitializeTx(tx *Tx) error InitializeGenesisTx(tx *Tx) error }
func NewCustomParser ¶
type Tx ¶
type Tx struct { Unsigned UnsignedTx `serialize:"true" json:"unsignedTx"` Creds []*fxs.FxCredential `serialize:"true" json:"credentials"` // The credentials of this transaction // contains filtered or unexported fields }
Tx is the core operation that can be performed. The tx uses the UTXO model. Specifically, a txs inputs will consume previous txs outputs. A tx will be valid if the inputs have the authority to consume the outputs they are attempting to consume and the inputs consume sufficient state to produce the outputs.
func (*Tx) Initialize ¶ added in v1.7.14
func (*Tx) SignPropertyFx ¶
func (*Tx) SignSECP256K1Fx ¶
type UnsignedTx ¶
type UnsignedTx interface { snow.ContextInitializable Initialize(unsignedBytes []byte) Bytes() []byte ConsumedAssetIDs() ids.Set AssetIDs() ids.Set NumCredentials() int InputUTXOs() []*avax.UTXOID SyntacticVerify( ctx *snow.Context, c codec.Manager, txFeeAssetID ids.ID, txFee uint64, creationTxFee uint64, numFxs int, ) error Visit(visitor Visitor) error }