Documentation ¶
Index ¶
- Constants
- Variables
- func AdjustToMinimumStorageDeposit[T iotago.Output](out T) T
- func AssetsFromOutput(o iotago.Output) *isc.Assets
- func BasicOutputFromPostData(senderAddress iotago.Address, senderContract isc.ContractIdentity, ...) *iotago.BasicOutput
- func ComputeInputsAndRemainder(senderAddress iotago.Address, baseTokenOut uint64, ...) (iotago.OutputIDs, *iotago.BasicOutput, error)
- func CreateAndSignTx(inputs iotago.Inputs, inputsCommitment []byte, outputs iotago.Outputs, ...) (*iotago.Transaction, error)
- func GetAnchorFromTransaction(tx *iotago.Transaction) (*isc.StateAnchor, *iotago.AliasOutput, error)
- func L1CommitmentFromAliasOutput(ao *iotago.AliasOutput) (*state.L1Commitment, error)
- func MakeAnchorTransaction(essence *iotago.TransactionEssence, sig iotago.Signature) *iotago.Transaction
- func MakeBasicOutput(targetAddress iotago.Address, senderAddress iotago.Address, assets *isc.Assets, ...) *iotago.BasicOutput
- func MakeRequestTransactionOutput(par NewRequestTransactionParams) iotago.Output
- func MakeSignatureAndAliasUnlockFeatures(totalInputs int, sig iotago.Signature) iotago.Unlocks
- func MakeSignatureAndReferenceUnlocks(totalInputs int, sig iotago.Signature) iotago.Unlocks
- func MustL1CommitmentFromAliasOutput(ao *iotago.AliasOutput) *state.L1Commitment
- func NFTOutputFromPostData(senderAddress iotago.Address, senderContract isc.ContractIdentity, ...) *iotago.NFTOutput
- func NewChangeGovControllerTx(chainID iotago.AliasID, newGovController iotago.Address, ...) (*iotago.Transaction, error)
- func NewMintNFTsTransaction(par MintNFTsTransactionParams) (*iotago.Transaction, error)
- func NewRequestTransaction(par NewRequestTransactionParams) (*iotago.Transaction, error)
- func NewRotateChainStateControllerTx(aliasID iotago.AliasID, newStateController iotago.Address, ...) (*iotago.Transaction, error)
- func NewTransferTransaction(params NewTransferTransactionParams) (*iotago.Transaction, error)
- func NftOutputFromBasicOutput(o *iotago.BasicOutput, nft *isc.NFT) *iotago.NFTOutput
- type MintNFTsTransactionParams
- type NewRequestTransactionParams
- type NewTransferTransactionParams
- type StateMetadata
Constants ¶
const ( // L1Commitment calculation has changed from version 0 to version 1. // The structure is actually the same, but the L1 commitment in V0 // refers to an empty state, and in V1 refers to the first initialized // state. StateMetadataSupportedVersion byte = 1 )
Variables ¶
var ( ErrNotEnoughBaseTokens = errors.New("not enough base tokens") ErrNotEnoughBaseTokensForStorageDeposit = errors.New("not enough base tokens for storage deposit") ErrNotEnoughNativeTokens = errors.New("not enough native tokens") )
var ErrNoAliasOutputAtIndex0 = errors.New("origin AliasOutput not found at index 0")
Functions ¶
func AdjustToMinimumStorageDeposit ¶ added in v1.0.3
func BasicOutputFromPostData ¶ added in v0.3.0
func BasicOutputFromPostData( senderAddress iotago.Address, senderContract isc.ContractIdentity, par isc.RequestParameters, ) *iotago.BasicOutput
BasicOutputFromPostData creates extended output object from parameters. It automatically adjusts amount of base tokens required for the storage deposit
func ComputeInputsAndRemainder ¶ added in v1.0.3
func ComputeInputsAndRemainder( senderAddress iotago.Address, baseTokenOut uint64, tokensOut map[iotago.NativeTokenID]*big.Int, nftsOut map[iotago.NFTID]bool, unspentOutputs iotago.OutputSet, unspentOutputIDs iotago.OutputIDs, ) ( iotago.OutputIDs, *iotago.BasicOutput, error, )
computeInputsAndRemainder computes inputs and remainder for given outputs balances. Takes into account minimum storage deposit requirements The inputs are consumed one by one in the order provided in the parameters. Consumes only what is needed to cover output balances Returned reminder is nil if not needed
func CreateAndSignTx ¶ added in v0.3.0
func GetAnchorFromTransaction ¶ added in v0.3.0
func GetAnchorFromTransaction(tx *iotago.Transaction) (*isc.StateAnchor, *iotago.AliasOutput, error)
GetAnchorFromTransaction analyzes the output at index 0 and extracts anchor information. Otherwise error
func L1CommitmentFromAliasOutput ¶ added in v1.0.3
func L1CommitmentFromAliasOutput(ao *iotago.AliasOutput) (*state.L1Commitment, error)
func MakeAnchorTransaction ¶ added in v0.3.0
func MakeAnchorTransaction(essence *iotago.TransactionEssence, sig iotago.Signature) *iotago.Transaction
func MakeBasicOutput ¶ added in v0.3.0
func MakeBasicOutput( targetAddress iotago.Address, senderAddress iotago.Address, assets *isc.Assets, metadata *isc.RequestMetadata, options isc.SendOptions, ) *iotago.BasicOutput
MakeBasicOutput creates new output from input parameters (ignoring storage deposit).
func MakeRequestTransactionOutput ¶ added in v1.0.3
func MakeRequestTransactionOutput(par NewRequestTransactionParams) iotago.Output
func MakeSignatureAndAliasUnlockFeatures ¶ added in v0.3.0
func MakeSignatureAndReferenceUnlocks ¶ added in v0.3.0
func MustL1CommitmentFromAliasOutput ¶ added in v1.0.3
func MustL1CommitmentFromAliasOutput(ao *iotago.AliasOutput) *state.L1Commitment
func NFTOutputFromPostData ¶ added in v0.3.0
func NFTOutputFromPostData( senderAddress iotago.Address, senderContract isc.ContractIdentity, par isc.RequestParameters, nft *isc.NFT, ) *iotago.NFTOutput
func NewChangeGovControllerTx ¶ added in v1.0.3
func NewMintNFTsTransaction ¶ added in v1.0.3
func NewMintNFTsTransaction(par MintNFTsTransactionParams) (*iotago.Transaction, error)
func NewRequestTransaction ¶
func NewRequestTransaction(par NewRequestTransactionParams) (*iotago.Transaction, error)
NewRequestTransaction creates a transaction including one or more requests to a chain. Empty assets in the request data defaults to 1 base token, which later is adjusted to the minimum storage deposit Assumes all UnspentOutputs and corresponding UnspentOutputIDs can be used as inputs, i.e. are unlockable for the sender address
func NewRotateChainStateControllerTx ¶ added in v0.3.0
func NewTransferTransaction ¶ added in v0.3.0
func NewTransferTransaction(params NewTransferTransactionParams) (*iotago.Transaction, error)
NewTransferTransaction creates a basic output transaction that sends L1 Token to another L1 address
func NftOutputFromBasicOutput ¶ added in v0.3.0
Types ¶
type MintNFTsTransactionParams ¶ added in v1.0.3
type NewRequestTransactionParams ¶
type NewRequestTransactionParams struct { SenderKeyPair *cryptolib.KeyPair SenderAddress iotago.Address // might be different from the senderKP address (when sending as NFT or alias) UnspentOutputs iotago.OutputSet UnspentOutputIDs iotago.OutputIDs Request *isc.RequestParameters NFT *isc.NFT DisableAutoAdjustStorageDeposit bool // if true, the minimal storage deposit won't be adjusted automatically }
type NewTransferTransactionParams ¶ added in v0.3.0
type NewTransferTransactionParams struct { DisableAutoAdjustStorageDeposit bool // if true, the minimal storage deposit won't be adjusted automatically FungibleTokens *isc.Assets SendOptions isc.SendOptions SenderAddress iotago.Address SenderKeyPair *cryptolib.KeyPair TargetAddress iotago.Address UnspentOutputs iotago.OutputSet UnspentOutputIDs iotago.OutputIDs }
type StateMetadata ¶ added in v1.0.3
type StateMetadata struct { Version byte L1Commitment *state.L1Commitment GasFeePolicy *gas.FeePolicy SchemaVersion uint32 PublicURL string }
func NewStateMetadata ¶ added in v1.0.3
func NewStateMetadata( l1Commitment *state.L1Commitment, gasFeePolicy *gas.FeePolicy, schemaVersion uint32, publicURL string, ) *StateMetadata
func StateMetadataFromBytes ¶ added in v1.0.3
func StateMetadataFromBytes(data []byte) (*StateMetadata, error)
func (*StateMetadata) Bytes ¶ added in v1.0.3
func (s *StateMetadata) Bytes() []byte