@coinbase/cdp-sdk
Version:
SDK for interacting with the Coinbase Developer Platform Wallet API
42 lines • 1.76 kB
JavaScript
import { cdpApiClient } from "../../cdpApiClient.js";
/**
* List all accounts. The API will return all accounts that the API Key has Permissions to access. You can filter the results by using query parameters, which will be treated as a single conjunction (i.e. AND). Results are sorted by creation date in descending order (newest first).
* @summary List accounts
*/
export const listFoundationAccounts = (params, options) => {
return cdpApiClient({ url: `/v2/accounts`, method: "GET", params }, options);
};
/**
* Create an account for your Entity. Support for creating Customer-owned accounts is in development.
* @summary Create account
*/
export const createFoundationAccount = (createAccountRequest, options) => {
return cdpApiClient({
url: `/v2/accounts`,
method: "POST",
headers: { "Content-Type": "application/json" },
data: createAccountRequest,
}, options);
};
/**
* Get an account by its ID.
* @summary Get account
*/
export const getFoundationAccountById = (accountId, options) => {
return cdpApiClient({ url: `/v2/accounts/${accountId}`, method: "GET" }, options);
};
/**
* List the balances for an account. Results are sorted by native-fiat equivalent balance in descending order.
* @summary List balances for account
*/
export const listBalances = (accountId, params, options) => {
return cdpApiClient({ url: `/v2/accounts/${accountId}/balances`, method: "GET", params }, options);
};
/**
* Get the balance for an account by asset.
* @summary Get balance for account
*/
export const getBalanceByAsset = (accountId, asset, options) => {
return cdpApiClient({ url: `/v2/accounts/${accountId}/balances/${asset}`, method: "GET" }, options);
};
//# sourceMappingURL=accounts.js.map