AssertIsNotHandleNativeCoin
func()AssertIsNotHandleNativeCoin validates that no native coins were sent with the transaction. Panics with errNotHandleNativeCoin if any native coins were sent. Use this when a function should only work with GRC20 tokens and not accept native coins.
- OID
- 057463…de87:3
AssertIsNotHandleNativeCoin details
errNotRegistered
untyped stringValue
"[GNOSWAP-COMMON-001] token is not registered"
errNotHandleNativeCoin
untyped stringValue
"[GNOSWAP-COMMON-002] handle native coin is not allowed"
newErrorWithDetail
func(message string, detail string) stringnewErrorWithDetail creates an error message with additional context in format "\<original\_error> || \<detail>".
- OID
- 057463…de87:5
newErrorWithDetail details
GetToken
func(tokenKey string) *grc20.TokenGetToken returns a grc20.Token instance for the specified tokenKey, panicking if not registered. Parameters: - tokenKey: GRC20 registry key Returns a pointer to the grc20.Token instance. Panics if the token is not registered in grc20reg.
- OID
- 057463…de87:7
GetToken details
GetTokenTeller
func(tokenKey string) grc20.TellerGetTokenTeller returns a CallerTeller for the specified tokenKey, panicking if not registered. Parameters: - tokenKey: GRC20 registry key Returns a grc20.Teller whose write methods derive the actor from the caller realm. Panics if the token is not registered in grc20reg.
- OID
- 057463…de87:9
GetTokenTeller details
IsRegistered
func(tokenKey string) .uverse.errorIsRegistered checks if a token is registered in grc20reg, returning nil if registered or error if not. Parameters: - tokenKey: GRC20 registry key Returns nil if the token is registered, or an error describing the issue.
- OID
- 057463…de87:10
IsRegistered details
MustRegistered
func(tokenKeys []string)MustRegistered checks if all provided tokens are registered, panicking if any is not registered. Parameters: - tokenKeys: variable number of GRC20 registry keys to check Panics if any of the provided tokens is not registered in grc20reg.
- OID
- 057463…de87:11
MustRegistered details
TotalSupply
func(tokenKey string) int64TotalSupply returns the total supply of the specified token. Parameters: - tokenKey: GRC20 registry key Returns the total supply of the token as int64.
- OID
- 057463…de87:12
TotalSupply details
BalanceOf
func(tokenKey string, addr .uverse.address) int64BalanceOf returns the token balance for the specified address. Parameters: - tokenKey: GRC20 registry key - addr: address to query the balance for Returns the token balance as int64.
- OID
- 057463…de87:13
BalanceOf details
Allowance
func(tokenKey string, owner .uverse.address, spender .uverse.address) int64Allowance returns the token allowance from owner to spender. Parameters: - tokenKey: GRC20 registry key - owner: address of the token owner - spender: address of the spender Returns the allowance amount as int64.
- OID
- 057463…de87:14
Allowance details
Transfer
func(tokenKey string, to .uverse.address, amount int64) .uverse.errorTransfer crosses into common before forwarding to grc20.Teller.Transfer. CallerTeller uses cur.Previous() as the token actor, so this helper must remain a crossing adapter called with cross(cur). Parameters: - cur: current realm - tokenKey: GRC20 registry key - to: recipient address - amount: amount of tokens to transfer Returns an error if the transfer fails, nil otherwise.
- OID
- 057463…de87:15
Transfer details
TransferFrom
func(tokenKey string, from .uverse.address, to .uverse.address, amount int64) .uverse.errorTransferFrom crosses into common before forwarding to grc20.Teller.TransferFrom. CallerTeller uses cur.Previous() as the spender, so this helper must remain a crossing adapter called with cross(cur). Parameters: - cur: current realm - tokenKey: GRC20 registry key - from: sender address - to: recipient address - amount: amount of tokens to transfer Returns an error if the transfer fails, nil otherwise.
- OID
- 057463…de87:16
TransferFrom details
Approve
func(tokenKey string, spender .uverse.address, amount int64) .uverse.errorApprove crosses into common before forwarding to grc20.Teller.Approve. CallerTeller uses cur.Previous() as the approver, so this helper must remain a crossing adapter called with cross(cur). Parameters: - cur: current realm - tokenKey: GRC20 registry key - spender: address allowed to spend the tokens - amount: amount of tokens to approve Returns an error if the approval fails, nil otherwise.
- OID
- 057463…de87:17
Approve details
SafeGRC20Transfer
func(tokenKey string, to .uverse.address, amount int64)SafeGRC20Transfer crosses into common, transfers tokens, and panics if it fails. CallerTeller uses cur.Previous() as the token actor, so this helper must remain a crossing adapter called with cross(cur). Parameters: - cur: current realm - tokenKey: GRC20 registry key - to: recipient address - amount: amount of tokens to transfer Panics if the transfer fails.
- OID
- 057463…de87:18
SafeGRC20Transfer details
SafeGRC20TransferFrom
func(tokenKey string, from .uverse.address, to .uverse.address, amount int64)SafeGRC20TransferFrom crosses into common, transfers tokens, and panics if it fails. CallerTeller uses cur.Previous() as the spender, so this helper must remain a crossing adapter called with cross(cur). Parameters: - cur: current realm - tokenKey: GRC20 registry key - from: sender address - to: recipient address - amount: amount of tokens to transfer Panics if the transfer fails.
- OID
- 057463…de87:19
SafeGRC20TransferFrom details
SafeGRC20Approve
func(tokenKey string, spender .uverse.address, amount int64)SafeGRC20Approve crosses into common, approves tokens, and panics if it fails. CallerTeller uses cur.Previous() as the approver, so this helper must remain a crossing adapter called with cross(cur). Parameters: - cur: current realm - tokenKey: GRC20 registry key - spender: address allowed to spend the tokens - amount: amount of tokens to approve Panics if the approval fails.
- OID
- 057463…de87:20