Skip to content
This repository was archived by the owner on Sep 2, 2025. It is now read-only.

Latest commit

 

History

History
134 lines (87 loc) · 4.94 KB

File metadata and controls

134 lines (87 loc) · 4.94 KB

ledger.BalancesApi

All URIs are relative to http://localhost

Method HTTP request Description
getBalances GET /{ledger}/balances Get the balances from a ledger's account
getBalancesAggregated GET /{ledger}/aggregate/balances Get the aggregated balances from selected accounts

getBalances

BalancesCursorResponse getBalances()

Example

import { ledger } from '@numaryhq/ledger-nodejs';
import * as fs from 'fs';

const configuration = ledger.createConfiguration();
const apiInstance = new ledger.BalancesApi(configuration);

let body:ledger.BalancesApiGetBalancesRequest = {
  // string | Name of the ledger.
  ledger: "ledger001",
  // string | Filter balances involving given account, either as source or destination. (optional)
  address: "users:001",
  // string | Pagination cursor, will return accounts after given address, in descending order. (optional)
  after: "users:003",
  // string | Parameter used in pagination requests. Maximum page size is set to 15. Set to the value of next for the next page of results. Set to the value of previous for the previous page of results. No other parameters can be set when this parameter is set.  (optional)
  cursor: "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==",
  // string | Parameter used in pagination requests. Set to the value of next for the next page of results. Set to the value of previous for the previous page of results. Deprecated, please use `cursor` instead. (optional)
  paginationToken: "aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==",
};

apiInstance.getBalances(body).then((data:any) => {
  console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));

Parameters

Name Type Description Notes
ledger [string] Name of the ledger. defaults to undefined
address [string] Filter balances involving given account, either as source or destination. (optional) defaults to undefined
after [string] Pagination cursor, will return accounts after given address, in descending order. (optional) defaults to undefined
cursor [string] Parameter used in pagination requests. Maximum page size is set to 15. Set to the value of next for the next page of results. Set to the value of previous for the previous page of results. No other parameters can be set when this parameter is set. (optional) defaults to undefined
paginationToken [string] Parameter used in pagination requests. Set to the value of next for the next page of results. Set to the value of previous for the previous page of results. Deprecated, please use `cursor` instead. (optional) defaults to undefined

Return type

BalancesCursorResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json; charset=utf-8

HTTP response details

Status code Description Response headers
200 OK -
0 Error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getBalancesAggregated

AggregateBalancesResponse getBalancesAggregated()

Example

import { ledger } from '@numaryhq/ledger-nodejs';
import * as fs from 'fs';

const configuration = ledger.createConfiguration();
const apiInstance = new ledger.BalancesApi(configuration);

let body:ledger.BalancesApiGetBalancesAggregatedRequest = {
  // string | Name of the ledger.
  ledger: "ledger001",
  // string | Filter balances involving given account, either as source or destination. (optional)
  address: "users:001",
};

apiInstance.getBalancesAggregated(body).then((data:any) => {
  console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));

Parameters

Name Type Description Notes
ledger [string] Name of the ledger. defaults to undefined
address [string] Filter balances involving given account, either as source or destination. (optional) defaults to undefined

Return type

AggregateBalancesResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json; charset=utf-8

HTTP response details

Status code Description Response headers
200 OK -
0 Error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]