Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions 1-Identities-and-Names/identity-transfer-credits.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ const transferCredits = async () => {

const recipientId = process.env.RECIPIENT_ID; // Recipient's ID
const recipientIdentity = await client.platform.identities.get(recipientId);
console.log('Recipient identity balance before transfer: ', recipientIdentity.balance);
console.log(
'Recipient identity balance before transfer: ',
recipientIdentity.balance,
);
const transferAmount = 1000; // Number of credits to transfer

await client.platform.identities.creditTransfer(
Expand All @@ -32,6 +35,8 @@ const transferCredits = async () => {
};

transferCredits()
.then((d) => console.log('Recipient identity balance after transfer: ', d.balance))
.then((d) =>
console.log('Recipient identity balance after transfer: ', d.balance),
)
.catch((e) => console.error('Something went wrong:\n', e))
.finally(() => client.disconnect());
Loading