Skip to content

Commit

Permalink
Updated the documentation for getBalances.
Browse files Browse the repository at this point in the history
  • Loading branch information
aikchun committed Jun 11, 2021
1 parent ce8d998 commit dd5b8fd
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/jellyfish-api-core/src/category/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ export class Wallet {

/**
* Returns an object with all balances
*
* @param {boolean} withTokens = false, Include tokens balances; Default is 'false' for backward compatibility.
* @return {Promise<WalletBalance>}
*/
async getBalances (withTokens = false): Promise<WalletBalance> {
return await this.client.call('getbalances', [withTokens], 'bignumber')
Expand Down
28 changes: 28 additions & 0 deletions website/docs/jellyfish/api/wallet.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,34 @@ interface wallet {
}
```

## getBalances

Returns an object with all balances.

```ts title="client.wallet.getBalances()"
interface wallet {
getBalances(withTokens = false): Promise<WalletBalance>
}

interface WalletBalance {
mine: WalletMineBalance
watchonly?: WalletWatchOnlyBalance
}

interface WalletMineBalance {
trusted: BigNumber
untrusted_pending: BigNumber
immature: BigNumber
used?: BigNumber
}

interface WalletWatchOnlyBalance {
trusted: BigNumber
untrusted_pending: BigNumber
immature: BigNumber
}
```

## listUnspent

Get list of UTXOs in wallet.
Expand Down

0 comments on commit dd5b8fd

Please sign in to comment.