@7kprotocol/sdk-ts 3.0.2 → 3.2.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 -2
- package/lib/cjs/features/swap/config.js +17 -12
- package/lib/cjs/features/swap/getQuote.js +2 -0
- package/lib/cjs/libs/protocols/base.js +13 -0
- package/lib/cjs/libs/protocols/haedal_pmm/index.js +5 -7
- package/lib/cjs/libs/protocols/index.js +16 -13
- package/lib/cjs/libs/protocols/obric/index.js +4 -6
- package/lib/cjs/libs/protocols/sevenk/index.js +55 -0
- package/lib/cjs/libs/protocols/steamm/index.js +12 -9
- package/lib/cjs/types/features/swap/buildTx.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/base.d.ts +2 -1
- package/lib/cjs/types/libs/protocols/base.d.ts.map +1 -1
- package/lib/cjs/types/libs/protocols/haedal_pmm/index.d.ts +6 -1
- package/lib/cjs/types/libs/protocols/haedal_pmm/index.d.ts.map +1 -1
- package/lib/cjs/types/libs/protocols/index.d.ts +16 -13
- package/lib/cjs/types/libs/protocols/index.d.ts.map +1 -1
- package/lib/cjs/types/libs/protocols/obric/index.d.ts +6 -1
- package/lib/cjs/types/libs/protocols/obric/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/libs/protocols/steamm/index.d.ts +3 -3
- package/lib/cjs/types/libs/protocols/steamm/index.d.ts.map +1 -1
- package/lib/cjs/types/types/aggregator.d.ts +5 -7
- package/lib/cjs/types/types/aggregator.d.ts.map +1 -1
- package/lib/esm/features/swap/buildTx.js +3 -2
- package/lib/esm/features/swap/config.js +17 -12
- package/lib/esm/features/swap/getQuote.js +2 -0
- package/lib/esm/libs/protocols/base.js +14 -1
- package/lib/esm/libs/protocols/haedal_pmm/index.js +5 -7
- package/lib/esm/libs/protocols/index.js +16 -13
- package/lib/esm/libs/protocols/obric/index.js +4 -6
- package/lib/esm/libs/protocols/sevenk/index.js +51 -0
- package/lib/esm/libs/protocols/steamm/index.js +13 -10
- package/lib/esm/types/features/swap/buildTx.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/base.d.ts +2 -1
- package/lib/esm/types/libs/protocols/base.d.ts.map +1 -1
- package/lib/esm/types/libs/protocols/haedal_pmm/index.d.ts +6 -1
- package/lib/esm/types/libs/protocols/haedal_pmm/index.d.ts.map +1 -1
- package/lib/esm/types/libs/protocols/index.d.ts +16 -13
- package/lib/esm/types/libs/protocols/index.d.ts.map +1 -1
- package/lib/esm/types/libs/protocols/obric/index.d.ts +6 -1
- package/lib/esm/types/libs/protocols/obric/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/libs/protocols/steamm/index.d.ts +3 -3
- package/lib/esm/types/libs/protocols/steamm/index.d.ts.map +1 -1
- package/lib/esm/types/types/aggregator.d.ts +5 -7
- package/lib/esm/types/types/aggregator.d.ts.map +1 -1
- package/package.json +7 -7
|
@@ -12,14 +12,9 @@ export const DEFAULT_CONFIG = {
|
|
|
12
12
|
},
|
|
13
13
|
bluefin: {
|
|
14
14
|
name: "Bluefin",
|
|
15
|
-
package: "
|
|
15
|
+
package: "0x67b34b728c4e28e704dcfecf7c5cf55c7fc593b6c65c20d1836d97c209c1928a",
|
|
16
16
|
globalConfig: "0x03db251ba509a8d5d8777b6338836082335d93eecbdd09a11e190a1cff51c352",
|
|
17
17
|
},
|
|
18
|
-
bluefinx: {
|
|
19
|
-
name: "BluefinX",
|
|
20
|
-
package: "0xf8870f988ab09be7c5820a856bd5e9da84fc7192e095a7a8829919293b00a36c",
|
|
21
|
-
globalConfig: "0xc6b29a60c3924776bedc78df72c127ea52b86aeb655432979a38f13d742dedaa",
|
|
22
|
-
},
|
|
23
18
|
bluemove: {
|
|
24
19
|
name: "Bluemove",
|
|
25
20
|
package: "0x08cd33481587d4c4612865b164796d937df13747d8c763b8a178c87e3244498f",
|
|
@@ -27,7 +22,7 @@ export const DEFAULT_CONFIG = {
|
|
|
27
22
|
},
|
|
28
23
|
cetus: {
|
|
29
24
|
name: "Cetus",
|
|
30
|
-
package: "
|
|
25
|
+
package: "0xb2db7142fa83210a7d78d9c12ac49c043b3cbbd482224fea6e3da00aa5a5ae2d",
|
|
31
26
|
globalConfig: "0xdaa46292632c3c4d8f31f23ea0f9b36a28ff3677e9684980e4438403a67a3d8f",
|
|
32
27
|
},
|
|
33
28
|
deepbook_v3: {
|
|
@@ -43,7 +38,7 @@ export const DEFAULT_CONFIG = {
|
|
|
43
38
|
},
|
|
44
39
|
flowx_v3: {
|
|
45
40
|
name: "Flowx Finance V3",
|
|
46
|
-
package: "
|
|
41
|
+
package: "0xe882cd54551e73e64ff5b257146a0c5264546974cf00d78ecc871017cb22df67",
|
|
47
42
|
registry: "0x27565d24a4cd51127ac90e4074a841bbe356cca7bf5759ddc14a975be1632abc",
|
|
48
43
|
version: "0x67624a1533b5aff5d0dfcf5e598684350efd38134d2d245f475524c03a64e656",
|
|
49
44
|
},
|
|
@@ -53,7 +48,7 @@ export const DEFAULT_CONFIG = {
|
|
|
53
48
|
},
|
|
54
49
|
kriya_v3: {
|
|
55
50
|
name: "Kriya V3",
|
|
56
|
-
package: "
|
|
51
|
+
package: "0x0d7305a7475ed54adc905365bd081939a81926636b4c438cf2f75f4924b8d960",
|
|
57
52
|
version: "0xf5145a7ac345ca8736cf8c76047d00d6d378f30e81be6f6eb557184d9de93c78",
|
|
58
53
|
},
|
|
59
54
|
obric: {
|
|
@@ -75,7 +70,7 @@ export const DEFAULT_CONFIG = {
|
|
|
75
70
|
},
|
|
76
71
|
turbos: {
|
|
77
72
|
name: "Turbos Finance",
|
|
78
|
-
package: "
|
|
73
|
+
package: "0xd02012c71c1a6a221e540c36c37c81e0224907fe1ee05bfe250025654ff17103",
|
|
79
74
|
version: "0xf1cf0e81048df168ebeb1b8030fad24b3e0b53ae827c25053fff0779c1445b6f",
|
|
80
75
|
},
|
|
81
76
|
steamm: {
|
|
@@ -86,7 +81,7 @@ export const DEFAULT_CONFIG = {
|
|
|
86
81
|
},
|
|
87
82
|
magma: {
|
|
88
83
|
name: "Magma",
|
|
89
|
-
package: "
|
|
84
|
+
package: "0x49e9f06c58a36830fe0d83291f002012e72b00a4ec9b3a6304c40fc5712bb6e3",
|
|
90
85
|
globalConfig: "0x4c4e1402401f72c7d8533d0ed8d5f8949da363c7a3319ccef261ffe153d32f8a",
|
|
91
86
|
},
|
|
92
87
|
haedal_pmm: {
|
|
@@ -95,9 +90,19 @@ export const DEFAULT_CONFIG = {
|
|
|
95
90
|
},
|
|
96
91
|
momentum: {
|
|
97
92
|
name: "Momentum",
|
|
98
|
-
package: "
|
|
93
|
+
package: "0xc84b1ef2ac2ba5c3018e2b8c956ba5d0391e0e46d1daa1926d5a99a6a42526b4",
|
|
99
94
|
version: "0x2375a0b1ec12010aaea3b2545acfa2ad34cfbba03ce4b59f4c39e1e25eed1b2a",
|
|
100
95
|
},
|
|
96
|
+
bluefinx: {
|
|
97
|
+
name: "BluefinX",
|
|
98
|
+
package: "0xf8870f988ab09be7c5820a856bd5e9da84fc7192e095a7a8829919293b00a36c",
|
|
99
|
+
globalConfig: "0xc6b29a60c3924776bedc78df72c127ea52b86aeb655432979a38f13d742dedaa",
|
|
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;
|
|
@@ -19,9 +19,11 @@ export const DEFAULT_SOURCES = [
|
|
|
19
19
|
"stsui",
|
|
20
20
|
"steamm",
|
|
21
21
|
"steamm_oracle_quoter",
|
|
22
|
+
"steamm_oracle_quoter_v2",
|
|
22
23
|
"magma",
|
|
23
24
|
"haedal_pmm",
|
|
24
25
|
"momentum",
|
|
26
|
+
"sevenk_v1",
|
|
25
27
|
];
|
|
26
28
|
export async function getQuote({ tokenIn, tokenOut, amountIn, sources = DEFAULT_SOURCES, commissionBps, targetPools, excludedPools, taker, }) {
|
|
27
29
|
const params = new URLSearchParams({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { normalizeStructTag, parseStructTag } from "@mysten/sui/utils";
|
|
1
|
+
import { normalizeStructTag, parseStructTag, toHex } from "@mysten/sui/utils";
|
|
2
2
|
import { SuiUtils } from "../../utils/sui";
|
|
3
3
|
export class BaseContract {
|
|
4
4
|
swapInfo;
|
|
@@ -26,4 +26,17 @@ export class BaseContract {
|
|
|
26
26
|
}
|
|
27
27
|
return extra;
|
|
28
28
|
}
|
|
29
|
+
getPythPriceInfoId(oracle) {
|
|
30
|
+
// FIXME: deprecation price_identifier in the next version
|
|
31
|
+
const bytes = oracle?.Pyth?.bytes || oracle?.Pyth?.price_identifier?.bytes;
|
|
32
|
+
if (!bytes) {
|
|
33
|
+
throw new Error(`Invalid oracle info for getPythPriceInfoId`);
|
|
34
|
+
}
|
|
35
|
+
const feedId = "0x" + toHex(Uint8Array.from(bytes));
|
|
36
|
+
const id = this.pythMap[feedId];
|
|
37
|
+
if (!id) {
|
|
38
|
+
throw new Error(`Missing price info for oracle ${feedId}`);
|
|
39
|
+
}
|
|
40
|
+
return id;
|
|
41
|
+
}
|
|
29
42
|
}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { SUI_CLOCK_OBJECT_ID } from "@mysten/sui/utils";
|
|
2
|
-
import { BaseContract } from "../base";
|
|
3
2
|
import { SuiUtils } from "../../../utils/sui";
|
|
3
|
+
import { BaseContract } from "../base";
|
|
4
4
|
export class HaedalPMMContract extends BaseContract {
|
|
5
5
|
async swap(tx) {
|
|
6
6
|
const [coinX, coinY] = this.swapInfo.pool.allTokens;
|
|
7
7
|
const xToY = this.swapInfo.swapXtoY;
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
throw new Error("x_price_id and y_price_id are required");
|
|
11
|
-
}
|
|
8
|
+
const oracleX = this.getPythPriceInfoId(this.extra.oracles?.[0]);
|
|
9
|
+
const oracleY = this.getPythPriceInfoId(this.extra.oracles?.[1]);
|
|
12
10
|
const config = this.config.haedal_pmm;
|
|
13
11
|
const [coinOut] = tx.moveCall({
|
|
14
12
|
target: `${config.package}::trader::${xToY ? "sell_base_coin" : "sell_quote_coin"}`,
|
|
@@ -16,8 +14,8 @@ export class HaedalPMMContract extends BaseContract {
|
|
|
16
14
|
arguments: [
|
|
17
15
|
tx.object(this.swapInfo.poolId),
|
|
18
16
|
tx.object(SUI_CLOCK_OBJECT_ID),
|
|
19
|
-
tx.object(
|
|
20
|
-
tx.object(
|
|
17
|
+
tx.object(oracleX), // pyth pricefeed for x
|
|
18
|
+
tx.object(oracleY), // pyth pricefeed for y
|
|
21
19
|
this.inputCoinObject, // mutable coin
|
|
22
20
|
this.getInputCoinValue(tx), // swap amount
|
|
23
21
|
tx.pure.u64(0), // min output amount
|
|
@@ -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,
|
|
@@ -34,8 +35,10 @@ export const ProtocolContract = {
|
|
|
34
35
|
stsui: StSuiContract,
|
|
35
36
|
steamm: SteammContract,
|
|
36
37
|
steamm_oracle_quoter: SteammContract,
|
|
38
|
+
steamm_oracle_quoter_v2: SteammContract,
|
|
37
39
|
magma: MagmaContract,
|
|
38
40
|
haedal_pmm: HaedalPMMContract,
|
|
39
41
|
momentum: MomentumContract,
|
|
40
42
|
bluefinx: BluefinXContract,
|
|
43
|
+
sevenk_v1: SevenKV1,
|
|
41
44
|
};
|
|
@@ -4,10 +4,8 @@ export class ObricContract extends BaseContract {
|
|
|
4
4
|
async swap(tx) {
|
|
5
5
|
const [coinX, coinY] = this.swapInfo.pool.allTokens;
|
|
6
6
|
const xToY = this.swapInfo.swapXtoY;
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
throw new Error("x_price_id and y_price_id are required");
|
|
10
|
-
}
|
|
7
|
+
const oracleX = this.getPythPriceInfoId(this.extra.oracles?.[0]);
|
|
8
|
+
const oracleY = this.getPythPriceInfoId(this.extra.oracles?.[1]);
|
|
11
9
|
const { package: PACKAGE_ID, pythState: PYTH_STATE } = this.config.obric;
|
|
12
10
|
const [coinOut] = tx.moveCall({
|
|
13
11
|
target: `${PACKAGE_ID}::v2::${xToY ? "swap_x_to_y" : "swap_y_to_x"}`,
|
|
@@ -16,8 +14,8 @@ export class ObricContract extends BaseContract {
|
|
|
16
14
|
tx.object(this.swapInfo.poolId),
|
|
17
15
|
tx.object(SUI_CLOCK_OBJECT_ID),
|
|
18
16
|
tx.object(PYTH_STATE),
|
|
19
|
-
tx.object(
|
|
20
|
-
tx.object(
|
|
17
|
+
tx.object(oracleX), // pyth pricefeed for x
|
|
18
|
+
tx.object(oracleY), // pyth pricefeed for y
|
|
21
19
|
this.inputCoinObject,
|
|
22
20
|
],
|
|
23
21
|
});
|
|
@@ -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,10 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { normalizeStructTag, parseStructTag, SUI_CLOCK_OBJECT_ID, toHex, } from "@mysten/sui/utils";
|
|
1
|
+
import { normalizeStructTag, parseStructTag, SUI_CLOCK_OBJECT_ID, } from "@mysten/sui/utils";
|
|
3
2
|
import { SuiUtils } from "../../../utils/sui";
|
|
3
|
+
import { BaseContract } from "../base";
|
|
4
4
|
export class SteammContract extends BaseContract {
|
|
5
5
|
async swap(tx) {
|
|
6
6
|
if (this.extra.poolStructTag.includes("omm::OracleQuoter")) {
|
|
7
|
-
return this.ommSwap(tx);
|
|
7
|
+
return this.ommSwap(tx, "v1");
|
|
8
|
+
}
|
|
9
|
+
else if (this.extra.poolStructTag.includes("omm_v2::OracleQuoterV2")) {
|
|
10
|
+
return this.ommSwap(tx, "v2");
|
|
8
11
|
}
|
|
9
12
|
else if (this.extra.poolStructTag.includes("cpmm::CpQuoter")) {
|
|
10
13
|
return this.cpmmSwap(tx);
|
|
@@ -65,7 +68,7 @@ export class SteammContract extends BaseContract {
|
|
|
65
68
|
SuiUtils.collectDust(tx, this.swapInfo.assetIn, coinIn);
|
|
66
69
|
return coinOut;
|
|
67
70
|
}
|
|
68
|
-
ommSwap(tx) {
|
|
71
|
+
ommSwap(tx, version) {
|
|
69
72
|
const extra = this.swapInfo.extra;
|
|
70
73
|
if (!extra ||
|
|
71
74
|
!extra.bankAStructTag ||
|
|
@@ -93,7 +96,7 @@ export class SteammContract extends BaseContract {
|
|
|
93
96
|
: SuiUtils.zeroCoin(tx, normalizeStructTag(coinTypeB));
|
|
94
97
|
const [priceA, priceB] = this.getOraclePriceUpdate(tx);
|
|
95
98
|
tx.moveCall({
|
|
96
|
-
target: `${this.config.steamm.script}::pool_script_v2
|
|
99
|
+
target: `${this.config.steamm.script}::pool_script_v2::${version === "v1" ? "omm_swap" : "omm_v2_swap"}`,
|
|
97
100
|
typeArguments: [
|
|
98
101
|
lendingMarket,
|
|
99
102
|
coinTypeA,
|
|
@@ -123,18 +126,18 @@ export class SteammContract extends BaseContract {
|
|
|
123
126
|
return coinOut;
|
|
124
127
|
}
|
|
125
128
|
getOraclePriceUpdate(tx) {
|
|
126
|
-
const oracleA = this.extra.oracles?.[0]
|
|
127
|
-
const oracleB = this.extra.oracles?.[1]
|
|
129
|
+
const oracleA = this.getPythPriceInfoId(this.extra.oracles?.[0]);
|
|
130
|
+
const oracleB = this.getPythPriceInfoId(this.extra.oracles?.[1]);
|
|
128
131
|
const registry = this.extra.oracleRegistry;
|
|
129
132
|
const indexes = this.extra.oracleIndexes;
|
|
130
|
-
if (!
|
|
133
|
+
if (!registry || indexes?.length !== 2) {
|
|
131
134
|
throw new Error(`Invalid oracle info for getOraclePriceUpdate`);
|
|
132
135
|
}
|
|
133
136
|
const [a] = tx.moveCall({
|
|
134
137
|
target: `${this.config.steamm.oracle}::oracles::get_pyth_price`,
|
|
135
138
|
arguments: [
|
|
136
139
|
tx.object(registry),
|
|
137
|
-
tx.object(
|
|
140
|
+
tx.object(oracleA),
|
|
138
141
|
tx.pure.u64(indexes[0]),
|
|
139
142
|
tx.object(SUI_CLOCK_OBJECT_ID),
|
|
140
143
|
],
|
|
@@ -143,7 +146,7 @@ export class SteammContract extends BaseContract {
|
|
|
143
146
|
target: `${this.config.steamm.oracle}::oracles::get_pyth_price`,
|
|
144
147
|
arguments: [
|
|
145
148
|
tx.object(registry),
|
|
146
|
-
tx.object(
|
|
149
|
+
tx.object(oracleB),
|
|
147
150
|
tx.pure.u64(indexes[1]),
|
|
148
151
|
tx.object(SUI_CLOCK_OBJECT_ID),
|
|
149
152
|
],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildTx.d.ts","sourceRoot":"","sources":["../../../../../src/features/swap/buildTx.ts"],"names":[],"mappings":"AAcA,OAAO,EACL,aAAa,
|
|
1
|
+
{"version":3,"file":"buildTx.d.ts","sourceRoot":"","sources":["../../../../../src/features/swap/buildTx.ts"],"names":[],"mappings":"AAcA,OAAO,EACL,aAAa,EAId,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAK/C,eAAO,MAAM,OAAO,GAAU,2GAQ3B,aAAa,KAAG,OAAO,CAAC,aAAa,CA4IvC,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,0BA+BR"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Transaction } from "@mysten/sui/transactions";
|
|
2
|
-
import { Config, TxSorSwap } from "../../types/aggregator";
|
|
2
|
+
import { Config, ExtraOracle, TxSorSwap } from "../../types/aggregator";
|
|
3
3
|
import { TransactionResultItem } from "../../types/sui";
|
|
4
4
|
export interface BaseContractParams {
|
|
5
5
|
swapInfo: TxSorSwap;
|
|
@@ -20,5 +20,6 @@ export declare abstract class BaseContract<T = any> {
|
|
|
20
20
|
protected getInputCoinValue(tx: Transaction): import("@mysten/sui/transactions").TransactionArgument;
|
|
21
21
|
protected getTypeParams(): string[];
|
|
22
22
|
protected get extra(): NonNullable<T>;
|
|
23
|
+
protected getPythPriceInfoId(oracle?: ExtraOracle): string;
|
|
23
24
|
}
|
|
24
25
|
//# sourceMappingURL=base.d.ts.map
|
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../../../src/libs/protocols/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAGxD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,SAAS,CAAC;IACpB,eAAe,EAAE,qBAAqB,CAAC;IACvC,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,sDAAsD;IACtD,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACjC;AAED,8BAAsB,YAAY,CAAC,CAAC,GAAG,GAAG;IACxC,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;IACzB,SAAS,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;gBAE9B,EACV,QAAQ,EACR,eAAe,EACf,cAAc,EACd,MAAM,EACN,OAAO,GACR,EAAE,kBAAkB;IAQrB,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,WAAW,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAE9D,SAAS,CAAC,iBAAiB,CAAC,EAAE,EAAE,WAAW;IAQ3C,SAAS,CAAC,aAAa;IAMvB,SAAS,KAAK,KAAK,mBAMlB;IAED,SAAS,CAAC,kBAAkB,CAAC,MAAM,CAAC,EAAE,WAAW;CAclD"}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { Transaction } from "@mysten/sui/transactions";
|
|
2
|
+
import { ExtraOracle } from "../../../types/aggregator";
|
|
2
3
|
import { BaseContract } from "../base";
|
|
3
|
-
|
|
4
|
+
type HaedalPMMExtra = {
|
|
5
|
+
oracles: ExtraOracle[];
|
|
6
|
+
};
|
|
7
|
+
export declare class HaedalPMMContract extends BaseContract<HaedalPMMExtra> {
|
|
4
8
|
swap(tx: Transaction): Promise<{
|
|
5
9
|
$kind: "NestedResult";
|
|
6
10
|
NestedResult: [number, number];
|
|
7
11
|
}>;
|
|
8
12
|
}
|
|
13
|
+
export {};
|
|
9
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/protocols/haedal_pmm/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/haedal_pmm/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,KAAK,cAAc,GAAG;IACpB,OAAO,EAAE,WAAW,EAAE,CAAC;CACxB,CAAC;AACF,qBAAa,iBAAkB,SAAQ,YAAY,CAAC,cAAc,CAAC;IAC3D,IAAI,CAAC,EAAE,EAAE,WAAW;;;;CAyB3B"}
|
|
@@ -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;
|
|
@@ -34,9 +35,11 @@ export declare const ProtocolContract: {
|
|
|
34
35
|
stsui: typeof StSuiContract;
|
|
35
36
|
steamm: typeof SteammContract;
|
|
36
37
|
steamm_oracle_quoter: typeof SteammContract;
|
|
38
|
+
steamm_oracle_quoter_v2: typeof SteammContract;
|
|
37
39
|
magma: typeof MagmaContract;
|
|
38
40
|
haedal_pmm: typeof HaedalPMMContract;
|
|
39
41
|
momentum: typeof MomentumContract;
|
|
40
42
|
bluefinx: typeof BluefinXContract;
|
|
43
|
+
sevenk_v1: typeof SevenKV1;
|
|
41
44
|
};
|
|
42
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"}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { Transaction } from "@mysten/sui/transactions";
|
|
2
|
+
import { ExtraOracle } from "../../../types/aggregator";
|
|
2
3
|
import { BaseContract } from "../base";
|
|
3
|
-
|
|
4
|
+
type ObricExtra = {
|
|
5
|
+
oracles: ExtraOracle[];
|
|
6
|
+
};
|
|
7
|
+
export declare class ObricContract extends BaseContract<ObricExtra> {
|
|
4
8
|
swap(tx: Transaction): Promise<{
|
|
5
9
|
$kind: "NestedResult";
|
|
6
10
|
NestedResult: [number, number];
|
|
7
11
|
}>;
|
|
8
12
|
}
|
|
13
|
+
export {};
|
|
9
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/protocols/obric/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/obric/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,KAAK,UAAU,GAAG;IAChB,OAAO,EAAE,WAAW,EAAE,CAAC;CACxB,CAAC;AACF,qBAAa,aAAc,SAAQ,YAAY,CAAC,UAAU,CAAC;IACnD,IAAI,CAAC,EAAE,EAAE,WAAW;;;;CAuB3B"}
|
|
@@ -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,6 +1,6 @@
|
|
|
1
1
|
import { Transaction } from "@mysten/sui/transactions";
|
|
2
|
-
import { BaseContract } from "../base";
|
|
3
2
|
import { ExtraOracle } from "../../../types/aggregator";
|
|
3
|
+
import { BaseContract } from "../base";
|
|
4
4
|
export type SteamExtra = {
|
|
5
5
|
bankAStructTag: string;
|
|
6
6
|
bankBStructTag: string;
|
|
@@ -10,7 +10,7 @@ export type SteamExtra = {
|
|
|
10
10
|
lendingMarketA: string;
|
|
11
11
|
lendingMarketB: string;
|
|
12
12
|
oracleRegistry?: string;
|
|
13
|
-
oracles
|
|
13
|
+
oracles: ExtraOracle[];
|
|
14
14
|
oracleIndexes?: number[];
|
|
15
15
|
};
|
|
16
16
|
export declare class SteammContract extends BaseContract<SteamExtra> {
|
|
@@ -22,7 +22,7 @@ export declare class SteammContract extends BaseContract<SteamExtra> {
|
|
|
22
22
|
$kind: "NestedResult";
|
|
23
23
|
NestedResult: [number, number];
|
|
24
24
|
};
|
|
25
|
-
ommSwap(tx: Transaction): {
|
|
25
|
+
ommSwap(tx: Transaction, version: "v1" | "v2"): {
|
|
26
26
|
$kind: "NestedResult";
|
|
27
27
|
NestedResult: [number, number];
|
|
28
28
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/protocols/steamm/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/protocols/steamm/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAMvD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,MAAM,MAAM,UAAU,GAAG;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CAC1B,CAAC;AACF,qBAAa,cAAe,SAAQ,YAAY,CAAC,UAAU,CAAC;IACpD,IAAI,CAAC,EAAE,EAAE,WAAW;;;;IAW1B,QAAQ,CAAC,EAAE,EAAE,WAAW;;;;IAmExB,OAAO,CAAC,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,IAAI,GAAG,IAAI;;;;IAuE7C,oBAAoB,CAAC,EAAE,EAAE,WAAW;;;;;;;CA8BrC"}
|
|
@@ -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" | "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,15 +132,13 @@ 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?: {
|
|
138
|
-
|
|
139
|
-
bytes: number[];
|
|
140
|
-
};
|
|
141
|
-
};
|
|
142
|
-
Switchboard?: {
|
|
143
|
-
object_id: string;
|
|
141
|
+
bytes: number[];
|
|
144
142
|
};
|
|
145
143
|
};
|
|
146
144
|
export type AggregatorTx = Transaction | BluefinXTx;
|
|
@@ -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,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,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