Documentation ¶
Overview ¶
Package balance contains RPC wrappers for Balance contract.
Index ¶
- type Actor
- type BurnEvent
- type Contract
- func (c *Contract) Burn(from util.Uint160, amount *big.Int, txDetails []byte) (util.Uint256, uint32, error)
- func (c *Contract) BurnTransaction(from util.Uint160, amount *big.Int, txDetails []byte) (*transaction.Transaction, error)
- func (c *Contract) BurnUnsigned(from util.Uint160, amount *big.Int, txDetails []byte) (*transaction.Transaction, error)
- func (c *Contract) Lock(txDetails []byte, from util.Uint160, to util.Uint160, amount *big.Int, ...) (util.Uint256, uint32, error)
- func (c *Contract) LockTransaction(txDetails []byte, from util.Uint160, to util.Uint160, amount *big.Int, ...) (*transaction.Transaction, error)
- func (c *Contract) LockUnsigned(txDetails []byte, from util.Uint160, to util.Uint160, amount *big.Int, ...) (*transaction.Transaction, error)
- func (c *Contract) Mint(to util.Uint160, amount *big.Int, txDetails []byte) (util.Uint256, uint32, error)
- func (c *Contract) MintTransaction(to util.Uint160, amount *big.Int, txDetails []byte) (*transaction.Transaction, error)
- func (c *Contract) MintUnsigned(to util.Uint160, amount *big.Int, txDetails []byte) (*transaction.Transaction, error)
- func (c *Contract) NewEpoch(epochNum *big.Int) (util.Uint256, uint32, error)
- func (c *Contract) NewEpochTransaction(epochNum *big.Int) (*transaction.Transaction, error)
- func (c *Contract) NewEpochUnsigned(epochNum *big.Int) (*transaction.Transaction, error)
- func (c *Contract) TransferX(from util.Uint160, to util.Uint160, amount *big.Int, details []byte) (util.Uint256, uint32, error)
- func (c *Contract) TransferXTransaction(from util.Uint160, to util.Uint160, amount *big.Int, details []byte) (*transaction.Transaction, error)
- func (c *Contract) TransferXUnsigned(from util.Uint160, to util.Uint160, amount *big.Int, details []byte) (*transaction.Transaction, error)
- func (c *Contract) Update(script []byte, manifest []byte, data any) (util.Uint256, uint32, error)
- func (c *Contract) UpdateTransaction(script []byte, manifest []byte, data any) (*transaction.Transaction, error)
- func (c *Contract) UpdateUnsigned(script []byte, manifest []byte, data any) (*transaction.Transaction, error)
- type ContractReader
- type Invoker
- type LockEvent
- type MintEvent
- type TransferXEvent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Actor ¶
type Actor interface { Invoker nep17.Actor MakeCall(contract util.Uint160, method string, params ...any) (*transaction.Transaction, error) MakeRun(script []byte) (*transaction.Transaction, error) MakeUnsignedCall(contract util.Uint160, method string, attrs []transaction.Attribute, params ...any) (*transaction.Transaction, error) MakeUnsignedRun(script []byte, attrs []transaction.Attribute) (*transaction.Transaction, error) SendCall(contract util.Uint160, method string, params ...any) (util.Uint256, uint32, error) SendRun(script []byte) (util.Uint256, uint32, error) }
Actor is used by Contract to call state-changing methods.
type BurnEvent ¶
BurnEvent represents "Burn" event emitted by the contract.
func BurnEventsFromApplicationLog ¶
func BurnEventsFromApplicationLog(log *result.ApplicationLog) ([]*BurnEvent, error)
BurnEventsFromApplicationLog retrieves a set of all emitted events with "Burn" name from the provided result.ApplicationLog.
func (*BurnEvent) FromStackItem ¶
FromStackItem converts provided stackitem.Array to BurnEvent or returns an error if it's not possible to do to so.
type Contract ¶
type Contract struct { ContractReader nep17.TokenWriter // contains filtered or unexported fields }
Contract implements all contract methods.
func (*Contract) Burn ¶
func (c *Contract) Burn(from util.Uint160, amount *big.Int, txDetails []byte) (util.Uint256, uint32, error)
Burn creates a transaction invoking `burn` method of the contract. This transaction is signed and immediately sent to the network. The values returned are its hash, ValidUntilBlock value and error if any.
func (*Contract) BurnTransaction ¶
func (c *Contract) BurnTransaction(from util.Uint160, amount *big.Int, txDetails []byte) (*transaction.Transaction, error)
BurnTransaction creates a transaction invoking `burn` method of the contract. This transaction is signed, but not sent to the network, instead it's returned to the caller.
func (*Contract) BurnUnsigned ¶
func (c *Contract) BurnUnsigned(from util.Uint160, amount *big.Int, txDetails []byte) (*transaction.Transaction, error)
BurnUnsigned creates a transaction invoking `burn` method of the contract. This transaction is not signed, it's simply returned to the caller. Any fields of it that do not affect fees can be changed (ValidUntilBlock, Nonce), fee values (NetworkFee, SystemFee) can be increased as well.
func (*Contract) Lock ¶
func (c *Contract) Lock(txDetails []byte, from util.Uint160, to util.Uint160, amount *big.Int, until *big.Int) (util.Uint256, uint32, error)
Lock creates a transaction invoking `lock` method of the contract. This transaction is signed and immediately sent to the network. The values returned are its hash, ValidUntilBlock value and error if any.
func (*Contract) LockTransaction ¶
func (c *Contract) LockTransaction(txDetails []byte, from util.Uint160, to util.Uint160, amount *big.Int, until *big.Int) (*transaction.Transaction, error)
LockTransaction creates a transaction invoking `lock` method of the contract. This transaction is signed, but not sent to the network, instead it's returned to the caller.
func (*Contract) LockUnsigned ¶
func (c *Contract) LockUnsigned(txDetails []byte, from util.Uint160, to util.Uint160, amount *big.Int, until *big.Int) (*transaction.Transaction, error)
LockUnsigned creates a transaction invoking `lock` method of the contract. This transaction is not signed, it's simply returned to the caller. Any fields of it that do not affect fees can be changed (ValidUntilBlock, Nonce), fee values (NetworkFee, SystemFee) can be increased as well.
func (*Contract) Mint ¶
func (c *Contract) Mint(to util.Uint160, amount *big.Int, txDetails []byte) (util.Uint256, uint32, error)
Mint creates a transaction invoking `mint` method of the contract. This transaction is signed and immediately sent to the network. The values returned are its hash, ValidUntilBlock value and error if any.
func (*Contract) MintTransaction ¶
func (c *Contract) MintTransaction(to util.Uint160, amount *big.Int, txDetails []byte) (*transaction.Transaction, error)
MintTransaction creates a transaction invoking `mint` method of the contract. This transaction is signed, but not sent to the network, instead it's returned to the caller.
func (*Contract) MintUnsigned ¶
func (c *Contract) MintUnsigned(to util.Uint160, amount *big.Int, txDetails []byte) (*transaction.Transaction, error)
MintUnsigned creates a transaction invoking `mint` method of the contract. This transaction is not signed, it's simply returned to the caller. Any fields of it that do not affect fees can be changed (ValidUntilBlock, Nonce), fee values (NetworkFee, SystemFee) can be increased as well.
func (*Contract) NewEpoch ¶
NewEpoch creates a transaction invoking `newEpoch` method of the contract. This transaction is signed and immediately sent to the network. The values returned are its hash, ValidUntilBlock value and error if any.
func (*Contract) NewEpochTransaction ¶
func (c *Contract) NewEpochTransaction(epochNum *big.Int) (*transaction.Transaction, error)
NewEpochTransaction creates a transaction invoking `newEpoch` method of the contract. This transaction is signed, but not sent to the network, instead it's returned to the caller.
func (*Contract) NewEpochUnsigned ¶
func (c *Contract) NewEpochUnsigned(epochNum *big.Int) (*transaction.Transaction, error)
NewEpochUnsigned creates a transaction invoking `newEpoch` method of the contract. This transaction is not signed, it's simply returned to the caller. Any fields of it that do not affect fees can be changed (ValidUntilBlock, Nonce), fee values (NetworkFee, SystemFee) can be increased as well.
func (*Contract) TransferX ¶
func (c *Contract) TransferX(from util.Uint160, to util.Uint160, amount *big.Int, details []byte) (util.Uint256, uint32, error)
TransferX creates a transaction invoking `transferX` method of the contract. This transaction is signed and immediately sent to the network. The values returned are its hash, ValidUntilBlock value and error if any.
func (*Contract) TransferXTransaction ¶
func (c *Contract) TransferXTransaction(from util.Uint160, to util.Uint160, amount *big.Int, details []byte) (*transaction.Transaction, error)
TransferXTransaction creates a transaction invoking `transferX` method of the contract. This transaction is signed, but not sent to the network, instead it's returned to the caller.
func (*Contract) TransferXUnsigned ¶
func (c *Contract) TransferXUnsigned(from util.Uint160, to util.Uint160, amount *big.Int, details []byte) (*transaction.Transaction, error)
TransferXUnsigned creates a transaction invoking `transferX` method of the contract. This transaction is not signed, it's simply returned to the caller. Any fields of it that do not affect fees can be changed (ValidUntilBlock, Nonce), fee values (NetworkFee, SystemFee) can be increased as well.
func (*Contract) Update ¶
Update creates a transaction invoking `update` method of the contract. This transaction is signed and immediately sent to the network. The values returned are its hash, ValidUntilBlock value and error if any.
func (*Contract) UpdateTransaction ¶
func (c *Contract) UpdateTransaction(script []byte, manifest []byte, data any) (*transaction.Transaction, error)
UpdateTransaction creates a transaction invoking `update` method of the contract. This transaction is signed, but not sent to the network, instead it's returned to the caller.
func (*Contract) UpdateUnsigned ¶
func (c *Contract) UpdateUnsigned(script []byte, manifest []byte, data any) (*transaction.Transaction, error)
UpdateUnsigned creates a transaction invoking `update` method of the contract. This transaction is not signed, it's simply returned to the caller. Any fields of it that do not affect fees can be changed (ValidUntilBlock, Nonce), fee values (NetworkFee, SystemFee) can be increased as well.
type ContractReader ¶
type ContractReader struct { nep17.TokenReader // contains filtered or unexported fields }
ContractReader implements safe contract methods.
type LockEvent ¶
type LockEvent struct { TxID []byte From util.Uint160 To util.Uint160 Amount *big.Int Until *big.Int }
LockEvent represents "Lock" event emitted by the contract.
func LockEventsFromApplicationLog ¶
func LockEventsFromApplicationLog(log *result.ApplicationLog) ([]*LockEvent, error)
LockEventsFromApplicationLog retrieves a set of all emitted events with "Lock" name from the provided result.ApplicationLog.
func (*LockEvent) FromStackItem ¶
FromStackItem converts provided stackitem.Array to LockEvent or returns an error if it's not possible to do to so.
type MintEvent ¶
MintEvent represents "Mint" event emitted by the contract.
func MintEventsFromApplicationLog ¶
func MintEventsFromApplicationLog(log *result.ApplicationLog) ([]*MintEvent, error)
MintEventsFromApplicationLog retrieves a set of all emitted events with "Mint" name from the provided result.ApplicationLog.
func (*MintEvent) FromStackItem ¶
FromStackItem converts provided stackitem.Array to MintEvent or returns an error if it's not possible to do to so.
type TransferXEvent ¶
TransferXEvent represents "TransferX" event emitted by the contract.
func TransferXEventsFromApplicationLog ¶
func TransferXEventsFromApplicationLog(log *result.ApplicationLog) ([]*TransferXEvent, error)
TransferXEventsFromApplicationLog retrieves a set of all emitted events with "TransferX" name from the provided result.ApplicationLog.
func (*TransferXEvent) FromStackItem ¶
func (e *TransferXEvent) FromStackItem(item *stackitem.Array) error
FromStackItem converts provided stackitem.Array to TransferXEvent or returns an error if it's not possible to do to so.