Variable swapQuoteApiConst
swapQuoteApi: {
"/v1/swap/estimate": {
get: {
description: "Get an estimate for a Swap on the CFX network.\n\nAn estimate will calculate the source amount, the total fees extracted and the target amount to swap between cryptocurrency assets.\n\nNote this endpoint is purely for the estimation of swap amounts and fees.\nThe actual swap is actioned via other swap endpoints which facilitate the creation of a binding swap quote and capturing explicit acceptance.";
querystring: TObject<
{
country: TString;
entityType: TUnsafe<"ORGANIZATION" | "IDENTITY">;
sourceAmount: TNumber;
sourceCurrency: TUnion<
[
TUnsafe<"MOVEUSD" | "USDC" | "SOL" | "WETH" | "WBTC">,
TLiteral<"REWARD">,
],
>;
targetCurrency: TUnion<
[
TUnsafe<"MOVEUSD" | "USDC" | "SOL" | "WETH" | "WBTC">,
TLiteral<"REWARD">,
],
>;
},
>;
response: {
"200": TIntersect<
[
TObject<
{
fees: TArray<TObject<{ fee: ...; type: ... }>>;
sourceAmount: TNumber;
sourceAmountAfterFees: TNumber;
sourceCurrency: TUnion<[TUnsafe<(...)>, TLiteral<(...)>]>;
targetAmount: TNumber;
targetAmountAfterFees: TNumber;
targetCurrency: TUnion<[TUnsafe<(...)>, TLiteral<(...)>]>;
},
>,
TObject<{ rawQuote: TOptional<TUnknown> }>,
],
>;
"400": TObject<
{
code: TString;
details: TOptional<TRecord<"^.*$", TAny>>;
message: TString;
},
>;
};
summary: "Get Swap Estimate";
};
};
"/v1/swap/quote": {
post: {
body: TUnion<
[
TIntersect<
[
TObject<{ identityId: TString }>,
TObject<
{
sourceAmount: TNumber;
sourceCurrency: TUnion<[(...), (...), (...), (...)]>;
targetCurrency: TUnion<[(...), (...), (...), (...)]>;
wallet: TUnion<[(...), (...)]>;
},
>,
],
>,
TIntersect<
[
TObject<{ organizationId: TString }>,
TObject<
{
sourceAmount: TNumber;
sourceCurrency: TUnion<[(...), (...), (...), (...)]>;
targetCurrency: TUnion<[(...), (...), (...), (...)]>;
wallet: TUnion<[(...), (...)]>;
},
>,
],
>,
],
>;
description: "Generate a quote for Swap on the CFX network.\n\nThe Get Estimate endpoint provides a non-binding estimate for a swap transaction.\n\nThis Create Quote generates a binding quote, which includes an unsigned Solana transaction facilitating the swapping of assets from the nominated user wallet.";
response: {
"200": TUnion<
[
TIntersect<
[
TObject<{ identityId: TString }>,
TIntersect<[TObject<(...)>, TObject<(...)>, TObject<(...)>]>,
],
>,
TIntersect<
[
TObject<{ organizationId: TString }>,
TIntersect<[TObject<(...)>, TObject<(...)>, TObject<(...)>]>,
],
>,
],
>;
"400": TObject<
{
code: TString;
details: TOptional<TRecord<"^.*$", TAny>>;
message: TString;
},
>;
};
summary: "Create Quote";
};
};
"/v1/swap/quote/{id}": {
get: {
description: "Retrieves a specific swap quote.";
params: TObject<{ id: TString }>;
querystring: TObject<{ identityId: TString }>;
response: {
"200": TUnion<
[
TIntersect<
[
TObject<{ identityId: TString }>,
TIntersect<[TObject<(...)>, TObject<(...)>, TObject<(...)>]>,
],
>,
TIntersect<
[
TObject<{ organizationId: TString }>,
TIntersect<[TObject<(...)>, TObject<(...)>, TObject<(...)>]>,
],
>,
],
>;
"400": TObject<
{
code: TString;
details: TOptional<TRecord<"^.*$", TAny>>;
message: TString;
},
>;
"404": TObject<
{
code: TLiteral<"notFound">;
details: TOptional<TRecord<"^.*$", TAny>>;
message: TString;
},
>;
};
summary: "Get Swap Quote";
tags: readonly ["Quote"];
};
};
"/v1/swap/quote/{id}/accept": {
post: {
body: TIntersect<
[
TUnion<
[
TIntersect<[TObject<{ identityId: ... }>, TObject<{}>]>,
TIntersect<[TObject<{ organizationId: ... }>, TObject<{}>]>,
],
>,
TObject<{ signedTransaction: TOptional<TString> }>,
],
>;
description: "Accepts a swap quote for execution.\n\nThis endpoint confirms acceptance of a quote previously generated by the Create Quote endpoint.";
params: TObject<{ id: TString }>;
response: {
"200": TUnion<
[
TIntersect<
[
TObject<{ identityId: TString }>,
TIntersect<[TObject<(...)>, TObject<(...)>]>,
],
>,
TIntersect<
[
TObject<{ organizationId: TString }>,
TIntersect<[TObject<(...)>, TObject<(...)>]>,
],
>,
],
>;
"400": TObject<
{
code: TString;
details: TOptional<TRecord<"^.*$", TAny>>;
message: TString;
},
>;
"404": TObject<
{
code: TLiteral<"notFound">;
details: TOptional<TRecord<"^.*$", TAny>>;
message: TString;
},
>;
};
summary: "Accept Quote";
tags: readonly ["Quote"];
};
};
"/v1/swap/quote/{id}/reject": {
post: {
body: TUnion<
[
TIntersect<[TObject<{ identityId: TString }>, TObject<{}>]>,
TIntersect<[TObject<{ organizationId: TString }>, TObject<{}>]>,
],
>;
description: "Rejects a swap quote.";
params: TObject<{ id: TString }>;
response: {
"200": TObject<{ id: TString }>;
"400": TObject<
{
code: TString;
details: TOptional<TRecord<"^.*$", TAny>>;
message: TString;
},
>;
"404": TObject<
{
code: TLiteral<"notFound">;
details: TOptional<TRecord<"^.*$", TAny>>;
message: TString;
},
>;
};
summary: "Reject Quote";
tags: readonly ["Quote"];
};
};
} = ...
Type Declaration
Readonly/v1/swap/estimate: {
get: {
description: "Get an estimate for a Swap on the CFX network.\n\nAn estimate will calculate the source amount, the total fees extracted and the target amount to swap between cryptocurrency assets.\n\nNote this endpoint is purely for the estimation of swap amounts and fees.\nThe actual swap is actioned via other swap endpoints which facilitate the creation of a binding swap quote and capturing explicit acceptance.";
querystring: TObject<
{
country: TString;
entityType: TUnsafe<"ORGANIZATION" | "IDENTITY">;
sourceAmount: TNumber;
sourceCurrency: TUnion<
[
TUnsafe<"MOVEUSD" | "USDC" | "SOL" | "WETH" | "WBTC">,
TLiteral<"REWARD">,
],
>;
targetCurrency: TUnion<
[
TUnsafe<"MOVEUSD" | "USDC" | "SOL" | "WETH" | "WBTC">,
TLiteral<"REWARD">,
],
>;
},
>;
response: {
"200": TIntersect<
[
TObject<
{
fees: TArray<TObject<{ fee: ...; type: ... }>>;
sourceAmount: TNumber;
sourceAmountAfterFees: TNumber;
sourceCurrency: TUnion<[TUnsafe<(...)>, TLiteral<(...)>]>;
targetAmount: TNumber;
targetAmountAfterFees: TNumber;
targetCurrency: TUnion<[TUnsafe<(...)>, TLiteral<(...)>]>;
},
>,
TObject<{ rawQuote: TOptional<TUnknown> }>,
],
>;
"400": TObject<
{
code: TString;
details: TOptional<TRecord<"^.*$", TAny>>;
message: TString;
},
>;
};
summary: "Get Swap Estimate";
};
}
Readonly/v1/swap/quote: {
post: {
body: TUnion<
[
TIntersect<
[
TObject<{ identityId: TString }>,
TObject<
{
sourceAmount: TNumber;
sourceCurrency: TUnion<[(...), (...), (...), (...)]>;
targetCurrency: TUnion<[(...), (...), (...), (...)]>;
wallet: TUnion<[(...), (...)]>;
},
>,
],
>,
TIntersect<
[
TObject<{ organizationId: TString }>,
TObject<
{
sourceAmount: TNumber;
sourceCurrency: TUnion<[(...), (...), (...), (...)]>;
targetCurrency: TUnion<[(...), (...), (...), (...)]>;
wallet: TUnion<[(...), (...)]>;
},
>,
],
>,
],
>;
description: "Generate a quote for Swap on the CFX network.\n\nThe Get Estimate endpoint provides a non-binding estimate for a swap transaction.\n\nThis Create Quote generates a binding quote, which includes an unsigned Solana transaction facilitating the swapping of assets from the nominated user wallet.";
response: {
"200": TUnion<
[
TIntersect<
[
TObject<{ identityId: TString }>,
TIntersect<[TObject<(...)>, TObject<(...)>, TObject<(...)>]>,
],
>,
TIntersect<
[
TObject<{ organizationId: TString }>,
TIntersect<[TObject<(...)>, TObject<(...)>, TObject<(...)>]>,
],
>,
],
>;
"400": TObject<
{
code: TString;
details: TOptional<TRecord<"^.*$", TAny>>;
message: TString;
},
>;
};
summary: "Create Quote";
};
}
Readonly/v1/swap/quote/{id}: {
get: {
description: "Retrieves a specific swap quote.";
params: TObject<{ id: TString }>;
querystring: TObject<{ identityId: TString }>;
response: {
"200": TUnion<
[
TIntersect<
[
TObject<{ identityId: TString }>,
TIntersect<[TObject<(...)>, TObject<(...)>, TObject<(...)>]>,
],
>,
TIntersect<
[
TObject<{ organizationId: TString }>,
TIntersect<[TObject<(...)>, TObject<(...)>, TObject<(...)>]>,
],
>,
],
>;
"400": TObject<
{
code: TString;
details: TOptional<TRecord<"^.*$", TAny>>;
message: TString;
},
>;
"404": TObject<
{
code: TLiteral<"notFound">;
details: TOptional<TRecord<"^.*$", TAny>>;
message: TString;
},
>;
};
summary: "Get Swap Quote";
tags: readonly ["Quote"];
};
}
Readonly/v1/swap/quote/{id}/accept: {
post: {
body: TIntersect<
[
TUnion<
[
TIntersect<[TObject<{ identityId: ... }>, TObject<{}>]>,
TIntersect<[TObject<{ organizationId: ... }>, TObject<{}>]>,
],
>,
TObject<{ signedTransaction: TOptional<TString> }>,
],
>;
description: "Accepts a swap quote for execution.\n\nThis endpoint confirms acceptance of a quote previously generated by the Create Quote endpoint.";
params: TObject<{ id: TString }>;
response: {
"200": TUnion<
[
TIntersect<
[
TObject<{ identityId: TString }>,
TIntersect<[TObject<(...)>, TObject<(...)>]>,
],
>,
TIntersect<
[
TObject<{ organizationId: TString }>,
TIntersect<[TObject<(...)>, TObject<(...)>]>,
],
>,
],
>;
"400": TObject<
{
code: TString;
details: TOptional<TRecord<"^.*$", TAny>>;
message: TString;
},
>;
"404": TObject<
{
code: TLiteral<"notFound">;
details: TOptional<TRecord<"^.*$", TAny>>;
message: TString;
},
>;
};
summary: "Accept Quote";
tags: readonly ["Quote"];
};
}
Readonly/v1/swap/quote/{id}/reject: {
post: {
body: TUnion<
[
TIntersect<[TObject<{ identityId: TString }>, TObject<{}>]>,
TIntersect<[TObject<{ organizationId: TString }>, TObject<{}>]>,
],
>;
description: "Rejects a swap quote.";
params: TObject<{ id: TString }>;
response: {
"200": TObject<{ id: TString }>;
"400": TObject<
{
code: TString;
details: TOptional<TRecord<"^.*$", TAny>>;
message: TString;
},
>;
"404": TObject<
{
code: TLiteral<"notFound">;
details: TOptional<TRecord<"^.*$", TAny>>;
message: TString;
},
>;
};
summary: "Reject Quote";
tags: readonly ["Quote"];
};
}