genius-intents 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +45 -0
- package/LICENSE +21 -0
- package/README.md +376 -0
- package/dist/src/index.d.ts +27 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +62 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/intents-protocols.d.ts +69 -0
- package/dist/src/intents-protocols.d.ts.map +1 -0
- package/dist/src/intents-protocols.js +371 -0
- package/dist/src/intents-protocols.js.map +1 -0
- package/dist/src/interfaces/intent-protocol.d.ts +21 -0
- package/dist/src/interfaces/intent-protocol.d.ts.map +1 -0
- package/dist/src/interfaces/intent-protocol.js +3 -0
- package/dist/src/interfaces/intent-protocol.js.map +1 -0
- package/dist/src/protocols/aftermath/aftermath.service.d.ts +28 -0
- package/dist/src/protocols/aftermath/aftermath.service.d.ts.map +1 -0
- package/dist/src/protocols/aftermath/aftermath.service.js +162 -0
- package/dist/src/protocols/aftermath/aftermath.service.js.map +1 -0
- package/dist/src/protocols/aftermath/aftermath.types.d.ts +100 -0
- package/dist/src/protocols/aftermath/aftermath.types.d.ts.map +1 -0
- package/dist/src/protocols/aftermath/aftermath.types.js +3 -0
- package/dist/src/protocols/aftermath/aftermath.types.js.map +1 -0
- package/dist/src/protocols/aftermath/index.d.ts +3 -0
- package/dist/src/protocols/aftermath/index.d.ts.map +1 -0
- package/dist/src/protocols/aftermath/index.js +7 -0
- package/dist/src/protocols/aftermath/index.js.map +1 -0
- package/dist/src/protocols/debridge/debridge.service.d.ts +157 -0
- package/dist/src/protocols/debridge/debridge.service.d.ts.map +1 -0
- package/dist/src/protocols/debridge/debridge.service.js +462 -0
- package/dist/src/protocols/debridge/debridge.service.js.map +1 -0
- package/dist/src/protocols/debridge/debridge.types.d.ts +82 -0
- package/dist/src/protocols/debridge/debridge.types.d.ts.map +1 -0
- package/dist/src/protocols/debridge/debridge.types.js +3 -0
- package/dist/src/protocols/debridge/debridge.types.js.map +1 -0
- package/dist/src/protocols/debridge/index.d.ts +3 -0
- package/dist/src/protocols/debridge/index.d.ts.map +1 -0
- package/dist/src/protocols/debridge/index.js +7 -0
- package/dist/src/protocols/debridge/index.js.map +1 -0
- package/dist/src/protocols/genius-bridge/genius-bridge.service.d.ts +36 -0
- package/dist/src/protocols/genius-bridge/genius-bridge.service.d.ts.map +1 -0
- package/dist/src/protocols/genius-bridge/genius-bridge.service.js +312 -0
- package/dist/src/protocols/genius-bridge/genius-bridge.service.js.map +1 -0
- package/dist/src/protocols/genius-bridge/genius-bridge.types.d.ts +100 -0
- package/dist/src/protocols/genius-bridge/genius-bridge.types.d.ts.map +1 -0
- package/dist/src/protocols/genius-bridge/genius-bridge.types.js +3 -0
- package/dist/src/protocols/genius-bridge/genius-bridge.types.js.map +1 -0
- package/dist/src/protocols/genius-bridge/index.d.ts +3 -0
- package/dist/src/protocols/genius-bridge/index.d.ts.map +1 -0
- package/dist/src/protocols/genius-bridge/index.js +7 -0
- package/dist/src/protocols/genius-bridge/index.js.map +1 -0
- package/dist/src/protocols/jupiter/index.d.ts +3 -0
- package/dist/src/protocols/jupiter/index.d.ts.map +1 -0
- package/dist/src/protocols/jupiter/index.js +7 -0
- package/dist/src/protocols/jupiter/index.js.map +1 -0
- package/dist/src/protocols/jupiter/jupiter.service.d.ts +37 -0
- package/dist/src/protocols/jupiter/jupiter.service.d.ts.map +1 -0
- package/dist/src/protocols/jupiter/jupiter.service.js +188 -0
- package/dist/src/protocols/jupiter/jupiter.service.js.map +1 -0
- package/dist/src/protocols/jupiter/jupiter.types.d.ts +272 -0
- package/dist/src/protocols/jupiter/jupiter.types.d.ts.map +1 -0
- package/dist/src/protocols/jupiter/jupiter.types.js +3 -0
- package/dist/src/protocols/jupiter/jupiter.types.js.map +1 -0
- package/dist/src/protocols/kyberswap/index.d.ts +3 -0
- package/dist/src/protocols/kyberswap/index.d.ts.map +1 -0
- package/dist/src/protocols/kyberswap/index.js +7 -0
- package/dist/src/protocols/kyberswap/index.js.map +1 -0
- package/dist/src/protocols/kyberswap/kyberswap.service.d.ts +34 -0
- package/dist/src/protocols/kyberswap/kyberswap.service.d.ts.map +1 -0
- package/dist/src/protocols/kyberswap/kyberswap.service.js +218 -0
- package/dist/src/protocols/kyberswap/kyberswap.service.js.map +1 -0
- package/dist/src/protocols/kyberswap/kyberswap.types.d.ts +114 -0
- package/dist/src/protocols/kyberswap/kyberswap.types.d.ts.map +1 -0
- package/dist/src/protocols/kyberswap/kyberswap.types.js +3 -0
- package/dist/src/protocols/kyberswap/kyberswap.types.js.map +1 -0
- package/dist/src/protocols/odos/index.d.ts +3 -0
- package/dist/src/protocols/odos/index.d.ts.map +1 -0
- package/dist/src/protocols/odos/index.js +7 -0
- package/dist/src/protocols/odos/index.js.map +1 -0
- package/dist/src/protocols/odos/odos.service.d.ts +39 -0
- package/dist/src/protocols/odos/odos.service.d.ts.map +1 -0
- package/dist/src/protocols/odos/odos.service.js +207 -0
- package/dist/src/protocols/odos/odos.service.js.map +1 -0
- package/dist/src/protocols/odos/odos.types.d.ts +114 -0
- package/dist/src/protocols/odos/odos.types.d.ts.map +1 -0
- package/dist/src/protocols/odos/odos.types.js +3 -0
- package/dist/src/protocols/odos/odos.types.js.map +1 -0
- package/dist/src/protocols/okx/index.d.ts +3 -0
- package/dist/src/protocols/okx/index.d.ts.map +1 -0
- package/dist/src/protocols/okx/index.js +7 -0
- package/dist/src/protocols/okx/index.js.map +1 -0
- package/dist/src/protocols/okx/okx.service.d.ts +36 -0
- package/dist/src/protocols/okx/okx.service.d.ts.map +1 -0
- package/dist/src/protocols/okx/okx.service.js +281 -0
- package/dist/src/protocols/okx/okx.service.js.map +1 -0
- package/dist/src/protocols/okx/okx.types.d.ts +119 -0
- package/dist/src/protocols/okx/okx.types.d.ts.map +1 -0
- package/dist/src/protocols/okx/okx.types.js +4 -0
- package/dist/src/protocols/okx/okx.types.js.map +1 -0
- package/dist/src/protocols/okx-bridge/okx-bridge.service.d.ts +1 -0
- package/dist/src/protocols/okx-bridge/okx-bridge.service.d.ts.map +1 -0
- package/dist/src/protocols/okx-bridge/okx-bridge.service.js +2 -0
- package/dist/src/protocols/okx-bridge/okx-bridge.service.js.map +1 -0
- package/dist/src/protocols/okx-bridge/okx-bridge.types.d.ts +1 -0
- package/dist/src/protocols/okx-bridge/okx-bridge.types.d.ts.map +1 -0
- package/dist/src/protocols/okx-bridge/okx-bridge.types.js +2 -0
- package/dist/src/protocols/okx-bridge/okx-bridge.types.js.map +1 -0
- package/dist/src/protocols/openocean/index.d.ts +3 -0
- package/dist/src/protocols/openocean/index.d.ts.map +1 -0
- package/dist/src/protocols/openocean/index.js +7 -0
- package/dist/src/protocols/openocean/index.js.map +1 -0
- package/dist/src/protocols/openocean/openocean.service.d.ts +29 -0
- package/dist/src/protocols/openocean/openocean.service.d.ts.map +1 -0
- package/dist/src/protocols/openocean/openocean.service.js +181 -0
- package/dist/src/protocols/openocean/openocean.service.js.map +1 -0
- package/dist/src/protocols/openocean/openocean.types.d.ts +68 -0
- package/dist/src/protocols/openocean/openocean.types.d.ts.map +1 -0
- package/dist/src/protocols/openocean/openocean.types.js +3 -0
- package/dist/src/protocols/openocean/openocean.types.js.map +1 -0
- package/dist/src/protocols/pumpfun/index.d.ts +3 -0
- package/dist/src/protocols/pumpfun/index.d.ts.map +1 -0
- package/dist/src/protocols/pumpfun/index.js +7 -0
- package/dist/src/protocols/pumpfun/index.js.map +1 -0
- package/dist/src/protocols/pumpfun/pumpfun.service.d.ts +45 -0
- package/dist/src/protocols/pumpfun/pumpfun.service.d.ts.map +1 -0
- package/dist/src/protocols/pumpfun/pumpfun.service.js +217 -0
- package/dist/src/protocols/pumpfun/pumpfun.service.js.map +1 -0
- package/dist/src/protocols/pumpfun/pumpfun.types.d.ts +14 -0
- package/dist/src/protocols/pumpfun/pumpfun.types.d.ts.map +1 -0
- package/dist/src/protocols/pumpfun/pumpfun.types.js +3 -0
- package/dist/src/protocols/pumpfun/pumpfun.types.js.map +1 -0
- package/dist/src/protocols/raydium/index.d.ts +3 -0
- package/dist/src/protocols/raydium/index.d.ts.map +1 -0
- package/dist/src/protocols/raydium/index.js +7 -0
- package/dist/src/protocols/raydium/index.js.map +1 -0
- package/dist/src/protocols/raydium/raydium-v2.service.d.ts +35 -0
- package/dist/src/protocols/raydium/raydium-v2.service.d.ts.map +1 -0
- package/dist/src/protocols/raydium/raydium-v2.service.js +301 -0
- package/dist/src/protocols/raydium/raydium-v2.service.js.map +1 -0
- package/dist/src/protocols/raydium/raydium-v2.types.d.ts +96 -0
- package/dist/src/protocols/raydium/raydium-v2.types.d.ts.map +1 -0
- package/dist/src/protocols/raydium/raydium-v2.types.js +3 -0
- package/dist/src/protocols/raydium/raydium-v2.types.js.map +1 -0
- package/dist/src/protocols/zeroX/index.d.ts +3 -0
- package/dist/src/protocols/zeroX/index.d.ts.map +1 -0
- package/dist/src/protocols/zeroX/index.js +7 -0
- package/dist/src/protocols/zeroX/index.js.map +1 -0
- package/dist/src/protocols/zeroX/zeroX.service.d.ts +37 -0
- package/dist/src/protocols/zeroX/zeroX.service.d.ts.map +1 -0
- package/dist/src/protocols/zeroX/zeroX.service.js +209 -0
- package/dist/src/protocols/zeroX/zeroX.service.js.map +1 -0
- package/dist/src/protocols/zeroX/zeroX.types.d.ts +120 -0
- package/dist/src/protocols/zeroX/zeroX.types.d.ts.map +1 -0
- package/dist/src/protocols/zeroX/zeroX.types.js +3 -0
- package/dist/src/protocols/zeroX/zeroX.types.js.map +1 -0
- package/dist/src/types/enums.d.ts +42 -0
- package/dist/src/types/enums.d.ts.map +1 -0
- package/dist/src/types/enums.js +49 -0
- package/dist/src/types/enums.js.map +1 -0
- package/dist/src/types/intents-protocols.d.ts +89 -0
- package/dist/src/types/intents-protocols.d.ts.map +1 -0
- package/dist/src/types/intents-protocols.js +3 -0
- package/dist/src/types/intents-protocols.js.map +1 -0
- package/dist/src/types/price-response.d.ts +26 -0
- package/dist/src/types/price-response.d.ts.map +1 -0
- package/dist/src/types/price-response.js +3 -0
- package/dist/src/types/price-response.js.map +1 -0
- package/dist/src/types/quote-response.d.ts +31 -0
- package/dist/src/types/quote-response.d.ts.map +1 -0
- package/dist/src/types/quote-response.js +3 -0
- package/dist/src/types/quote-response.js.map +1 -0
- package/dist/src/utils/address-validation.d.ts +9 -0
- package/dist/src/utils/address-validation.d.ts.map +1 -0
- package/dist/src/utils/address-validation.js +42 -0
- package/dist/src/utils/address-validation.js.map +1 -0
- package/dist/src/utils/address.d.ts +9 -0
- package/dist/src/utils/address.d.ts.map +1 -0
- package/dist/src/utils/address.js +74 -0
- package/dist/src/utils/address.js.map +1 -0
- package/dist/src/utils/base64-to-base58.d.ts +2 -0
- package/dist/src/utils/base64-to-base58.d.ts.map +1 -0
- package/dist/src/utils/base64-to-base58.js +22 -0
- package/dist/src/utils/base64-to-base58.js.map +1 -0
- package/dist/src/utils/chain-id-name.d.ts +3 -0
- package/dist/src/utils/chain-id-name.d.ts.map +1 -0
- package/dist/src/utils/chain-id-name.js +23 -0
- package/dist/src/utils/chain-id-name.js.map +1 -0
- package/dist/src/utils/check-vm.d.ts +8 -0
- package/dist/src/utils/check-vm.d.ts.map +1 -0
- package/dist/src/utils/check-vm.js +39 -0
- package/dist/src/utils/check-vm.js.map +1 -0
- package/dist/src/utils/constants.d.ts +7 -0
- package/dist/src/utils/constants.d.ts.map +1 -0
- package/dist/src/utils/constants.js +10 -0
- package/dist/src/utils/constants.js.map +1 -0
- package/dist/src/utils/create-error-message.d.ts +5 -0
- package/dist/src/utils/create-error-message.d.ts.map +1 -0
- package/dist/src/utils/create-error-message.js +42 -0
- package/dist/src/utils/create-error-message.js.map +1 -0
- package/dist/src/utils/fetch-spl-metadata.d.ts +4 -0
- package/dist/src/utils/fetch-spl-metadata.d.ts.map +1 -0
- package/dist/src/utils/fetch-spl-metadata.js +108 -0
- package/dist/src/utils/fetch-spl-metadata.js.map +1 -0
- package/dist/src/utils/is-native.d.ts +2 -0
- package/dist/src/utils/is-native.d.ts.map +1 -0
- package/dist/src/utils/is-native.js +23 -0
- package/dist/src/utils/is-native.js.map +1 -0
- package/dist/src/utils/logger.d.ts +56 -0
- package/dist/src/utils/logger.d.ts.map +1 -0
- package/dist/src/utils/logger.js +108 -0
- package/dist/src/utils/logger.js.map +1 -0
- package/dist/src/utils/throw-error.d.ts +3 -0
- package/dist/src/utils/throw-error.d.ts.map +1 -0
- package/dist/src/utils/throw-error.js +8 -0
- package/dist/src/utils/throw-error.js.map +1 -0
- package/dist/tests/core/intent-protocol-suite.test.d.ts +2 -0
- package/dist/tests/core/intent-protocol-suite.test.d.ts.map +1 -0
- package/dist/tests/core/intent-protocol-suite.test.js +485 -0
- package/dist/tests/core/intent-protocol-suite.test.js.map +1 -0
- package/dist/tests/core/intents-protocols.test.d.ts +2 -0
- package/dist/tests/core/intents-protocols.test.d.ts.map +1 -0
- package/dist/tests/core/intents-protocols.test.js +307 -0
- package/dist/tests/core/intents-protocols.test.js.map +1 -0
- package/dist/tests/core/protocol-test-runner.d.ts +62 -0
- package/dist/tests/core/protocol-test-runner.d.ts.map +1 -0
- package/dist/tests/core/protocol-test-runner.js +260 -0
- package/dist/tests/core/protocol-test-runner.js.map +1 -0
- package/dist/tests/core/setup.test.d.ts +1 -0
- package/dist/tests/core/setup.test.d.ts.map +1 -0
- package/dist/tests/core/setup.test.js +13 -0
- package/dist/tests/core/setup.test.js.map +1 -0
- package/dist/tests/fixtures/test-data.d.ts +84 -0
- package/dist/tests/fixtures/test-data.d.ts.map +1 -0
- package/dist/tests/fixtures/test-data.js +142 -0
- package/dist/tests/fixtures/test-data.js.map +1 -0
- package/dist/tests/integration/cross-chain.test.d.ts +2 -0
- package/dist/tests/integration/cross-chain.test.d.ts.map +1 -0
- package/dist/tests/integration/cross-chain.test.js +44 -0
- package/dist/tests/integration/cross-chain.test.js.map +1 -0
- package/dist/tests/protocols/simple-protocol.test.d.ts +2 -0
- package/dist/tests/protocols/simple-protocol.test.d.ts.map +1 -0
- package/dist/tests/protocols/simple-protocol.test.js +77 -0
- package/dist/tests/protocols/simple-protocol.test.js.map +1 -0
- package/dist/tests/setup.d.ts +24 -0
- package/dist/tests/setup.d.ts.map +1 -0
- package/dist/tests/setup.js +48 -0
- package/dist/tests/setup.js.map +1 -0
- package/dist/tests/utils/test-generator.d.ts +30 -0
- package/dist/tests/utils/test-generator.d.ts.map +1 -0
- package/dist/tests/utils/test-generator.js +153 -0
- package/dist/tests/utils/test-generator.js.map +1 -0
- package/package.json +102 -0
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.JupiterService = void 0;
|
|
7
|
+
const axios_1 = __importDefault(require("axios"));
|
|
8
|
+
const bs58_1 = __importDefault(require("bs58"));
|
|
9
|
+
const enums_1 = require("../../types/enums");
|
|
10
|
+
const constants_1 = require("../../utils/constants");
|
|
11
|
+
const logger_1 = require("../../utils/logger");
|
|
12
|
+
const throw_error_1 = require("../../utils/throw-error");
|
|
13
|
+
const axios_2 = require("axios");
|
|
14
|
+
const web3_js_1 = require("@solana/web3.js");
|
|
15
|
+
const create_error_message_1 = require("../../utils/create-error-message");
|
|
16
|
+
let logger;
|
|
17
|
+
class JupiterService {
|
|
18
|
+
constructor(config) {
|
|
19
|
+
this.protocol = enums_1.ProtocolEnum.JUPITER;
|
|
20
|
+
this.chains = [enums_1.ChainIdEnum.SOLANA];
|
|
21
|
+
this.singleChain = true;
|
|
22
|
+
this.multiChain = false;
|
|
23
|
+
this.priceParamOverrides = {
|
|
24
|
+
restrictIntermediateTokens: true,
|
|
25
|
+
onlyDirectRoutes: false,
|
|
26
|
+
// dynamicSlippage: true,
|
|
27
|
+
};
|
|
28
|
+
this.quoteParamOverrides = {
|
|
29
|
+
wrapAndUnwrapSol: true,
|
|
30
|
+
dynamicComputeUnitLimit: true,
|
|
31
|
+
dynamicSlippage: true,
|
|
32
|
+
skipUserAccountsRpcCalls: false,
|
|
33
|
+
};
|
|
34
|
+
this.priceEndpoint = '/quote';
|
|
35
|
+
this.quoteEndpoint = '/swap-instructions';
|
|
36
|
+
this.assemblyEndpoint = '/swap';
|
|
37
|
+
if (config?.debug) {
|
|
38
|
+
logger_1.LoggerFactory.configure(logger_1.LoggerFactory.createConsoleLogger({ level: logger_1.LogLevelEnum.DEBUG }));
|
|
39
|
+
}
|
|
40
|
+
// Use custom logger if provided
|
|
41
|
+
else if (config?.logger) {
|
|
42
|
+
logger_1.LoggerFactory.configure(config.logger);
|
|
43
|
+
}
|
|
44
|
+
logger = logger_1.LoggerFactory.getLogger();
|
|
45
|
+
// Jupiter API endpoint
|
|
46
|
+
this.baseUrl = config?.jupiterPrivateUrl || 'https://quote-api.jup.ag/v6';
|
|
47
|
+
}
|
|
48
|
+
isCorrectConfig(_config) {
|
|
49
|
+
// Jupiter has no required config fields, all are optional
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
async fetchPrice(params) {
|
|
53
|
+
if (params.networkIn !== enums_1.ChainIdEnum.SOLANA || params.networkOut !== enums_1.ChainIdEnum.SOLANA) {
|
|
54
|
+
logger.error(`Jupiter only supports Solana network`);
|
|
55
|
+
throw (0, throw_error_1.sdkError)(enums_1.SdkErrorEnum.INVALID_PARAMS, 'Jupiter only supports Solana network');
|
|
56
|
+
}
|
|
57
|
+
try {
|
|
58
|
+
const requestParams = this.priceParamsToRequestParams({
|
|
59
|
+
tokenIn: params.tokenIn,
|
|
60
|
+
tokenOut: params.tokenOut,
|
|
61
|
+
amountIn: params.amountIn,
|
|
62
|
+
slippage: params.slippage,
|
|
63
|
+
from: params.from,
|
|
64
|
+
});
|
|
65
|
+
// Apply price parameter overrides
|
|
66
|
+
const finalParams = {
|
|
67
|
+
...requestParams,
|
|
68
|
+
...this.priceParamOverrides,
|
|
69
|
+
};
|
|
70
|
+
if (finalParams.dynamicSlippage) {
|
|
71
|
+
delete finalParams.slippageBps;
|
|
72
|
+
}
|
|
73
|
+
const urlParams = new URLSearchParams(finalParams);
|
|
74
|
+
const endpoint = `${this.baseUrl}${this.priceEndpoint}?${urlParams.toString()}`;
|
|
75
|
+
logger.debug(`Making Jupiter API price request to: ${endpoint}`);
|
|
76
|
+
const response = await axios_1.default.get(endpoint);
|
|
77
|
+
const priceData = response.data;
|
|
78
|
+
if ('error' in priceData) {
|
|
79
|
+
logger.error(`Jupiter API returned error`, new Error(JSON.stringify(priceData, null, 2)));
|
|
80
|
+
throw (0, throw_error_1.sdkError)(enums_1.SdkErrorEnum.PRICE_NOT_FOUND, `Jupiter API returned error: ${JSON.stringify(priceData.error, null, 2)}`);
|
|
81
|
+
}
|
|
82
|
+
const priceResponse = {
|
|
83
|
+
protocol: enums_1.ProtocolEnum.JUPITER,
|
|
84
|
+
networkIn: params.networkIn,
|
|
85
|
+
networkOut: params.networkOut,
|
|
86
|
+
tokenIn: params.tokenIn,
|
|
87
|
+
tokenOut: params.tokenOut,
|
|
88
|
+
amountIn: params.amountIn,
|
|
89
|
+
amountOut: priceData.outAmount,
|
|
90
|
+
slippage: params.slippage,
|
|
91
|
+
priceImpact: parseFloat(priceData.priceImpactPct) * 100,
|
|
92
|
+
protocolResponse: priceData,
|
|
93
|
+
};
|
|
94
|
+
return priceResponse;
|
|
95
|
+
}
|
|
96
|
+
catch (error) {
|
|
97
|
+
const { errorMessage, errorMessageError } = (0, create_error_message_1.createErrorMessage)(error);
|
|
98
|
+
logger.error(`Failed to fetch swap price from ${this.protocol}`, errorMessageError);
|
|
99
|
+
logger.error(`Failed to fetch Jupiter price`, errorMessageError);
|
|
100
|
+
throw (0, throw_error_1.sdkError)(enums_1.SdkErrorEnum.PRICE_NOT_FOUND, `Failed to fetch Jupiter price, error: ${errorMessage}`);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
async fetchQuote(params) {
|
|
104
|
+
const { from, receiver } = params;
|
|
105
|
+
let { priceResponse } = params;
|
|
106
|
+
if (!priceResponse || !this.isJupiterPriceResponse(priceResponse.protocolResponse)) {
|
|
107
|
+
priceResponse = await this.fetchPrice(params);
|
|
108
|
+
}
|
|
109
|
+
if (!this.isJupiterPriceResponse(priceResponse.protocolResponse)) {
|
|
110
|
+
logger.error(`Invalid Jupiter price response`);
|
|
111
|
+
throw (0, throw_error_1.sdkError)(enums_1.SdkErrorEnum.PRICE_NOT_FOUND, `Invalid Jupiter price response: ${JSON.stringify(priceResponse)}`);
|
|
112
|
+
}
|
|
113
|
+
try {
|
|
114
|
+
logger.debug(`Making Jupiter API quote request for swap instructions`);
|
|
115
|
+
const swapParams = {
|
|
116
|
+
quoteResponse: priceResponse.protocolResponse,
|
|
117
|
+
userPublicKey: from,
|
|
118
|
+
...this.quoteParamOverrides,
|
|
119
|
+
};
|
|
120
|
+
const swapTransactionResponse = await axios_1.default.post(`${this.baseUrl}${this.assemblyEndpoint}`, swapParams);
|
|
121
|
+
//will throw if transaction is too large
|
|
122
|
+
swapTransactionResponse.data.swapTransaction = bs58_1.default.encode(web3_js_1.VersionedTransaction.deserialize(Buffer.from(swapTransactionResponse.data.swapTransaction, 'base64')).serialize());
|
|
123
|
+
if (this.quoteParamOverrides.dynamicSlippage &&
|
|
124
|
+
!swapTransactionResponse?.data?.dynamicSlippageReport) {
|
|
125
|
+
throw new Error('Dynamic slippage report is not available');
|
|
126
|
+
}
|
|
127
|
+
//@ts-ignore // will never be undefined if dynamic slippage is enabled
|
|
128
|
+
if (this.quoteParamOverrides.dynamicSlippage &&
|
|
129
|
+
swapTransactionResponse.data.dynamicSlippageReport &&
|
|
130
|
+
swapTransactionResponse.data.dynamicSlippageReport.slippageBps > params.slippage * 100) {
|
|
131
|
+
throw new Error(`Dynamic slippage is higher than expected. Reported: ${swapTransactionResponse?.data?.dynamicSlippageReport?.slippageBps}bps, Max Tolerance: ${params.slippage * 100}bps`);
|
|
132
|
+
}
|
|
133
|
+
const quoteResponse = {
|
|
134
|
+
protocol: enums_1.ProtocolEnum.JUPITER,
|
|
135
|
+
networkIn: params.networkIn,
|
|
136
|
+
networkOut: params.networkOut,
|
|
137
|
+
tokenIn: priceResponse.tokenIn,
|
|
138
|
+
tokenOut: priceResponse.tokenOut,
|
|
139
|
+
amountIn: priceResponse.amountIn,
|
|
140
|
+
amountOut: priceResponse.amountOut,
|
|
141
|
+
from,
|
|
142
|
+
receiver: receiver || from,
|
|
143
|
+
//@ts-ignore // will never be undefined if dynamic slippage is enabled
|
|
144
|
+
slippage: this.quoteParamOverrides.dynamicSlippage &&
|
|
145
|
+
swapTransactionResponse?.data?.dynamicSlippageReport?.slippageBps
|
|
146
|
+
? swapTransactionResponse?.data?.dynamicSlippageReport?.slippageBps / 100
|
|
147
|
+
: priceResponse.slippage,
|
|
148
|
+
priceImpact: priceResponse.priceImpact,
|
|
149
|
+
executionPayload: {
|
|
150
|
+
transactionData: [
|
|
151
|
+
{
|
|
152
|
+
...swapTransactionResponse.data,
|
|
153
|
+
transaction: swapTransactionResponse.data.swapTransaction,
|
|
154
|
+
},
|
|
155
|
+
],
|
|
156
|
+
},
|
|
157
|
+
protocolResponse: { transactions: [] },
|
|
158
|
+
};
|
|
159
|
+
return quoteResponse;
|
|
160
|
+
}
|
|
161
|
+
catch (error) {
|
|
162
|
+
const errorMessage = error instanceof axios_2.AxiosError
|
|
163
|
+
? error?.response?.data?.error ||
|
|
164
|
+
error?.response?.data?.detail ||
|
|
165
|
+
error?.response?.data?.message
|
|
166
|
+
: error instanceof Error
|
|
167
|
+
? error.message
|
|
168
|
+
: String(error);
|
|
169
|
+
logger.error(`Failed to fetch Jupiter quote`, errorMessage);
|
|
170
|
+
throw (0, throw_error_1.sdkError)(enums_1.SdkErrorEnum.QUOTE_NOT_FOUND, `Failed to fetch Jupiter quote, error: ${errorMessage}`);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
priceParamsToRequestParams(params) {
|
|
174
|
+
const { tokenIn, tokenOut, amountIn, slippage } = params;
|
|
175
|
+
const requestParams = {
|
|
176
|
+
inputMint: tokenIn === constants_1.NATIVE_SOL ? constants_1.WRAPPED_SOL : tokenIn,
|
|
177
|
+
outputMint: tokenOut === constants_1.NATIVE_SOL ? constants_1.WRAPPED_SOL : tokenOut,
|
|
178
|
+
amount: parseInt(amountIn),
|
|
179
|
+
slippageBps: Math.round(slippage * 100),
|
|
180
|
+
};
|
|
181
|
+
return requestParams;
|
|
182
|
+
}
|
|
183
|
+
isJupiterPriceResponse(response) {
|
|
184
|
+
return (response && 'inputMint' in response && 'outputMint' in response && 'outAmount' in response);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
exports.JupiterService = JupiterService;
|
|
188
|
+
//# sourceMappingURL=jupiter.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jupiter.service.js","sourceRoot":"","sources":["../../../../src/protocols/jupiter/jupiter.service.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,gDAAwB;AAExB,6CAA4E;AAM5E,qDAAgE;AAChE,+CAA0E;AAC1E,yDAAmD;AACnD,iCAAmC;AAQnC,6CAAuD;AACvD,2EAAsE;AAEtE,IAAI,MAAe,CAAC;AAEpB,MAAa,cAAc;IAuBzB,YAAY,MAAyC;QAtBrC,aAAQ,GAAG,oBAAY,CAAC,OAAO,CAAC;QAChC,WAAM,GAAG,CAAC,mBAAW,CAAC,MAAM,CAAC,CAAC;QAC9B,gBAAW,GAAG,IAAI,CAAC;QACnB,eAAU,GAAG,KAAK,CAAC;QAEhB,wBAAmB,GAAmC;YACvE,0BAA0B,EAAE,IAAI;YAChC,gBAAgB,EAAE,KAAK;YACvB,yBAAyB;SAC1B,CAAC;QACiB,wBAAmB,GAAkC;YACtE,gBAAgB,EAAE,IAAI;YACtB,uBAAuB,EAAE,IAAI;YAC7B,eAAe,EAAE,IAAI;YACrB,wBAAwB,EAAE,KAAK;SAChC,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AAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC;QACzD,MAAM,aAAa,GAA0B;YAC3C,SAAS,EAAE,OAAO,KAAK,sBAAU,CAAC,CAAC,CAAC,uBAAW,CAAC,CAAC,CAAC,OAAO;YACzD,UAAU,EAAE,QAAQ,KAAK,sBAAU,CAAC,CAAC,CAAC,uBAAW,CAAC,CAAC,CAAC,QAAQ;YAC5D,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC;YAC1B,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,GAAG,CAAC;SACxC,CAAC;QACF,OAAO,aAAa,CAAC;IACvB,CAAC;IAES,sBAAsB,CAC9B,QAAkC;QAElC,OAAO,CACL,QAAQ,IAAI,WAAW,IAAI,QAAQ,IAAI,YAAY,IAAI,QAAQ,IAAI,WAAW,IAAI,QAAQ,CAC3F,CAAC;IACJ,CAAC;CACF;AA1OD,wCA0OC"}
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
export type JupiterConfig = {
|
|
2
|
+
jupiterPrivateUrl?: string;
|
|
3
|
+
};
|
|
4
|
+
export type JupiterSwapPlatformFee = {
|
|
5
|
+
amount: string;
|
|
6
|
+
feeBps: number;
|
|
7
|
+
};
|
|
8
|
+
export type JupiterSwapRoutePlanSwapInfo = {
|
|
9
|
+
ammKey: string;
|
|
10
|
+
label: string;
|
|
11
|
+
inputMint: string;
|
|
12
|
+
outputMint: string;
|
|
13
|
+
inAmount: string;
|
|
14
|
+
outAmount: string;
|
|
15
|
+
feeAmount: string;
|
|
16
|
+
feeMint: string;
|
|
17
|
+
};
|
|
18
|
+
export type JupiterSwapRoutePlan = {
|
|
19
|
+
swapInfo: JupiterSwapRoutePlanSwapInfo;
|
|
20
|
+
percent: number;
|
|
21
|
+
};
|
|
22
|
+
export type JupiterPriceResponse = {
|
|
23
|
+
inputMint: string;
|
|
24
|
+
inAmount: string;
|
|
25
|
+
outputMint: string;
|
|
26
|
+
outAmount: string;
|
|
27
|
+
otherAmountThreshold: string;
|
|
28
|
+
swapMode: 'ExactIn' | 'ExactOut';
|
|
29
|
+
slippageBps: number;
|
|
30
|
+
computedAutoSlippage?: number;
|
|
31
|
+
platformFee: JupiterSwapPlatformFee;
|
|
32
|
+
priceImpactPct: string;
|
|
33
|
+
routePlan: JupiterSwapRoutePlan[];
|
|
34
|
+
contextSlot: number;
|
|
35
|
+
timeTaken: number;
|
|
36
|
+
};
|
|
37
|
+
export type ComputeBudgetInstruction = {
|
|
38
|
+
programId: string;
|
|
39
|
+
accounts: any[];
|
|
40
|
+
data: string;
|
|
41
|
+
};
|
|
42
|
+
export type SetupInstruction = {
|
|
43
|
+
programId: string;
|
|
44
|
+
accounts: any[];
|
|
45
|
+
data: string;
|
|
46
|
+
};
|
|
47
|
+
export type Instructions = {
|
|
48
|
+
computeBudgetInstructions: ComputeBudgetInstruction[];
|
|
49
|
+
setupInstructions: SetupInstruction[];
|
|
50
|
+
};
|
|
51
|
+
export type JupiterPriceUrlParams = {
|
|
52
|
+
/**
|
|
53
|
+
* Required token mint address for the input token
|
|
54
|
+
* The token the user is swapping from
|
|
55
|
+
*/
|
|
56
|
+
inputMint: string;
|
|
57
|
+
/**
|
|
58
|
+
* Required token mint address for the output token
|
|
59
|
+
* The token the user is swapping to
|
|
60
|
+
*/
|
|
61
|
+
outputMint: string;
|
|
62
|
+
/**
|
|
63
|
+
* Required raw amount to swap (before decimals)
|
|
64
|
+
* - If swapMode=ExactIn: This is the input amount
|
|
65
|
+
* - If swapMode=ExactOut: This is the output amount
|
|
66
|
+
*/
|
|
67
|
+
amount: number;
|
|
68
|
+
/**
|
|
69
|
+
* Slippage tolerance in basis points (1 bp = 0.01%)
|
|
70
|
+
* Controls how much price movement is acceptable
|
|
71
|
+
* Example: 50 = 0.5% slippage tolerance
|
|
72
|
+
*/
|
|
73
|
+
slippageBps?: number;
|
|
74
|
+
/**
|
|
75
|
+
* Determines whether the input or output amount is fixed
|
|
76
|
+
* - ExactIn: User specifies exact input amount, output may vary within slippage
|
|
77
|
+
* - ExactOut: User specifies exact output amount, input may vary within slippage
|
|
78
|
+
* Note: Not all AMMs support ExactOut
|
|
79
|
+
* @default "ExactIn"
|
|
80
|
+
*/
|
|
81
|
+
swapMode?: 'ExactIn' | 'ExactOut';
|
|
82
|
+
/**
|
|
83
|
+
* Specific DEXes to use for routing
|
|
84
|
+
* If specified, the route will ONLY use these DEXes
|
|
85
|
+
* Multiple DEXes can be passed as an array
|
|
86
|
+
* Example: ["Raydium", "Orca V2", "Meteora DLMM"]
|
|
87
|
+
*/
|
|
88
|
+
dexes?: string[];
|
|
89
|
+
/**
|
|
90
|
+
* DEXes to exclude from routing
|
|
91
|
+
* If specified, the route will NOT use these DEXes
|
|
92
|
+
* Multiple DEXes can be passed as an array
|
|
93
|
+
* Example: ["Raydium", "Orca V2", "Meteora DLMM"]
|
|
94
|
+
*/
|
|
95
|
+
excludeDexes?: string[];
|
|
96
|
+
/**
|
|
97
|
+
* Restricts intermediate tokens within a route to a set of more stable tokens
|
|
98
|
+
* Helps reduce exposure to potential high slippage routes
|
|
99
|
+
* @default true
|
|
100
|
+
*/
|
|
101
|
+
restrictIntermediateTokens?: boolean;
|
|
102
|
+
/**
|
|
103
|
+
* Limits Jupiter routing to single hop routes only
|
|
104
|
+
* May result in worse pricing but simpler routes
|
|
105
|
+
* @default false
|
|
106
|
+
*/
|
|
107
|
+
onlyDirectRoutes?: boolean;
|
|
108
|
+
/**
|
|
109
|
+
* Uses legacy transaction format instead of versioned transaction
|
|
110
|
+
* @default false
|
|
111
|
+
*/
|
|
112
|
+
asLegacyTransaction?: boolean;
|
|
113
|
+
/**
|
|
114
|
+
* Platform fee in basis points (1 bp = 0.01%)
|
|
115
|
+
* Used together with feeAccount in /swap endpoint
|
|
116
|
+
*/
|
|
117
|
+
platformFeeBps?: number;
|
|
118
|
+
/**
|
|
119
|
+
* Rough estimate of the max accounts to be used for the quote
|
|
120
|
+
* Useful when composing your own transaction or for more precise resource accounting
|
|
121
|
+
* @default 64
|
|
122
|
+
*/
|
|
123
|
+
maxAccounts?: number;
|
|
124
|
+
/**
|
|
125
|
+
* Dynamic Slippage does not have any effect on price url
|
|
126
|
+
*/
|
|
127
|
+
dynamicSlippage?: boolean;
|
|
128
|
+
};
|
|
129
|
+
export type JupiterSwapUrlParams = {
|
|
130
|
+
/**
|
|
131
|
+
* Required public key of the user initiating the swap
|
|
132
|
+
* This is the account that will sign the transaction
|
|
133
|
+
*/
|
|
134
|
+
userPublicKey: string;
|
|
135
|
+
/**
|
|
136
|
+
* Required quote response object returned from a previous call to the quote endpoint
|
|
137
|
+
* Contains pricing information and routing details for the swap
|
|
138
|
+
*/
|
|
139
|
+
quoteResponse: object;
|
|
140
|
+
/**
|
|
141
|
+
* Whether to automatically wrap/unwrap SOL in the transaction
|
|
142
|
+
* If false, it will use wSOL token account
|
|
143
|
+
* Parameter will be ignored if destinationTokenAccount is set because the
|
|
144
|
+
* destinationTokenAccount may belong to a different user that we have no authority to close
|
|
145
|
+
* @default true
|
|
146
|
+
*/
|
|
147
|
+
wrapAndUnwrapSol?: boolean;
|
|
148
|
+
/**
|
|
149
|
+
* Enables the usage of shared program accounts
|
|
150
|
+
* Essential for complex routing that requires multiple intermediate token accounts
|
|
151
|
+
* The default is determined dynamically by the routing engine to optimize for compute units
|
|
152
|
+
* Note: shared accounts route will fail on some new AMMs with low liquidity tokens
|
|
153
|
+
*/
|
|
154
|
+
useSharedAccounts?: boolean;
|
|
155
|
+
/**
|
|
156
|
+
* Token account that will be used to collect fees
|
|
157
|
+
* The mint of the token account can only be either the input or output mint of the swap
|
|
158
|
+
* No longer requires using the Referral Program
|
|
159
|
+
*/
|
|
160
|
+
feeAccount?: string;
|
|
161
|
+
/**
|
|
162
|
+
* Any public key that belongs to you to track the transactions
|
|
163
|
+
* Useful for integrators to get all swap transactions from this public key
|
|
164
|
+
* Data can be queried using block explorers or analytics platforms
|
|
165
|
+
*/
|
|
166
|
+
trackingAccount?: string;
|
|
167
|
+
/**
|
|
168
|
+
* Specifies additional fees to prioritize the transaction
|
|
169
|
+
* Can be used for EITHER priority fee OR Jito tip (not both simultaneously)
|
|
170
|
+
* For both, use /swap-instructions endpoint
|
|
171
|
+
* Can be set to 0 to skip adding priority fees
|
|
172
|
+
*/
|
|
173
|
+
prioritizationFeeLamports?: {
|
|
174
|
+
/**
|
|
175
|
+
* Sets a priority level with a maximum lamport cap
|
|
176
|
+
*/
|
|
177
|
+
priorityLevelWithMaxLamports?: {
|
|
178
|
+
/**
|
|
179
|
+
* Priority level for transaction processing
|
|
180
|
+
*/
|
|
181
|
+
priorityLevel: 'medium' | 'high' | 'veryHigh';
|
|
182
|
+
/**
|
|
183
|
+
* Maximum lamports to cap the priority fee estimation
|
|
184
|
+
* Prevents overpaying for transaction priority
|
|
185
|
+
*/
|
|
186
|
+
maxLamports: number;
|
|
187
|
+
};
|
|
188
|
+
/**
|
|
189
|
+
* Exact amount of tip to use in a Jito tip instruction
|
|
190
|
+
* Must be used with a connection to a Jito RPC
|
|
191
|
+
*/
|
|
192
|
+
jitoTipLamports?: number;
|
|
193
|
+
} | number;
|
|
194
|
+
/**
|
|
195
|
+
* Builds a legacy transaction rather than the default versioned transaction
|
|
196
|
+
* Should be used together with asLegacyTransaction in /quote
|
|
197
|
+
* @default false
|
|
198
|
+
*/
|
|
199
|
+
asLegacyTransaction?: boolean;
|
|
200
|
+
/**
|
|
201
|
+
* Public key of a token account that will receive the output tokens
|
|
202
|
+
* If not provided, the signer's token account will be used
|
|
203
|
+
* If provided, we assume the token account is already initialized
|
|
204
|
+
*/
|
|
205
|
+
destinationTokenAccount?: string;
|
|
206
|
+
/**
|
|
207
|
+
* When enabled, performs a swap simulation to determine compute unit usage
|
|
208
|
+
* Sets the value in ComputeBudget's compute unit limit
|
|
209
|
+
* Requires one extra RPC call for simulation
|
|
210
|
+
* Recommended to estimate compute units correctly and reduce priority fees
|
|
211
|
+
* @default false
|
|
212
|
+
*/
|
|
213
|
+
dynamicComputeUnitLimit?: boolean;
|
|
214
|
+
/**
|
|
215
|
+
* When enabled, skips additional RPC calls to check required accounts
|
|
216
|
+
* Only enable when you've already set up all accounts needed for the transaction
|
|
217
|
+
* @default false
|
|
218
|
+
*/
|
|
219
|
+
skipUserAccountsRpcCalls?: boolean;
|
|
220
|
+
/**
|
|
221
|
+
* When enabled, estimates slippage and applies it directly in the swap transaction
|
|
222
|
+
* Overwrites the slippageBps parameter in the quote response
|
|
223
|
+
* Should be used together with dynamicSlippage in /quote
|
|
224
|
+
* @default false
|
|
225
|
+
*/
|
|
226
|
+
dynamicSlippage?: boolean;
|
|
227
|
+
/**
|
|
228
|
+
* Exact compute unit price to calculate priority fee
|
|
229
|
+
* Total fee = computeUnitLimit (1400000) * computeUnitPriceMicroLamports
|
|
230
|
+
* Using prioritizationFeeLamports with dynamicComputeUnitLimit is recommended instead
|
|
231
|
+
*/
|
|
232
|
+
computeUnitPriceMicroLamports?: number;
|
|
233
|
+
/**
|
|
234
|
+
* Number of slots for which the transaction will be valid
|
|
235
|
+
* Example: 10 slots ≈ 4 seconds (at ~400ms per slot) before expiration
|
|
236
|
+
*/
|
|
237
|
+
blockhashSlotsToExpiry?: number;
|
|
238
|
+
};
|
|
239
|
+
export type JupiterTransactionData = {
|
|
240
|
+
swapTransaction: string;
|
|
241
|
+
lastValidBlockHeight: number;
|
|
242
|
+
prioritizationFeeLamports: number;
|
|
243
|
+
computeUnitLimit: number;
|
|
244
|
+
prioritizationType: {
|
|
245
|
+
computeBudget: {
|
|
246
|
+
microLamports: number;
|
|
247
|
+
estimatedMicroLamports: number;
|
|
248
|
+
};
|
|
249
|
+
};
|
|
250
|
+
simulationSlot: number | null;
|
|
251
|
+
dynamicSlippageReport: {
|
|
252
|
+
slippageBps: number;
|
|
253
|
+
otherAmount: null;
|
|
254
|
+
simulatedIncurredSlippageBps: null;
|
|
255
|
+
amplificationRatio: null;
|
|
256
|
+
categoryName: string;
|
|
257
|
+
heuristicMaxSlippageBps: number;
|
|
258
|
+
rtseSlippageBps: null;
|
|
259
|
+
failedTxnEstSlippage: number;
|
|
260
|
+
emaEstSlippage: number;
|
|
261
|
+
} | null;
|
|
262
|
+
simulationError: {
|
|
263
|
+
errorCode: string;
|
|
264
|
+
error: string;
|
|
265
|
+
} | null;
|
|
266
|
+
addressesByLookupTableAddress: null;
|
|
267
|
+
transaction: string;
|
|
268
|
+
};
|
|
269
|
+
export type JupiterQuoteResponses = {
|
|
270
|
+
transactions: string[];
|
|
271
|
+
};
|
|
272
|
+
//# sourceMappingURL=jupiter.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jupiter.types.d.ts","sourceRoot":"","sources":["../../../../src/protocols/jupiter/jupiter.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG;IAC1B,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,EAAE,4BAA4B,CAAC;IACvC,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,oBAAoB,EAAE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ACnC,eAAe,EAAE,MAAM,CAAC;IACxB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,yBAAyB,EAAE,MAAM,CAAC;IAClC,gBAAgB,EAAE,MAAM,CAAC;IACzB,kBAAkB,EAAE;QAClB,aAAa,EAAE;YACb,aAAa,EAAE,MAAM,CAAC;YACtB,sBAAsB,EAAE,MAAM,CAAC;SAChC,CAAC;KACH,CAAC;IACF,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,qBAAqB,EAAE;QACrB,WAAW,EAAE,MAAM,CAAC;QACpB,WAAW,EAAE,IAAI,CAAC;QAClB,4BAA4B,EAAE,IAAI,CAAC;QACnC,kBAAkB,EAAE,IAAI,CAAC;QACzB,YAAY,EAAE,MAAM,CAAC;QACrB,uBAAuB,EAAE,MAAM,CAAC;QAChC,eAAe,EAAE,IAAI,CAAC;QACtB,oBAAoB,EAAE,MAAM,CAAC;QAC7B,cAAc,EAAE,MAAM,CAAC;KACxB,GAAG,IAAI,CAAC;IACT,eAAe,EAAE;QACf,SAAS,EAAE,MAAM,CAAC;QAClB,KAAK,EAAE,MAAM,CAAC;KACf,GAAG,IAAI,CAAC;IACT,6BAA6B,EAAE,IAAI,CAAC;IACpC,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jupiter.types.js","sourceRoot":"","sources":["../../../../src/protocols/jupiter/jupiter.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { KyberswapService } from './kyberswap.service';
|
|
2
|
+
export type { KyberswapConfig, KyberswapPriceRequestBody, KyberswapQuoteRequestBody, PoolExtra, ExtraFee, Pool, RouteSummary, KyberswapPriceResponse, KyberswapQuoteResponse, KyberswapMultiPriceParams, KyberswapMultiQuoteParams, } from './kyberswap.types';
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/protocols/kyberswap/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,YAAY,EACV,eAAe,EACf,yBAAyB,EACzB,yBAAyB,EACzB,SAAS,EACT,QAAQ,EACR,IAAI,EACJ,YAAY,EACZ,sBAAsB,EACtB,sBAAsB,EACtB,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.KyberswapService = void 0;
|
|
4
|
+
// Kyberswap Protocol - All exports
|
|
5
|
+
var kyberswap_service_1 = require("./kyberswap.service");
|
|
6
|
+
Object.defineProperty(exports, "KyberswapService", { enumerable: true, get: function () { return kyberswap_service_1.KyberswapService; } });
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/protocols/kyberswap/index.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AACnC,yDAAuD;AAA9C,qHAAA,gBAAgB,OAAA"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { IIntentProtocol } from '../../interfaces/intent-protocol';
|
|
2
|
+
import { ChainIdEnum, ProtocolEnum } from '../../types/enums';
|
|
3
|
+
import { IntentPriceParams } from '../../types/price-params';
|
|
4
|
+
import { PriceResponse, RawProtocolPriceResponse } from '../../types/price-response';
|
|
5
|
+
import { IntentQuoteParams } from '../../types/quote-params';
|
|
6
|
+
import { QuoteResponse } from '../../types/quote-response';
|
|
7
|
+
import { IntentsSDKConfig } from '../../types/sdk-config';
|
|
8
|
+
import { KyberswapConfig, KyberswapPriceRequestBody, KyberswapPriceResponse, KyberswapQuoteResponse } from './kyberswap.types';
|
|
9
|
+
export declare class KyberswapService implements IIntentProtocol {
|
|
10
|
+
readonly protocol = ProtocolEnum.KYBERSWAP;
|
|
11
|
+
readonly chains: ChainIdEnum[];
|
|
12
|
+
readonly singleChain = true;
|
|
13
|
+
readonly multiChain = false;
|
|
14
|
+
readonly priceEndpoint = "/api/v1/routes";
|
|
15
|
+
readonly quoteEndpoint = "/api/v1/route/build";
|
|
16
|
+
baseUrl: string;
|
|
17
|
+
clientId: string;
|
|
18
|
+
constructor(config: IntentsSDKConfig & KyberswapConfig);
|
|
19
|
+
isCorrectConfig<T extends {
|
|
20
|
+
[key: string]: string;
|
|
21
|
+
}>(config: {
|
|
22
|
+
[key: string]: string;
|
|
23
|
+
}): config is T;
|
|
24
|
+
fetchPrice(params: IntentPriceParams): Promise<Omit<PriceResponse, 'protocolResponse'> & {
|
|
25
|
+
protocolResponse: KyberswapPriceResponse;
|
|
26
|
+
}>;
|
|
27
|
+
fetchQuote(params: IntentQuoteParams): Promise<QuoteResponse & {
|
|
28
|
+
protocolResponse: KyberswapQuoteResponse;
|
|
29
|
+
}>;
|
|
30
|
+
protected priceParamsToRequestBody(params: IntentPriceParams): KyberswapPriceRequestBody;
|
|
31
|
+
protected validatePriceParams(params: IntentPriceParams): void;
|
|
32
|
+
protected isKyberswapPriceResponse(response: RawProtocolPriceResponse): response is KyberswapPriceResponse;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=kyberswap.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kyberswap.service.d.ts","sourceRoot":"","sources":["../../../../src/protocols/kyberswap/kyberswap.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAgB,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AA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