Wallets

Check user primary wallet

For this, you need to add a WalletsModule in Initialisation. Refer Initialize the RGN SDK
RGNCoreBuilder.AddModule(newWalletsModule());

API call:

WalletsModule module = RGNCoreBuilder.I.GetModule<WalletsModule>();
IsUserHavePrimaryWalletResponseData response = await module.IsUserHavePrimaryWallet();

Response:

Return IsUserHavePrimaryWalletResponseData object, which contains following fields:
  • bool isUserHavePrimaryWallet

Retrieve user wallets

API call:

WalletsModule module = RGNCoreBuilder.I.GetModule<WalletsModule>();
GetUserWalletsResponseData response = await module.GetUserWallets();

Response:

Return GetUserWalletsResponseData object, which contains following fields:
  • RGNWallet[] wallets - list of wallet objects
Details of RGNWallet:
  • address (string) - unique address of wallet

Retrieve user items

In order to retrieve user items, it requires to call the following function by passing wallet's address (string) as a parameter.

API call:

WalletsModule module = RGNCoreBuilder.I.GetModule<WalletsModule>();
GetUserWalletItemsResponseData response = await module.GetUserWalletItems(walletAddress);

Response:

Return GetUserWalletItemsResponseData object, which contains following fields:
  • RGNWalletItem[] walletItems - list of wallet items
Details of RGNWalletItem:
  • itemId (string) - unique id of item
  • quantity (int) - quantity of item

Creating new wallet

When creating a wallet, you can use a password, leave the field blank if this is not necessary.

API call:

WalletsModule module = RGNCoreBuilder.I.GetModule<WalletsModule>();
CreateWalletResponseData response = await module.CreateWallet(password);

Response:

Return CreateWalletResponseData object, which contains following fields:
  • string address - address of created wallet
  • bool wallet_created - is wallet was created
Last modified 2mo ago
Copy link
On this page
Check user primary wallet
Retrieve user wallets
Retrieve user items
Creating new wallet