This document features the method references for now.gg Gaming Wallet.
The NowGGWalletSdkManager
provides the public methods for your game (dapp) to interact with the now.gg wallet.
Instance – Returns the instance of the class.
This method is used to Initialize the Wallet SDK with provided arguments.
Returns – void.
Argument | Summary |
string apiKey | API key provided by now.gg. |
string appId | Your game-specific app id. |
NowGGWalletDelegate walletDelegate | Delegate implementation for receiving events in your game. |
VoidCallback OnDone | Callback for successful initialization. |
StringCallback OnFailed | Callback for initialization failure. |
This method is used to request a connection with now.gg Wallet.
Returns – void.
Exceptions:
Argument | Summary |
caipChainId | Chain agnostic improvement proposal’s chain id. (CAIP). |
voidCallback onPairingInvoked | Called when pairing is invoked. |
stringCallback onError | Called in case of an error. |
This method is used to request transaction approval with the connected now.gg Wallet.
Returns – void.
Exceptions:
Argument | Summary |
string toAddress | The wallet address where the transaction value should be sent. |
string value | Value to be sent. |
string data | The data to be sent along with the request. |
string caipChainId | Chain agnostic improvement proposal’s chain id. () |
string extra | Extra information to be passed for a transaction. |
This method requests the wallet to initiate the buying token procedure.
Returns – void.
Exceptions:
Argument | Summary |
string coinContractAddress | ERC20 contract address of token which needs to be bought. |
string value | The value of the token to be bought. |
string caipChainId | Chain agnostic improvement proposal’s chain id. (CAIP) |
string extra | Extra information to be passed for a transaction. |
This method requests the list of NFTs for the current user.
Returns – void.
Exceptions:
Argument | Summary |
string caipChainId | Chain agnostic improvement proposal’s chain id. (CAIP) |
string address | The wallet address of the current user. |
OnNftsReceived onNftsReceived | Callback when the result is available for NFTs. |
stringCallback onError | Called in case of an error. |
This method is used to retrieve the token balance for the current user.
Returns – void.
Exceptions:
Argument | Summary |
string coinContractAddess | ERC20 contract address of token whose balance needs to be retrieved. |
string caipChainId | The caipChainId for which balance is requested in (CAIP). |
string address | The wallet address of the current user. |
stringCallback onSuccess | Callback when the result is available. |
stringCallback onError | Called in case of an error. |
This method retrieves the transaction information for the provided hash.
Returns – void.
Exceptions:
Argument | Summary |
string caipChainId | caipChainId where the transaction was made. (CAIP) |
string transactionHash | The transaction hash for which information is being requested. |
OnTransactionsReceived onTransactionsReceived | Callback when the result is available. |
stringCallback onError | Called in case of an error. |
This method pings the connected wallet.
Returns – void.
Exceptions:
Argument | Summary |
stringCallback onPingSuccess | Callback when ping is successful. |
stringCallback onPingError | Called in case of an error |
This Interface defines the contract using callbacks on interaction with the wallet.
This method is triggered when the wallet approves a session request.
Returns – void.
Argument | Summary |
ApprovedSession approvedSession | Session details, including topic and wallet address. |
User user | The user information associated with the wallet holder, including:
|
This method is triggered when the wallet rejects a session request.
Returns – void.
Argument | Summary |
RejectedSession rejectedSession | Information associated with a rejected session request. |
This method is triggered when the information associated with a session is updated.
Returns – void.
Argument | Summary |
UpdatedSession updatedSession | Updated session information. |
This method is triggered when a session is deleted.
Returns – void.
Argument | Summary |
DeletedSession session | Information associated with a deleted session. |
This method is triggered when the connection state changes.
Returns – void.
Argument | Summary |
bool isAvailable | A flag which tells if the connection is available.
If If
|
This method is triggered when there is an error.
Returns – void.
Argument | Summary |
string error | Error Information / Error Code. |
This method is triggered when a token purchase is successful.
Returns – void.
Argument | Summary |
JsonRpcResponse result | Result received from the wallet. |
string extra | Extra data that we initially sent along with BuyToken , reverted by the wallet. |
This method is triggered when a token purchase fails.
Returns – void.
Argument | Summary |
string error | Error information received from the wallet. |
string extra | Extra data that we initially sent along with BuyToken , reverted by the wallet. |
This method is triggered when an error occurs while requesting for SendTransaction
operation.
Returns – void.
Argument | Summary |
string error | Error information. |
string extra | Extra data that we initially sent along with SendTransaction , reverted by the wallet. |
This method is triggered when a request has been successfully made for a transaction to the wallet.
Returns – void.
Argument | Summary |
string txnHash | The hash of the transaction received from the wallet. |
string caipChainId | Chain agnostic improvement proposal’s chain id. (CAIP) |
string extra | Extra data that we initially sent along with SendTransaction , reverted by the wallet. |
This method is triggered when a transaction is completed successfully.
Returns – void.
Argument | Summary |
TransactionInfo transaction | Transaction information object |
string extra | Extra data that we initially sent along with SendTransaction , reverted by the wallet. |
This method is triggered when a transaction is completed with an error post-wallet approval request.
Returns – void.
Argument | Summary |
string error | Error information. |
string extra | Extra data that we initially sent along with SendTransaction , reverted by the wallet. |
This class defines the list of error codes that may be raised during interaction with now.gg Wallet.
Argument | Error Code | Summary |
String SESSION_EXPIRED | sessionExpired | You must reconnect to the Wallet module by calling the Connect function of the NowGGWalletSdkManager class. |
The following is the list of supported blockchains:
Blockchain |
Ethereum |
Binance Smart Chain |
Polygon |
Avalanche C-Chain |
Optimism |
Arbitrum |
Polkadot |
Solana |
Tron |
Algorand |
Fantom |
Litecoin |
Cosmos |
Dogecoin |
Dash |
DigiByte |
Ethereum Classic |
Zcash |
XRP |
Stellar |
Bitcoin Cash |
Bitcoin |
Bitcoin Gold |
EOS |
TerraV2 |
NEAR |
Kusama |
Theta |
NEO |
Wallet Module
Wallet Module
Document Rev. 1.0