Documentation
¶
Index ¶
- Constants
- func CheckError(err error) errors.Status
- func NewAddressBuilder(cfgI *xc.ChainBaseConfig) (xc.AddressBuilder, error)
- func Signature(method string) []byte
- type AddressBuilder
- type Client
- func (client *Client) FetchBalance(ctx context.Context, args *xclient.BalanceArgs) (xc.AmountBlockchain, error)
- func (client *Client) FetchBlock(ctx context.Context, args *xclient.BlockArgs) (*xclient.BlockWithTransactions, error)
- func (client *Client) FetchDecimals(ctx context.Context, contract xc.ContractAddress) (int, error)
- func (client *Client) FetchLegacyTxInfo(ctx context.Context, txHash xc.TxHash) (xc.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, txHashStr xc.TxHash) (xclient.TxInfo, error)
- func (client *Client) SubmitTx(ctx context.Context, tx xc.Tx) error
- 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, ...) (xc.Tx, error)
- func (txBuilder TxBuilder) Transfer(args xcbuilder.TransferArgs, input xc.TxInput) (xc.Tx, error)
- type TxInput
- func (input *TxInput) GetDriver() xc.Driver
- func (input *TxInput) GetFeeLimit() (xc.AmountBlockchain, xc.ContractAddress)
- func (input *TxInput) IndependentOf(other xc.TxInput) (independent bool)
- func (input *TxInput) SafeFromDoubleSend(others ...xc.TxInput) (safe bool)
- func (input *TxInput) SetGasFeePriority(other xc.GasFeePriority) error
- func (input *TxInput) SetUnix(unix int64)
- func (input *TxInput) ToRawData(contract *core.Transaction_Contract) *core.TransactionRaw
Constants ¶
View Source
const TRANSFER_EVENT_HASH_HEX = "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"
View Source
const TX_TIMEOUT = 2 * time.Hour
Variables ¶
This section is empty.
Functions ¶
func CheckError ¶
func NewAddressBuilder ¶
func NewAddressBuilder(cfgI *xc.ChainBaseConfig) (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 {
// contains filtered or unexported fields
}
Client for Template
func (*Client) FetchBalance ¶
func (client *Client) FetchBalance(ctx context.Context, args *xclient.BalanceArgs) (xc.AmountBlockchain, error)
func (*Client) FetchBlock ¶
func (*Client) FetchDecimals ¶
func (*Client) FetchLegacyTxInfo ¶
func (*Client) FetchLegacyTxInput ¶
func (*Client) FetchNativeBalance ¶
func (*Client) FetchTransferInput ¶
func (*Client) FetchTxInfo ¶
type Tx ¶
type Tx struct {
// contains filtered or unexported fields
}
Tx for Template
func (*Tx) AddSignatures ¶
func (tx *Tx) AddSignatures(signatures ...xc.TxSignature) error
AddSignatures adds a signature to Tx
func (*Tx) GetSignatures ¶
func (tx *Tx) GetSignatures() []xc.TxSignature
type TxBuilder ¶
type TxBuilder struct {
Asset *xc.ChainBaseConfig
}
TxBuilder for Template
func NewTxBuilder ¶
func NewTxBuilder(cfgI *xc.ChainBaseConfig) (TxBuilder, error)
NewTxBuilder creates a new Template TxBuilder
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
type TxInput ¶
type TxInput struct { xc.TxInputEnvelope // 6th to 8th (exclusive) byte of the reference block height RefBlockBytes []byte `json:"ref_block_bytes,omitempty"` // 8th to 16th (exclusive) byte of the reference block hash RefBlockHash []byte `json:"ref_block_hash,omitempty"` // Expiration time (seconds) Expiration int64 `json:"expiration,omitempty"` // Transaction creation time (seconds) Timestamp int64 `json:"timestamp,omitempty"` // Max fee budget MaxFee xc.AmountBlockchain `json:"max_fee,omitempty"` }
TxInput for Template
func NewTxInput ¶
func NewTxInput() *TxInput
func (*TxInput) GetFeeLimit ¶
func (input *TxInput) GetFeeLimit() (xc.AmountBlockchain, xc.ContractAddress)
func (*TxInput) IndependentOf ¶
func (*TxInput) SafeFromDoubleSend ¶
func (*TxInput) SetGasFeePriority ¶
func (input *TxInput) SetGasFeePriority(other xc.GasFeePriority) error
func (*TxInput) ToRawData ¶
func (input *TxInput) ToRawData(contract *core.Transaction_Contract) *core.TransactionRaw
Click to show internal directories.
Click to hide internal directories.