/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { accountsCountAccountsApiV2LedgersLedgerCanisterIdAccountsCountGet } from "../funcs/accountsCountAccountsApiV2LedgersLedgerCanisterIdAccountsCountGet.js"; import { accountsCountTransactionsApiV2LedgersLedgerCanisterIdAccountsIdTransactionsCountGet, } from "../funcs/accountsCountTransactionsApiV2LedgersLedgerCanisterIdAccountsIdTransactionsCountGet.js"; import { accountsGetAccountApiV1LedgersLedgerCanisterIdAccountsIdGet } from "../funcs/accountsGetAccountApiV1LedgersLedgerCanisterIdAccountsIdGet.js"; import { accountsListAccountsApiV1LedgersLedgerCanisterIdAccountsGet } from "../funcs/accountsListAccountsApiV1LedgersLedgerCanisterIdAccountsGet.js"; import { accountsListAccountsApiV2LedgersLedgerCanisterIdAccountsGet } from "../funcs/accountsListAccountsApiV2LedgersLedgerCanisterIdAccountsGet.js"; import { accountsListAccountTransactionsApiV1LedgersLedgerCanisterIdAccountsIdTransactionsGet, } from "../funcs/accountsListAccountTransactionsApiV1LedgersLedgerCanisterIdAccountsIdTransactionsGet.js"; import { accountsListAccountTransactionsApiV2LedgersLedgerCanisterIdAccountsIdTransactionsGet, } from "../funcs/accountsListAccountTransactionsApiV2LedgersLedgerCanisterIdAccountsIdTransactionsGet.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as models from "../models/index.js"; import * as operations from "../models/operations/index.js"; import { unwrapAsync } from "../types/fp.js"; export class Accounts extends ClientSDK { /** * List accounts * * @remarks * ### How is data retrieved for this endpoint? * * Values from the endpoint are created by the retrieved transactions from the * ledger canister. As transactions come in, the API updates the account information * and balances in the database. */ async listAccountsApiV1LedgersLedgerCanisterIdAccountsGet( request: operations.ListAccountsApiV1LedgersLedgerCanisterIdAccountsGetRequest, options?: RequestOptions, ): Promise { return unwrapAsync( accountsListAccountsApiV1LedgersLedgerCanisterIdAccountsGet( this, request, options, ), ); } /** * List transactions for an account * * @remarks * This endpoint returns an account's transactions, the total transactions for the account found, * and the max transaction index. The max transaction index is used to keep track of the * location in the dataset for pagination purposes. * * ### How is data retrieved for this endpoint? * * Values from the endpoint are created by scraping the transactions from the * ledger canister (and associated archive canisters). */ async listAccountTransactionsApiV1LedgersLedgerCanisterIdAccountsIdTransactionsGet( request: operations.ListAccountTransactionsApiV1LedgersLedgerCanisterIdAccountsIdTransactionsGetRequest, options?: RequestOptions, ): Promise { return unwrapAsync( accountsListAccountTransactionsApiV1LedgersLedgerCanisterIdAccountsIdTransactionsGet( this, request, options, ), ); } /** * Get owner's account * * @remarks * This endpoint returns a singular account that can be found for a given * ledger canister. * * ### How is data retrieved for this endpoint? * * Values from the endpoint are created by the retrieved transactions from the * ledger canister. As transactions come in, the API updates the account information * and balances in the database. */ async getAccountApiV1LedgersLedgerCanisterIdAccountsIdGet( request: operations.GetAccountApiV1LedgersLedgerCanisterIdAccountsIdGetRequest, options?: RequestOptions, ): Promise { return unwrapAsync( accountsGetAccountApiV1LedgersLedgerCanisterIdAccountsIdGet( this, request, options, ), ); } /** * Get the total number of accounts that meet the criteria */ async countAccountsApiV2LedgersLedgerCanisterIdAccountsCountGet( request: operations.CountAccountsApiV2LedgersLedgerCanisterIdAccountsCountGetRequest, options?: RequestOptions, ): Promise { return unwrapAsync( accountsCountAccountsApiV2LedgersLedgerCanisterIdAccountsCountGet( this, request, options, ), ); } /** * List accounts * * @remarks * ### How is data retrieved for this endpoint? * * Values from the endpoint are created by the retrieved transactions from the * ledger canister. As transactions come in, the API updates the account information * and balances in the database. */ async listAccountsApiV2LedgersLedgerCanisterIdAccountsGet( request: operations.ListAccountsApiV2LedgersLedgerCanisterIdAccountsGetRequest, options?: RequestOptions, ): Promise { return unwrapAsync( accountsListAccountsApiV2LedgersLedgerCanisterIdAccountsGet( this, request, options, ), ); } /** * List transactions for an account * * @remarks * This endpoint is similar to the v2 transactions list endpoint. * This endpoint returns a list of all transactions that have a `from_account`, * `to_account`, or `from_ledger` matching the given account. * It also returns a "next_cursor" and "previous_cursor" if there are more pages * of results * * ### How is data retrieved for this endpoint? * * Values from the endpoint are created by scraping the transactions from the * ledger canister (and associated archive canisters). */ async listAccountTransactionsApiV2LedgersLedgerCanisterIdAccountsIdTransactionsGet( request: operations.ListAccountTransactionsApiV2LedgersLedgerCanisterIdAccountsIdTransactionsGetRequest, options?: RequestOptions, ): Promise { return unwrapAsync( accountsListAccountTransactionsApiV2LedgersLedgerCanisterIdAccountsIdTransactionsGet( this, request, options, ), ); } /** * Get the total count of transactions matching the given criteria * * @remarks * This endpoint returns the total count of transactions matching the given criteria. */ async countTransactionsApiV2LedgersLedgerCanisterIdAccountsIdTransactionsCountGet( request: operations.CountTransactionsApiV2LedgersLedgerCanisterIdAccountsIdTransactionsCountGetRequest, options?: RequestOptions, ): Promise { return unwrapAsync( accountsCountTransactionsApiV2LedgersLedgerCanisterIdAccountsIdTransactionsCountGet( this, request, options, ), ); } }