Documentation
¶
Index ¶
- Constants
- func CheckError(err error) xclient.ClientError
- func NewAddressBuilder(cfgI xc.ITask) (xc.AddressBuilder, error)
- func Signature(method string) []byte
- type AddressBuilder
- type Client
- func (client *Client) FetchBalance(ctx context.Context, address xc.Address) (xc.AmountBlockchain, 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, 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)
- func (txBuilder TxBuilder) Transfer(args xcbuilder.TransferArgs, input xc.TxInput) (xc.Tx, error)
- type TxInput
- func (input *TxInput) GetDriver() xc.Driver
- 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 CheckError(err error) xclient.ClientError
func NewAddressBuilder ¶
func NewAddressBuilder(cfgI 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 {
// contains filtered or unexported fields
}
Client for Template
func (*Client) FetchBalance ¶
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 ¶
TxBuilder for Template
func NewTxBuilder ¶
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
func (TxBuilder) NewTokenTransfer ¶
func (txBuilder TxBuilder) NewTokenTransfer(from xc.Address, to xc.Address, amount xc.AmountBlockchain, input xc.TxInput) (xc.Tx, error)
NewTokenTransfer creates a new transfer for a token 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"` }
TxInput for Template
func NewTxInput ¶
func NewTxInput() *TxInput
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.