Documentation ¶
Index ¶
- func CheckError(err error) xc.ClientError
- func NewAddressBuilder(asset xc.ITask) (xc.AddressBuilder, error)
- func NewSigner(asset xc.ITask) (xc.Signer, error)
- func NewTxBuilder(asset xc.ITask) (xc.TxBuilder, error)
- type AddressBuilder
- type Client
- func (client *Client) FetchBalance(ctx context.Context, address xc.Address) (xc.AmountBlockchain, error)
- func (client *Client) FetchNativeBalance(ctx context.Context, address xc.Address) (xc.AmountBlockchain, error)
- func (client *Client) FetchTxInfo(ctx context.Context, txHash xc.TxHash) (xc.TxInfo, error)
- func (client *Client) FetchTxInput(ctx context.Context, from xc.Address, _ xc.Address) (xc.TxInput, error)
- func (client *Client) SubmitTx(ctx context.Context, txInput xc.Tx) error
- type Signer
- type Tx
- type TxBuilder
- func (txBuilder TxBuilder) NewNativeTransfer(from xc.Address, to xc.Address, amount xc.AmountBlockchain, input xc.TxInput) (xc.Tx, error)
- func (txBuilder TxBuilder) NewTokenTransfer(from xc.Address, to xc.Address, amount xc.AmountBlockchain, input xc.TxInput) (xc.Tx, error)
- func (txBuilder TxBuilder) NewTransfer(from xc.Address, to xc.Address, amount xc.AmountBlockchain, input xc.TxInput) (xc.Tx, error)
- type TxInput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckError ¶
func CheckError(err error) xc.ClientError
func NewAddressBuilder ¶
func NewAddressBuilder(asset xc.ITask) (xc.AddressBuilder, error)
NewAddressBuilder creates a new Template AddressBuilder
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
func (AddressBuilder) GetAllPossibleAddressesFromPublicKey ¶
func (ab AddressBuilder) GetAllPossibleAddressesFromPublicKey(publicKeyBytes []byte) ([]xc.PossibleAddress, error)
GetAllPossibleAddressesFromPublicKey returns all PossubleAddress(es) given a public key
type Client ¶
type Client struct { Asset *xc.AssetConfig AptosClient *aptosclient.RestClient }
Client for Aptos
func (*Client) FetchBalance ¶
func (client *Client) FetchBalance(ctx context.Context, address xc.Address) (xc.AmountBlockchain, error)
FetchBalance fetches balance for an Aptos address
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) FetchTxInfo ¶
FetchTxInfo returns tx info for a Aptos tx
type Signer ¶
type Signer struct { }
Signer for Aptos
func (Signer) ImportPrivateKey ¶
func (signer Signer) ImportPrivateKey(privateKey string) (xc.PrivateKey, error)
ImportPrivateKey imports an Aptos private key
func (Signer) Sign ¶
func (signer Signer) Sign(privateKey xc.PrivateKey, data xc.TxDataToSign) (xc.TxSignature, error)
Sign an Aptos tx
type Tx ¶
type Tx struct { }
Tx for Template
func (Tx) AddSignatures ¶
func (tx Tx) AddSignatures(...xc.TxSignature) error
AddSignatures adds a signature to Tx
type TxBuilder ¶
type TxBuilder struct {
Asset *xc.AssetConfig
}
TxBuilder for Template
func (TxBuilder) NewNativeTransfer ¶
func (txBuilder TxBuilder) NewNativeTransfer(from xc.Address, to xc.Address, amount xc.AmountBlockchain, input xc.TxInput) (xc.Tx, error)
NewNativeTransfer creates a new transfer for a native asset
Click to show internal directories.
Click to hide internal directories.