@7kprotocol/sdk-ts 2.2.2 → 2.3.0
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/lib/cjs/features/swap/buildTx.js +3 -0
- package/lib/cjs/features/swap/config.js +110 -0
- package/lib/cjs/features/swap/getQuote.js +16 -3
- package/lib/cjs/libs/protocols/aftermath/index.js +7 -13
- package/lib/cjs/libs/protocols/base.js +2 -1
- package/lib/cjs/libs/protocols/bluefin/index.js +3 -4
- package/lib/cjs/libs/protocols/bluemove/index.js +3 -4
- package/lib/cjs/libs/protocols/cetus/index.js +3 -4
- package/lib/cjs/libs/protocols/deepbook/index.js +5 -5
- package/lib/cjs/libs/protocols/deepbookV3/sponsored.js +3 -4
- package/lib/cjs/libs/protocols/flowx/index.js +3 -5
- package/lib/cjs/libs/protocols/flowxV3/index.js +50 -0
- package/lib/cjs/libs/protocols/index.js +2 -0
- package/lib/cjs/libs/swapWithRoute.js +2 -1
- package/lib/cjs/types/features/swap/buildTx.d.ts.map +1 -1
- package/lib/cjs/types/features/swap/config.d.ts +3 -0
- package/lib/cjs/types/features/swap/config.d.ts.map +1 -0
- package/lib/cjs/types/features/swap/getQuote.d.ts +5 -1
- package/lib/cjs/types/features/swap/getQuote.d.ts.map +1 -1
- package/lib/cjs/types/libs/protocols/aftermath/index.d.ts.map +1 -1
- package/lib/cjs/types/libs/protocols/base.d.ts +4 -2
- package/lib/cjs/types/libs/protocols/base.d.ts.map +1 -1
- package/lib/cjs/types/libs/protocols/bluefin/index.d.ts.map +1 -1
- package/lib/cjs/types/libs/protocols/bluemove/index.d.ts.map +1 -1
- package/lib/cjs/types/libs/protocols/cetus/index.d.ts.map +1 -1
- package/lib/cjs/types/libs/protocols/deepbook/index.d.ts.map +1 -1
- package/lib/cjs/types/libs/protocols/deepbookV3/sponsored.d.ts.map +1 -1
- package/lib/cjs/types/libs/protocols/flowx/index.d.ts.map +1 -1
- package/lib/cjs/types/libs/protocols/flowxV3/index.d.ts +9 -0
- package/lib/cjs/types/libs/protocols/flowxV3/index.d.ts.map +1 -0
- package/lib/cjs/types/libs/protocols/index.d.ts +2 -0
- package/lib/cjs/types/libs/protocols/index.d.ts.map +1 -1
- package/lib/cjs/types/libs/swapWithRoute.d.ts +3 -2
- package/lib/cjs/types/libs/swapWithRoute.d.ts.map +1 -1
- package/lib/cjs/types/types/aggregator.d.ts +50 -1
- package/lib/cjs/types/types/aggregator.d.ts.map +1 -1
- package/lib/esm/features/swap/buildTx.js +3 -0
- package/lib/esm/features/swap/config.js +96 -0
- package/lib/esm/features/swap/getQuote.js +16 -3
- package/lib/esm/libs/protocols/aftermath/index.js +7 -13
- package/lib/esm/libs/protocols/base.js +3 -1
- package/lib/esm/libs/protocols/bluefin/index.js +3 -4
- package/lib/esm/libs/protocols/bluemove/index.js +3 -4
- package/lib/esm/libs/protocols/cetus/index.js +3 -4
- package/lib/esm/libs/protocols/deepbook/index.js +5 -5
- package/lib/esm/libs/protocols/deepbookV3/sponsored.js +3 -4
- package/lib/esm/libs/protocols/flowx/index.js +3 -5
- package/lib/esm/libs/protocols/flowxV3/index.js +35 -0
- package/lib/esm/libs/protocols/index.js +2 -0
- package/lib/esm/libs/swapWithRoute.js +2 -1
- package/lib/esm/types/features/swap/buildTx.d.ts.map +1 -1
- package/lib/esm/types/features/swap/config.d.ts +3 -0
- package/lib/esm/types/features/swap/config.d.ts.map +1 -0
- package/lib/esm/types/features/swap/getQuote.d.ts +5 -1
- package/lib/esm/types/features/swap/getQuote.d.ts.map +1 -1
- package/lib/esm/types/libs/protocols/aftermath/index.d.ts.map +1 -1
- package/lib/esm/types/libs/protocols/base.d.ts +4 -2
- package/lib/esm/types/libs/protocols/base.d.ts.map +1 -1
- package/lib/esm/types/libs/protocols/bluefin/index.d.ts.map +1 -1
- package/lib/esm/types/libs/protocols/bluemove/index.d.ts.map +1 -1
- package/lib/esm/types/libs/protocols/cetus/index.d.ts.map +1 -1
- package/lib/esm/types/libs/protocols/deepbook/index.d.ts.map +1 -1
- package/lib/esm/types/libs/protocols/deepbookV3/sponsored.d.ts.map +1 -1
- package/lib/esm/types/libs/protocols/flowx/index.d.ts.map +1 -1
- package/lib/esm/types/libs/protocols/flowxV3/index.d.ts +9 -0
- package/lib/esm/types/libs/protocols/flowxV3/index.d.ts.map +1 -0
- package/lib/esm/types/libs/protocols/index.d.ts +2 -0
- package/lib/esm/types/libs/protocols/index.d.ts.map +1 -1
- package/lib/esm/types/libs/swapWithRoute.d.ts +3 -2
- package/lib/esm/types/libs/swapWithRoute.d.ts.map +1 -1
- package/lib/esm/types/types/aggregator.d.ts +50 -1
- package/lib/esm/types/types/aggregator.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -22,6 +22,7 @@ const token_1 = require("../../utils/token");
|
|
|
22
22
|
const sui_1 = require("../../utils/sui");
|
|
23
23
|
const _7k_1 = require("../../constants/_7k");
|
|
24
24
|
const utils_1 = require("@mysten/sui/utils");
|
|
25
|
+
const config_1 = require("./config");
|
|
25
26
|
const buildTx = (_a) => __awaiter(void 0, [_a], void 0, function* ({ quoteResponse, accountAddress, slippage, commission: _commission, devInspect, extendTx, }) {
|
|
26
27
|
const { tx: _tx, coinIn } = extendTx || {};
|
|
27
28
|
let coinOut;
|
|
@@ -47,6 +48,7 @@ const buildTx = (_a) => __awaiter(void 0, [_a], void 0, function* ({ quoteRespon
|
|
|
47
48
|
coinData = _data;
|
|
48
49
|
}
|
|
49
50
|
const coinObjects = [];
|
|
51
|
+
const config = yield (0, config_1.getConfig)();
|
|
50
52
|
yield Promise.all(routes.map((route, index) => __awaiter(void 0, void 0, void 0, function* () {
|
|
51
53
|
const inputCoinObject = coinData[index];
|
|
52
54
|
const coinRes = yield (0, swapWithRoute_1.swapWithRoute)({
|
|
@@ -54,6 +56,7 @@ const buildTx = (_a) => __awaiter(void 0, [_a], void 0, function* ({ quoteRespon
|
|
|
54
56
|
inputCoinObject,
|
|
55
57
|
currentAccount: accountAddress,
|
|
56
58
|
tx,
|
|
59
|
+
config,
|
|
57
60
|
});
|
|
58
61
|
if (coinRes) {
|
|
59
62
|
coinObjects.push(coinRes);
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.getConfig = getConfig;
|
|
13
|
+
let config = null;
|
|
14
|
+
let configTs = 0;
|
|
15
|
+
const DEFAULT_CONFIG = {
|
|
16
|
+
aftermath: {
|
|
17
|
+
name: "Aftermath",
|
|
18
|
+
package: "0xc4049b2d1cc0f6e017fda8260e4377cecd236bd7f56a54fee120816e72e2e0dd",
|
|
19
|
+
poolRegistry: "0xfcc774493db2c45c79f688f88d28023a3e7d98e4ee9f48bbf5c7990f651577ae",
|
|
20
|
+
protocolFeeVault: "0xf194d9b1bcad972e45a7dd67dd49b3ee1e3357a00a50850c52cd51bb450e13b4",
|
|
21
|
+
treasury: "0x28e499dff5e864a2eafe476269a4f5035f1c16f338da7be18b103499abf271ce",
|
|
22
|
+
insuranceFund: "0xf0c40d67b078000e18032334c3325c47b9ec9f3d9ae4128be820d54663d14e3b",
|
|
23
|
+
referralVault: "0x35d35b0e5b177593d8c3a801462485572fc30861e6ce96a55af6dc4730709278",
|
|
24
|
+
},
|
|
25
|
+
bluefin: {
|
|
26
|
+
name: "Bluefin",
|
|
27
|
+
package: "0x6c796c3ab3421a68158e0df18e4657b2827b1f8fed5ed4b82dba9c935988711b",
|
|
28
|
+
globalConfig: "0x03db251ba509a8d5d8777b6338836082335d93eecbdd09a11e190a1cff51c352",
|
|
29
|
+
},
|
|
30
|
+
bluemove: {
|
|
31
|
+
name: "Bluemove",
|
|
32
|
+
package: "0x08cd33481587d4c4612865b164796d937df13747d8c763b8a178c87e3244498f",
|
|
33
|
+
dexInfo: "0x3f2d9f724f4a1ce5e71676448dc452be9a6243dac9c5b975a588c8c867066e92",
|
|
34
|
+
},
|
|
35
|
+
cetus: {
|
|
36
|
+
name: "Cetus",
|
|
37
|
+
package: "0x6f5e582ede61fe5395b50c4a449ec11479a54d7ff8e0158247adfda60d98970b",
|
|
38
|
+
globalConfig: "0xdaa46292632c3c4d8f31f23ea0f9b36a28ff3677e9684980e4438403a67a3d8f",
|
|
39
|
+
},
|
|
40
|
+
deepbook: {
|
|
41
|
+
name: "Deepbook",
|
|
42
|
+
package: "0xdee9",
|
|
43
|
+
},
|
|
44
|
+
deepbook_v3: {
|
|
45
|
+
name: "Deepbook V3",
|
|
46
|
+
package: "",
|
|
47
|
+
sponsor: "0x951a01360d85b06722edf896852bf8005b81cdb26375235c935138987f629502",
|
|
48
|
+
sponsorFund: "0xf245e7a4b83ed9a26622f5818a158c2ba7a03b91e62717b557a7df1d4dab38df",
|
|
49
|
+
},
|
|
50
|
+
flowx: {
|
|
51
|
+
name: "Flowx Finance",
|
|
52
|
+
package: "0xba153169476e8c3114962261d1edc70de5ad9781b83cc617ecc8c1923191cae0",
|
|
53
|
+
container: "0xb65dcbf63fd3ad5d0ebfbf334780dc9f785eff38a4459e37ab08fa79576ee511",
|
|
54
|
+
},
|
|
55
|
+
flowx_v3: {
|
|
56
|
+
name: "Flowx Finance V3",
|
|
57
|
+
package: "0x25929e7f29e0a30eb4e692952ba1b5b65a3a4d65ab5f2a32e1ba3edcb587f26d",
|
|
58
|
+
registry: "0x27565d24a4cd51127ac90e4074a841bbe356cca7bf5759ddc14a975be1632abc",
|
|
59
|
+
version: "0x67624a1533b5aff5d0dfcf5e598684350efd38134d2d245f475524c03a64e656",
|
|
60
|
+
},
|
|
61
|
+
kriya: {
|
|
62
|
+
name: "Kriya",
|
|
63
|
+
package: "0xa0eba10b173538c8fecca1dff298e488402cc9ff374f8a12ca7758eebe830b66",
|
|
64
|
+
},
|
|
65
|
+
kriya_v3: {
|
|
66
|
+
name: "Kriya V3",
|
|
67
|
+
package: "0xbd8d4489782042c6fafad4de4bc6a5e0b84a43c6c00647ffd7062d1e2bb7549e",
|
|
68
|
+
version: "0xf5145a7ac345ca8736cf8c76047d00d6d378f30e81be6f6eb557184d9de93c78",
|
|
69
|
+
},
|
|
70
|
+
obric: {
|
|
71
|
+
name: "Obric",
|
|
72
|
+
package: "0xb84e63d22ea4822a0a333c250e790f69bf5c2ef0c63f4e120e05a6415991368f",
|
|
73
|
+
pythState: "0x1f9310238ee9298fb703c3419030b35b22bb1cc37113e3bb5007c99aec79e5b8",
|
|
74
|
+
},
|
|
75
|
+
springsui: {
|
|
76
|
+
name: "SpringSui",
|
|
77
|
+
package: "0x82e6f4f75441eae97d2d5850f41a09d28c7b64a05b067d37748d471f43aaf3f7",
|
|
78
|
+
},
|
|
79
|
+
stsui: {
|
|
80
|
+
name: "AlphaFi stSUI",
|
|
81
|
+
package: "0x059f94b85c07eb74d2847f8255d8cc0a67c9a8dcc039eabf9f8b9e23a0de2700",
|
|
82
|
+
},
|
|
83
|
+
suiswap: {
|
|
84
|
+
name: "SuiSwap",
|
|
85
|
+
package: "0xd075d51486df71e750872b4edf82ea3409fda397ceecc0b6aedf573d923c54a0",
|
|
86
|
+
},
|
|
87
|
+
turbos: {
|
|
88
|
+
name: "Turbos Finance",
|
|
89
|
+
package: "0x1a3c42ded7b75cdf4ebc7c7b7da9d1e1db49f16fcdca934fac003f35f39ecad9",
|
|
90
|
+
version: "0xf1cf0e81048df168ebeb1b8030fad24b3e0b53ae827c25053fff0779c1445b6f",
|
|
91
|
+
},
|
|
92
|
+
};
|
|
93
|
+
function getConfig() {
|
|
94
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
95
|
+
const ttl = typeof window === "undefined" ? 60 : 10 * 60;
|
|
96
|
+
if (config && Date.now() - configTs < ttl * 1000) {
|
|
97
|
+
return config;
|
|
98
|
+
}
|
|
99
|
+
try {
|
|
100
|
+
const response = yield fetch(`https://api.7k.ag/config`);
|
|
101
|
+
const quoteResponse = (yield response.json());
|
|
102
|
+
config = quoteResponse;
|
|
103
|
+
configTs = Date.now();
|
|
104
|
+
return quoteResponse;
|
|
105
|
+
}
|
|
106
|
+
catch (error) {
|
|
107
|
+
return DEFAULT_CONFIG;
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
}
|
|
@@ -11,7 +11,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.DEFAULT_SOURCES = void 0;
|
|
13
13
|
exports.getQuote = getQuote;
|
|
14
|
-
const
|
|
14
|
+
const utils_1 = require("@mysten/sui/utils");
|
|
15
15
|
exports.DEFAULT_SOURCES = [
|
|
16
16
|
"suiswap",
|
|
17
17
|
"turbos",
|
|
@@ -23,14 +23,27 @@ exports.DEFAULT_SOURCES = [
|
|
|
23
23
|
"deepbook",
|
|
24
24
|
"deepbook_v3",
|
|
25
25
|
"flowx",
|
|
26
|
+
"flowx_v3",
|
|
26
27
|
"bluefin",
|
|
27
28
|
"springsui",
|
|
28
29
|
"obric",
|
|
29
30
|
"stsui",
|
|
30
31
|
];
|
|
31
32
|
function getQuote(_a) {
|
|
32
|
-
return __awaiter(this, arguments, void 0, function* ({ tokenIn, tokenOut, amountIn, sources = exports.DEFAULT_SOURCES, }) {
|
|
33
|
-
const
|
|
33
|
+
return __awaiter(this, arguments, void 0, function* ({ tokenIn, tokenOut, amountIn, sources = exports.DEFAULT_SOURCES, targetPools, excludedPools, }) {
|
|
34
|
+
const params = new URLSearchParams({
|
|
35
|
+
amount: amountIn,
|
|
36
|
+
from: (0, utils_1.normalizeStructTag)(tokenIn),
|
|
37
|
+
to: (0, utils_1.normalizeStructTag)(tokenOut),
|
|
38
|
+
sources: sources.join(","),
|
|
39
|
+
});
|
|
40
|
+
if (targetPools === null || targetPools === void 0 ? void 0 : targetPools.length) {
|
|
41
|
+
params.append("target_pools", targetPools.map((v) => (0, utils_1.normalizeSuiObjectId)(v)).join(","));
|
|
42
|
+
}
|
|
43
|
+
if (excludedPools === null || excludedPools === void 0 ? void 0 : excludedPools.length) {
|
|
44
|
+
params.append("excluded_pools", excludedPools.map((v) => (0, utils_1.normalizeSuiObjectId)(v)).join(","));
|
|
45
|
+
}
|
|
46
|
+
const response = yield fetch(`https://api.7k.ag/quote?${params}`);
|
|
34
47
|
if (!response.ok) {
|
|
35
48
|
throw new Error("Failed to fetch aggregator quote");
|
|
36
49
|
}
|
|
@@ -12,13 +12,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.AfterMathContract = void 0;
|
|
13
13
|
const base_1 = require("../base");
|
|
14
14
|
const token_1 = require("../../../utils/token");
|
|
15
|
-
const PACKAGE_ID = "0xc4049b2d1cc0f6e017fda8260e4377cecd236bd7f56a54fee120816e72e2e0dd";
|
|
16
|
-
const MODULE_NAME = "swap";
|
|
17
|
-
const POOL_REGISTRY = "0xfcc774493db2c45c79f688f88d28023a3e7d98e4ee9f48bbf5c7990f651577ae";
|
|
18
|
-
const PROTOCOL_FEE_VAULT = "0xf194d9b1bcad972e45a7dd67dd49b3ee1e3357a00a50850c52cd51bb450e13b4";
|
|
19
|
-
const TREASURY = "0x28e499dff5e864a2eafe476269a4f5035f1c16f338da7be18b103499abf271ce";
|
|
20
|
-
const INSURANCE_FUND = "0xf0c40d67b078000e18032334c3325c47b9ec9f3d9ae4128be820d54663d14e3b";
|
|
21
|
-
const REFERRAL_VAULT = "0x35d35b0e5b177593d8c3a801462485572fc30861e6ce96a55af6dc4730709278";
|
|
22
15
|
class AfterMathContract extends base_1.BaseContract {
|
|
23
16
|
swap(tx) {
|
|
24
17
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -30,16 +23,17 @@ class AfterMathContract extends base_1.BaseContract {
|
|
|
30
23
|
const [lpCoinType] = this.getTypeParams();
|
|
31
24
|
if (!lpCoinType)
|
|
32
25
|
throw new Error("lpCoinType is not defined");
|
|
26
|
+
const config = this.config.aftermath;
|
|
33
27
|
const [tokenOut] = tx.moveCall({
|
|
34
|
-
target: `${
|
|
28
|
+
target: `${config.package}::swap::swap_exact_in`,
|
|
35
29
|
typeArguments: [lpCoinType, coinInType, coinOutType],
|
|
36
30
|
arguments: [
|
|
37
31
|
tx.object(poolId),
|
|
38
|
-
tx.object(
|
|
39
|
-
tx.object(
|
|
40
|
-
tx.object(
|
|
41
|
-
tx.object(
|
|
42
|
-
tx.object(
|
|
32
|
+
tx.object(config.poolRegistry),
|
|
33
|
+
tx.object(config.protocolFeeVault),
|
|
34
|
+
tx.object(config.treasury),
|
|
35
|
+
tx.object(config.insuranceFund),
|
|
36
|
+
tx.object(config.referralVault),
|
|
43
37
|
inputCoinObject,
|
|
44
38
|
tx.pure.u64(returnAmount),
|
|
45
39
|
tx.pure.u64("1000000000000000000"), // slippage
|
|
@@ -4,10 +4,11 @@ exports.BaseContract = void 0;
|
|
|
4
4
|
const utils_1 = require("@mysten/sui/utils");
|
|
5
5
|
const sui_1 = require("../../utils/sui");
|
|
6
6
|
class BaseContract {
|
|
7
|
-
constructor({ swapInfo, inputCoinObject, currentAccount, }) {
|
|
7
|
+
constructor({ swapInfo, inputCoinObject, currentAccount, config, }) {
|
|
8
8
|
this.swapInfo = swapInfo;
|
|
9
9
|
this.inputCoinObject = inputCoinObject;
|
|
10
10
|
this.currentAccount = currentAccount;
|
|
11
|
+
this.config = config;
|
|
11
12
|
}
|
|
12
13
|
getInputCoinValue(tx) {
|
|
13
14
|
return sui_1.SuiUtils.getCoinValue(this.swapInfo.assetIn, this.inputCoinObject, tx);
|
|
@@ -18,8 +18,6 @@ const utils_1 = require("@mysten/sui/utils");
|
|
|
18
18
|
const utils_2 = require("../utils");
|
|
19
19
|
const bn_js_1 = __importDefault(require("bn.js"));
|
|
20
20
|
const sui_1 = require("../../../utils/sui");
|
|
21
|
-
const PACKAGE_ID = "0x6c796c3ab3421a68158e0df18e4657b2827b1f8fed5ed4b82dba9c935988711b";
|
|
22
|
-
const CONFIG_ID = "0x03db251ba509a8d5d8777b6338836082335d93eecbdd09a11e190a1cff51c352";
|
|
23
21
|
class BluefinContract extends base_1.BaseContract {
|
|
24
22
|
swap(tx) {
|
|
25
23
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -28,12 +26,13 @@ class BluefinContract extends base_1.BaseContract {
|
|
|
28
26
|
const amountIn = this.getInputCoinValue(tx);
|
|
29
27
|
const coinInBalance = sui_1.SuiUtils.coinIntoBalance(tx, this.swapInfo.assetIn, this.inputCoinObject);
|
|
30
28
|
const coinOutBalance = sui_1.SuiUtils.zeroBalance(tx, this.swapInfo.assetOut);
|
|
29
|
+
const config = this.config.bluefin;
|
|
31
30
|
const [balanceOutX, balanceOutY] = tx.moveCall({
|
|
32
|
-
target: `${
|
|
31
|
+
target: `${config.package}::pool::swap`,
|
|
33
32
|
typeArguments: [coinX.address, coinY.address],
|
|
34
33
|
arguments: [
|
|
35
34
|
tx.object(utils_1.SUI_CLOCK_OBJECT_ID),
|
|
36
|
-
tx.object(
|
|
35
|
+
tx.object(config.globalConfig),
|
|
37
36
|
tx.object(this.swapInfo.poolId),
|
|
38
37
|
swapXtoY ? coinInBalance : coinOutBalance,
|
|
39
38
|
swapXtoY ? coinOutBalance : coinInBalance,
|
|
@@ -12,13 +12,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.BluemoveContract = void 0;
|
|
13
13
|
const base_1 = require("../base");
|
|
14
14
|
const sui_1 = require("../../../utils/sui");
|
|
15
|
-
const PACKAGE_ID = "0x08cd33481587d4c4612865b164796d937df13747d8c763b8a178c87e3244498f";
|
|
16
|
-
const DEX_INFO_ID = "0x3f2d9f724f4a1ce5e71676448dc452be9a6243dac9c5b975a588c8c867066e92";
|
|
17
15
|
class BluemoveContract extends base_1.BaseContract {
|
|
18
16
|
swap(tx) {
|
|
19
17
|
return __awaiter(this, void 0, void 0, function* () {
|
|
18
|
+
const config = this.config.bluemove;
|
|
20
19
|
const [coinOut] = tx.moveCall({
|
|
21
|
-
target: `${
|
|
20
|
+
target: `${config.package}::router::swap_exact_input_`,
|
|
22
21
|
typeArguments: [this.swapInfo.assetIn, this.swapInfo.assetOut],
|
|
23
22
|
arguments: [
|
|
24
23
|
sui_1.SuiUtils.getCoinValue(this.swapInfo.swapXtoY
|
|
@@ -26,7 +25,7 @@ class BluemoveContract extends base_1.BaseContract {
|
|
|
26
25
|
: this.swapInfo.coinY.type, this.inputCoinObject, tx), // input amount
|
|
27
26
|
this.inputCoinObject, // input coin
|
|
28
27
|
tx.pure.u64(0), // min output amount
|
|
29
|
-
tx.object(
|
|
28
|
+
tx.object(config.dexInfo),
|
|
30
29
|
],
|
|
31
30
|
});
|
|
32
31
|
return coinOut;
|
|
@@ -14,8 +14,6 @@ const base_1 = require("../base");
|
|
|
14
14
|
const utils_1 = require("@mysten/sui/utils");
|
|
15
15
|
const utils_2 = require("../utils");
|
|
16
16
|
const sui_1 = require("../../../utils/sui");
|
|
17
|
-
const GLOBAL_CONFIG_ID = "0xdaa46292632c3c4d8f31f23ea0f9b36a28ff3677e9684980e4438403a67a3d8f";
|
|
18
|
-
const INTEGRATE_PACKAGE_ID = "0x6f5e582ede61fe5395b50c4a449ec11479a54d7ff8e0158247adfda60d98970b";
|
|
19
17
|
class CetusContract extends base_1.BaseContract {
|
|
20
18
|
swap(tx) {
|
|
21
19
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -32,11 +30,12 @@ class CetusContract extends base_1.BaseContract {
|
|
|
32
30
|
const amountIn = sui_1.SuiUtils.getCoinValue(this.swapInfo.swapXtoY
|
|
33
31
|
? this.swapInfo.coinX.type
|
|
34
32
|
: this.swapInfo.coinY.type, this.inputCoinObject, tx);
|
|
33
|
+
const config = this.config.cetus;
|
|
35
34
|
const [receiveA, receiveB] = tx.moveCall({
|
|
36
|
-
target: `${
|
|
35
|
+
target: `${config.package}::router::swap`,
|
|
37
36
|
typeArguments,
|
|
38
37
|
arguments: [
|
|
39
|
-
tx.object(
|
|
38
|
+
tx.object(config.globalConfig),
|
|
40
39
|
tx.object(this.swapInfo.poolId),
|
|
41
40
|
this.swapInfo.swapXtoY ? this.inputCoinObject : zeroOut, // coin A
|
|
42
41
|
this.swapInfo.swapXtoY ? zeroOut : this.inputCoinObject, // coin B
|
|
@@ -14,7 +14,6 @@ const utils_1 = require("@mysten/sui/utils");
|
|
|
14
14
|
const base_1 = require("../base");
|
|
15
15
|
const _7k_1 = require("../../../constants/_7k");
|
|
16
16
|
const sui_1 = require("../../../utils/sui");
|
|
17
|
-
const PACKAGE_ID = "0xdee9";
|
|
18
17
|
const MODULE_NAME = "clob_v2";
|
|
19
18
|
class DeepBookContract extends base_1.BaseContract {
|
|
20
19
|
swap(tx) {
|
|
@@ -28,6 +27,7 @@ class DeepBookContract extends base_1.BaseContract {
|
|
|
28
27
|
const [baseAsset, quoteAsset] = typeArgs;
|
|
29
28
|
const accountCap = this.createAccountCap(tx);
|
|
30
29
|
const amountIn = this.getInputCoinValue(tx);
|
|
30
|
+
const config = this.config.deepbook;
|
|
31
31
|
let result;
|
|
32
32
|
if (swapXtoY) {
|
|
33
33
|
const amountInRound = tx.moveCall({
|
|
@@ -38,7 +38,7 @@ class DeepBookContract extends base_1.BaseContract {
|
|
|
38
38
|
],
|
|
39
39
|
});
|
|
40
40
|
const [base_coin_ret, quote_coin_ret] = tx.moveCall({
|
|
41
|
-
target: `${
|
|
41
|
+
target: `${config.package}::${MODULE_NAME}::swap_exact_base_for_quote`,
|
|
42
42
|
typeArguments: [baseAsset, quoteAsset],
|
|
43
43
|
arguments: [
|
|
44
44
|
tx.object(poolId),
|
|
@@ -60,7 +60,7 @@ class DeepBookContract extends base_1.BaseContract {
|
|
|
60
60
|
}
|
|
61
61
|
else {
|
|
62
62
|
const [base_coin_ret, quote_coin_ret] = tx.moveCall({
|
|
63
|
-
target: `${
|
|
63
|
+
target: `${config.package}::${MODULE_NAME}::swap_exact_quote_for_base`,
|
|
64
64
|
typeArguments: [baseAsset, quoteAsset],
|
|
65
65
|
arguments: [
|
|
66
66
|
tx.object(poolId),
|
|
@@ -81,14 +81,14 @@ class DeepBookContract extends base_1.BaseContract {
|
|
|
81
81
|
createAccountCap(tx) {
|
|
82
82
|
const [cap] = tx.moveCall({
|
|
83
83
|
typeArguments: [],
|
|
84
|
-
target: `${
|
|
84
|
+
target: `${this.config.deepbook.package}::${MODULE_NAME}::create_account`,
|
|
85
85
|
arguments: [],
|
|
86
86
|
});
|
|
87
87
|
return cap;
|
|
88
88
|
}
|
|
89
89
|
deleteAccountCap(tx, accountCap) {
|
|
90
90
|
tx.moveCall({
|
|
91
|
-
target: `${
|
|
91
|
+
target: `${this.config.deepbook.package}::custodian_v2::delete_account_cap`,
|
|
92
92
|
arguments: [accountCap],
|
|
93
93
|
});
|
|
94
94
|
}
|
|
@@ -13,19 +13,18 @@ exports.SponsoredDeepBookV3Contract = void 0;
|
|
|
13
13
|
const base_1 = require("../base");
|
|
14
14
|
const utils_1 = require("@mysten/sui/utils");
|
|
15
15
|
const sui_1 = require("../../../utils/sui");
|
|
16
|
-
const PACKAGE_ID = "0x951a01360d85b06722edf896852bf8005b81cdb26375235c935138987f629502";
|
|
17
|
-
const FUND_ID = "0xf245e7a4b83ed9a26622f5818a158c2ba7a03b91e62717b557a7df1d4dab38df";
|
|
18
16
|
class SponsoredDeepBookV3Contract extends base_1.BaseContract {
|
|
19
17
|
swap(tx) {
|
|
20
18
|
return __awaiter(this, void 0, void 0, function* () {
|
|
21
19
|
const [coinX] = this.swapInfo.pool.allTokens;
|
|
22
20
|
const swapXtoY = (0, utils_1.normalizeStructTag)(coinX.address) ===
|
|
23
21
|
(0, utils_1.normalizeStructTag)(this.swapInfo.assetIn);
|
|
22
|
+
const config = this.config.deepbook_v3;
|
|
24
23
|
const [base, quote] = tx.moveCall({
|
|
25
|
-
target: `${
|
|
24
|
+
target: `${config.sponsor}::sponsored::${swapXtoY ? "swap_exact_base_for_quote" : "swap_exact_quote_for_base"}`,
|
|
26
25
|
typeArguments: this.getTypeParams(),
|
|
27
26
|
arguments: [
|
|
28
|
-
tx.object(
|
|
27
|
+
tx.object(config.sponsorFund),
|
|
29
28
|
tx.object(this.swapInfo.poolId),
|
|
30
29
|
this.inputCoinObject,
|
|
31
30
|
tx.pure.u64(0),
|
|
@@ -11,18 +11,16 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.FlowXContract = void 0;
|
|
13
13
|
const base_1 = require("../base");
|
|
14
|
-
const PACKAGE_ID = "0xba153169476e8c3114962261d1edc70de5ad9781b83cc617ecc8c1923191cae0";
|
|
15
|
-
const MODULE_NAME = "router";
|
|
16
|
-
const CONTAINER_OBJECT_ID = "0xb65dcbf63fd3ad5d0ebfbf334780dc9f785eff38a4459e37ab08fa79576ee511";
|
|
17
14
|
class FlowXContract extends base_1.BaseContract {
|
|
18
15
|
swap(tx) {
|
|
19
16
|
return __awaiter(this, void 0, void 0, function* () {
|
|
20
17
|
const coinInType = this.swapInfo.assetIn;
|
|
21
18
|
const coinOutType = this.swapInfo.assetOut;
|
|
19
|
+
const config = this.config.flowx;
|
|
22
20
|
const [tokenOut] = tx.moveCall({
|
|
23
|
-
target: `${
|
|
21
|
+
target: `${config.package}::router::swap_exact_input_direct`,
|
|
24
22
|
typeArguments: [coinInType, coinOutType],
|
|
25
|
-
arguments: [tx.object(
|
|
23
|
+
arguments: [tx.object(config.container), this.inputCoinObject],
|
|
26
24
|
});
|
|
27
25
|
return tokenOut;
|
|
28
26
|
});
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.FlowxV3Contract = void 0;
|
|
13
|
+
const utils_1 = require("@mysten/sui/utils");
|
|
14
|
+
const base_1 = require("../base");
|
|
15
|
+
const utils_2 = require("../utils");
|
|
16
|
+
const bn_js_1 = require("bn.js");
|
|
17
|
+
class FlowxV3Contract extends base_1.BaseContract {
|
|
18
|
+
swap(tx) {
|
|
19
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
+
const [coinX, coinY] = this.swapInfo.pool.allTokens;
|
|
21
|
+
const swapXtoY = this.swapInfo.swapXtoY;
|
|
22
|
+
const swapFeeRate = this.swapInfo.extra.swapFeeRate;
|
|
23
|
+
if (!swapFeeRate) {
|
|
24
|
+
throw new Error("swapFeeRate is required");
|
|
25
|
+
}
|
|
26
|
+
const config = this.config.flowx_v3;
|
|
27
|
+
const [coinOut] = tx.moveCall({
|
|
28
|
+
target: `${config.package}::swap_router::swap_exact_input`,
|
|
29
|
+
typeArguments: [
|
|
30
|
+
swapXtoY ? coinX.address : coinY.address,
|
|
31
|
+
swapXtoY ? coinY.address : coinX.address,
|
|
32
|
+
],
|
|
33
|
+
arguments: [
|
|
34
|
+
tx.object(config.registry),
|
|
35
|
+
tx.pure.u64(swapFeeRate), // swap fee rate to lookup pool in the registry
|
|
36
|
+
this.inputCoinObject,
|
|
37
|
+
tx.pure.u64(0), // min amount out
|
|
38
|
+
tx.pure.u128((0, utils_2.getDefaultSqrtPriceLimit)(swapXtoY)
|
|
39
|
+
.add(swapXtoY ? new bn_js_1.BN(1) : new bn_js_1.BN(-1))
|
|
40
|
+
.toString(10)), // sqrt price limit
|
|
41
|
+
tx.pure.u64("18446744073709551615"), // u64 max value
|
|
42
|
+
tx.object(config.version),
|
|
43
|
+
tx.object(utils_1.SUI_CLOCK_OBJECT_ID),
|
|
44
|
+
],
|
|
45
|
+
});
|
|
46
|
+
return coinOut;
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.FlowxV3Contract = FlowxV3Contract;
|
|
@@ -15,6 +15,7 @@ const bluefin_1 = require("./bluefin");
|
|
|
15
15
|
const springsui_1 = require("./springsui");
|
|
16
16
|
const obric_1 = require("./obric");
|
|
17
17
|
const stsui_1 = require("./stsui");
|
|
18
|
+
const flowxV3_1 = require("./flowxV3");
|
|
18
19
|
exports.ProtocolContract = {
|
|
19
20
|
cetus: cetus_1.CetusContract,
|
|
20
21
|
turbos: turbos_1.TurbosContract,
|
|
@@ -25,6 +26,7 @@ exports.ProtocolContract = {
|
|
|
25
26
|
deepbook: deepbook_1.DeepBookContract,
|
|
26
27
|
deepbook_v3: sponsored_1.SponsoredDeepBookV3Contract,
|
|
27
28
|
flowx: flowx_1.FlowXContract,
|
|
29
|
+
flowx_v3: flowxV3_1.FlowxV3Contract,
|
|
28
30
|
kriya_v3: kriyaV3_1.KriyaV3Contract,
|
|
29
31
|
bluefin: bluefin_1.BluefinContract,
|
|
30
32
|
springsui: springsui_1.SpringSuiContract,
|
|
@@ -12,7 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.swapWithRoute = swapWithRoute;
|
|
13
13
|
const protocols_1 = require("./protocols");
|
|
14
14
|
function swapWithRoute(_a) {
|
|
15
|
-
return __awaiter(this, arguments, void 0, function* ({ route, inputCoinObject, currentAccount, tx, }) {
|
|
15
|
+
return __awaiter(this, arguments, void 0, function* ({ route, inputCoinObject, currentAccount, config, tx, }) {
|
|
16
16
|
let inputTokenObject = inputCoinObject;
|
|
17
17
|
let txbResultToReturn;
|
|
18
18
|
for (const swap of route) {
|
|
@@ -21,6 +21,7 @@ function swapWithRoute(_a) {
|
|
|
21
21
|
swapInfo: swap,
|
|
22
22
|
inputCoinObject: inputTokenObject,
|
|
23
23
|
currentAccount,
|
|
24
|
+
config,
|
|
24
25
|
});
|
|
25
26
|
const tokenOut = yield contractInstance.swap(tx);
|
|
26
27
|
inputTokenObject = tokenOut;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildTx.d.ts","sourceRoot":"","sources":["../../../../../src/features/swap/buildTx.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,yBAAyB,EAE1B,MAAM,0BAA0B,CAAC;AAOlC,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"buildTx.d.ts","sourceRoot":"","sources":["../../../../../src/features/swap/buildTx.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,yBAAyB,EAE1B,MAAM,0BAA0B,CAAC;AAOlC,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAK/C,eAAO,MAAM,OAAO,gGAOjB,aAAa;;;EAmGf,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../src/features/swap/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AA+GhD,wBAAsB,SAAS,oBAe9B"}
|
|
@@ -4,8 +4,12 @@ interface Params {
|
|
|
4
4
|
tokenOut: string;
|
|
5
5
|
amountIn: string;
|
|
6
6
|
sources?: SourceDex[];
|
|
7
|
+
/** Limit the route to a specific set of pools */
|
|
8
|
+
targetPools?: string[];
|
|
9
|
+
/** Exclude a specific set of pools from the route */
|
|
10
|
+
excludedPools?: string[];
|
|
7
11
|
}
|
|
8
12
|
export declare const DEFAULT_SOURCES: SourceDex[];
|
|
9
|
-
export declare function getQuote({ tokenIn, tokenOut, amountIn, sources, }: Params): Promise<QuoteResponse>;
|
|
13
|
+
export declare function getQuote({ tokenIn, tokenOut, amountIn, sources, targetPools, excludedPools, }: Params): Promise<QuoteResponse>;
|
|
10
14
|
export {};
|
|
11
15
|
//# sourceMappingURL=getQuote.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getQuote.d.ts","sourceRoot":"","sources":["../../../../../src/features/swap/getQuote.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getQuote.d.ts","sourceRoot":"","sources":["../../../../../src/features/swap/getQuote.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAElE,UAAU,MAAM;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,SAAS,EAAE,CAAC;IACtB,iDAAiD;IACjD,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,qDAAqD;IACrD,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CAC1B;AAED,eAAO,MAAM,eAAe,EAAE,SAAS,EAgBtC,CAAC;AAEF,wBAAsB,QAAQ,CAAC,EAC7B,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,OAAyB,EACzB,WAAW,EACX,aAAa,GACd,EAAE,MAAM,0BA2BR"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/protocols/aftermath/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/protocols/aftermath/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAGvC,qBAAa,iBAAkB,SAAQ,YAAY;IAC3C,IAAI,CAAC,EAAE,EAAE,WAAW;;;;CA4B3B"}
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { Transaction } from "@mysten/sui/transactions";
|
|
2
|
-
import { TxSorSwap } from "../../types/aggregator";
|
|
2
|
+
import { Config, TxSorSwap } from "../../types/aggregator";
|
|
3
3
|
import { TransactionResultItem } from "../../types/sui";
|
|
4
4
|
export interface BaseContractParams {
|
|
5
5
|
swapInfo: TxSorSwap;
|
|
6
6
|
inputCoinObject: TransactionResultItem;
|
|
7
7
|
currentAccount: string;
|
|
8
|
+
config: Config;
|
|
8
9
|
}
|
|
9
10
|
export declare abstract class BaseContract {
|
|
10
11
|
protected swapInfo: TxSorSwap;
|
|
11
12
|
protected inputCoinObject: TransactionResultItem;
|
|
12
13
|
protected currentAccount: string;
|
|
13
|
-
|
|
14
|
+
protected config: Config;
|
|
15
|
+
constructor({ swapInfo, inputCoinObject, currentAccount, config, }: BaseContractParams);
|
|
14
16
|
abstract swap(tx: Transaction): Promise<TransactionResultItem>;
|
|
15
17
|
protected getInputCoinValue(tx: Transaction): import("@mysten/sui/transactions").TransactionArgument;
|
|
16
18
|
protected getTypeParams(): string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../../../src/libs/protocols/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../../../src/libs/protocols/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAG3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAExD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,SAAS,CAAC;IACpB,eAAe,EAAE,qBAAqB,CAAC;IACvC,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,8BAAsB,YAAY;IAChC,SAAS,CAAC,QAAQ,EAAE,SAAS,CAAC;IAC9B,SAAS,CAAC,eAAe,EAAE,qBAAqB,CAAC;IACjD,SAAS,CAAC,cAAc,EAAE,MAAM,CAAC;IACjC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC;gBAEb,EACV,QAAQ,EACR,eAAe,EACf,cAAc,EACd,MAAM,GACP,EAAE,kBAAkB;IAOrB,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,WAAW,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAE9D,SAAS,CAAC,iBAAiB,CAAC,EAAE,EAAE,WAAW;IAQ3C,SAAS,CAAC,aAAa;CAKxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/protocols/bluefin/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/protocols/bluefin/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAKvC,qBAAa,eAAgB,SAAQ,YAAY;IACzC,IAAI,CAAC,EAAE,EAAE,WAAW;;;;CA4C3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/protocols/bluemove/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/protocols/bluemove/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAGvC,qBAAa,gBAAiB,SAAQ,YAAY;IAC1C,IAAI,CAAC,EAAE,EAAE,WAAW;;;;CAqB3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/protocols/cetus/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/protocols/cetus/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAMvC,qBAAa,aAAc,SAAQ,YAAY;IACvC,IAAI,CAAC,EAAE,EAAE,WAAW;;;;CA4C3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/protocols/deepbook/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAGvD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/protocols/deepbook/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAGvD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAMvC,qBAAa,gBAAiB,SAAQ,YAAY;IAC1C,IAAI,CAAC,EAAE,EAAE,WAAW;;;;IAyE1B,OAAO,CAAC,gBAAgB;IASxB,OAAO,CAAC,gBAAgB;CAMzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sponsored.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/protocols/deepbookV3/sponsored.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"sponsored.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/protocols/deepbookV3/sponsored.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAG3D,qBAAa,2BAA4B,SAAQ,YAAY;IACrD,IAAI,CAAC,EAAE,EAAE,WAAW,GAAG,OAAO,CAAC,qBAAqB,CAAC;CA8B5D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/protocols/flowx/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/protocols/flowx/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,qBAAa,aAAc,SAAQ,YAAY;IACvC,IAAI,CAAC,EAAE,EAAE,WAAW;;;;CAa3B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Transaction } from "@mysten/sui/transactions";
|
|
2
|
+
import { BaseContract } from "../base";
|
|
3
|
+
export declare class FlowxV3Contract extends BaseContract {
|
|
4
|
+
swap(tx: Transaction): Promise<{
|
|
5
|
+
$kind: "NestedResult";
|
|
6
|
+
NestedResult: [number, number];
|
|
7
|
+
}>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/protocols/flowxV3/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAIvC,qBAAa,eAAgB,SAAQ,YAAY;IACzC,IAAI,CAAC,EAAE,EAAE,WAAW;;;;CAiC3B"}
|
|
@@ -12,6 +12,7 @@ import { BluefinContract } from "./bluefin";
|
|
|
12
12
|
import { SpringSuiContract } from "./springsui";
|
|
13
13
|
import { ObricContract } from "./obric";
|
|
14
14
|
import { StSuiContract } from "./stsui";
|
|
15
|
+
import { FlowxV3Contract } from "./flowxV3";
|
|
15
16
|
export declare const ProtocolContract: {
|
|
16
17
|
cetus: typeof CetusContract;
|
|
17
18
|
turbos: typeof TurbosContract;
|
|
@@ -22,6 +23,7 @@ export declare const ProtocolContract: {
|
|
|
22
23
|
deepbook: typeof DeepBookContract;
|
|
23
24
|
deepbook_v3: typeof SponsoredDeepBookV3Contract;
|
|
24
25
|
flowx: typeof FlowXContract;
|
|
26
|
+
flowx_v3: typeof FlowxV3Contract;
|
|
25
27
|
kriya_v3: typeof KriyaV3Contract;
|
|
26
28
|
bluefin: typeof BluefinContract;
|
|
27
29
|
springsui: typeof SpringSuiContract;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/libs/protocols/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/libs/protocols/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;CAgB5B,CAAC"}
|