Hello Canados,
Congrats on your first post! Thank you for reaching Samsung Developer Forums.
Regarding your issue:
First of all, please ensure your mainnet infura rpc endpoint is up & running, and there is no mistake with the URL.
After that, please allow me to explain the Account Management | Samsung Developers of Samsung Blockchain Platform SDK.
Relevant APIs:
-
restoreAccounts: Traverses addresses in your Wallet’s HD paths sequentially one by one and saves the account into the account repo at sharedPreferences only if:
- the address balance is NON Zero, I mean there’s some balance.
- the address has transaction count/nonce.
In the sequence, once there is any address that doesn’t meet this requirement, the loop breaks.
-
generateAccounts: generateAccounts API calls the restoreAccounts API internally. After restoration, it creates a new account on the next HD path and stores that account on the account repo at sharedPreferences.
-
getAccounts: Returns all the accounts from account repo at sharedPreferences.
In your case, what we guess happened is: Your Wallet has two addresses that have balance or transaction count in the “rinkeby” test network. Thus restoreAccount stores those 2 accounts on repo and getAccounts return those 2 accounts.
But in the case of mainnet, we guess your Wallet may have no addresses that have balance or transaction count, thus that restores nothing and returns nothing at get. So, please utilize the generateAccount API for such cases, then get the account.
Hope this helps, Best Regards,
Armaan Ul Islam
Samsung Developer Program