Documentation
¶
Index ¶
- Constants
- Variables
- func CheckError(err error) errors.Status
- func DecodeAddress(h string) ([transactionbuilder.ADDRESS_LENGTH]byte, error)
- func DecodeHex(h string) ([]byte, error)
- func NewAddressBuilder(asset *xc.ChainBaseConfig) (xc.AddressBuilder, error)
- func ValidateAddress(cfg *xc.ChainBaseConfig, address xc.Address) error
- type AddressBuilder
- type Client
- func (client *Client) EstimateGas(ctx context.Context, ledgerInfo *aptostypes.LedgerInfo) (xc.AmountBlockchain, error)
- func (client *Client) FetchBalance(ctx context.Context, args *xclient.BalanceArgs) (xc.AmountBlockchain, error)
- func (client *Client) FetchBlock(ctx context.Context, args *xclient.BlockArgs) (*txinfo.BlockWithTransactions, error)
- func (client *Client) FetchDecimals(ctx context.Context, contract xc.ContractAddress) (int, error)
- func (client *Client) FetchLegacyTxInfo(ctx context.Context, txHash xc.TxHash) (txinfo.LegacyTxInfo, error)
- func (client *Client) FetchLegacyTxInput(ctx context.Context, from xc.Address, to xc.Address) (xc.TxInput, error)
- func (client *Client) FetchNativeBalance(ctx context.Context, address xc.Address) (xc.AmountBlockchain, error)
- func (client *Client) FetchTransferInput(ctx context.Context, args xcbuilder.TransferArgs) (xc.TxInput, error)
- func (client *Client) FetchTxInfo(ctx context.Context, args *txinfo.Args) (txinfo.TxInfo, error)
- func (client *Client) SubmitTx(ctx context.Context, tx xctypes.SubmitTxReq) error
- type FungibleAssetMetadata
- type GasSchedule
- type GasScheduleEntry
- type Tx
- type TxBuilder
- func (txBuilder TxBuilder) NewNativeTransfer(feePayer xc.Address, from xc.Address, to xc.Address, ...) (xc.Tx, error)
- func (txb *TxBuilder) NewTokenTransfer(feePayer xc.Address, from xc.Address, to xc.Address, ...) (xc.Tx, error)
- func (txBuilder TxBuilder) SupportsFeePayer() xcbuilder.FeePayerType
- func (txBuilder TxBuilder) SupportsMemo() xc.MemoSupport
- func (txBuilder TxBuilder) Transfer(args xcbuilder.TransferArgs, input xc.TxInput) (xc.Tx, error)
Constants ¶
const DefaultGasLimit = 10000
Variables ¶
var AptosModuleId *transactionbuilder.ModuleId
Functions ¶
func CheckError ¶
func DecodeAddress ¶
func DecodeAddress(h string) ([transactionbuilder.ADDRESS_LENGTH]byte, error)
func NewAddressBuilder ¶
func NewAddressBuilder(asset *xc.ChainBaseConfig) (xc.AddressBuilder, error)
NewAddressBuilder creates a new Template AddressBuilder
func ValidateAddress ¶
func ValidateAddress(cfg *xc.ChainBaseConfig, address xc.Address) error
Types ¶
type AddressBuilder ¶
type AddressBuilder struct {
}
AddressBuilder for Template
func (AddressBuilder) GetAddressFromPublicKey ¶
func (ab AddressBuilder) GetAddressFromPublicKey(publicKeyBytes []byte) (xc.Address, error)
GetAddressFromPublicKey returns an Address given a public key
type Client ¶
type Client struct {
Asset *xc.ChainConfig
AptosClient *aptosclient.RestClient
}
Client for Aptos
func NewClient ¶
func NewClient(cfgI *xc.ChainConfig) (*Client, error)
NewClient returns a new Aptos Client
func NewClientFrom ¶
func NewClientFrom(asset *xc.ChainConfig, client *aptosclient.RestClient) *Client
Enable constructing multiple clients without dialing aptos endpoint multiple times
func (*Client) EstimateGas ¶
func (client *Client) EstimateGas(ctx context.Context, ledgerInfo *aptostypes.LedgerInfo) (xc.AmountBlockchain, error)
func (*Client) FetchBalance ¶
func (client *Client) FetchBalance(ctx context.Context, args *xclient.BalanceArgs) (xc.AmountBlockchain, error)
FetchBalance fetches balance for an Aptos address
func (*Client) FetchBlock ¶
func (*Client) FetchDecimals ¶
func (*Client) FetchLegacyTxInfo ¶
func (client *Client) FetchLegacyTxInfo(ctx context.Context, txHash xc.TxHash) (txinfo.LegacyTxInfo, error)
FetchLegacyTxInfo returns tx info for a Aptos tx
func (*Client) FetchLegacyTxInput ¶
func (client *Client) FetchLegacyTxInput(ctx context.Context, from xc.Address, to xc.Address) (xc.TxInput, error)
FetchLegacyTxInput returns tx input for a Aptos tx
func (*Client) FetchNativeBalance ¶
func (client *Client) FetchNativeBalance(ctx context.Context, address xc.Address) (xc.AmountBlockchain, error)
FetchNativeBalance fetches the native asset balance for an Aptos address
func (*Client) FetchTransferInput ¶
func (*Client) FetchTxInfo ¶
type FungibleAssetMetadata ¶
type GasSchedule ¶
type GasSchedule struct {
Entries []GasScheduleEntry `json:"entries"`
}
type GasScheduleEntry ¶
type Tx ¶
func (*Tx) SetSignatures ¶
func (tx *Tx) SetSignatures(signatures ...*xc.SignatureResponse) error
SetSignatures adds a signature to Tx
type TxBuilder ¶
type TxBuilder struct {
Asset *xc.ChainBaseConfig
}
TxBuilder for Template
func NewTxBuilder ¶
func NewTxBuilder(asset *xc.ChainBaseConfig) (TxBuilder, error)
NewTxBuilder creates a new Template TxBuilder
func (TxBuilder) NewNativeTransfer ¶
func (txBuilder TxBuilder) NewNativeTransfer(feePayer xc.Address, from xc.Address, to xc.Address, amount xc.AmountBlockchain, input *tx_input.TxInput) (xc.Tx, error)
NewNativeTransfer creates a new transfer for a native asset
func (*TxBuilder) NewTokenTransfer ¶
func (txb *TxBuilder) NewTokenTransfer(feePayer xc.Address, from xc.Address, to xc.Address, amount xc.AmountBlockchain, contract xc.ContractAddress, input *tx_input.TxInput) (xc.Tx, error)
NewTokenTransfer creates a new transfer for a token asset
func (TxBuilder) SupportsFeePayer ¶
func (txBuilder TxBuilder) SupportsFeePayer() xcbuilder.FeePayerType
func (TxBuilder) SupportsMemo ¶
func (txBuilder TxBuilder) SupportsMemo() xc.MemoSupport