Documentation ¶
Overview ¶
Package neptoken contains RPC wrapper for common NEP-11 and NEP-17 methods.
All of these methods are safe, read-only.
Index ¶
Constants ¶
View Source
const ( // MaxValidDecimals is the maximum value 'decimals' contract method can // return to be considered as valid. It's log10(2^256), higher values // don't make any sense on a VM with 256-bit integers. This restriction // is not imposed by NEP-17 or NEP-11, but we do it as a sanity check // anyway (and return plain int as a result). MaxValidDecimals = 77 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Base ¶
type Base struct {
// contains filtered or unexported fields
}
Base is a reader interface for common NEP-11 and NEP-17 methods built on top of Invoker.
func New ¶
New creates an instance of Base for contract with the given hash using the given invoker.
func (*Base) Decimals ¶
Decimals implements `decimals` NEP-17 or NEP-11 method and returns the number of decimals used by token. For non-divisible NEP-11 tokens this method always returns zero. Values less than 0 or more than MaxValidDecimals are considered to be invalid (with an appropriate error) even if returned by the contract.
Click to show internal directories.
Click to hide internal directories.