Documentation ¶
Index ¶
- func NewAddressBuilder(cfgI xc.ITask) (xc.AddressBuilder, error)
- func NewSigner(cfgI xc.ITask) (xc.Signer, error)
- func NewTxBuilder(cfgI xc.ITask) (xc.TxBuilder, error)
- type AddressBuilder
- type Client
- type Signer
- type Tx
- func (tx *Tx) AddSignatures(...xc.TxSignature) error
- func (tx Tx) Amount() xc.AmountBlockchain
- func (tx Tx) ContractAddress() xc.ContractAddress
- func (tx Tx) Destinations() []*xc.TxInfoEndpoint
- func (tx Tx) From() xc.Address
- func (tx Tx) Hash() xc.TxHash
- func (tx *Tx) ParseTransfer()
- func (tx Tx) Serialize() ([]byte, error)
- func (tx Tx) Sighashes() ([]xc.TxDataToSign, error)
- func (tx Tx) Sources() []*xc.TxInfoEndpoint
- func (tx Tx) To() xc.Address
- 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 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 { }
Client for Template
func (*Client) FetchTxInfo ¶
FetchTxInfo returns tx info for a Template tx
func (*Client) FetchTxInput ¶
FetchTxInput returns tx input for a Template tx
type Signer ¶
type Signer struct { }
Signer for Template
func (Signer) ImportPrivateKey ¶ added in v0.2.0
func (signer Signer) ImportPrivateKey(privateKey string) (xc.PrivateKey, error)
ImportPrivateKey imports a Template private key
func (Signer) Sign ¶
func (signer Signer) Sign(privateKey xc.PrivateKey, data xc.TxDataToSign) (xc.TxSignature, error)
Sign a Template tx
type Tx ¶
type Tx struct { }
Tx for Template
func (*Tx) AddSignatures ¶ added in v0.3.0
func (tx *Tx) AddSignatures(...xc.TxSignature) error
AddSignatures adds a signature to Tx
func (Tx) Amount ¶ added in v0.3.0
func (tx Tx) Amount() xc.AmountBlockchain
Amount returns the tx amount
func (Tx) ContractAddress ¶ added in v0.3.0
func (tx Tx) ContractAddress() xc.ContractAddress
ContractAddress returns the contract address for a token transfer
func (Tx) Destinations ¶ added in v0.3.0
func (tx Tx) Destinations() []*xc.TxInfoEndpoint
Destinations returns the destinations of a Tx
func (*Tx) ParseTransfer ¶ added in v0.3.0
func (tx *Tx) ParseTransfer()
ParseTransfer parses a tx and extracts higher-level transfer information
func (Tx) Sighashes ¶ added in v0.3.0
func (tx Tx) Sighashes() ([]xc.TxDataToSign, error)
Sighashes returns the tx payload to sign, aka sighash
func (Tx) Sources ¶ added in v0.3.0
func (tx Tx) Sources() []*xc.TxInfoEndpoint
Sources returns the sources of a 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