UNPKG

@coinbase/cdp-sdk

Version:

SDK for interacting with the Coinbase Developer Platform Wallet API

36 lines (35 loc) • 2.08 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getDisbursement = exports.listDisbursements = exports.createDisbursement = void 0; const cdpApiClient_js_1 = require("../../cdpApiClient.js"); /** * Creates a merchant-initiated payment of funds from a CDP account owned by the merchant to a Coinbase user account or onchain address. Used for standalone refunds, goodwill disbursements, rebates, and other merchant-driven payouts that are not tied to a specific payment session. This is an asynchronous operation. The disbursement is returned in `pending` status and transitions to `succeeded` (with associated `onchainTransactions`) or `failed` (with `error`). * @summary Create a disbursement */ const createDisbursement = (createDisbursementRequest, options) => { return (0, cdpApiClient_js_1.cdpApiClient)({ url: `/v2/disbursements`, method: "POST", headers: { "Content-Type": "application/json" }, data: createDisbursementRequest, }, options); }; exports.createDisbursement = createDisbursement; /** * Returns a paginated list of disbursements created by the merchant. Each disbursement includes its source, target, status, amount, and timestamps. Only disbursements accessible by the current API key are returned. * @summary List disbursements */ const listDisbursements = (params, options) => { return (0, cdpApiClient_js_1.cdpApiClient)({ url: `/v2/disbursements`, method: "GET", params }, options); }; exports.listDisbursements = listDisbursements; /** * Retrieves a single disbursement by its ID, including source, target, status, amount, associated onchain transactions, error details (if failed), and timestamps. Only returns the disbursement if the API key has permission to access it. * @summary Get a disbursement */ const getDisbursement = (disbursementId, options) => { return (0, cdpApiClient_js_1.cdpApiClient)({ url: `/v2/disbursements/${disbursementId}`, method: "GET" }, options); }; exports.getDisbursement = getDisbursement; //# sourceMappingURL=disbursements.js.map