tx_builder

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const MaxFee = uint64(1)

Variables

This section is empty.

Functions

func CreateTransaction

func CreateTransaction(receiverPubKey []byte, k *account.AccountKey, amount uint64, systemID types.SystemID, bill *wtypes.Bill, timeout uint64, fcrID []byte) (*types.TransactionOrder, error)

CreateTransaction creates a P2PKH transfer or split transaction using the given bill.

func CreateTransactions

func CreateTransactions(pubKey []byte, amount uint64, systemID types.SystemID, bills []*wtypes.Bill, k *account.AccountKey, timeout uint64, fcrID []byte) ([]*types.TransactionOrder, error)

CreateTransactions creates 1 to N P2PKH transactions from given bills until target amount is reached. If there exists a bill with value equal to the given amount then transfer transaction is created using that bill, otherwise bills are selected in the given order.

func NewAddFCTx

func NewAddFCTx(unitID []byte, fcProof *wallet.Proof, ac *account.AccountKey, systemID types.SystemID, timeout uint64) (*types.TransactionOrder, error)

func NewCloseFCTx

func NewCloseFCTx(systemID types.SystemID, unitID []byte, timeout uint64, amount uint64, targetUnitID, targetUnitBacklink []byte, k *account.AccountKey) (*types.TransactionOrder, error)

func NewDustTx

func NewDustTx(ac *account.AccountKey, systemID types.SystemID, bill *wallet.Bill, targetBillID []byte, targetBillHash []byte, timeout uint64) (*types.TransactionOrder, error)

func NewLockFCTx

func NewLockFCTx(ac *account.AccountKey, systemID types.SystemID, fcb *wtypes.FeeCreditBill, lockStatus uint64, timeout uint64) (*types.TransactionOrder, error)

func NewLockTx

func NewLockTx(ac *account.AccountKey, systemID types.SystemID, targetBillID, targetBillBacklink []byte, lockStatus, timeout uint64) (*types.TransactionOrder, error)

func NewReclaimFCTx

func NewReclaimFCTx(systemID types.SystemID, unitID []byte, timeout uint64, fcProof *wallet.Proof, backlink []byte, k *account.AccountKey) (*types.TransactionOrder, error)

func NewSplitTx

func NewSplitTx(targetUnits []*money.TargetUnit, remainingValue uint64, k *account.AccountKey, systemID types.SystemID, bill *wtypes.Bill, timeout uint64, fcrID []byte) (*types.TransactionOrder, error)

NewSplitTx creates a P2PKH split transaction.

func NewSwapTx

func NewSwapTx(k *account.AccountKey, systemID types.SystemID, dcProofs []*wallet.Proof, targetUnitID []byte, timeout uint64) (*types.TransactionOrder, error)

func NewTransferFCTx

func NewTransferFCTx(amount uint64, targetRecordID []byte, targetUnitBacklink []byte, k *account.AccountKey, moneySystemID, targetSystemID types.SystemID, unitID, backlink []byte, timeout, t1, t2 uint64) (*types.TransactionOrder, error)

func NewTransferTx

func NewTransferTx(receiverPubKey []byte, k *account.AccountKey, systemID types.SystemID, bill *wtypes.Bill, timeout uint64, fcrID []byte) (*types.TransactionOrder, error)

NewTransferTx creates a P2PKH transfer transaction.

func NewTxPayload

func NewTxPayload(systemID types.SystemID, txType string, unitID types.UnitID, timeout uint64, fcrID []byte, attr interface{}) (*types.Payload, error)

func NewUnlockFCTx

func NewUnlockFCTx(ac *account.AccountKey, systemID types.SystemID, fcb *wtypes.FeeCreditBill, timeout uint64) (*types.TransactionOrder, error)

func NewUnlockTx

func NewUnlockTx(ac *account.AccountKey, systemID types.SystemID, b *wtypes.Bill, timeout uint64) (*types.TransactionOrder, error)

func SignPayload

func SignPayload(payload *types.Payload, ac *account.AccountKey) (*types.TransactionOrder, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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