```{eval-rst} .. tutorials-topup-identity-balance: ``` # Topup an identity's balance The purpose of this tutorial is to walk through the steps necessary to add credits to an identity's balance. ## Overview As users interact with Dash Platform applications, the credit balance associated with their identity will decrease. Eventually it will be necessary to topup the balance by converting some Dash to credits. Additional details regarding credits can be found in the [Credits description](../../explanations/identity.md#credits). ## Prerequisites - [General prerequisites](../../tutorials/introduction.md#prerequisites) (Node.js / Dash SDK installed) - A wallet mnemonic with some funds in it: [Tutorial: Create and Fund a Wallet](../../tutorials/create-and-fund-a-wallet.md) - A configured client: [Setup SDK Client](../setup-sdk-client.md) - A Dash Platform Identity: [Tutorial: Register an Identity](../../tutorials/identities-and-names/register-an-identity.md) ## Code ```javascript const setupDashClient = require('../setupDashClient'); const client = setupDashClient(); const topupIdentity = async () => { const identityId = 'an identity ID goes here'; const topUpAmount = 100000; // Number of duffs await client.platform.identities.topUp(identityId, topUpAmount); return client.platform.identities.get(identityId); }; topupIdentity() .then((d) => console.log('Identity credit balance: ', d.balance)) .catch((e) => console.error('Something went wrong:\n', e)) .finally(() => client.disconnect()); ``` ## What's Happening After connecting to the Client, we call `platform.identities.topUp` with an identity ID and a topup amount in duffs (1 duff = 1000 credits). This creates a lock transaction and increases the identity's credit balance by the relevant amount (minus fee). The updated balance is output to the console. > 📘 Wallet Sync > > Since the SDK does not cache wallet information, lengthy re-syncs (5+ minutes) may be required for some Core chain wallet operations. See [Wallet Operations](../setup-sdk-client.md#wallet-operations) for options.