tx

package
v0.0.0-...-78bb2a7 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2025 License: Apache-2.0, MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HashFromTx

func HashFromTx(encodeTx string) (string, error)

func RenderSendMax

func RenderSendMax(fields map[string]interface{}, sendMax *Amount)

func RenderToMap

func RenderToMap(xrpTx XRPTransaction) (map[string]interface{}, error)

func RenderTokenAmount

func RenderTokenAmount(fields map[string]interface{}, amount *Amount)

func RenderXrpAmount

func RenderXrpAmount(fields map[string]interface{}, amount string) error

Types

type Amount

type Amount struct {
	Currency string `json:"currency"`
	Issuer   string `json:"issuer"`
	Value    string `json:"value"`
}

type AmountBlockchain

type AmountBlockchain struct {
	XRPAmount   string  `json:"-"`
	TokenAmount *Amount `json:"-"`
}

type TransactionType

type TransactionType string
const (
	PAYMENT                 TransactionType = "Payment"
	TRANSACTION_HASH_PREFIX                 = "54584E00"
)

type Tx

type Tx struct {
	XRPTx                *XRPTransaction
	SignPubKey           []byte
	TransactionSignature []xc.TxSignature
}

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

GetSignatures returns back signatures, which may be used for signed-transaction broadcasting

func (Tx) Hash

func (tx Tx) Hash() xc.TxHash

Hash returns the tx hash or id

func (Tx) Serialize

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

Serialize returns the serialized tx

func (Tx) Sighashes

func (tx Tx) Sighashes() ([]xc.TxDataToSign, error)

Sighashes returns the tx payload to sign, aka sighash

type XRPTransaction

type XRPTransaction struct {
	Account            xc.Address       `json:"Account"`
	Amount             AmountBlockchain `json:"Amount"`
	SendMax            Amount           `json:"SendMax"`
	Destination        xc.Address       `json:"Destination"`
	DestinationTag     int64            `json:"DestinationTag"`
	Fee                string           `json:"Fee"`
	Flags              int64            `json:"Flags,omitempty"`
	LastLedgerSequence int64            `json:"LastLedgerSequence"`
	Sequence           int64            `json:"Sequence"`
	SigningPubKey      string           `json:"SigningPubKey"`
	TransactionType    TransactionType  `json:"TransactionType"`
	TxnSignature       string           `json:"TxnSignature"`
}

Jump to

Keyboard shortcuts

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