Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNilWrapper = errors.New("balance contract client wrapper is nil")
ErrNilWrapper is returned by functions that expect a non-nil Wrapper pointer, but received nil.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client represents the Balance contract client.
It is a type alias of github.com/nspcc-dev/neofs-node/pkg/morph/client/balance.Client.
type TransferPrm ¶ added in v0.15.0
TransferPrm groups parameters of TransferX method.
type Wrapper ¶
type Wrapper struct {
// contains filtered or unexported fields
}
Wrapper is a wrapper over balance contract client which implements:
- tool for obtaining the amount of funds in the client's account;
- tool for obtaining decimal precision of currency transactions.
Working wrapper must be created via constructor New. Using the Wrapper that has been created with new(Wrapper) expression (or just declaring a Wrapper variable) is unsafe and can lead to panic.
func New ¶
New creates, initializes and returns the Wrapper instance.
If Client is nil, balance.ErrNilClient is returned.
func (*Wrapper) BalanceOf ¶
BalanceOf receives the amount of funds in the client's account through the Balance contract call, and returns it.
func (*Wrapper) Decimals ¶
Decimals decimal precision of currency transactions through the Balance contract call, and returns it.
func (*Wrapper) TransferX ¶ added in v0.15.0
func (w *Wrapper) TransferX(p TransferPrm) error
TransferX transfers p.Amount of GASe-12 from p.From to p.To with details p.Details through direct smart contract call.
func (*Wrapper) TransferXNotary ¶ added in v0.17.0
func (w *Wrapper) TransferXNotary(p TransferPrm) error
TransferXNotary transfers p.Amount of GASe-12 from p.From to p.To with details p.Details via notary contract.