Skip to content

Commit 2bcc481

Browse files
committed
docs(sdk): add credit transfer
1 parent 0dd7d40 commit 2bcc481

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Credit Transfer
2+
3+
**Usage**: `await client.platform.identities.creditTransfer(identity, recipientId, amount)`
4+
5+
**Description**: Transfers credits from one identity to another within the Dash Platform.
6+
7+
Parameters:
8+
9+
| Parameters | Type | Required | Description |
10+
| ------------ | ------------------- | -------- | --------------------------------------------------------------------------- |
11+
| **identity** | Identity | Yes | The identity object initiating the transfer. |
12+
| **recipientId** | Identifier \| string | Yes | The identifier of the recipient identity. Can be an Identifier object or a string. |
13+
| **amount** | number | Yes | The amount of credits to transfer. |
14+
15+
**Example**:
16+
17+
```js
18+
const identity = await client.platform.identities.get('yourIdentityId');
19+
const recipientId = 'recipientIdentityId'; // The recipient's identity ID.
20+
const amount = 1000; // Amount of credits to transfer.
21+
22+
await client.platform.identities.creditTransfer(identity, recipientId, amount);
23+
```
24+
25+
**Note**:
26+
27+
- Ensure both the sender and recipient identities are registered on Dash Platform.
28+
- The amount must be less than the available balance of the identity initiating the transfer.
29+
- Transfers are irreversible once broadcasted.
30+
31+
Returns: A promise that resolves to `true` upon successful execution of the credit transfer.

docs/sdk-js/platform/identities/identities.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Each identity contains a credit balance. The ratio is 1 duff = 1000 credits.
1515
```{toctree}
1616
:maxdepth: 2
1717
18+
credit-transfer
1819
get
1920
register
2021
topup

0 commit comments

Comments
 (0)