wrapper

package
v0.27.4 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2022 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BurnPrm added in v0.27.0

type BurnPrm struct {
	client.InvokePrmOptional
	// contains filtered or unexported fields
}

BurnPrm groups parameters of Burn operation.

func (*BurnPrm) SetAmount added in v0.27.0

func (b *BurnPrm) SetAmount(amount int64)

SetAmount sets amount.

func (*BurnPrm) SetID added in v0.27.0

func (b *BurnPrm) SetID(id []byte)

SetID sets ID

func (*BurnPrm) SetTo added in v0.27.0

func (b *BurnPrm) SetTo(to util.Uint160)

SetTo sets receiver.

type LockPrm added in v0.27.0

type LockPrm struct {
	client.InvokePrmOptional
	// contains filtered or unexported fields
}

LockPrm groups parameters of Lock operation.

func (*LockPrm) SetAmount added in v0.27.0

func (l *LockPrm) SetAmount(amount int64)

SetAmount sets amount.

func (*LockPrm) SetDueEpoch added in v0.27.0

func (l *LockPrm) SetDueEpoch(dueEpoch int64)

SetDueEpoch sets end of the lock.

func (*LockPrm) SetID added in v0.27.0

func (l *LockPrm) SetID(id []byte)

SetID sets ID.

func (*LockPrm) SetLock added in v0.27.0

func (l *LockPrm) SetLock(lock util.Uint160)

SetLock sets lock.

func (*LockPrm) SetUser added in v0.27.0

func (l *LockPrm) SetUser(user util.Uint160)

SetUser set user.

type MintPrm added in v0.27.0

type MintPrm struct {
	client.InvokePrmOptional
	// contains filtered or unexported fields
}

MintPrm groups parameters of Mint operation.

func (*MintPrm) SetAmount added in v0.27.0

func (m *MintPrm) SetAmount(amount int64)

SetAmount sets amount of the transfer.

func (*MintPrm) SetID added in v0.27.0

func (m *MintPrm) SetID(id []byte)

SetID sets ID.

func (*MintPrm) SetTo added in v0.27.0

func (m *MintPrm) SetTo(to util.Uint160)

SetTo sets receiver of the transfer.

type Option added in v0.21.0

type Option func(*opts)

Option allows to set an optional parameter of Wrapper.

func AsAlphabet added in v0.25.0

func AsAlphabet() Option

AsAlphabet returns option to sign main TX of notary requests with client's private key.

Considered to be used by IR nodes only.

func TryNotary added in v0.21.0

func TryNotary() Option

TryNotary returns option to enable notary invocation tries.

type TransferPrm added in v0.15.0

type TransferPrm struct {
	Amount int64

	From, To *owner.ID

	Details []byte

	client.InvokePrmOptional
}

TransferPrm groups parameters of TransferX method.

type Wrapper

type Wrapper struct {
	internal.StaticClient
	// 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

func (w *Wrapper) BalanceOf(id *owner.ID) (*big.Int, error)

BalanceOf receives the amount of funds in the client's account through the Balance contract call, and returns it.

func (*Wrapper) Burn added in v0.22.0

func (w *Wrapper) Burn(prm BurnPrm) error

Burn destroys funds from the account.

func (*Wrapper) Decimals

func (w *Wrapper) Decimals() (uint32, error)

Decimals decimal precision of currency transactions through the Balance contract call, and returns it.

func (*Wrapper) Lock added in v0.22.0

func (w *Wrapper) Lock(prm LockPrm) error

Lock locks fund on the user account.

func (*Wrapper) Mint added in v0.22.0

func (w *Wrapper) Mint(prm MintPrm) error

Mint sends funds to the account.

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.

Jump to

Keyboard shortcuts

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