@coinbase/cdp-sdk
Version:
SDK for interacting with the Coinbase Developer Platform Wallet API
50 lines • 2.35 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getBalanceByAsset = exports.listBalances = exports.getFoundationAccountById = exports.createFoundationAccount = exports.listFoundationAccounts = void 0;
const cdpApiClient_js_1 = require("../../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
*/
const listFoundationAccounts = (params, options) => {
return (0, cdpApiClient_js_1.cdpApiClient)({ url: `/v2/accounts`, method: "GET", params }, options);
};
exports.listFoundationAccounts = listFoundationAccounts;
/**
* Create an account for your Entity. Support for creating Customer-owned accounts is in development.
* @summary Create account
*/
const createFoundationAccount = (createAccountRequest, options) => {
return (0, cdpApiClient_js_1.cdpApiClient)({
url: `/v2/accounts`,
method: "POST",
headers: { "Content-Type": "application/json" },
data: createAccountRequest,
}, options);
};
exports.createFoundationAccount = createFoundationAccount;
/**
* Get an account by its ID.
* @summary Get account
*/
const getFoundationAccountById = (accountId, options) => {
return (0, cdpApiClient_js_1.cdpApiClient)({ url: `/v2/accounts/${accountId}`, method: "GET" }, options);
};
exports.getFoundationAccountById = getFoundationAccountById;
/**
* List the balances for an account. Results are sorted by native-fiat equivalent balance in descending order.
* @summary List balances for account
*/
const listBalances = (accountId, params, options) => {
return (0, cdpApiClient_js_1.cdpApiClient)({ url: `/v2/accounts/${accountId}/balances`, method: "GET", params }, options);
};
exports.listBalances = listBalances;
/**
* Get the balance for an account by asset.
* @summary Get balance for account
*/
const getBalanceByAsset = (accountId, asset, options) => {
return (0, cdpApiClient_js_1.cdpApiClient)({ url: `/v2/accounts/${accountId}/balances/${asset}`, method: "GET" }, options);
};
exports.getBalanceByAsset = getBalanceByAsset;
//# sourceMappingURL=accounts.js.map