share

package
v0.15.6 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: ISC Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BalanceArguments

type BalanceArguments struct {
	Owner   *account.Account `json:"owner"` // base58
	ShareId merkle.Digest    `json:"shareId"`
	Count   int              `json:"count"` // number of records
}

BalanceArguments - arguments for RPC

type BalanceReply

type BalanceReply struct {
	Balances []reservoir.BalanceInfo `json:"balances"`
}

BalanceReply - balances of shares belonging to an account

type CreateReply

type CreateReply struct {
	TxId     merkle.Digest                                   `json:"txId"`
	ShareId  merkle.Digest                                   `json:"shareId"`
	PayId    pay.PayId                                       `json:"payId"`
	Payments map[string]transactionrecord.PaymentAlternative `json:"payments"`
}

CreateReply - results from creating a share

type GrantReply

type GrantReply struct {
	Remaining uint64                                          `json:"remaining"`
	TxId      merkle.Digest                                   `json:"txId"`
	PayId     pay.PayId                                       `json:"payId"`
	Payments  map[string]transactionrecord.PaymentAlternative `json:"payments"`
}

GrantReply - result of granting some shares to another account

type Share

type Share struct {
	Log          *logger.L
	Limiter      *rate.Limiter
	IsNormalMode func(mode.Mode) bool
	Rsvr         reservoir.Reservoir
}

Share - type for RPC

func New

func New(log *logger.L, isNormalMode func(mode.Mode) bool, rsvr reservoir.Reservoir) *Share

func (*Share) Balance

func (share *Share) Balance(arguments *BalanceArguments, reply *BalanceReply) error

Balance - list balances for an account

func (*Share) Create

func (share *Share) Create(bmfr *transactionrecord.BitmarkShare, reply *CreateReply) error

Create - create fractional bitmark

func (*Share) Grant

func (share *Share) Grant(arguments *transactionrecord.ShareGrant, reply *GrantReply) error

Grant - grant a number of shares to another account

func (*Share) Swap

func (share *Share) Swap(arguments *transactionrecord.ShareSwap, reply *SwapReply) error

Swap - atomically swap shares between accounts

type SwapReply

type SwapReply struct {
	RemainingOne uint64                                          `json:"remainingOne"`
	RemainingTwo uint64                                          `json:"remainingTwo"`
	TxId         merkle.Digest                                   `json:"txId"`
	PayId        pay.PayId                                       `json:"payId"`
	Payments     map[string]transactionrecord.PaymentAlternative `json:"payments"`
}

SwapReply - result of a share swap

Jump to

Keyboard shortcuts

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