Documentation
¶
Index ¶
- func WithTxInputOptions(txInput xc.TxInput, timeStamp int64, priorityMaybe xc.GasFeePriority) (xc.TxInput, error)
- type BuilderOption
- func OptionContractAddress(contract xc.ContractAddress, decimalsMaybe ...int) BuilderOption
- func OptionContractDecimals(decimals int) BuilderOption
- func OptionFeePayer(feePayer xc.Address, feePayerPublicKey []byte) BuilderOption
- func OptionFeePayerIdentity(feePayerIdentity string) BuilderOption
- func OptionFromIdentity(fromIdentity string) BuilderOption
- func OptionInclusiveFeeSpending(inclusiveFeeSpending bool) BuilderOption
- func OptionMemo(memo string) BuilderOption
- func OptionPriority(priority xc.GasFeePriority) BuilderOption
- func OptionPublicKey(publicKey []byte) BuilderOption
- func OptionStakeAccount(account string) BuilderOption
- func OptionStakeOwner(owner xc.Address) BuilderOption
- func OptionTimestamp(ts int64) BuilderOption
- func OptionToIdentity(toIdentity string) BuilderOption
- func OptionTransactionAttempts(transactionAttempts []string) BuilderOption
- func OptionValidator(validator string) BuilderOption
- type BuilderRequiresIdentity
- type BuilderSupportsFeePayer
- type FullBuilder
- type FullTransferBuilder
- type MultiTransfer
- type MultiTransferArgs
- func (args *MultiTransferArgs) AsAccountTransfers() ([]*TransferArgs, error)
- func (args *MultiTransferArgs) AsUtxoTransfers() ([]*TransferArgs, error)
- func (args *MultiTransferArgs) DeductFee(amount xc.AmountBlockchain, chainId xc.NativeAsset, ...) error
- func (args *MultiTransferArgs) GetFeePayer() (xc.Address, bool)
- func (args *MultiTransferArgs) GetFeePayerIdentity() (string, bool)
- func (args *MultiTransferArgs) GetFeePayerPublicKey() ([]byte, bool)
- func (args *MultiTransferArgs) GetMemo() (string, bool)
- func (args *MultiTransferArgs) GetPriority() (xc.GasFeePriority, bool)
- func (args *MultiTransferArgs) GetTransactionAttempts() []string
- func (args *MultiTransferArgs) Receivers() []*Receiver
- func (args *MultiTransferArgs) SetFeePayer(feePayer xc.Address)
- func (args *MultiTransferArgs) Spenders() []*Sender
- type Receiver
- type Sender
- type StakeArgs
- func (args *StakeArgs) GetAmount() xc.AmountBlockchain
- func (args *StakeArgs) GetFeePayer() (xc.Address, bool)
- func (args *StakeArgs) GetFeePayerIdentity() (string, bool)
- func (args *StakeArgs) GetFeePayerPublicKey() ([]byte, bool)
- func (args *StakeArgs) GetFrom() xc.Address
- func (args *StakeArgs) GetFromIdentity() (string, bool)
- func (args *StakeArgs) GetMemo() (string, bool)
- func (args *StakeArgs) GetPriority() (xc.GasFeePriority, bool)
- func (args *StakeArgs) GetPublicKey() ([]byte, bool)
- func (args *StakeArgs) GetStakeAccount() (string, bool)
- func (args *StakeArgs) GetStakeOwner() (xc.Address, bool)
- func (args *StakeArgs) GetTimestamp() (int64, bool)
- func (args *StakeArgs) GetValidator() (string, bool)
- type Staking
- type TransactionOptions
- type Transfer
- type TransferArgs
- func (args *TransferArgs) GetAmount() xc.AmountBlockchain
- func (args *TransferArgs) GetContract() (xc.ContractAddress, bool)
- func (args *TransferArgs) GetDecimals() (int, bool)
- func (args *TransferArgs) GetFeePayer() (xc.Address, bool)
- func (args *TransferArgs) GetFeePayerIdentity() (string, bool)
- func (args *TransferArgs) GetFeePayerPublicKey() ([]byte, bool)
- func (args *TransferArgs) GetFrom() xc.Address
- func (args *TransferArgs) GetFromIdentity() (string, bool)
- func (args *TransferArgs) GetMemo() (string, bool)
- func (args *TransferArgs) GetPriority() (xc.GasFeePriority, bool)
- func (args *TransferArgs) GetPublicKey() ([]byte, bool)
- func (args *TransferArgs) GetTimestamp() (int64, bool)
- func (args *TransferArgs) GetTo() xc.Address
- func (args *TransferArgs) GetToIdentity() (string, bool)
- func (args *TransferArgs) GetTransactionAttempts() []string
- func (args *TransferArgs) InclusiveFeeSpendingEnabled() bool
- func (args *TransferArgs) SetAmount(amount xc.AmountBlockchain)
- func (args *TransferArgs) SetContract(contract xc.ContractAddress)
- func (args *TransferArgs) SetFeePayer(feePayer xc.Address)
- func (args *TransferArgs) SetFeePayerPublicKey(feePayerPublicKey []byte)
- func (args *TransferArgs) SetFrom(from xc.Address)
- func (args *TransferArgs) SetFromIdentity(fromIdentity string)
- func (args *TransferArgs) SetInclusiveFeeSpending(inclusiveFeeSpending bool)
- func (args *TransferArgs) SetPublicKey(publicKey []byte)
- func (args *TransferArgs) SetTo(to xc.Address)
- func (args *TransferArgs) SetToIdentity(toIdentity string)
- func (args *TransferArgs) SetTransactionAttempts(previousTransactionAttempts []string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithTxInputOptions ¶
func WithTxInputOptions(txInput xc.TxInput, timeStamp int64, priorityMaybe xc.GasFeePriority) (xc.TxInput, error)
Previously the crosschain abstraction would require callers to set options directly on the transaction input, if the interface was implemented on the input type. However, wasn't very clear or easy to use. This function bridges the gap, to allow callers to use a more natural interface with options. Chain transaction builders can call this to safely set provided options on the old transaction input setters.
Types ¶
type BuilderOption ¶
type BuilderOption func(opts *builderOptions) error
func OptionContractAddress ¶
func OptionContractAddress(contract xc.ContractAddress, decimalsMaybe ...int) BuilderOption
func OptionContractDecimals ¶
func OptionContractDecimals(decimals int) BuilderOption
func OptionFeePayer ¶
func OptionFeePayer(feePayer xc.Address, feePayerPublicKey []byte) BuilderOption
func OptionFeePayerIdentity ¶
func OptionFeePayerIdentity(feePayerIdentity string) BuilderOption
The identity may be needed if the chain requires it (e.g. EOS)
func OptionFromIdentity ¶
func OptionFromIdentity(fromIdentity string) BuilderOption
The identity may be needed if the chain requires it (e.g. EOS)
func OptionInclusiveFeeSpending ¶
func OptionInclusiveFeeSpending(inclusiveFeeSpending bool) BuilderOption
func OptionMemo ¶
func OptionMemo(memo string) BuilderOption
func OptionPriority ¶
func OptionPriority(priority xc.GasFeePriority) BuilderOption
func OptionPublicKey ¶
func OptionPublicKey(publicKey []byte) BuilderOption
func OptionStakeAccount ¶
func OptionStakeAccount(account string) BuilderOption
func OptionStakeOwner ¶
func OptionStakeOwner(owner xc.Address) BuilderOption
Set an alternative owner of the stake from the from address
func OptionTimestamp ¶
func OptionTimestamp(ts int64) BuilderOption
func OptionToIdentity ¶
func OptionToIdentity(toIdentity string) BuilderOption
The identity may be needed if the chain requires it (e.g. EOS)
func OptionTransactionAttempts ¶
func OptionTransactionAttempts(transactionAttempts []string) BuilderOption
func OptionValidator ¶
func OptionValidator(validator string) BuilderOption
type BuilderRequiresIdentity ¶
type BuilderRequiresIdentity interface {
RequiresIdentityEOS()
}
Indicator to show that this chain requires an identity to be set for destination addresses. * The identity may be looked up dynamically for sending addresses * This is currently only used by EOS.
type BuilderSupportsFeePayer ¶
type BuilderSupportsFeePayer interface {
SupportsFeePayer()
}
Marker to indicate if fee payer is supported, until we support it everywhere
type FullBuilder ¶
type FullBuilder interface { FullTransferBuilder Staking }
type FullTransferBuilder ¶
type FullTransferBuilder interface { Transfer }
type MultiTransfer ¶
type MultiTransfer interface {
MultiTransfer(args MultiTransferArgs, input xc.MultiTransferInput) (xc.Tx, error)
}
type MultiTransferArgs ¶
type MultiTransferArgs struct {
// contains filtered or unexported fields
}
func NewMultiTransferArgs ¶
func NewMultiTransferArgs(chain xc.NativeAsset, spenders []*Sender, receivers []*Receiver, options ...BuilderOption) (*MultiTransferArgs, error)
func NewMultiTransferArgsFromSingle ¶
func NewMultiTransferArgsFromSingle(chain xc.NativeAsset, single *TransferArgs, options ...BuilderOption) (*MultiTransferArgs, error)
func (*MultiTransferArgs) AsAccountTransfers ¶
func (args *MultiTransferArgs) AsAccountTransfers() ([]*TransferArgs, error)
func (*MultiTransferArgs) AsUtxoTransfers ¶
func (args *MultiTransferArgs) AsUtxoTransfers() ([]*TransferArgs, error)
func (*MultiTransferArgs) DeductFee ¶
func (args *MultiTransferArgs) DeductFee(amount xc.AmountBlockchain, chainId xc.NativeAsset, contract xc.ContractAddress) error
Deduct fee from the first matching receiver Used for inclusive fee spending.
func (*MultiTransferArgs) GetFeePayer ¶
func (args *MultiTransferArgs) GetFeePayer() (xc.Address, bool)
func (*MultiTransferArgs) GetFeePayerIdentity ¶
func (args *MultiTransferArgs) GetFeePayerIdentity() (string, bool)
func (*MultiTransferArgs) GetFeePayerPublicKey ¶
func (args *MultiTransferArgs) GetFeePayerPublicKey() ([]byte, bool)
func (*MultiTransferArgs) GetMemo ¶
func (args *MultiTransferArgs) GetMemo() (string, bool)
func (*MultiTransferArgs) GetPriority ¶
func (args *MultiTransferArgs) GetPriority() (xc.GasFeePriority, bool)
func (*MultiTransferArgs) GetTransactionAttempts ¶
func (args *MultiTransferArgs) GetTransactionAttempts() []string
func (*MultiTransferArgs) Receivers ¶
func (args *MultiTransferArgs) Receivers() []*Receiver
func (*MultiTransferArgs) SetFeePayer ¶
func (args *MultiTransferArgs) SetFeePayer(feePayer xc.Address)
func (*MultiTransferArgs) Spenders ¶
func (args *MultiTransferArgs) Spenders() []*Sender
type Receiver ¶
type Receiver struct {
// contains filtered or unexported fields
}
func NewReceiver ¶
func NewReceiver(address xc.Address, amount xc.AmountBlockchain, options ...BuilderOption) (*Receiver, error)
func (*Receiver) GetAmount ¶
func (args *Receiver) GetAmount() xc.AmountBlockchain
func (*Receiver) GetContract ¶
func (args *Receiver) GetContract() (xc.ContractAddress, bool)
func (*Receiver) GetDecimals ¶
type Sender ¶
type Sender struct {
// contains filtered or unexported fields
}
func (*Sender) GetFromIdentity ¶
func (*Sender) GetPublicKey ¶
type StakeArgs ¶
type StakeArgs struct {
// contains filtered or unexported fields
}
func NewStakeArgs ¶
func NewStakeArgs(chain xc.NativeAsset, from xc.Address, amount xc.AmountBlockchain, options ...BuilderOption) (StakeArgs, error)
func (*StakeArgs) GetAmount ¶
func (args *StakeArgs) GetAmount() xc.AmountBlockchain
func (*StakeArgs) GetFeePayerIdentity ¶
func (*StakeArgs) GetFeePayerPublicKey ¶
func (*StakeArgs) GetFromIdentity ¶
func (*StakeArgs) GetPriority ¶
func (args *StakeArgs) GetPriority() (xc.GasFeePriority, bool)
func (*StakeArgs) GetPublicKey ¶
func (*StakeArgs) GetStakeAccount ¶
func (*StakeArgs) GetTimestamp ¶
func (*StakeArgs) GetValidator ¶
Staking options
type TransactionOptions ¶
type TransactionOptions interface { GetMemo() (string, bool) GetTimestamp() (int64, bool) GetPriority() (xc.GasFeePriority, bool) GetPublicKey() ([]byte, bool) }
All ArgumentBuilders should provide base arguments for transactions
type TransferArgs ¶
type TransferArgs struct {
// contains filtered or unexported fields
}
func NewTransferArgs ¶
func NewTransferArgs(from xc.Address, to xc.Address, amount xc.AmountBlockchain, options ...BuilderOption) (TransferArgs, error)
func (*TransferArgs) GetAmount ¶
func (args *TransferArgs) GetAmount() xc.AmountBlockchain
func (*TransferArgs) GetContract ¶
func (args *TransferArgs) GetContract() (xc.ContractAddress, bool)
func (*TransferArgs) GetDecimals ¶
func (args *TransferArgs) GetDecimals() (int, bool)
Decimals for token contract, which may be needed for token transfers on some chains
func (*TransferArgs) GetFeePayer ¶
func (args *TransferArgs) GetFeePayer() (xc.Address, bool)
func (*TransferArgs) GetFeePayerIdentity ¶
func (args *TransferArgs) GetFeePayerIdentity() (string, bool)
func (*TransferArgs) GetFeePayerPublicKey ¶
func (args *TransferArgs) GetFeePayerPublicKey() ([]byte, bool)
func (*TransferArgs) GetFrom ¶
func (args *TransferArgs) GetFrom() xc.Address
Transfer relevant arguments
func (*TransferArgs) GetFromIdentity ¶
func (args *TransferArgs) GetFromIdentity() (string, bool)
func (*TransferArgs) GetPriority ¶
func (args *TransferArgs) GetPriority() (xc.GasFeePriority, bool)
func (*TransferArgs) GetPublicKey ¶
func (args *TransferArgs) GetPublicKey() ([]byte, bool)
func (*TransferArgs) GetTimestamp ¶
func (args *TransferArgs) GetTimestamp() (int64, bool)
func (*TransferArgs) GetTo ¶
func (args *TransferArgs) GetTo() xc.Address
func (*TransferArgs) GetToIdentity ¶
func (args *TransferArgs) GetToIdentity() (string, bool)
func (*TransferArgs) GetTransactionAttempts ¶
func (args *TransferArgs) GetTransactionAttempts() []string
func (*TransferArgs) InclusiveFeeSpendingEnabled ¶
func (args *TransferArgs) InclusiveFeeSpendingEnabled() bool
func (*TransferArgs) SetAmount ¶
func (args *TransferArgs) SetAmount(amount xc.AmountBlockchain)
func (*TransferArgs) SetContract ¶
func (args *TransferArgs) SetContract(contract xc.ContractAddress)
func (*TransferArgs) SetFeePayer ¶
func (args *TransferArgs) SetFeePayer(feePayer xc.Address)
func (*TransferArgs) SetFeePayerPublicKey ¶
func (args *TransferArgs) SetFeePayerPublicKey(feePayerPublicKey []byte)
func (*TransferArgs) SetFrom ¶
func (args *TransferArgs) SetFrom(from xc.Address)
func (*TransferArgs) SetFromIdentity ¶
func (args *TransferArgs) SetFromIdentity(fromIdentity string)
func (*TransferArgs) SetInclusiveFeeSpending ¶
func (args *TransferArgs) SetInclusiveFeeSpending(inclusiveFeeSpending bool)
func (*TransferArgs) SetPublicKey ¶
func (args *TransferArgs) SetPublicKey(publicKey []byte)
func (*TransferArgs) SetTo ¶
func (args *TransferArgs) SetTo(to xc.Address)
func (*TransferArgs) SetToIdentity ¶
func (args *TransferArgs) SetToIdentity(toIdentity string)
func (*TransferArgs) SetTransactionAttempts ¶
func (args *TransferArgs) SetTransactionAttempts(previousTransactionAttempts []string)