@7kprotocol/sdk-ts 3.1.0 → 3.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/constants/_7k.js +2 -1
- package/lib/cjs/features/swap/config.js +5 -0
- package/lib/cjs/features/swap/getQuote.js +9 -1
- package/lib/cjs/libs/protocols/index.js +15 -13
- package/lib/cjs/libs/protocols/sevenk/index.js +55 -0
- package/lib/cjs/types/constants/_7k.d.ts +1 -1
- package/lib/cjs/types/constants/_7k.d.ts.map +1 -1
- package/lib/cjs/types/features/swap/config.d.ts.map +1 -1
- package/lib/cjs/types/features/swap/getQuote.d.ts.map +1 -1
- package/lib/cjs/types/libs/protocols/index.d.ts +15 -13
- package/lib/cjs/types/libs/protocols/index.d.ts.map +1 -1
- package/lib/cjs/types/libs/protocols/sevenk/index.d.ts +18 -0
- package/lib/cjs/types/libs/protocols/sevenk/index.d.ts.map +1 -0
- package/lib/cjs/types/types/aggregator.d.ts +4 -1
- package/lib/cjs/types/types/aggregator.d.ts.map +1 -1
- package/lib/esm/constants/_7k.js +2 -1
- package/lib/esm/features/swap/config.js +5 -0
- package/lib/esm/features/swap/getQuote.js +9 -1
- package/lib/esm/libs/protocols/index.js +15 -13
- package/lib/esm/libs/protocols/sevenk/index.js +51 -0
- package/lib/esm/types/constants/_7k.d.ts +1 -1
- package/lib/esm/types/constants/_7k.d.ts.map +1 -1
- package/lib/esm/types/features/swap/config.d.ts.map +1 -1
- package/lib/esm/types/features/swap/getQuote.d.ts.map +1 -1
- package/lib/esm/types/libs/protocols/index.d.ts +15 -13
- package/lib/esm/types/libs/protocols/index.d.ts.map +1 -1
- package/lib/esm/types/libs/protocols/sevenk/index.d.ts +18 -0
- package/lib/esm/types/libs/protocols/sevenk/index.d.ts.map +1 -0
- package/lib/esm/types/types/aggregator.d.ts +4 -1
- package/lib/esm/types/types/aggregator.d.ts.map +1 -1
- package/package.json +1 -1
package/lib/cjs/constants/_7k.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports._7K_VAULT = exports._7K_CONFIG = exports._7K_PACKAGE_ID = void 0;
|
|
4
|
-
exports._7K_PACKAGE_ID = "
|
|
4
|
+
exports._7K_PACKAGE_ID = "0x62412b7268c35f3808336aee57a52836501f40b8ba5d936f8ad275e672befd04";
|
|
5
|
+
//legacy V4: "0xe8f996ea6ff38c557c253d3b93cfe2ebf393816487266786371aa4532a9229f2";
|
|
5
6
|
//legacy V3: "0x7ea6e27ad7af6f3b8671d59df1aaebd7c03dddab893e52a714227b2f4fe91519";
|
|
6
7
|
//legacy V2: "0xa13447019cd982d6bef91cf7b46ad384a52583b1dfc2bdecf31ef0c4bd787a0f";
|
|
7
8
|
//legacy V1: "0xd48e7cdc9e92bec69ce3baa75578010458a0c5b2733d661a84971e8cef6806bc";
|
|
@@ -102,6 +102,11 @@ exports.DEFAULT_CONFIG = {
|
|
|
102
102
|
package: "0xf8870f988ab09be7c5820a856bd5e9da84fc7192e095a7a8829919293b00a36c",
|
|
103
103
|
globalConfig: "0xc6b29a60c3924776bedc78df72c127ea52b86aeb655432979a38f13d742dedaa",
|
|
104
104
|
},
|
|
105
|
+
sevenk_v1: {
|
|
106
|
+
name: "7K DEX",
|
|
107
|
+
package: "0x4142285db093ba0cf0623b3cbc07372fb4f5ed00af1fb62be6d55f49a42c0b0e",
|
|
108
|
+
oracle: "0x8c36ea167c5e6da8c3d60b4fc897416105dcb986471bd81cfbfd38720a4487c0",
|
|
109
|
+
},
|
|
105
110
|
};
|
|
106
111
|
let config = exports.DEFAULT_CONFIG;
|
|
107
112
|
let configTs = 0;
|
|
@@ -27,6 +27,7 @@ exports.DEFAULT_SOURCES = [
|
|
|
27
27
|
"magma",
|
|
28
28
|
"haedal_pmm",
|
|
29
29
|
"momentum",
|
|
30
|
+
"sevenk_v1",
|
|
30
31
|
];
|
|
31
32
|
async function getQuote({ tokenIn, tokenOut, amountIn, sources = exports.DEFAULT_SOURCES, commissionBps, targetPools, excludedPools, taker, }) {
|
|
32
33
|
const params = new URLSearchParams({
|
|
@@ -46,7 +47,14 @@ async function getQuote({ tokenIn, tokenOut, amountIn, sources = exports.DEFAULT
|
|
|
46
47
|
}
|
|
47
48
|
const response = await (0, fetchClient_1.fetchClient)(`${apiEndpoints_1.API_ENDPOINTS.MAIN}/quote?${params}`);
|
|
48
49
|
if (!response.ok) {
|
|
49
|
-
|
|
50
|
+
let responseText;
|
|
51
|
+
try {
|
|
52
|
+
responseText = await response.text();
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
responseText = "Failed to fetch aggregator quote";
|
|
56
|
+
}
|
|
57
|
+
throw new Error(responseText);
|
|
50
58
|
}
|
|
51
59
|
const quoteResponse = (await response.json());
|
|
52
60
|
computeReturnAmountAfterCommission(quoteResponse, commissionBps);
|
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ProtocolContract = void 0;
|
|
4
|
-
const flowx_1 = require("./flowx");
|
|
5
4
|
const aftermath_1 = require("./aftermath");
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const turbos_1 = require("./turbos");
|
|
9
|
-
const suiswap_1 = require("./suiswap");
|
|
5
|
+
const bluefin_1 = require("./bluefin");
|
|
6
|
+
const bluefinx_1 = require("./bluefinx");
|
|
10
7
|
const bluemove_1 = require("./bluemove");
|
|
11
|
-
const
|
|
8
|
+
const cetus_1 = require("./cetus");
|
|
12
9
|
const sponsored_1 = require("./deepbookV3/sponsored");
|
|
13
|
-
const
|
|
14
|
-
const springsui_1 = require("./springsui");
|
|
15
|
-
const obric_1 = require("./obric");
|
|
16
|
-
const stsui_1 = require("./stsui");
|
|
10
|
+
const flowx_1 = require("./flowx");
|
|
17
11
|
const flowxV3_1 = require("./flowxV3");
|
|
18
|
-
const steamm_1 = require("./steamm");
|
|
19
|
-
const magma_1 = require("./magma");
|
|
20
12
|
const haedal_pmm_1 = require("./haedal_pmm");
|
|
13
|
+
const kriya_1 = require("./kriya");
|
|
14
|
+
const kriyaV3_1 = require("./kriyaV3");
|
|
15
|
+
const magma_1 = require("./magma");
|
|
21
16
|
const momentum_1 = require("./momentum");
|
|
22
|
-
const
|
|
17
|
+
const obric_1 = require("./obric");
|
|
18
|
+
const sevenk_1 = require("./sevenk");
|
|
19
|
+
const springsui_1 = require("./springsui");
|
|
20
|
+
const steamm_1 = require("./steamm");
|
|
21
|
+
const stsui_1 = require("./stsui");
|
|
22
|
+
const suiswap_1 = require("./suiswap");
|
|
23
|
+
const turbos_1 = require("./turbos");
|
|
23
24
|
exports.ProtocolContract = {
|
|
24
25
|
cetus: cetus_1.CetusContract,
|
|
25
26
|
turbos: turbos_1.TurbosContract,
|
|
@@ -42,4 +43,5 @@ exports.ProtocolContract = {
|
|
|
42
43
|
haedal_pmm: haedal_pmm_1.HaedalPMMContract,
|
|
43
44
|
momentum: momentum_1.MomentumContract,
|
|
44
45
|
bluefinx: bluefinx_1.BluefinXContract,
|
|
46
|
+
sevenk_v1: sevenk_1.SevenKV1,
|
|
45
47
|
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SevenKV1 = void 0;
|
|
4
|
+
const utils_1 = require("@mysten/sui/utils");
|
|
5
|
+
const base_1 = require("../base");
|
|
6
|
+
class SevenKV1 extends base_1.BaseContract {
|
|
7
|
+
async swap(tx) {
|
|
8
|
+
const x2y = this.swapInfo.swapXtoY;
|
|
9
|
+
const config = this.config.sevenk_v1;
|
|
10
|
+
const [coinOut] = tx.moveCall({
|
|
11
|
+
target: `${config.package}::pool_v1::${x2y ? "swap_x_to_y" : "swap_y_to_x"}`,
|
|
12
|
+
typeArguments: (0, utils_1.parseStructTag)(this.extra.poolStructTag).typeParams.map(utils_1.normalizeStructTag),
|
|
13
|
+
arguments: [
|
|
14
|
+
tx.object(this.swapInfo.poolId),
|
|
15
|
+
this.getOraclePriceUpdate(tx),
|
|
16
|
+
this.inputCoinObject,
|
|
17
|
+
tx.pure.u64(0),
|
|
18
|
+
],
|
|
19
|
+
});
|
|
20
|
+
return coinOut;
|
|
21
|
+
}
|
|
22
|
+
getOraclePriceUpdate(tx) {
|
|
23
|
+
const oracleX = this.extra.oracles?.[0]?.Pyth?.bytes;
|
|
24
|
+
const oracleY = this.extra.oracles?.[1]?.Pyth?.bytes;
|
|
25
|
+
if (!oracleX ||
|
|
26
|
+
!oracleY ||
|
|
27
|
+
!this.extra.oracleConfigX ||
|
|
28
|
+
!this.extra.oracleConfigY) {
|
|
29
|
+
throw new Error(`Invalid oracle info for getOraclePriceUpdate`);
|
|
30
|
+
}
|
|
31
|
+
const [holder] = tx.moveCall({
|
|
32
|
+
target: `${this.config.sevenk_v1.oracle}::oracle::new_holder`,
|
|
33
|
+
});
|
|
34
|
+
tx.moveCall({
|
|
35
|
+
target: `${this.config.sevenk_v1.oracle}::pyth::get_price`,
|
|
36
|
+
arguments: [
|
|
37
|
+
tx.object(this.extra.oracleConfigX),
|
|
38
|
+
holder,
|
|
39
|
+
tx.object(this.pythMap["0x" + (0, utils_1.toHex)(Uint8Array.from(oracleX))]),
|
|
40
|
+
tx.object(utils_1.SUI_CLOCK_OBJECT_ID),
|
|
41
|
+
],
|
|
42
|
+
});
|
|
43
|
+
tx.moveCall({
|
|
44
|
+
target: `${this.config.sevenk_v1.oracle}::pyth::get_price`,
|
|
45
|
+
arguments: [
|
|
46
|
+
tx.object(this.extra.oracleConfigY),
|
|
47
|
+
holder,
|
|
48
|
+
tx.object(this.pythMap["0x" + (0, utils_1.toHex)(Uint8Array.from(oracleY))]),
|
|
49
|
+
tx.object(utils_1.SUI_CLOCK_OBJECT_ID),
|
|
50
|
+
],
|
|
51
|
+
});
|
|
52
|
+
return holder;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
exports.SevenKV1 = SevenKV1;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const _7K_PACKAGE_ID = "
|
|
1
|
+
export declare const _7K_PACKAGE_ID = "0x62412b7268c35f3808336aee57a52836501f40b8ba5d936f8ad275e672befd04";
|
|
2
2
|
export declare const _7K_CONFIG = "0x47442a93f7727d188ba7cb71031170d1786af70013cb7ad5115f3fe877ff0c54";
|
|
3
3
|
export declare const _7K_VAULT = "0x442ad50389ed5cda6f7a6f5a7ae6361a4c05ef1d9fb2e54fbba5a268d690bfe6";
|
|
4
4
|
//# sourceMappingURL=_7k.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_7k.d.ts","sourceRoot":"","sources":["../../../../src/constants/_7k.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,uEAC2C,CAAC;
|
|
1
|
+
{"version":3,"file":"_7k.d.ts","sourceRoot":"","sources":["../../../../src/constants/_7k.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,uEAC2C,CAAC;AAKvE,eAAO,MAAM,UAAU,uEAC+C,CAAC;AAGvE,eAAO,MAAM,SAAS,uEACgD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../src/features/swap/config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAEhD,eAAO,MAAM,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../src/features/swap/config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAEhD,eAAO,MAAM,cAAc,EAAE,MAgJ5B,CAAC;AAIF,wBAAsB,SAAS,oBAe9B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getQuote.d.ts","sourceRoot":"","sources":["../../../../../src/features/swap/getQuote.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,aAAa,EACb,SAAS,EACV,MAAM,wBAAwB,CAAC;AAEhC,UAAU,MAAM;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB;;;kEAG8D;IAC9D,OAAO,CAAC,EAAE,SAAS,EAAE,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iDAAiD;IACjD,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,qDAAqD;IACrD,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,+CAA+C;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,eAAe,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"getQuote.d.ts","sourceRoot":"","sources":["../../../../../src/features/swap/getQuote.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,aAAa,EACb,SAAS,EACV,MAAM,wBAAwB,CAAC;AAEhC,UAAU,MAAM;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB;;;kEAG8D;IAC9D,OAAO,CAAC,EAAE,SAAS,EAAE,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iDAAiD;IACjD,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,qDAAqD;IACrD,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,+CAA+C;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,eAAe,EAAE,SAAS,EAsBtC,CAAC;AAEF,wBAAsB,QAAQ,CAAC,EAC7B,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,OAAyB,EACzB,aAAa,EACb,WAAW,EACX,aAAa,EACb,KAAK,GACN,EAAE,MAAM,0BAqCR"}
|
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import { FlowXContract } from "./flowx";
|
|
2
1
|
import { AfterMathContract } from "./aftermath";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { TurbosContract } from "./turbos";
|
|
6
|
-
import { SuiswapContract } from "./suiswap";
|
|
2
|
+
import { BluefinContract } from "./bluefin";
|
|
3
|
+
import { BluefinXContract } from "./bluefinx";
|
|
7
4
|
import { BluemoveContract } from "./bluemove";
|
|
8
|
-
import {
|
|
5
|
+
import { CetusContract } from "./cetus";
|
|
9
6
|
import { SponsoredDeepBookV3Contract } from "./deepbookV3/sponsored";
|
|
10
|
-
import {
|
|
11
|
-
import { SpringSuiContract } from "./springsui";
|
|
12
|
-
import { ObricContract } from "./obric";
|
|
13
|
-
import { StSuiContract } from "./stsui";
|
|
7
|
+
import { FlowXContract } from "./flowx";
|
|
14
8
|
import { FlowxV3Contract } from "./flowxV3";
|
|
15
|
-
import { SteammContract } from "./steamm";
|
|
16
|
-
import { MagmaContract } from "./magma";
|
|
17
9
|
import { HaedalPMMContract } from "./haedal_pmm";
|
|
10
|
+
import { KriyaContract } from "./kriya";
|
|
11
|
+
import { KriyaV3Contract } from "./kriyaV3";
|
|
12
|
+
import { MagmaContract } from "./magma";
|
|
18
13
|
import { MomentumContract } from "./momentum";
|
|
19
|
-
import {
|
|
14
|
+
import { ObricContract } from "./obric";
|
|
15
|
+
import { SevenKV1 } from "./sevenk";
|
|
16
|
+
import { SpringSuiContract } from "./springsui";
|
|
17
|
+
import { SteammContract } from "./steamm";
|
|
18
|
+
import { StSuiContract } from "./stsui";
|
|
19
|
+
import { SuiswapContract } from "./suiswap";
|
|
20
|
+
import { TurbosContract } from "./turbos";
|
|
20
21
|
export declare const ProtocolContract: {
|
|
21
22
|
cetus: typeof CetusContract;
|
|
22
23
|
turbos: typeof TurbosContract;
|
|
@@ -39,5 +40,6 @@ export declare const ProtocolContract: {
|
|
|
39
40
|
haedal_pmm: typeof HaedalPMMContract;
|
|
40
41
|
momentum: typeof MomentumContract;
|
|
41
42
|
bluefinx: typeof BluefinXContract;
|
|
43
|
+
sevenk_v1: typeof SevenKV1;
|
|
42
44
|
};
|
|
43
45
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/libs/protocols/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/libs/protocols/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,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,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;CAuB5B,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Transaction } from "@mysten/sui/transactions";
|
|
2
|
+
import { ExtraOracle } from "../../../types/aggregator";
|
|
3
|
+
import { TransactionResultItem } from "../../../types/sui";
|
|
4
|
+
import { BaseContract } from "../base";
|
|
5
|
+
export type SevenKExtra = {
|
|
6
|
+
poolStructTag: string;
|
|
7
|
+
oracleConfigX: string;
|
|
8
|
+
oracleConfigY: string;
|
|
9
|
+
oracles: ExtraOracle[];
|
|
10
|
+
};
|
|
11
|
+
export declare class SevenKV1 extends BaseContract<SevenKExtra> {
|
|
12
|
+
swap(tx: Transaction): Promise<TransactionResultItem>;
|
|
13
|
+
getOraclePriceUpdate(tx: Transaction): {
|
|
14
|
+
$kind: "NestedResult";
|
|
15
|
+
NestedResult: [number, number];
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/protocols/sevenk/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAOvD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,MAAM,MAAM,WAAW,GAAG;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,WAAW,EAAE,CAAC;CACxB,CAAC;AAEF,qBAAa,QAAS,SAAQ,YAAY,CAAC,WAAW,CAAC;IAC/C,IAAI,CAAC,EAAE,EAAE,WAAW,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAqB3D,oBAAoB,CAAC,EAAE,EAAE,WAAW;;;;CAkCrC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Transaction, TransactionObjectArgument } from "@mysten/sui/transactions";
|
|
2
2
|
import { BluefinXTx } from "../libs/protocols/bluefinx/types";
|
|
3
3
|
export { BluefinXTx };
|
|
4
|
-
export type SourceDex = "suiswap" | "turbos" | "cetus" | "bluemove" | "kriya" | "kriya_v3" | "aftermath" | "deepbook_v3" | "flowx" | "flowx_v3" | "bluefin" | "bluefinx" | "springsui" | "obric" | "stsui" | "steamm" | "steamm_oracle_quoter" | "steamm_oracle_quoter_v2" | "magma" | "haedal_pmm" | "momentum";
|
|
4
|
+
export type SourceDex = "suiswap" | "turbos" | "cetus" | "bluemove" | "kriya" | "kriya_v3" | "aftermath" | "deepbook_v3" | "flowx" | "flowx_v3" | "bluefin" | "bluefinx" | "springsui" | "obric" | "stsui" | "steamm" | "steamm_oracle_quoter" | "steamm_oracle_quoter_v2" | "magma" | "haedal_pmm" | "momentum" | "sevenk_v1";
|
|
5
5
|
export type SorSwap = {
|
|
6
6
|
poolId: string;
|
|
7
7
|
assetInIndex: number;
|
|
@@ -132,6 +132,9 @@ export interface Config {
|
|
|
132
132
|
momentum: DexConfig & {
|
|
133
133
|
version: string;
|
|
134
134
|
};
|
|
135
|
+
sevenk_v1: DexConfig & {
|
|
136
|
+
oracle: string;
|
|
137
|
+
};
|
|
135
138
|
}
|
|
136
139
|
export type ExtraOracle = {
|
|
137
140
|
Pyth?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aggregator.d.ts","sourceRoot":"","sources":["../../../../src/types/aggregator.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,yBAAyB,EAC1B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,CAAC;AAEtB,MAAM,MAAM,SAAS,GACjB,SAAS,GACT,QAAQ,GACR,OAAO,GACP,UAAU,GACV,OAAO,GACP,UAAU,GACV,WAAW,GACX,aAAa,GACb,OAAO,GACP,UAAU,GACV,SAAS,GACT,UAAU,GACV,WAAW,GACX,OAAO,GACP,OAAO,GACP,QAAQ,GACR,sBAAsB,GACtB,yBAAyB,GACzB,OAAO,GACP,YAAY,GACZ,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"aggregator.d.ts","sourceRoot":"","sources":["../../../../src/types/aggregator.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,yBAAyB,EAC1B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,CAAC;AAEtB,MAAM,MAAM,SAAS,GACjB,SAAS,GACT,QAAQ,GACR,OAAO,GACP,UAAU,GACV,OAAO,GACP,UAAU,GACV,WAAW,GACX,aAAa,GACb,OAAO,GACP,UAAU,GACV,SAAS,GACT,UAAU,GACV,WAAW,GACX,OAAO,GACP,OAAO,GACP,QAAQ,GACR,sBAAsB,GACtB,yBAAyB,GACzB,OAAO,GACP,YAAY,GACZ,UAAU,GACV,WAAW,CAAC;AAEhB,MAAM,MAAM,OAAO,GAAG;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB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,GAAG;IAC1B,EAAE,EAAE,YAAY,CAAC;IACjB,OAAO,CAAC,EAAE,yBAAyB,CAAC;CACrC,CAAC"}
|
package/lib/esm/constants/_7k.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export const _7K_PACKAGE_ID = "
|
|
1
|
+
export const _7K_PACKAGE_ID = "0x62412b7268c35f3808336aee57a52836501f40b8ba5d936f8ad275e672befd04";
|
|
2
|
+
//legacy V4: "0xe8f996ea6ff38c557c253d3b93cfe2ebf393816487266786371aa4532a9229f2";
|
|
2
3
|
//legacy V3: "0x7ea6e27ad7af6f3b8671d59df1aaebd7c03dddab893e52a714227b2f4fe91519";
|
|
3
4
|
//legacy V2: "0xa13447019cd982d6bef91cf7b46ad384a52583b1dfc2bdecf31ef0c4bd787a0f";
|
|
4
5
|
//legacy V1: "0xd48e7cdc9e92bec69ce3baa75578010458a0c5b2733d661a84971e8cef6806bc";
|
|
@@ -98,6 +98,11 @@ export const DEFAULT_CONFIG = {
|
|
|
98
98
|
package: "0xf8870f988ab09be7c5820a856bd5e9da84fc7192e095a7a8829919293b00a36c",
|
|
99
99
|
globalConfig: "0xc6b29a60c3924776bedc78df72c127ea52b86aeb655432979a38f13d742dedaa",
|
|
100
100
|
},
|
|
101
|
+
sevenk_v1: {
|
|
102
|
+
name: "7K DEX",
|
|
103
|
+
package: "0x4142285db093ba0cf0623b3cbc07372fb4f5ed00af1fb62be6d55f49a42c0b0e",
|
|
104
|
+
oracle: "0x8c36ea167c5e6da8c3d60b4fc897416105dcb986471bd81cfbfd38720a4487c0",
|
|
105
|
+
},
|
|
101
106
|
};
|
|
102
107
|
let config = DEFAULT_CONFIG;
|
|
103
108
|
let configTs = 0;
|
|
@@ -23,6 +23,7 @@ export const DEFAULT_SOURCES = [
|
|
|
23
23
|
"magma",
|
|
24
24
|
"haedal_pmm",
|
|
25
25
|
"momentum",
|
|
26
|
+
"sevenk_v1",
|
|
26
27
|
];
|
|
27
28
|
export async function getQuote({ tokenIn, tokenOut, amountIn, sources = DEFAULT_SOURCES, commissionBps, targetPools, excludedPools, taker, }) {
|
|
28
29
|
const params = new URLSearchParams({
|
|
@@ -42,7 +43,14 @@ export async function getQuote({ tokenIn, tokenOut, amountIn, sources = DEFAULT_
|
|
|
42
43
|
}
|
|
43
44
|
const response = await fetchClient(`${API_ENDPOINTS.MAIN}/quote?${params}`);
|
|
44
45
|
if (!response.ok) {
|
|
45
|
-
|
|
46
|
+
let responseText;
|
|
47
|
+
try {
|
|
48
|
+
responseText = await response.text();
|
|
49
|
+
}
|
|
50
|
+
catch {
|
|
51
|
+
responseText = "Failed to fetch aggregator quote";
|
|
52
|
+
}
|
|
53
|
+
throw new Error(responseText);
|
|
46
54
|
}
|
|
47
55
|
const quoteResponse = (await response.json());
|
|
48
56
|
computeReturnAmountAfterCommission(quoteResponse, commissionBps);
|
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import { FlowXContract } from "./flowx";
|
|
2
1
|
import { AfterMathContract } from "./aftermath";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { TurbosContract } from "./turbos";
|
|
6
|
-
import { SuiswapContract } from "./suiswap";
|
|
2
|
+
import { BluefinContract } from "./bluefin";
|
|
3
|
+
import { BluefinXContract } from "./bluefinx";
|
|
7
4
|
import { BluemoveContract } from "./bluemove";
|
|
8
|
-
import {
|
|
5
|
+
import { CetusContract } from "./cetus";
|
|
9
6
|
import { SponsoredDeepBookV3Contract } from "./deepbookV3/sponsored";
|
|
10
|
-
import {
|
|
11
|
-
import { SpringSuiContract } from "./springsui";
|
|
12
|
-
import { ObricContract } from "./obric";
|
|
13
|
-
import { StSuiContract } from "./stsui";
|
|
7
|
+
import { FlowXContract } from "./flowx";
|
|
14
8
|
import { FlowxV3Contract } from "./flowxV3";
|
|
15
|
-
import { SteammContract } from "./steamm";
|
|
16
|
-
import { MagmaContract } from "./magma";
|
|
17
9
|
import { HaedalPMMContract } from "./haedal_pmm";
|
|
10
|
+
import { KriyaContract } from "./kriya";
|
|
11
|
+
import { KriyaV3Contract } from "./kriyaV3";
|
|
12
|
+
import { MagmaContract } from "./magma";
|
|
18
13
|
import { MomentumContract } from "./momentum";
|
|
19
|
-
import {
|
|
14
|
+
import { ObricContract } from "./obric";
|
|
15
|
+
import { SevenKV1 } from "./sevenk";
|
|
16
|
+
import { SpringSuiContract } from "./springsui";
|
|
17
|
+
import { SteammContract } from "./steamm";
|
|
18
|
+
import { StSuiContract } from "./stsui";
|
|
19
|
+
import { SuiswapContract } from "./suiswap";
|
|
20
|
+
import { TurbosContract } from "./turbos";
|
|
20
21
|
export const ProtocolContract = {
|
|
21
22
|
cetus: CetusContract,
|
|
22
23
|
turbos: TurbosContract,
|
|
@@ -39,4 +40,5 @@ export const ProtocolContract = {
|
|
|
39
40
|
haedal_pmm: HaedalPMMContract,
|
|
40
41
|
momentum: MomentumContract,
|
|
41
42
|
bluefinx: BluefinXContract,
|
|
43
|
+
sevenk_v1: SevenKV1,
|
|
42
44
|
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { normalizeStructTag, parseStructTag, SUI_CLOCK_OBJECT_ID, toHex, } from "@mysten/sui/utils";
|
|
2
|
+
import { BaseContract } from "../base";
|
|
3
|
+
export class SevenKV1 extends BaseContract {
|
|
4
|
+
async swap(tx) {
|
|
5
|
+
const x2y = this.swapInfo.swapXtoY;
|
|
6
|
+
const config = this.config.sevenk_v1;
|
|
7
|
+
const [coinOut] = tx.moveCall({
|
|
8
|
+
target: `${config.package}::pool_v1::${x2y ? "swap_x_to_y" : "swap_y_to_x"}`,
|
|
9
|
+
typeArguments: parseStructTag(this.extra.poolStructTag).typeParams.map(normalizeStructTag),
|
|
10
|
+
arguments: [
|
|
11
|
+
tx.object(this.swapInfo.poolId),
|
|
12
|
+
this.getOraclePriceUpdate(tx),
|
|
13
|
+
this.inputCoinObject,
|
|
14
|
+
tx.pure.u64(0),
|
|
15
|
+
],
|
|
16
|
+
});
|
|
17
|
+
return coinOut;
|
|
18
|
+
}
|
|
19
|
+
getOraclePriceUpdate(tx) {
|
|
20
|
+
const oracleX = this.extra.oracles?.[0]?.Pyth?.bytes;
|
|
21
|
+
const oracleY = this.extra.oracles?.[1]?.Pyth?.bytes;
|
|
22
|
+
if (!oracleX ||
|
|
23
|
+
!oracleY ||
|
|
24
|
+
!this.extra.oracleConfigX ||
|
|
25
|
+
!this.extra.oracleConfigY) {
|
|
26
|
+
throw new Error(`Invalid oracle info for getOraclePriceUpdate`);
|
|
27
|
+
}
|
|
28
|
+
const [holder] = tx.moveCall({
|
|
29
|
+
target: `${this.config.sevenk_v1.oracle}::oracle::new_holder`,
|
|
30
|
+
});
|
|
31
|
+
tx.moveCall({
|
|
32
|
+
target: `${this.config.sevenk_v1.oracle}::pyth::get_price`,
|
|
33
|
+
arguments: [
|
|
34
|
+
tx.object(this.extra.oracleConfigX),
|
|
35
|
+
holder,
|
|
36
|
+
tx.object(this.pythMap["0x" + toHex(Uint8Array.from(oracleX))]),
|
|
37
|
+
tx.object(SUI_CLOCK_OBJECT_ID),
|
|
38
|
+
],
|
|
39
|
+
});
|
|
40
|
+
tx.moveCall({
|
|
41
|
+
target: `${this.config.sevenk_v1.oracle}::pyth::get_price`,
|
|
42
|
+
arguments: [
|
|
43
|
+
tx.object(this.extra.oracleConfigY),
|
|
44
|
+
holder,
|
|
45
|
+
tx.object(this.pythMap["0x" + toHex(Uint8Array.from(oracleY))]),
|
|
46
|
+
tx.object(SUI_CLOCK_OBJECT_ID),
|
|
47
|
+
],
|
|
48
|
+
});
|
|
49
|
+
return holder;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const _7K_PACKAGE_ID = "
|
|
1
|
+
export declare const _7K_PACKAGE_ID = "0x62412b7268c35f3808336aee57a52836501f40b8ba5d936f8ad275e672befd04";
|
|
2
2
|
export declare const _7K_CONFIG = "0x47442a93f7727d188ba7cb71031170d1786af70013cb7ad5115f3fe877ff0c54";
|
|
3
3
|
export declare const _7K_VAULT = "0x442ad50389ed5cda6f7a6f5a7ae6361a4c05ef1d9fb2e54fbba5a268d690bfe6";
|
|
4
4
|
//# sourceMappingURL=_7k.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_7k.d.ts","sourceRoot":"","sources":["../../../../src/constants/_7k.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,uEAC2C,CAAC;
|
|
1
|
+
{"version":3,"file":"_7k.d.ts","sourceRoot":"","sources":["../../../../src/constants/_7k.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,uEAC2C,CAAC;AAKvE,eAAO,MAAM,UAAU,uEAC+C,CAAC;AAGvE,eAAO,MAAM,SAAS,uEACgD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../src/features/swap/config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAEhD,eAAO,MAAM,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../src/features/swap/config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAEhD,eAAO,MAAM,cAAc,EAAE,MAgJ5B,CAAC;AAIF,wBAAsB,SAAS,oBAe9B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getQuote.d.ts","sourceRoot":"","sources":["../../../../../src/features/swap/getQuote.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,aAAa,EACb,SAAS,EACV,MAAM,wBAAwB,CAAC;AAEhC,UAAU,MAAM;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB;;;kEAG8D;IAC9D,OAAO,CAAC,EAAE,SAAS,EAAE,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iDAAiD;IACjD,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,qDAAqD;IACrD,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,+CAA+C;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,eAAe,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"getQuote.d.ts","sourceRoot":"","sources":["../../../../../src/features/swap/getQuote.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,aAAa,EACb,SAAS,EACV,MAAM,wBAAwB,CAAC;AAEhC,UAAU,MAAM;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB;;;kEAG8D;IAC9D,OAAO,CAAC,EAAE,SAAS,EAAE,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iDAAiD;IACjD,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,qDAAqD;IACrD,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,+CAA+C;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,eAAe,EAAE,SAAS,EAsBtC,CAAC;AAEF,wBAAsB,QAAQ,CAAC,EAC7B,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,OAAyB,EACzB,aAAa,EACb,WAAW,EACX,aAAa,EACb,KAAK,GACN,EAAE,MAAM,0BAqCR"}
|
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import { FlowXContract } from "./flowx";
|
|
2
1
|
import { AfterMathContract } from "./aftermath";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { TurbosContract } from "./turbos";
|
|
6
|
-
import { SuiswapContract } from "./suiswap";
|
|
2
|
+
import { BluefinContract } from "./bluefin";
|
|
3
|
+
import { BluefinXContract } from "./bluefinx";
|
|
7
4
|
import { BluemoveContract } from "./bluemove";
|
|
8
|
-
import {
|
|
5
|
+
import { CetusContract } from "./cetus";
|
|
9
6
|
import { SponsoredDeepBookV3Contract } from "./deepbookV3/sponsored";
|
|
10
|
-
import {
|
|
11
|
-
import { SpringSuiContract } from "./springsui";
|
|
12
|
-
import { ObricContract } from "./obric";
|
|
13
|
-
import { StSuiContract } from "./stsui";
|
|
7
|
+
import { FlowXContract } from "./flowx";
|
|
14
8
|
import { FlowxV3Contract } from "./flowxV3";
|
|
15
|
-
import { SteammContract } from "./steamm";
|
|
16
|
-
import { MagmaContract } from "./magma";
|
|
17
9
|
import { HaedalPMMContract } from "./haedal_pmm";
|
|
10
|
+
import { KriyaContract } from "./kriya";
|
|
11
|
+
import { KriyaV3Contract } from "./kriyaV3";
|
|
12
|
+
import { MagmaContract } from "./magma";
|
|
18
13
|
import { MomentumContract } from "./momentum";
|
|
19
|
-
import {
|
|
14
|
+
import { ObricContract } from "./obric";
|
|
15
|
+
import { SevenKV1 } from "./sevenk";
|
|
16
|
+
import { SpringSuiContract } from "./springsui";
|
|
17
|
+
import { SteammContract } from "./steamm";
|
|
18
|
+
import { StSuiContract } from "./stsui";
|
|
19
|
+
import { SuiswapContract } from "./suiswap";
|
|
20
|
+
import { TurbosContract } from "./turbos";
|
|
20
21
|
export declare const ProtocolContract: {
|
|
21
22
|
cetus: typeof CetusContract;
|
|
22
23
|
turbos: typeof TurbosContract;
|
|
@@ -39,5 +40,6 @@ export declare const ProtocolContract: {
|
|
|
39
40
|
haedal_pmm: typeof HaedalPMMContract;
|
|
40
41
|
momentum: typeof MomentumContract;
|
|
41
42
|
bluefinx: typeof BluefinXContract;
|
|
43
|
+
sevenk_v1: typeof SevenKV1;
|
|
42
44
|
};
|
|
43
45
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/libs/protocols/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/libs/protocols/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,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,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;CAuB5B,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Transaction } from "@mysten/sui/transactions";
|
|
2
|
+
import { ExtraOracle } from "../../../types/aggregator";
|
|
3
|
+
import { TransactionResultItem } from "../../../types/sui";
|
|
4
|
+
import { BaseContract } from "../base";
|
|
5
|
+
export type SevenKExtra = {
|
|
6
|
+
poolStructTag: string;
|
|
7
|
+
oracleConfigX: string;
|
|
8
|
+
oracleConfigY: string;
|
|
9
|
+
oracles: ExtraOracle[];
|
|
10
|
+
};
|
|
11
|
+
export declare class SevenKV1 extends BaseContract<SevenKExtra> {
|
|
12
|
+
swap(tx: Transaction): Promise<TransactionResultItem>;
|
|
13
|
+
getOraclePriceUpdate(tx: Transaction): {
|
|
14
|
+
$kind: "NestedResult";
|
|
15
|
+
NestedResult: [number, number];
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/protocols/sevenk/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAOvD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,MAAM,MAAM,WAAW,GAAG;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,WAAW,EAAE,CAAC;CACxB,CAAC;AAEF,qBAAa,QAAS,SAAQ,YAAY,CAAC,WAAW,CAAC;IAC/C,IAAI,CAAC,EAAE,EAAE,WAAW,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAqB3D,oBAAoB,CAAC,EAAE,EAAE,WAAW;;;;CAkCrC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Transaction, TransactionObjectArgument } from "@mysten/sui/transactions";
|
|
2
2
|
import { BluefinXTx } from "../libs/protocols/bluefinx/types";
|
|
3
3
|
export { BluefinXTx };
|
|
4
|
-
export type SourceDex = "suiswap" | "turbos" | "cetus" | "bluemove" | "kriya" | "kriya_v3" | "aftermath" | "deepbook_v3" | "flowx" | "flowx_v3" | "bluefin" | "bluefinx" | "springsui" | "obric" | "stsui" | "steamm" | "steamm_oracle_quoter" | "steamm_oracle_quoter_v2" | "magma" | "haedal_pmm" | "momentum";
|
|
4
|
+
export type SourceDex = "suiswap" | "turbos" | "cetus" | "bluemove" | "kriya" | "kriya_v3" | "aftermath" | "deepbook_v3" | "flowx" | "flowx_v3" | "bluefin" | "bluefinx" | "springsui" | "obric" | "stsui" | "steamm" | "steamm_oracle_quoter" | "steamm_oracle_quoter_v2" | "magma" | "haedal_pmm" | "momentum" | "sevenk_v1";
|
|
5
5
|
export type SorSwap = {
|
|
6
6
|
poolId: string;
|
|
7
7
|
assetInIndex: number;
|
|
@@ -132,6 +132,9 @@ export interface Config {
|
|
|
132
132
|
momentum: DexConfig & {
|
|
133
133
|
version: string;
|
|
134
134
|
};
|
|
135
|
+
sevenk_v1: DexConfig & {
|
|
136
|
+
oracle: string;
|
|
137
|
+
};
|
|
135
138
|
}
|
|
136
139
|
export type ExtraOracle = {
|
|
137
140
|
Pyth?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aggregator.d.ts","sourceRoot":"","sources":["../../../../src/types/aggregator.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,yBAAyB,EAC1B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,CAAC;AAEtB,MAAM,MAAM,SAAS,GACjB,SAAS,GACT,QAAQ,GACR,OAAO,GACP,UAAU,GACV,OAAO,GACP,UAAU,GACV,WAAW,GACX,aAAa,GACb,OAAO,GACP,UAAU,GACV,SAAS,GACT,UAAU,GACV,WAAW,GACX,OAAO,GACP,OAAO,GACP,QAAQ,GACR,sBAAsB,GACtB,yBAAyB,GACzB,OAAO,GACP,YAAY,GACZ,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"aggregator.d.ts","sourceRoot":"","sources":["../../../../src/types/aggregator.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,yBAAyB,EAC1B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,CAAC;AAEtB,MAAM,MAAM,SAAS,GACjB,SAAS,GACT,QAAQ,GACR,OAAO,GACP,UAAU,GACV,OAAO,GACP,UAAU,GACV,WAAW,GACX,aAAa,GACb,OAAO,GACP,UAAU,GACV,SAAS,GACT,UAAU,GACV,WAAW,GACX,OAAO,GACP,OAAO,GACP,QAAQ,GACR,sBAAsB,GACtB,yBAAyB,GACzB,OAAO,GACP,YAAY,GACZ,UAAU,GACV,WAAW,CAAC;AAEhB,MAAM,MAAM,OAAO,GAAG;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,KAAK,CAAC,EAAE,GAAG,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG;IACpB,SAAS,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACvD,IAAI,EAAE,SAAS,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG;IACnB,MAAM,EAAE,MAAM,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