Documentation ¶
Index ¶
- type Option
- type TransferPrm
- type Wrapper
- func (w *Wrapper) BalanceOf(id *owner.ID) (*big.Int, error)
- func (w *Wrapper) Burn(to util.Uint160, amount int64, id []byte) error
- func (w *Wrapper) Decimals() (uint32, error)
- func (w *Wrapper) Lock(id []byte, user, lock util.Uint160, amount, dueEpoch int64) error
- func (w *Wrapper) Mint(to util.Uint160, amount int64, id []byte) error
- func (w *Wrapper) TransferX(p TransferPrm) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶ added in v0.21.0
type Option func(*opts)
Option allows to set an optional parameter of ClientWrapper.
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 NewFromMorph ¶ added in v0.21.0
func NewFromMorph(cli *client.Client, contract util.Uint160, fee fixedn.Fixed8, opts ...Option) (*Wrapper, error)
NewFromMorph returns the wrapper instance from the raw morph client.
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.
If TryNotary is provided, calls notary contract.