☞   The renaming of “Ledger Live” to “Ledger Wallet” and
     “wallet” (in the hardware sense) to “signer” is still in progress.
     This page may contain legacy references that will be updated.

Account sync

As this feature isn’t supported everywhere, we are going to extend account metadata like this :

export type MyBlockchainResources = {
  delegations: MyBlockchainDelegation[];
  unbondings: MyBlockchainUnbonding[];
  delegatedBalance: BigNumber;
  pendingRewardsBalance: BigNumber;
  unbondingBalance: BigNumber;
};

This is what will act as a cache of account staking informations

As every account related sync, it is done in the sync method of the account bridge. It’s the same as a standard send/receive integration, except we fetch addition staking data, and return additional resources:

return {
   ...
   myBlockchainResources: {
   delegations,
   unbondings,
   delegatedBalance,
   pendingRewardsBalance,
   unbondingBalance,
   },
 };

Those informations need to be serialized when saving app cache

We need to update those bridge methods:

  • assignFromAccountRaw

  • assignToAccountRaw

They are required when we start using specific additional account resources (here, myBlockchainResources)

Example

Ledger
Copyright © Ledger SAS. All rights reserved. Ledger, Ledger Stax, Ledger Flex, Ledger Nano, Ledger Nano S, Ledger OS, Ledger Wallet, [LEDGER] (logo), [L] (logo) are trademarks owned by Ledger SAS.