payment

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: May 27, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cheque added in v0.3.0

type Cheque struct {
	Sender   *types.Script
	Receiver *types.Script
	UUID     string
	Amount   *big.Int
	FeeRate  uint64
	// contains filtered or unexported fields
}

Cheque object

func NewCheque added in v0.3.0

func NewCheque(senderAddr, receiverAddr, uuid, amount string, feeRate uint64, systemScripts *utils.SystemScripts) (*Cheque, error)

NewCheque returns a new Cheque object

func (*Cheque) GenerateIssuingChequeUnsignedTx added in v0.3.0

func (c *Cheque) GenerateIssuingChequeUnsignedTx(client rpc.Client) (*types.Transaction, error)

GenerateIssuingChequeUnsignedTx generate an unsigned transaction for issuing a cheque cell

func (*Cheque) Send added in v0.3.0

func (c *Cheque) Send(client rpc.Client) (*types.Hash, error)

Send can send a tx to tx pool

func (*Cheque) SignTx added in v0.3.0

func (c *Cheque) SignTx(key crypto.Key) (*types.Transaction, error)

SignTx sign an unsigned issuing cheque transaction and return an signed transaction

type ClaimCheque added in v0.3.0

type ClaimCheque struct {
	Receiver *types.Script
	UUID     string
	FeeRate  uint64
	// contains filtered or unexported fields
}

ClaimCheque object

func NewClaimCheque added in v0.3.0

func NewClaimCheque(receiverAddr, uuid string, feeRate uint64, systemScripts *utils.SystemScripts) (*ClaimCheque, error)

NewClaimCheque returns a new ClaimCheque object

func (*ClaimCheque) GenerateClaimChequeUnsignedTx added in v0.3.0

func (c *ClaimCheque) GenerateClaimChequeUnsignedTx(client rpc.Client) (*types.Transaction, error)

GenerateClaimChequeUnsignedTx generate an unsigned transaction for claim cheque cells

func (*ClaimCheque) Send added in v0.3.0

func (c *ClaimCheque) Send(client rpc.Client) (*types.Hash, error)

Send can send a tx to tx pool

func (*ClaimCheque) SignTx added in v0.3.0

func (c *ClaimCheque) SignTx(key crypto.Key) (*types.Transaction, error)

SignTx sign an unsigned claim cheque transaction and return an signed transaction

type Payment

type Payment struct {
	From    *types.Script
	To      *types.Script
	Amount  uint64
	FeeRate uint64
	// contains filtered or unexported fields
}

func NewPayment

func NewPayment(from, to string, amount, feeRate uint64) (*Payment, error)

NewPayment returns a Payment object, amount's unit is shannon

func (*Payment) GenerateTx

func (p *Payment) GenerateTx(client rpc.Client, systemScripts *utils.SystemScripts) (*types.Transaction, error)

func (*Payment) Send

func (p *Payment) Send(client rpc.Client) (*types.Hash, error)

func (*Payment) Sign

func (p *Payment) Sign(key crypto.Key) (*types.Transaction, error)

type Sudt added in v0.3.0

type Sudt struct {
	Senders        []*types.Script
	ReceiverInfo   []types.ReceiverInfo
	CkbPayer       *types.Script
	CkbChanger     *types.Script
	SudtChanger    *types.Script
	UUID           string
	TransferAmount *big.Int
	FeeRate        uint64
	// contains filtered or unexported fields
}

func NewSudt added in v0.3.0

func NewSudt(senderAddresses []string, receiverInfo map[string]string, ckbPayerAddress, ckbChangeAddress, sudtChangeAddress, uuid string, feeRate uint64, systemScripts *utils.SystemScripts) (*Sudt, error)

NewSudt returns a new NewSudt object receiverInfo's key is an address and its value is a sudt amount

func (*Sudt) GenerateTransferSudtUnsignedTx added in v0.3.0

func (s *Sudt) GenerateTransferSudtUnsignedTx(client rpc.Client) (*types.Transaction, error)

GenerateTransferSudtUnsignedTx generate an unsigned transaction for transfer sudt

func (*Sudt) Send added in v0.3.0

func (s *Sudt) Send(client rpc.Client) (*types.Hash, error)

Send can send a tx to tx pool

func (*Sudt) SignTx added in v0.3.0

func (s *Sudt) SignTx(keys map[string]crypto.Key) (*types.Transaction, error)

SignTx sign an unsigned sudt transfer transaction and return an signed transaction The order of keys must be consistent with the order of locks in senders

type WithdrawCheque added in v0.3.0

type WithdrawCheque struct {
	Sender   *types.Script
	Receiver *types.Script
	UUID     string
	FeeRate  uint64
	Amount   *big.Int
	// contains filtered or unexported fields
}

WithdrawCheque object

func NewWithdrawCheque added in v0.3.0

func NewWithdrawCheque(senderAddr, receiverAddr, uuid, amount string, feeRate uint64, systemScripts *utils.SystemScripts) (*WithdrawCheque, error)

NewWithdrawCheque returns a new WithdrawCheque object

func (*WithdrawCheque) GenerateWithdrawChequeUnsignedTx added in v0.3.0

func (c *WithdrawCheque) GenerateWithdrawChequeUnsignedTx(client rpc.Client) (*types.Transaction, error)

GenerateWithdrawChequeUnsignedTx generate an unsigned transaction for withdraw the cheque cell

func (*WithdrawCheque) Send added in v0.3.0

func (c *WithdrawCheque) Send(client rpc.Client) (*types.Hash, error)

Send can send a tx to tx pool

func (*WithdrawCheque) SignTx added in v0.3.0

func (c *WithdrawCheque) SignTx(key crypto.Key) (*types.Transaction, error)

SignTx sign an unsigned withdraw cheque transaction and return an signed transaction

Jump to

Keyboard shortcuts

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