newchain

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 2, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

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

func NewSigner

func NewSigner(cfgI xc.ITask) (xc.Signer, error)

NewSigner creates a new Template Signer

func NewTxBuilder

func NewTxBuilder(cfgI xc.ITask) (xc.TxBuilder, error)

NewTxBuilder creates a new Template TxBuilder

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 NewClient

func NewClient(cfgI xc.ITask) (*Client, error)

NewClient returns a new Template Client

func (*Client) FetchTxInfo

func (client *Client) FetchTxInfo(ctx context.Context, txHash xc.TxHash) (xc.TxInfo, error)

FetchTxInfo returns tx info for a Template tx

func (*Client) FetchTxInput

func (client *Client) FetchTxInput(ctx context.Context, from xc.Address) (xc.TxInput, error)

FetchTxInput returns tx input for a Template tx

func (*Client) SubmitTx

func (client *Client) SubmitTx(ctx context.Context, txInput xc.Tx) error

SubmitTx submits 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) From added in v0.3.0

func (tx Tx) From() xc.Address

From is the sender of a transfer

func (Tx) Hash

func (tx Tx) Hash() xc.TxHash

Hash returns the tx hash or id

func (*Tx) ParseTransfer added in v0.3.0

func (tx *Tx) ParseTransfer()

ParseTransfer parses a tx and extracts higher-level transfer information

func (Tx) Serialize added in v0.3.0

func (tx Tx) Serialize() ([]byte, error)

Serialize returns the serialized tx

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

func (Tx) To added in v0.3.0

func (tx Tx) To() xc.Address

To is the account receiving a transfer

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

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

func (TxBuilder) NewTransfer

func (txBuilder TxBuilder) NewTransfer(from xc.Address, to xc.Address, amount xc.AmountBlockchain, input xc.TxInput) (xc.Tx, error)

NewTransfer creates a new transfer for an Asset, either native or token

type TxInput

type TxInput struct {
}

TxInput for Template

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL