/* tslint:disable */ /* eslint-disable */ /** * Fireblocks API * Fireblocks provides a suite of applications to manage digital asset operations and a complete development platform to build your business on the blockchain. - Visit our website for more information: [Fireblocks Website](https://fireblocks.com) - Visit our developer docs: [Fireblocks DevPortal](https://developers.fireblocks.com) * * The version of the OpenAPI document: 1.6.2 * Contact: developers@fireblocks.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import type { Configuration } from '../configuration'; import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; import { convertToFireblocksResponse } from "../response/fireblocksResponse"; // URLSearchParams not necessarily used // @ts-ignore import { URL, URLSearchParams } from 'url'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; import { assertParamExistsAndNotEmpty } from '../utils/validation_utils'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore import { CreatePayoutRequest } from '../models'; // @ts-ignore import { DispatchPayoutResponse } from '../models'; // @ts-ignore import { ErrorResponse } from '../models'; // @ts-ignore import { PayoutResponse } from '../models'; /** * PaymentsPayoutApi - axios parameter creator * @export */ export const PaymentsPayoutApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * **Note:** The reference content in this section documents the Payments Engine endpoint. The Payments Engine endpoints include APIs available only for customers with Payments Engine enabled on their accounts. These endpoints are currently in beta and might be subject to changes. If you want to learn more about Fireblocks Payments Engine, please contact your Fireblocks Customer Success Manager or email CSM@fireblocks.com. **Create a payout instruction set.** A payout instruction set is a set of instructions for distributing payments from a single payment account to a list of payee accounts. The instruction set defines: - the payment account and its account type (vault, exchange, or fiat). - the account type (vault account, exchange account, whitelisted address, network connection, fiat account, or merchant account), the amount, and the asset of payment for each payee account. Learn more about Fireblocks Payments - Payouts in the following [guide](https://developers.fireblocks.com/docs/create-payouts). Endpoint Permission: Admin, Non-Signing Admin. * @summary Create a payout instruction set * @param {CreatePayoutRequest} [createPayoutRequest] * @param {string} [idempotencyKey] A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. * @param {*} [options] Override http request option. * @deprecated * @throws {RequiredError} */ createPayout: async (createPayoutRequest?: CreatePayoutRequest, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/payments/payout`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; // Stamped onto the request config (not the headers, so it never goes on // the wire) so the response interceptor can name the operation in the // lifecycle warning. Key must match OPERATION_ID_CONFIG_KEY in utils/lifecycleWarning. (localVarRequestOptions as any).fireblocksOperationId = 'createPayout'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (idempotencyKey != null) { localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey); } localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(createPayoutRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * **Note:** The reference content in this section documents the Payments Engine endpoint. The Payments Engine endpoints include APIs available only for customers with Payments Engine enabled on their accounts. These endpoints are currently in beta and might be subject to changes. If you want to learn more about Fireblocks Payments Engine, please contact your Fireblocks Customer Success Manager or email CSM@fireblocks.com. **Execute a payout instruction set.** The instruction set will be verified and executed. **Source locking** If you are executing a payout instruction set from a payment account with an already active payout the active payout will complete before the new payout instruction set can be executed. You cannot execute the same payout instruction set more than once. * @summary Execute a payout instruction set * @param {string} payoutId the payout id received from the creation of the payout instruction set * @param {string} [idempotencyKey] A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. * @param {*} [options] Override http request option. * @deprecated * @throws {RequiredError} */ executePayoutAction: async (payoutId: string, idempotencyKey?: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('executePayoutAction', 'payoutId', payoutId) const localVarPath = `/payments/payout/{payoutId}/actions/execute` .replace(`{${"payoutId"}}`, encodeURIComponent(String(payoutId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; // Stamped onto the request config (not the headers, so it never goes on // the wire) so the response interceptor can name the operation in the // lifecycle warning. Key must match OPERATION_ID_CONFIG_KEY in utils/lifecycleWarning. (localVarRequestOptions as any).fireblocksOperationId = 'executePayoutAction'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (idempotencyKey != null) { localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey); } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * **Note:** The reference content in this section documents the Payments Engine endpoint. The Payments Engine endpoints include APIs available only for customers with Payments Engine enabled on their accounts. These endpoints are currently in beta and might be subject to changes. If you want to learn more about Fireblocks Payments Engine, please contact your Fireblocks Customer Success Manager or email CSM@fireblocks.com. Endpoint Permission: Admin, Non-Signing Admin. * @summary Get the status of a payout instruction set * @param {string} payoutId the payout id received from the creation of the payout instruction set * @param {*} [options] Override http request option. * @deprecated * @throws {RequiredError} */ getPayout: async (payoutId: string, options: RawAxiosRequestConfig = {}): Promise => { assertParamExistsAndNotEmpty('getPayout', 'payoutId', payoutId) const localVarPath = `/payments/payout/{payoutId}` .replace(`{${"payoutId"}}`, encodeURIComponent(String(payoutId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; // Stamped onto the request config (not the headers, so it never goes on // the wire) so the response interceptor can name the operation in the // lifecycle warning. Key must match OPERATION_ID_CONFIG_KEY in utils/lifecycleWarning. (localVarRequestOptions as any).fireblocksOperationId = 'getPayout'; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * PaymentsPayoutApi - functional programming interface * @export */ export const PaymentsPayoutApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = PaymentsPayoutApiAxiosParamCreator(configuration) return { /** * **Note:** The reference content in this section documents the Payments Engine endpoint. The Payments Engine endpoints include APIs available only for customers with Payments Engine enabled on their accounts. These endpoints are currently in beta and might be subject to changes. If you want to learn more about Fireblocks Payments Engine, please contact your Fireblocks Customer Success Manager or email CSM@fireblocks.com. **Create a payout instruction set.** A payout instruction set is a set of instructions for distributing payments from a single payment account to a list of payee accounts. The instruction set defines: - the payment account and its account type (vault, exchange, or fiat). - the account type (vault account, exchange account, whitelisted address, network connection, fiat account, or merchant account), the amount, and the asset of payment for each payee account. Learn more about Fireblocks Payments - Payouts in the following [guide](https://developers.fireblocks.com/docs/create-payouts). Endpoint Permission: Admin, Non-Signing Admin. * @summary Create a payout instruction set * @param {CreatePayoutRequest} [createPayoutRequest] * @param {string} [idempotencyKey] A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. * @param {*} [options] Override http request option. * @deprecated * @throws {RequiredError} */ async createPayout(createPayoutRequest?: CreatePayoutRequest, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.createPayout(createPayoutRequest, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['PaymentsPayoutApi.createPayout']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * **Note:** The reference content in this section documents the Payments Engine endpoint. The Payments Engine endpoints include APIs available only for customers with Payments Engine enabled on their accounts. These endpoints are currently in beta and might be subject to changes. If you want to learn more about Fireblocks Payments Engine, please contact your Fireblocks Customer Success Manager or email CSM@fireblocks.com. **Execute a payout instruction set.** The instruction set will be verified and executed. **Source locking** If you are executing a payout instruction set from a payment account with an already active payout the active payout will complete before the new payout instruction set can be executed. You cannot execute the same payout instruction set more than once. * @summary Execute a payout instruction set * @param {string} payoutId the payout id received from the creation of the payout instruction set * @param {string} [idempotencyKey] A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. * @param {*} [options] Override http request option. * @deprecated * @throws {RequiredError} */ async executePayoutAction(payoutId: string, idempotencyKey?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.executePayoutAction(payoutId, idempotencyKey, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['PaymentsPayoutApi.executePayoutAction']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, /** * **Note:** The reference content in this section documents the Payments Engine endpoint. The Payments Engine endpoints include APIs available only for customers with Payments Engine enabled on their accounts. These endpoints are currently in beta and might be subject to changes. If you want to learn more about Fireblocks Payments Engine, please contact your Fireblocks Customer Success Manager or email CSM@fireblocks.com. Endpoint Permission: Admin, Non-Signing Admin. * @summary Get the status of a payout instruction set * @param {string} payoutId the payout id received from the creation of the payout instruction set * @param {*} [options] Override http request option. * @deprecated * @throws {RequiredError} */ async getPayout(payoutId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getPayout(payoutId, options); const index = configuration?.serverIndex ?? 0; const operationBasePath = operationServerMap['PaymentsPayoutApi.getPayout']?.[index]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath); }, } }; /** * PaymentsPayoutApi - factory interface * @export */ export const PaymentsPayoutApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = PaymentsPayoutApiFp(configuration) return { /** * **Note:** The reference content in this section documents the Payments Engine endpoint. The Payments Engine endpoints include APIs available only for customers with Payments Engine enabled on their accounts. These endpoints are currently in beta and might be subject to changes. If you want to learn more about Fireblocks Payments Engine, please contact your Fireblocks Customer Success Manager or email CSM@fireblocks.com. **Create a payout instruction set.** A payout instruction set is a set of instructions for distributing payments from a single payment account to a list of payee accounts. The instruction set defines: - the payment account and its account type (vault, exchange, or fiat). - the account type (vault account, exchange account, whitelisted address, network connection, fiat account, or merchant account), the amount, and the asset of payment for each payee account. Learn more about Fireblocks Payments - Payouts in the following [guide](https://developers.fireblocks.com/docs/create-payouts). Endpoint Permission: Admin, Non-Signing Admin. * @summary Create a payout instruction set * @param {PaymentsPayoutApiCreatePayoutRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @deprecated * @throws {RequiredError} */ createPayout(requestParameters: PaymentsPayoutApiCreatePayoutRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.createPayout(requestParameters.createPayoutRequest, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, /** * **Note:** The reference content in this section documents the Payments Engine endpoint. The Payments Engine endpoints include APIs available only for customers with Payments Engine enabled on their accounts. These endpoints are currently in beta and might be subject to changes. If you want to learn more about Fireblocks Payments Engine, please contact your Fireblocks Customer Success Manager or email CSM@fireblocks.com. **Execute a payout instruction set.** The instruction set will be verified and executed. **Source locking** If you are executing a payout instruction set from a payment account with an already active payout the active payout will complete before the new payout instruction set can be executed. You cannot execute the same payout instruction set more than once. * @summary Execute a payout instruction set * @param {PaymentsPayoutApiExecutePayoutActionRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @deprecated * @throws {RequiredError} */ executePayoutAction(requestParameters: PaymentsPayoutApiExecutePayoutActionRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.executePayoutAction(requestParameters.payoutId, requestParameters.idempotencyKey, options).then((request) => request(axios, basePath)); }, /** * **Note:** The reference content in this section documents the Payments Engine endpoint. The Payments Engine endpoints include APIs available only for customers with Payments Engine enabled on their accounts. These endpoints are currently in beta and might be subject to changes. If you want to learn more about Fireblocks Payments Engine, please contact your Fireblocks Customer Success Manager or email CSM@fireblocks.com. Endpoint Permission: Admin, Non-Signing Admin. * @summary Get the status of a payout instruction set * @param {PaymentsPayoutApiGetPayoutRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @deprecated * @throws {RequiredError} */ getPayout(requestParameters: PaymentsPayoutApiGetPayoutRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getPayout(requestParameters.payoutId, options).then((request) => request(axios, basePath)); }, }; }; /** * Request parameters for createPayout operation in PaymentsPayoutApi. * @export * @interface PaymentsPayoutApiCreatePayoutRequest */ export interface PaymentsPayoutApiCreatePayoutRequest { /** * * @type {CreatePayoutRequest} * @memberof PaymentsPayoutApiCreatePayout */ readonly createPayoutRequest?: CreatePayoutRequest /** * A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. * @type {string} * @memberof PaymentsPayoutApiCreatePayout */ readonly idempotencyKey?: string } /** * Request parameters for executePayoutAction operation in PaymentsPayoutApi. * @export * @interface PaymentsPayoutApiExecutePayoutActionRequest */ export interface PaymentsPayoutApiExecutePayoutActionRequest { /** * the payout id received from the creation of the payout instruction set * @type {string} * @memberof PaymentsPayoutApiExecutePayoutAction */ readonly payoutId: string /** * A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. * @type {string} * @memberof PaymentsPayoutApiExecutePayoutAction */ readonly idempotencyKey?: string } /** * Request parameters for getPayout operation in PaymentsPayoutApi. * @export * @interface PaymentsPayoutApiGetPayoutRequest */ export interface PaymentsPayoutApiGetPayoutRequest { /** * the payout id received from the creation of the payout instruction set * @type {string} * @memberof PaymentsPayoutApiGetPayout */ readonly payoutId: string } /** * PaymentsPayoutApi - object-oriented interface * @export * @class PaymentsPayoutApi * @extends {BaseAPI} */ export class PaymentsPayoutApi extends BaseAPI { /** * **Note:** The reference content in this section documents the Payments Engine endpoint. The Payments Engine endpoints include APIs available only for customers with Payments Engine enabled on their accounts. These endpoints are currently in beta and might be subject to changes. If you want to learn more about Fireblocks Payments Engine, please contact your Fireblocks Customer Success Manager or email CSM@fireblocks.com. **Create a payout instruction set.** A payout instruction set is a set of instructions for distributing payments from a single payment account to a list of payee accounts. The instruction set defines: - the payment account and its account type (vault, exchange, or fiat). - the account type (vault account, exchange account, whitelisted address, network connection, fiat account, or merchant account), the amount, and the asset of payment for each payee account. Learn more about Fireblocks Payments - Payouts in the following [guide](https://developers.fireblocks.com/docs/create-payouts). Endpoint Permission: Admin, Non-Signing Admin. * @summary Create a payout instruction set * @param {PaymentsPayoutApiCreatePayoutRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @deprecated * @throws {RequiredError} * @memberof PaymentsPayoutApi */ public createPayout(requestParameters: PaymentsPayoutApiCreatePayoutRequest = {}) { return PaymentsPayoutApiFp(this.configuration).createPayout(requestParameters.createPayoutRequest, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * **Note:** The reference content in this section documents the Payments Engine endpoint. The Payments Engine endpoints include APIs available only for customers with Payments Engine enabled on their accounts. These endpoints are currently in beta and might be subject to changes. If you want to learn more about Fireblocks Payments Engine, please contact your Fireblocks Customer Success Manager or email CSM@fireblocks.com. **Execute a payout instruction set.** The instruction set will be verified and executed. **Source locking** If you are executing a payout instruction set from a payment account with an already active payout the active payout will complete before the new payout instruction set can be executed. You cannot execute the same payout instruction set more than once. * @summary Execute a payout instruction set * @param {PaymentsPayoutApiExecutePayoutActionRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @deprecated * @throws {RequiredError} * @memberof PaymentsPayoutApi */ public executePayoutAction(requestParameters: PaymentsPayoutApiExecutePayoutActionRequest) { return PaymentsPayoutApiFp(this.configuration).executePayoutAction(requestParameters.payoutId, requestParameters.idempotencyKey).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } /** * **Note:** The reference content in this section documents the Payments Engine endpoint. The Payments Engine endpoints include APIs available only for customers with Payments Engine enabled on their accounts. These endpoints are currently in beta and might be subject to changes. If you want to learn more about Fireblocks Payments Engine, please contact your Fireblocks Customer Success Manager or email CSM@fireblocks.com. Endpoint Permission: Admin, Non-Signing Admin. * @summary Get the status of a payout instruction set * @param {PaymentsPayoutApiGetPayoutRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @deprecated * @throws {RequiredError} * @memberof PaymentsPayoutApi */ public getPayout(requestParameters: PaymentsPayoutApiGetPayoutRequest) { return PaymentsPayoutApiFp(this.configuration).getPayout(requestParameters.payoutId).then((request) => request(this.axios, this.basePath)).then(convertToFireblocksResponse); } }