Documentation ¶
Index ¶
- Variables
- func AssetsFromOutput(o iotago.Output) *isc.FungibleTokens
- func BasicOutputFromPostData(senderAddress iotago.Address, senderContract isc.Hname, ...) *iotago.BasicOutput
- func CreateAndSignTx(inputs iotago.OutputIDs, inputsCommitment []byte, outputs iotago.Outputs, ...) (*iotago.Transaction, error)
- func FilterOutputIndices(outputs []iotago.Output, ids []*iotago.UTXOInput, filters ...OutputFilter) ([]iotago.Output, []*iotago.UTXOInput)
- func GetAliasOutput(tx *iotago.Transaction, aliasAddr iotago.Address) (*isc.AliasOutputWithID, error)
- func GetAnchorFromTransaction(tx *iotago.Transaction) (*isc.StateAnchor, *iotago.AliasOutput, error)
- func MakeAnchorTransaction(essence *iotago.TransactionEssence, sig iotago.Signature) *iotago.Transaction
- func MakeBasicOutput(targetAddress iotago.Address, senderAddress iotago.Address, ...) *iotago.BasicOutput
- func MakeSignatureAndAliasUnlockFeatures(totalInputs int, sig iotago.Signature) iotago.Unlocks
- func MakeSignatureAndReferenceUnlocks(totalInputs int, sig iotago.Signature) iotago.Unlocks
- func NFTOutputFromPostData(senderAddress iotago.Address, senderContract isc.Hname, ...) *iotago.NFTOutput
- func NewChainOriginTransaction(keyPair *cryptolib.KeyPair, stateControllerAddress iotago.Address, ...) (*iotago.Transaction, *isc.ChainID, error)
- func NewMintNFTTransaction(par MintNFTTransactionParams) (*iotago.Transaction, error)
- func NewRequestTransaction(par NewRequestTransactionParams) (*iotago.Transaction, error)
- func NewRootInitRequestTransaction(keyPair *cryptolib.KeyPair, chainID *isc.ChainID, description string, ...) (*iotago.Transaction, error)
- func NewRotateChainStateControllerTx(chainID 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 MintNFTTransactionParams
- type NewRequestTransactionParams
- type NewTransferTransactionParams
- type OutputFilter
- type StorageDepositAssumption
Constants ¶
This section is empty.
Variables ¶
var ( ErrNotEnoughBaseTokens = xerrors.New("not enough base tokens") ErrNotEnoughBaseTokensForStorageDeposit = xerrors.New("not enough base tokens for storage deposit") ErrNotEnoughNativeTokens = xerrors.New("not enough native tokens") )
var (
ErrNoAliasOutputAtIndex0 = xerrors.New("origin AliasOutput not found at index 0")
)
Functions ¶
func AssetsFromOutput ¶ added in v0.3.0
func AssetsFromOutput(o iotago.Output) *isc.FungibleTokens
func BasicOutputFromPostData ¶ added in v0.3.0
func BasicOutputFromPostData( senderAddress iotago.Address, senderContract isc.Hname, 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 CreateAndSignTx ¶ added in v0.3.0
func FilterOutputIndices ¶ added in v0.3.0
func FilterOutputIndices(outputs []iotago.Output, ids []*iotago.UTXOInput, filters ...OutputFilter) ([]iotago.Output, []*iotago.UTXOInput)
FilterOutputIndices returns a slice of indices of those outputs which satisfy all predicates Uses same underlying arrays slices
func GetAliasOutput ¶
func GetAliasOutput(tx *iotago.Transaction, aliasAddr iotago.Address) (*isc.AliasOutputWithID, error)
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 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.FungibleTokens, metadata *isc.RequestMetadata, options isc.SendOptions, disableAutoAdjustStorageDeposit ...bool, ) *iotago.BasicOutput
MakeBasicOutput creates new output from input parameters. Auto adjusts minimal storage deposit if the notAutoAdjust flag is absent or false If auto adjustment to storage deposit is disabled and not enough base tokens, returns an error
func MakeSignatureAndAliasUnlockFeatures ¶ added in v0.3.0
func MakeSignatureAndReferenceUnlocks ¶ added in v0.3.0
func NFTOutputFromPostData ¶ added in v0.3.0
func NewChainOriginTransaction ¶
func NewChainOriginTransaction( keyPair *cryptolib.KeyPair, stateControllerAddress iotago.Address, governanceControllerAddress iotago.Address, deposit uint64, unspentOutputs iotago.OutputSet, unspentOutputIDs iotago.OutputIDs, ) (*iotago.Transaction, *isc.ChainID, error)
NewChainOriginTransaction creates new origin transaction for the self-governed chain returns the transaction and newly minted chain ID
func NewMintNFTTransaction ¶ added in v0.3.0
func NewMintNFTTransaction(par MintNFTTransactionParams) (*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 NewRootInitRequestTransaction ¶
func NewRootInitRequestTransaction( keyPair *cryptolib.KeyPair, chainID *isc.ChainID, description string, unspentOutputs iotago.OutputSet, unspentOutputIDs iotago.OutputIDs, initParams ...dict.Dict, ) (*iotago.Transaction, error)
NewRootInitRequestTransaction is a transaction with one request output. It is the first request to be sent to the uninitialized chain. At this moment it is only able to process this specific request. The request contains the minimum data needed to bootstrap the chain. The signer must be the same that created the origin transaction.
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 MintNFTTransactionParams ¶ added in v0.3.0
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.FungibleTokens SendOptions isc.SendOptions SenderAddress iotago.Address SenderKeyPair *cryptolib.KeyPair TargetAddress iotago.Address UnspentOutputs iotago.OutputSet UnspentOutputIDs iotago.OutputIDs }
type OutputFilter ¶ added in v0.3.0
func FilterType ¶ added in v0.3.0
func FilterType(t iotago.OutputType) OutputFilter
type StorageDepositAssumption ¶ added in v0.3.0
type StorageDepositAssumption struct { AnchorOutput uint64 NativeTokenOutput uint64 NFTOutput uint64 }
func NewStorageDepositEstimate ¶ added in v0.3.0
func NewStorageDepositEstimate() *StorageDepositAssumption
func StorageDepositAssumptionFromBytes ¶ added in v0.3.0
func StorageDepositAssumptionFromBytes(data []byte) (*StorageDepositAssumption, error)
func (*StorageDepositAssumption) Bytes ¶ added in v0.3.0
func (d *StorageDepositAssumption) Bytes() []byte
func (*StorageDepositAssumption) String ¶ added in v0.3.0
func (d *StorageDepositAssumption) String() string