@swap-coffee/sdk
Version:
SDK for swap.coffee DEX aggregator
1,025 lines • 467 kB
JavaScript
"use strict";
/* tslint:disable */
/* eslint-disable */
/**
* Swap Coffee API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.LiquidityProvisioningApiFactory = exports.LiquidityProvisioningApiFp = exports.LiquidityProvisioningApiAxiosParamCreator = exports.EntityApi = exports.EntityApiFactory = exports.EntityApiFp = exports.EntityApiAxiosParamCreator = exports.DEXApi = exports.DEXApiFactory = exports.DEXApiFp = exports.DEXApiAxiosParamCreator = exports.ContestsApi = exports.ContestsApiFactory = exports.ContestsApiFp = exports.ContestsApiAxiosParamCreator = exports.ClaimApi = exports.ClaimApiFactory = exports.ClaimApiFp = exports.ClaimApiAxiosParamCreator = exports.CashbackApi = exports.CashbackApiFactory = exports.CashbackApiFp = exports.CashbackApiAxiosParamCreator = exports.BoostsApi = exports.BoostsApiFactory = exports.BoostsApiFp = exports.BoostsApiAxiosParamCreator = exports.AuthApi = exports.AuthApiFactory = exports.AuthApiFp = exports.AuthApiAxiosParamCreator = exports.ApiWithdrawalType = exports.ApiWithdrawalStatus = exports.ApiTxOperationStatus = exports.ApiTransactionStepStatus = exports.ApiTransactionStatus = exports.ApiSwapResult = exports.ApiSupportedYields = exports.ApiSupportedBlockchain = exports.ApiStrategyOrderType = exports.ApiStrategyOrderStatus = exports.ApiSortOrder = exports.ApiPoolType = exports.ApiPoolSortOrder = exports.ApiLpMigrationPoolAction = exports.ApiExternalStatus = exports.ApiDexSwapConditionType = exports.ApiClaimingType = exports.ApiAuthTokenOption = exports.ApiAmmType = void 0;
exports.YieldApi = exports.YieldApiFactory = exports.YieldApiFp = exports.YieldApiAxiosParamCreator = exports.TonApi = exports.TonApiFactory = exports.TonApiFp = exports.TonApiAxiosParamCreator = exports.StrategiesApi = exports.StrategiesApiFactory = exports.StrategiesApiFp = exports.StrategiesApiAxiosParamCreator = exports.StatisticsApi = exports.StatisticsApiFactory = exports.StatisticsApiFp = exports.StatisticsApiAxiosParamCreator = exports.StakingApi = exports.StakingApiFactory = exports.StakingApiFp = exports.StakingApiAxiosParamCreator = exports.RoutingApi = exports.RoutingApiFactory = exports.RoutingApiFp = exports.RoutingApiAxiosParamCreator = exports.ReferralApi = exports.ReferralApiFactory = exports.ReferralApiFp = exports.ReferralApiAxiosParamCreator = exports.ProfileApi = exports.ProfileApiFactory = exports.ProfileApiFp = exports.ProfileApiAxiosParamCreator = exports.PartnershipApi = exports.PartnershipApiFactory = exports.PartnershipApiFp = exports.PartnershipApiAxiosParamCreator = exports.LiquidityProvisioningApi = void 0;
const axios_1 = __importDefault(require("axios"));
// Some imports not used depending on template conditions
// @ts-ignore
const common_1 = require("./common");
// @ts-ignore
const base_1 = require("./base");
/**
*
* @export
* @enum {string}
*/
exports.ApiAmmType = {
ConstantProduct: 'constant_product',
CubicStable: 'cubic_stable',
CurveFiStable: 'curve_fi_stable',
ConcentratedV3: 'concentrated_v3',
Tonstakers: 'tonstakers',
WeightedConstantProduct: 'weighted_constant_product',
WeightedStable: 'weighted_stable'
};
/**
*
* @export
* @enum {string}
*/
exports.ApiAuthTokenOption = {
Administrator: 'administrator',
Moderator: 'moderator',
AllowCycles: 'allow_cycles',
ExtendedTxStatus: 'extended_tx_status'
};
/**
*
* @export
* @enum {string}
*/
exports.ApiClaimingType = {
All: 'all',
Referral: 'referral',
Cashback: 'cashback',
Staking: 'staking',
RewardsStonfi: 'rewards_stonfi',
RewardsDedust: 'rewards_dedust',
CoffeeDex: 'coffee_dex',
Boost: 'boost'
};
/**
*
* @export
* @enum {string}
*/
exports.ApiDexSwapConditionType = {
Unique: 'unique',
Listed: 'listed',
PartnerAddress: 'partner_address',
Tokens: 'tokens',
TokensPair: 'tokens-pair',
TokensExact: 'tokens-exact',
UsersWhitelist: 'users-whitelist',
SwapTxMinAmount: 'swap-tx-min-amount',
BlacklistPair: 'blacklist-pair',
BlacklistTokens: 'blacklist-tokens',
Dexes: 'dexes'
};
/**
*
* @export
* @enum {string}
*/
exports.ApiExternalStatus = {
Pending: 'pending',
Succeeded: 'succeeded',
Failed: 'failed'
};
/**
*
* @export
* @enum {string}
*/
exports.ApiLpMigrationPoolAction = {
NotExistingPool: 'not_existing_pool',
ExistingPool: 'existing_pool'
};
/**
*
* @export
* @enum {string}
*/
exports.ApiPoolSortOrder = {
Tvl: 'tvl',
Volume: 'volume',
Apr: 'apr'
};
/**
*
* @export
* @enum {string}
*/
exports.ApiPoolType = {
Public: 'public',
Private: 'private',
Slumbering: 'slumbering',
Invalid: 'invalid'
};
/**
*
* @export
* @enum {string}
*/
exports.ApiSortOrder = {
Asc: 'ASC',
Desc: 'DESC'
};
/**
*
* @export
* @enum {string}
*/
exports.ApiStrategyOrderStatus = {
Active: 'active',
RequestedCancellation: 'requested_cancellation',
CancelledByUser: 'cancelled_by_user',
CancelledBySystem: 'cancelled_by_system',
Executed: 'executed',
MaxRetriesExceeded: 'max_retries_exceeded'
};
/**
*
* @export
* @enum {string}
*/
exports.ApiStrategyOrderType = {
Limit: 'limit',
Dca: 'dca',
Vca: 'vca'
};
/**
*
* @export
* @enum {string}
*/
exports.ApiSupportedBlockchain = {
Ton: 'ton'
};
/**
*
* @export
* @enum {string}
*/
exports.ApiSupportedYields = {
Stonfi: 'stonfi',
Dedust: 'dedust',
StonfiV2: 'stonfi_v2',
Coffee: 'coffee',
Tonco: 'tonco',
Colossus: 'colossus',
Tonstakers: 'tonstakers',
TorchFinance: 'torch_finance'
};
/**
* Result of the swap
* @export
* @enum {string}
*/
exports.ApiSwapResult = {
FullyFulfilled: 'fully_fulfilled',
PartiallyFulfilled: 'partially_fulfilled',
Unavailable: 'unavailable'
};
/**
*
* @export
* @enum {string}
*/
exports.ApiTransactionStatus = {
Pending: 'pending',
PartiallyComplete: 'partially_complete',
Succeeded: 'succeeded',
Failed: 'failed',
TimedOut: 'timed_out'
};
/**
*
* @export
* @enum {string}
*/
exports.ApiTransactionStepStatus = {
Pending: 'pending',
Cancelled: 'cancelled',
Succeeded: 'succeeded',
Failed: 'failed',
TimedOut: 'timed_out'
};
/**
*
* @export
* @enum {string}
*/
exports.ApiTxOperationStatus = {
Pending: 'pending',
PartiallyComplete: 'partially_complete',
RequestConfirmed: 'request_confirmed',
SecondStageStarted: 'second_stage_started',
Refund: 'refund',
Succeeded: 'succeeded',
Failed: 'failed',
TimedOut: 'timed_out'
};
/**
*
* @export
* @enum {string}
*/
exports.ApiWithdrawalStatus = {
Unhandled: 'unhandled',
Processing: 'processing',
Processed: 'processed'
};
/**
*
* @export
* @enum {string}
*/
exports.ApiWithdrawalType = {
Repay: 'repay',
Refund: 'refund'
};
/**
* AuthApi - axios parameter creator
* @export
*/
const AuthApiAxiosParamCreator = function (configuration) {
return {
/**
*
* @summary Create new auth token
* @param {ApiCreateAuthTokenRequest} apiCreateAuthTokenRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createAuthToken: async (apiCreateAuthTokenRequest, options = {}) => {
// verify required parameter 'apiCreateAuthTokenRequest' is not null or undefined
(0, common_1.assertParamExists)('createAuthToken', 'apiCreateAuthTokenRequest', apiCreateAuthTokenRequest);
const localVarPath = `/v1/auth`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ApiKey required
await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "X-Api-Key", configuration);
localVarHeaderParameter['Content-Type'] = 'application/json';
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(apiCreateAuthTokenRequest, localVarRequestOptions, configuration);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @summary Delete existing auth token
* @param {string} key
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteAuthToken: async (key, options = {}) => {
// verify required parameter 'key' is not null or undefined
(0, common_1.assertParamExists)('deleteAuthToken', 'key', key);
const localVarPath = `/v1/auth`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ApiKey required
await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "X-Api-Key", configuration);
if (key !== undefined) {
localVarQueryParameter['key'] = key;
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @summary Edit existing auth token
* @param {ApiEditAuthTokenRequest} apiEditAuthTokenRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
editAuthToken: async (apiEditAuthTokenRequest, options = {}) => {
// verify required parameter 'apiEditAuthTokenRequest' is not null or undefined
(0, common_1.assertParamExists)('editAuthToken', 'apiEditAuthTokenRequest', apiEditAuthTokenRequest);
const localVarPath = `/v1/auth`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ApiKey required
await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "X-Api-Key", configuration);
localVarHeaderParameter['Content-Type'] = 'application/json';
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(apiEditAuthTokenRequest, localVarRequestOptions, configuration);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @summary List existing auth tokens
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getAuthTokens: async (options = {}) => {
const localVarPath = `/v1/auth`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ApiKey required
await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "X-Api-Key", configuration);
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
};
};
exports.AuthApiAxiosParamCreator = AuthApiAxiosParamCreator;
/**
* AuthApi - functional programming interface
* @export
*/
const AuthApiFp = function (configuration) {
const localVarAxiosParamCreator = (0, exports.AuthApiAxiosParamCreator)(configuration);
return {
/**
*
* @summary Create new auth token
* @param {ApiCreateAuthTokenRequest} apiCreateAuthTokenRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async createAuthToken(apiCreateAuthTokenRequest, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.createAuthToken(apiCreateAuthTokenRequest, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = base_1.operationServerMap['AuthApi.createAuthToken']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
*
* @summary Delete existing auth token
* @param {string} key
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async deleteAuthToken(key, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.deleteAuthToken(key, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = base_1.operationServerMap['AuthApi.deleteAuthToken']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
*
* @summary Edit existing auth token
* @param {ApiEditAuthTokenRequest} apiEditAuthTokenRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async editAuthToken(apiEditAuthTokenRequest, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.editAuthToken(apiEditAuthTokenRequest, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = base_1.operationServerMap['AuthApi.editAuthToken']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
*
* @summary List existing auth tokens
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getAuthTokens(options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.getAuthTokens(options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = base_1.operationServerMap['AuthApi.getAuthTokens']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
};
};
exports.AuthApiFp = AuthApiFp;
/**
* AuthApi - factory interface
* @export
*/
const AuthApiFactory = function (configuration, basePath, axios) {
const localVarFp = (0, exports.AuthApiFp)(configuration);
return {
/**
*
* @summary Create new auth token
* @param {ApiCreateAuthTokenRequest} apiCreateAuthTokenRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createAuthToken(apiCreateAuthTokenRequest, options) {
return localVarFp.createAuthToken(apiCreateAuthTokenRequest, options).then((request) => request(axios, basePath));
},
/**
*
* @summary Delete existing auth token
* @param {string} key
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteAuthToken(key, options) {
return localVarFp.deleteAuthToken(key, options).then((request) => request(axios, basePath));
},
/**
*
* @summary Edit existing auth token
* @param {ApiEditAuthTokenRequest} apiEditAuthTokenRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
editAuthToken(apiEditAuthTokenRequest, options) {
return localVarFp.editAuthToken(apiEditAuthTokenRequest, options).then((request) => request(axios, basePath));
},
/**
*
* @summary List existing auth tokens
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getAuthTokens(options) {
return localVarFp.getAuthTokens(options).then((request) => request(axios, basePath));
},
};
};
exports.AuthApiFactory = AuthApiFactory;
/**
* AuthApi - object-oriented interface
* @export
* @class AuthApi
* @extends {BaseAPI}
*/
class AuthApi extends base_1.BaseAPI {
/**
*
* @summary Create new auth token
* @param {ApiCreateAuthTokenRequest} apiCreateAuthTokenRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof AuthApi
*/
createAuthToken(apiCreateAuthTokenRequest, options) {
return (0, exports.AuthApiFp)(this.configuration).createAuthToken(apiCreateAuthTokenRequest, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary Delete existing auth token
* @param {string} key
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof AuthApi
*/
deleteAuthToken(key, options) {
return (0, exports.AuthApiFp)(this.configuration).deleteAuthToken(key, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary Edit existing auth token
* @param {ApiEditAuthTokenRequest} apiEditAuthTokenRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof AuthApi
*/
editAuthToken(apiEditAuthTokenRequest, options) {
return (0, exports.AuthApiFp)(this.configuration).editAuthToken(apiEditAuthTokenRequest, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary List existing auth tokens
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof AuthApi
*/
getAuthTokens(options) {
return (0, exports.AuthApiFp)(this.configuration).getAuthTokens(options).then((request) => request(this.axios, this.basePath));
}
}
exports.AuthApi = AuthApi;
/**
* BoostsApi - axios parameter creator
* @export
*/
const BoostsApiAxiosParamCreator = function (configuration) {
return {
/**
*
* @summary Build transaction to create boost for pool in swap.coffee DEX
* @param {string} poolAddress
* @param {string} xVerify TON proof for the given address
* @param {string} address
* @param {ApiCreateBoostRequest} apiCreateBoostRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createBoostRequest: async (poolAddress, xVerify, address, apiCreateBoostRequest, options = {}) => {
// verify required parameter 'poolAddress' is not null or undefined
(0, common_1.assertParamExists)('createBoostRequest', 'poolAddress', poolAddress);
// verify required parameter 'xVerify' is not null or undefined
(0, common_1.assertParamExists)('createBoostRequest', 'xVerify', xVerify);
// verify required parameter 'address' is not null or undefined
(0, common_1.assertParamExists)('createBoostRequest', 'address', address);
// verify required parameter 'apiCreateBoostRequest' is not null or undefined
(0, common_1.assertParamExists)('createBoostRequest', 'apiCreateBoostRequest', apiCreateBoostRequest);
const localVarPath = `/v1/boost/{pool_address}/{address}`
.replace(`{${"pool_address"}}`, encodeURIComponent(String(poolAddress)))
.replace(`{${"address"}}`, encodeURIComponent(String(address)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ApiKey required
await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "X-Api-Key", configuration);
localVarHeaderParameter['Content-Type'] = 'application/json';
if (xVerify != null) {
localVarHeaderParameter['x-verify'] = String(xVerify);
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(apiCreateBoostRequest, localVarRequestOptions, configuration);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @summary Build transaction to create stonfi farm position
* @param {string} xVerify TON proof for the given address
* @param {string} poolAddress
* @param {string} userAddress
* @param {ApiStonfiFarmRequest} apiStonfiFarmRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createStonfiFarmPosition: async (xVerify, poolAddress, userAddress, apiStonfiFarmRequest, options = {}) => {
// verify required parameter 'xVerify' is not null or undefined
(0, common_1.assertParamExists)('createStonfiFarmPosition', 'xVerify', xVerify);
// verify required parameter 'poolAddress' is not null or undefined
(0, common_1.assertParamExists)('createStonfiFarmPosition', 'poolAddress', poolAddress);
// verify required parameter 'userAddress' is not null or undefined
(0, common_1.assertParamExists)('createStonfiFarmPosition', 'userAddress', userAddress);
// verify required parameter 'apiStonfiFarmRequest' is not null or undefined
(0, common_1.assertParamExists)('createStonfiFarmPosition', 'apiStonfiFarmRequest', apiStonfiFarmRequest);
const localVarPath = `/v1/boost/stonfi/{pool_address}/{user_address}`
.replace(`{${"pool_address"}}`, encodeURIComponent(String(poolAddress)))
.replace(`{${"user_address"}}`, encodeURIComponent(String(userAddress)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ApiKey required
await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "X-Api-Key", configuration);
localVarHeaderParameter['Content-Type'] = 'application/json';
if (xVerify != null) {
localVarHeaderParameter['x-verify'] = String(xVerify);
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(apiStonfiFarmRequest, localVarRequestOptions, configuration);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @summary Build transaction to close farm position in stonfi
* @param {string} xVerify TON proof for the given address
* @param {string} poolAddress
* @param {string} positionAddress
* @param {string} userAddress
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
finishStonfiFarmPosition: async (xVerify, poolAddress, positionAddress, userAddress, options = {}) => {
// verify required parameter 'xVerify' is not null or undefined
(0, common_1.assertParamExists)('finishStonfiFarmPosition', 'xVerify', xVerify);
// verify required parameter 'poolAddress' is not null or undefined
(0, common_1.assertParamExists)('finishStonfiFarmPosition', 'poolAddress', poolAddress);
// verify required parameter 'positionAddress' is not null or undefined
(0, common_1.assertParamExists)('finishStonfiFarmPosition', 'positionAddress', positionAddress);
// verify required parameter 'userAddress' is not null or undefined
(0, common_1.assertParamExists)('finishStonfiFarmPosition', 'userAddress', userAddress);
const localVarPath = `/v1/boost/stonfi/{pool_address}/{position_address}/{user_address}`
.replace(`{${"pool_address"}}`, encodeURIComponent(String(poolAddress)))
.replace(`{${"position_address"}}`, encodeURIComponent(String(positionAddress)))
.replace(`{${"user_address"}}`, encodeURIComponent(String(userAddress)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ApiKey required
await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "X-Api-Key", configuration);
if (xVerify != null) {
localVarHeaderParameter['x-verify'] = String(xVerify);
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @summary Returns pool\'s aggregated APR
* @param {string} poolAddress
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getBoostAggregatedAPR: async (poolAddress, options = {}) => {
// verify required parameter 'poolAddress' is not null or undefined
(0, common_1.assertParamExists)('getBoostAggregatedAPR', 'poolAddress', poolAddress);
const localVarPath = `/v1/boost/{pool_address}/apr`
.replace(`{${"pool_address"}}`, encodeURIComponent(String(poolAddress)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ApiKey required
await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "X-Api-Key", configuration);
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @summary Returns status of new boost creation operation. Works for Coffee DEX pools only
* @param {number} queryId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getBoostStatus: async (queryId, options = {}) => {
// verify required parameter 'queryId' is not null or undefined
(0, common_1.assertParamExists)('getBoostStatus', 'queryId', queryId);
const localVarPath = `/v1/boost/result`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ApiKey required
await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "X-Api-Key", configuration);
if (queryId !== undefined) {
localVarQueryParameter['query_id'] = queryId;
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @summary Returns list of boosts for the pool
* @param {string} poolAddress
* @param {string} [lastFactory]
* @param {number} [lastId]
* @param {number} [size]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getBoostsForPool: async (poolAddress, lastFactory, lastId, size, options = {}) => {
// verify required parameter 'poolAddress' is not null or undefined
(0, common_1.assertParamExists)('getBoostsForPool', 'poolAddress', poolAddress);
const localVarPath = `/v1/boost/{pool_address}`
.replace(`{${"pool_address"}}`, encodeURIComponent(String(poolAddress)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ApiKey required
await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "X-Api-Key", configuration);
if (lastFactory !== undefined) {
localVarQueryParameter['last_factory'] = lastFactory;
}
if (lastId !== undefined) {
localVarQueryParameter['last_id'] = lastId;
}
if (size !== undefined) {
localVarQueryParameter['size'] = size;
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @summary Returns user\'s earned boosts in given pool
* @param {string} poolAddress
* @param {string} userAddress
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getBoostsForUserInPool: async (poolAddress, userAddress, options = {}) => {
// verify required parameter 'poolAddress' is not null or undefined
(0, common_1.assertParamExists)('getBoostsForUserInPool', 'poolAddress', poolAddress);
// verify required parameter 'userAddress' is not null or undefined
(0, common_1.assertParamExists)('getBoostsForUserInPool', 'userAddress', userAddress);
const localVarPath = `/v1/boost/user/{pool_address}/{user_address}`
.replace(`{${"pool_address"}}`, encodeURIComponent(String(poolAddress)))
.replace(`{${"user_address"}}`, encodeURIComponent(String(userAddress)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ApiKey required
await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "X-Api-Key", configuration);
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @summary Get detailed info about boost. Works for Coffee DEX pools only
* @param {string} boostFactory
* @param {number} boostId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getBoostsInfo: async (boostFactory, boostId, options = {}) => {
// verify required parameter 'boostFactory' is not null or undefined
(0, common_1.assertParamExists)('getBoostsInfo', 'boostFactory', boostFactory);
// verify required parameter 'boostId' is not null or undefined
(0, common_1.assertParamExists)('getBoostsInfo', 'boostId', boostId);
const localVarPath = `/v1/boost/{boost_factory}/{boost_id}`
.replace(`{${"boost_factory"}}`, encodeURIComponent(String(boostFactory)))
.replace(`{${"boost_id"}}`, encodeURIComponent(String(boostId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication ApiKey required
await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "X-Api-Key", configuration);
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
};
};
exports.BoostsApiAxiosParamCreator = BoostsApiAxiosParamCreator;
/**
* BoostsApi - functional programming interface
* @export
*/
const BoostsApiFp = function (configuration) {
const localVarAxiosParamCreator = (0, exports.BoostsApiAxiosParamCreator)(configuration);
return {
/**
*
* @summary Build transaction to create boost for pool in swap.coffee DEX
* @param {string} poolAddress
* @param {string} xVerify TON proof for the given address
* @param {string} address
* @param {ApiCreateBoostRequest} apiCreateBoostRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async createBoostRequest(poolAddress, xVerify, address, apiCreateBoostRequest, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.createBoostRequest(poolAddress, xVerify, address, apiCreateBoostRequest, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = base_1.operationServerMap['BoostsApi.createBoostRequest']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
*
* @summary Build transaction to create stonfi farm position
* @param {string} xVerify TON proof for the given address
* @param {string} poolAddress
* @param {string} userAddress
* @param {ApiStonfiFarmRequest} apiStonfiFarmRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async createStonfiFarmPosition(xVerify, poolAddress, userAddress, apiStonfiFarmRequest, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.createStonfiFarmPosition(xVerify, poolAddress, userAddress, apiStonfiFarmRequest, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = base_1.operationServerMap['BoostsApi.createStonfiFarmPosition']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
*
* @summary Build transaction to close farm position in stonfi
* @param {string} xVerify TON proof for the given address
* @param {string} poolAddress
* @param {string} positionAddress
* @param {string} userAddress
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async finishStonfiFarmPosition(xVerify, poolAddress, positionAddress, userAddress, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.finishStonfiFarmPosition(xVerify, poolAddress, positionAddress, userAddress, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = base_1.operationServerMap['BoostsApi.finishStonfiFarmPosition']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
*
* @summary Returns pool\'s aggregated APR
* @param {string} poolAddress
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getBoostAggregatedAPR(poolAddress, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.getBoostAggregatedAPR(poolAddress, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = base_1.operationServerMap['BoostsApi.getBoostAggregatedAPR']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
*
* @summary Returns status of new boost creation operation. Works for Coffee DEX pools only
* @param {number} queryId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getBoostStatus(queryId, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.getBoostStatus(queryId, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = base_1.operationServerMap['BoostsApi.getBoostStatus']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
*
* @summary Returns list of boosts for the pool
* @param {string} poolAddress
* @param {string} [lastFactory]
* @param {number} [lastId]
* @param {number} [size]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getBoostsForPool(poolAddress, lastFactory, lastId, size, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.getBoostsForPool(poolAddress, lastFactory, lastId, size, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = base_1.operationServerMap['BoostsApi.getBoostsForPool']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
*
* @summary Returns user\'s earned boosts in given pool
* @param {string} poolAddress
* @param {string} userAddress
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getBoostsForUserInPool(poolAddress, userAddress, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.getBoostsForUserInPool(poolAddress, userAddress, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = base_1.operationServerMap['BoostsApi.getBoostsForUserInPool']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
*
* @summary Get detailed info about boost. Works for Coffee DEX pools only
* @param {string} boostFactory
* @param {number} boostId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getBoostsInfo(boostFactory, boostId, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.getBoostsInfo(boostFactory, boostId, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = base_1.operationServerMap['BoostsApi.getBoostsInfo']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
};
};
exports.BoostsApiFp = BoostsApiFp;
/**
* BoostsApi - factory interface
* @export
*/
const BoostsApiFactory = function (configuration, basePath, axios) {
const localVarFp = (0, exports.BoostsApiFp)(configuration);
return {
/**
*
* @summary Build transaction to create boost for pool in swap.coffee DEX
* @param {string} poolAddress
* @param {string} xVerify TON proof for the given address
* @param {string} address
* @param {ApiCreateBoostRequest} apiCreateBoostRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createBoostRequest(poolAddress, xVerify, address, apiCreateBoostRequest, options) {
return localVarFp.createBoostRequest(poolAddress, xVerify, address, apiCreateBoostRequest, options).then((request) => request(axios, basePath));
},
/**
*
* @summary Build transaction to create stonfi farm position
* @param {string} xVerify TON proof for the given address
* @param {string} poolAddress
* @param {string} userAddress
* @param {ApiStonfiFarmRequest} apiStonfiFarmRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createStonfiFarmPosition(xVerify, poolAddress, userAddress, apiStonfiFarmRequest, options) {
return localVarFp.createStonfiFarmPositio