balance

package
v0.40.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BurnPrm

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

BurnPrm groups parameters of Burn operation.

func (*BurnPrm) SetAmount

func (b *BurnPrm) SetAmount(amount int64)

SetAmount sets amount.

func (*BurnPrm) SetID

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

SetID sets ID.

func (*BurnPrm) SetTo

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

SetTo sets receiver.

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a wrapper over StaticClient which makes calls with the names and arguments of the FrostFS Balance contract.

Working client must be created via constructor New. Using the Client that has been created with new(Client) expression (or just declaring a Client variable) is unsafe and can lead to panic.

func NewFromMorph

func NewFromMorph(cli *client.Client, contract util.Uint160, fee fixedn.Fixed8, opts ...Option) (*Client, error)

NewFromMorph returns the wrapper instance from the raw morph client.

func (*Client) BalanceOf

func (c *Client) BalanceOf(id user.ID) (*big.Int, error)

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

func (*Client) Burn

func (c *Client) Burn(p BurnPrm) error

Burn destroys funds from the account.

func (*Client) Decimals

func (c *Client) Decimals() (uint32, error)

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

func (*Client) Lock

func (c *Client) Lock(p LockPrm) error

Lock locks fund on the user account.

func (*Client) Mint

func (c *Client) Mint(p MintPrm) error

Mint sends funds to the account.

func (*Client) TransferX

func (c *Client) 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.

type LockPrm

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

LockPrm groups parameters of Lock operation.

func (*LockPrm) SetAmount

func (l *LockPrm) SetAmount(amount int64)

SetAmount sets amount.

func (*LockPrm) SetDueEpoch

func (l *LockPrm) SetDueEpoch(dueEpoch int64)

SetDueEpoch sets end of the lock.

func (*LockPrm) SetID

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

SetID sets ID.

func (*LockPrm) SetLock

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

SetLock sets lock.

func (*LockPrm) SetUser

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

SetUser set user.

type MintPrm

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

MintPrm groups parameters of Mint operation.

func (*MintPrm) SetAmount

func (m *MintPrm) SetAmount(amount int64)

SetAmount sets amount of the transfer.

func (*MintPrm) SetID

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

SetID sets ID.

func (*MintPrm) SetTo

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

SetTo sets receiver of the transfer.

type Option

type Option func(*opts)

Option allows to set an optional parameter of Wrapper.

func AsAlphabet

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

func TryNotary() Option

TryNotary returns option to enable notary invocation tries.

type TransferPrm

type TransferPrm struct {
	Amount int64

	From, To user.ID

	Details []byte

	client.InvokePrmOptional
}

TransferPrm groups parameters of TransferX method.

Jump to

Keyboard shortcuts

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