Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
117 changes: 116 additions & 1 deletion sdk.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"info": {
"version": "2.14.0",
"title": "All Circle APIs",
"description": "Circle's General, Core Functionality, Payments, Payouts, Accounts, and Crypto Payments APIs bundled into one OpenAPI Specification."
"description": "Circle's General, Core Functionality, Payments, Payouts, Accounts, Crypto Payments, and Exchange APIs bundled into one OpenAPI Specification."
},
"tags": [
{
Expand Down Expand Up @@ -114,6 +114,10 @@
{
"name": "Checkout Sessions",
"description": "Create, get, extend a checkout session."
},
{
"name": "Exchange",
"description": "Exchange between two currencies."
}
],
"paths": {
Expand Down Expand Up @@ -6998,6 +7002,46 @@
}
}
}
},
"/v1/exchange/cps/quotes": {
"post": {
"security": [
{
"bearerAuth": []
}
],
"summary": "Create CPS Quote",
"description": "Create a quote for exchanging between two stablecoins.",
"operationId": "createCpsQuote",
"tags": ["Exchange"],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CreateCpsQuoteRequest"
}
}
}
},
"responses": {
"200": {
"description": "Successfully created CPS quote.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CreateCpsQuoteResponse"
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/NotAuthorized"
}
}
}
}
},
"components": {
Expand All @@ -7018,6 +7062,77 @@
}
}
},
"CreateCpsQuoteRequest": {
"type": "object",
"required": ["from", "to"],
"properties": {
"from": {
"$ref": "#/components/schemas/CpsOptionalAmountMoney"
},
"to": {
"$ref": "#/components/schemas/CpsOptionalAmountMoney"
}
}
},
"CpsOptionalAmountMoney": {
"type": "object",
"required": ["currency"],
"properties": {
"amount": {
"type": "number",
"nullable": true,
"description": "Source amount (optional)",
"example": 100.0
},
"currency": {
"$ref": "#/components/schemas/CpsToken"
}
}
},
"CpsToken": {
"type": "string",
"description": "Supported stablecoin tokens for CPS",
"enum": ["USDC", "EURC"],
"example": "USDC"
},
"CreateCpsQuoteResponse": {
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/CpsQuote"
}
}
},
"CpsQuote": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Unique identifier for the CPS quote",
"example": "825a494f-83a7-4e1f-bb6c-e01f0766f420"
},
"rate": {
"type": "string",
"description": "Exchange rate",
"example": "0.9132"
},
"from": {
"$ref": "#/components/schemas/CpsOptionalAmountMoney"
},
"to": {
"$ref": "#/components/schemas/CpsOptionalAmountMoney"
},
"fee": {
"$ref": "#/components/schemas/CpsOptionalAmountMoney"
},
"expiry": {
"type": "string",
"format": "date-time",
"description": "Quote expiration time in ISO-8601 format",
"example": "2025-09-10T17:48:12.237Z"
}
}
},
"MerchantWalletId": {
"type": "string",
"description": "Unique system generated identifier for the wallet of the merchant.",
Expand Down
6 changes: 6 additions & 0 deletions src/generated/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ apis/crypto-payment-intents-api.ts
apis/cubixapi.ts
apis/deposits-api.ts
apis/encryption-api.ts
apis/exchange-api.ts
apis/health-api.ts
apis/management-api.ts
apis/payment-tokens-api.ts
Expand Down Expand Up @@ -82,6 +83,9 @@ models/checkout-session.ts
models/conflict.ts
models/continuous-payment-intent-creation-request.ts
models/continuous-payment-intent.ts
models/cps-optional-amount-money.ts
models/cps-quote.ts
models/cps-token.ts
models/create-address-book-recipient-response.ts
models/create-business-cbit-account-response.ts
models/create-business-cubix-account-response.ts
Expand All @@ -93,6 +97,8 @@ models/create-business-transfer-response.ts
models/create-business-wire-account-response.ts
models/create-card-response.ts
models/create-checkout-session-response.ts
models/create-cps-quote-request.ts
models/create-cps-quote-response.ts
models/create-crypto-payment-response.ts
models/create-crypto-payment-response1.ts
models/create-crypto-refund-response.ts
Expand Down
1 change: 1 addition & 0 deletions src/generated/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export * from "./apis/crypto-exchange-rates-api";
export * from "./apis/crypto-payment-intents-api";
export * from "./apis/deposits-api";
export * from "./apis/encryption-api";
export * from "./apis/exchange-api";
export * from "./apis/health-api";
export * from "./apis/management-api";
export * from "./apis/pixapi";
Expand Down
194 changes: 194 additions & 0 deletions src/generated/apis/exchange-api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
/* tslint:disable */
/* eslint-disable */
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/

import globalAxios, {
AxiosPromise,
AxiosInstance,
AxiosRequestConfig
} from "axios";
import { Configuration } from "../configuration";
// Some imports not used depending on template conditions
// @ts-ignore
import {
DUMMY_BASE_URL,
assertParamExists,
setBearerAuthToObject,
setSearchParams,
serializeDataIfNeeded,
toPathString,
createRequestFunction
} from "../common";
// @ts-ignore
import {
BASE_PATH,
COLLECTION_FORMATS,
RequestArgs,
BaseAPI,
RequiredError
} from "../base";
// @ts-ignore
import { BadRequest } from "../models";
// @ts-ignore
import { CreateCpsQuoteRequest } from "../models";
// @ts-ignore
import { CreateCpsQuoteResponse } from "../models";
// @ts-ignore
import { NotAuthorized } from "../models";
/**
* ExchangeApi - axios parameter creator
* @export
*/
export const ExchangeApiAxiosParamCreator = function (
configuration?: Configuration
) {
return {
/**
* Create a quote for exchanging between two stablecoins.
* @summary Create CPS Quote
* @param {CreateCpsQuoteRequest} [createCpsQuoteRequest]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createCpsQuote: async (
createCpsQuoteRequest?: CreateCpsQuoteRequest,
options: AxiosRequestConfig = {}
): Promise<RequestArgs> => {
const localVarPath = `/v1/exchange/cps/quotes`;
// 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
};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;

// authentication bearerAuth required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration);

localVarHeaderParameter["Content-Type"] = "application/json";

setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions =
baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {
...localVarHeaderParameter,
...headersFromBaseOptions,
...options.headers
};
localVarRequestOptions.data = serializeDataIfNeeded(
createCpsQuoteRequest,
localVarRequestOptions,
configuration
);

return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions
};
}
};
};

/**
* ExchangeApi - functional programming interface
* @export
*/
export const ExchangeApiFp = function (configuration?: Configuration) {
const localVarAxiosParamCreator = ExchangeApiAxiosParamCreator(configuration);
return {
/**
* Create a quote for exchanging between two stablecoins.
* @summary Create CPS Quote
* @param {CreateCpsQuoteRequest} [createCpsQuoteRequest]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async createCpsQuote(
createCpsQuoteRequest?: CreateCpsQuoteRequest,
options?: AxiosRequestConfig
): Promise<
(
axios?: AxiosInstance,
basePath?: string
) => AxiosPromise<CreateCpsQuoteResponse>
> {
const localVarAxiosArgs = await localVarAxiosParamCreator.createCpsQuote(
createCpsQuoteRequest,
options
);
return createRequestFunction(
localVarAxiosArgs,
globalAxios,
BASE_PATH,
configuration
);
}
};
};

/**
* ExchangeApi - factory interface
* @export
*/
export const ExchangeApiFactory = function (
configuration?: Configuration,
basePath?: string,
axios?: AxiosInstance
) {
const localVarFp = ExchangeApiFp(configuration);
return {
/**
* Create a quote for exchanging between two stablecoins.
* @summary Create CPS Quote
* @param {CreateCpsQuoteRequest} [createCpsQuoteRequest]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createCpsQuote(
createCpsQuoteRequest?: CreateCpsQuoteRequest,
options?: any
): AxiosPromise<CreateCpsQuoteResponse> {
return localVarFp
.createCpsQuote(createCpsQuoteRequest, options)
.then((request) => request(axios, basePath));
}
};
};

/**
* ExchangeApi - object-oriented interface
* @export
* @class ExchangeApi
* @extends {BaseAPI}
*/
export class ExchangeApi extends BaseAPI {
/**
* Create a quote for exchanging between two stablecoins.
* @summary Create CPS Quote
* @param {CreateCpsQuoteRequest} [createCpsQuoteRequest]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ExchangeApi
*/
public createCpsQuote(
createCpsQuoteRequest?: CreateCpsQuoteRequest,
options?: AxiosRequestConfig
) {
return ExchangeApiFp(this.configuration)
.createCpsQuote(createCpsQuoteRequest, options)
.then((request) => request(this.axios, this.basePath));
}
}
3 changes: 3 additions & 0 deletions src/generated/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
CryptoPaymentIntentsApi,
DepositsApi,
EncryptionApi,
ExchangeApi,
HealthApi,
ManagementApi,
PIXApi,
Expand Down Expand Up @@ -51,6 +52,7 @@ export class Circle {
public cryptoPaymentIntents: CryptoPaymentIntentsApi;
public deposits: DepositsApi;
public encryption: EncryptionApi;
public exchange: ExchangeApi;
public health: HealthApi;
public management: ManagementApi;
public pix: PIXApi;
Expand Down Expand Up @@ -79,6 +81,7 @@ export class Circle {
this.cryptoPaymentIntents = new CryptoPaymentIntentsApi(configuration);
this.deposits = new DepositsApi(configuration);
this.encryption = new EncryptionApi(configuration);
this.exchange = new ExchangeApi(configuration);
this.health = new HealthApi(configuration);
this.management = new ManagementApi(configuration);
this.pix = new PIXApi(configuration);
Expand Down
Loading
Loading