api

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: 9 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("not found")

ErrNotFound is returned by API methods if the requested item does not exist.

Functions

func WaitForConf

func WaitForConf(ctx context.Context, c RpcClient, tx *types.TransactionOrder) (*wallet.Proof, error)

Types

type Bill

type Bill struct {
	ID       types.UnitID
	BillData *money.BillData
}

func FetchBill

func FetchBill(ctx context.Context, c RpcClient, unitID types.UnitID) (*Bill, error)

func FetchBills

func FetchBills(ctx context.Context, c RpcClient, ownerID []byte) ([]*Bill, error)
func (b *Bill) Backlink() []byte

func (*Bill) IsLocked

func (b *Bill) IsLocked() bool

func (*Bill) Value

func (b *Bill) Value() uint64

type FeeCreditBill

type FeeCreditBill struct {
	ID              types.UnitID
	FeeCreditRecord *unit.FeeCreditRecord
}

func FetchFeeCreditBill

func FetchFeeCreditBill(ctx context.Context, c RpcClient, fcrID types.UnitID) (*FeeCreditBill, error)
func (b *FeeCreditBill) Backlink() []byte

func (*FeeCreditBill) Balance

func (b *FeeCreditBill) Balance() uint64

func (*FeeCreditBill) IsLocked

func (b *FeeCreditBill) IsLocked() bool

type RpcClient

type RpcClient interface {
	GetRoundNumber(ctx context.Context) (uint64, error)
	GetBill(ctx context.Context, unitID types.UnitID, includeStateProof bool) (*Bill, error)
	GetFeeCreditRecord(ctx context.Context, unitID types.UnitID, includeStateProof bool) (*FeeCreditBill, error)
	GetUnitsByOwnerID(ctx context.Context, ownerID types.Bytes) ([]types.UnitID, error)
	GetTransactionProof(ctx context.Context, txHash types.Bytes) (*types.TransactionRecord, *types.TxProof, error)
}

Jump to

Keyboard shortcuts

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