@cetusprotocol/aggregator-sdk 0.0.0-experimental-20240816181354 → 0.0.0-experimental-20240819150723
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/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +2 -2
- package/src/client.ts +1 -1
- package/src/transaction/deepbook_v2.ts +1 -1
- package/tests/router.test.ts +14 -13
package/dist/index.js
CHANGED
|
@@ -5111,7 +5111,7 @@ var DeepbookV2 = class {
|
|
|
5111
5111
|
txb.object(CLOCK_ADDRESS)
|
|
5112
5112
|
];
|
|
5113
5113
|
const res = txb.moveCall({
|
|
5114
|
-
target: `${client.publishedAt()}::
|
|
5114
|
+
target: `${client.publishedAt()}::deepbook::${func}`,
|
|
5115
5115
|
typeArguments: [coinAType, coinBType],
|
|
5116
5116
|
arguments: args
|
|
5117
5117
|
});
|
|
@@ -6208,7 +6208,7 @@ function parseRouterResponse(data) {
|
|
|
6208
6208
|
}
|
|
6209
6209
|
return {
|
|
6210
6210
|
id: path.id,
|
|
6211
|
-
|
|
6211
|
+
direction: path.direction,
|
|
6212
6212
|
provider: path.provider,
|
|
6213
6213
|
from: path.from,
|
|
6214
6214
|
target: path.target,
|
package/dist/index.mjs
CHANGED
|
@@ -5109,7 +5109,7 @@ var DeepbookV2 = class {
|
|
|
5109
5109
|
txb.object(CLOCK_ADDRESS)
|
|
5110
5110
|
];
|
|
5111
5111
|
const res = txb.moveCall({
|
|
5112
|
-
target: `${client.publishedAt()}::
|
|
5112
|
+
target: `${client.publishedAt()}::deepbook::${func}`,
|
|
5113
5113
|
typeArguments: [coinAType, coinBType],
|
|
5114
5114
|
arguments: args
|
|
5115
5115
|
});
|
|
@@ -6206,7 +6206,7 @@ function parseRouterResponse(data) {
|
|
|
6206
6206
|
}
|
|
6207
6207
|
return {
|
|
6208
6208
|
id: path.id,
|
|
6209
|
-
|
|
6209
|
+
direction: path.direction,
|
|
6210
6210
|
provider: path.provider,
|
|
6211
6211
|
from: path.from,
|
|
6212
6212
|
target: path.target,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cetusprotocol/aggregator-sdk",
|
|
3
|
-
"version": "0.0.0-experimental-
|
|
3
|
+
"version": "0.0.0-experimental-20240819150723",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"@babel/preset-env": "^7.24.5",
|
|
28
28
|
"@babel/preset-typescript": "^7.24.1",
|
|
29
29
|
"@jest/globals": "^29.7.0",
|
|
30
|
-
"@mysten/sui": "^1.0
|
|
30
|
+
"@mysten/sui": "^1.6.0",
|
|
31
31
|
"@types/jest": "^29.5.12",
|
|
32
32
|
"@types/node": "^20.12.12",
|
|
33
33
|
"babel-jest": "^29.7.0",
|
package/src/client.ts
CHANGED
|
@@ -108,7 +108,7 @@ export class DeepbookV2 implements Dex {
|
|
|
108
108
|
]
|
|
109
109
|
|
|
110
110
|
const res = txb.moveCall({
|
|
111
|
-
target: `${client.publishedAt()}::
|
|
111
|
+
target: `${client.publishedAt()}::deepbook::${func}`,
|
|
112
112
|
typeArguments: [coinAType, coinBType],
|
|
113
113
|
arguments: args,
|
|
114
114
|
}) as TransactionArgument
|
package/tests/router.test.ts
CHANGED
|
@@ -28,14 +28,15 @@ describe("router module", () => {
|
|
|
28
28
|
const secret = process.env.SUI_WALLET_SECRET!
|
|
29
29
|
|
|
30
30
|
// const byte = Buffer.from(secret, "hex")
|
|
31
|
-
|
|
32
|
-
// ? Ed25519Keypair.fromSecretKey(u8Array.slice(1, 33))
|
|
33
|
-
// : buildTestAccount()
|
|
31
|
+
|
|
34
32
|
const byte = Buffer.from(secret, "base64")
|
|
35
33
|
const u8Array = new Uint8Array(byte)
|
|
36
34
|
const secretKey = fromB64(secret)
|
|
37
35
|
|
|
38
|
-
keypair = Ed25519Keypair.fromSecretKey(fromB64(secret).slice(1, 33))
|
|
36
|
+
// keypair = Ed25519Keypair.fromSecretKey(fromB64(secret).slice(1, 33))
|
|
37
|
+
keypair = secret
|
|
38
|
+
? Ed25519Keypair.fromSecretKey(u8Array.slice(1, 33))
|
|
39
|
+
: buildTestAccount()
|
|
39
40
|
|
|
40
41
|
// const wallet = keypair.getPublicKey().toSuiAddress()
|
|
41
42
|
|
|
@@ -118,10 +119,10 @@ describe("router module", () => {
|
|
|
118
119
|
|
|
119
120
|
test("Build router tx", async () => {
|
|
120
121
|
const byAmountIn = true
|
|
121
|
-
const amount = "
|
|
122
|
+
const amount = "1000000"
|
|
122
123
|
|
|
123
|
-
const from =
|
|
124
|
-
const target =
|
|
124
|
+
const from = M_USDC
|
|
125
|
+
const target = M_SUI
|
|
125
126
|
|
|
126
127
|
const res = await client.findRouters({
|
|
127
128
|
from,
|
|
@@ -130,12 +131,12 @@ describe("router module", () => {
|
|
|
130
131
|
byAmountIn,
|
|
131
132
|
depth: 3,
|
|
132
133
|
providers: [
|
|
133
|
-
"CETUS",
|
|
134
|
-
"DEEPBOOKV2",
|
|
135
|
-
"AFTERMATH",
|
|
136
|
-
"FLOWX",
|
|
137
|
-
"
|
|
138
|
-
"TURBOS",
|
|
134
|
+
// "CETUS",
|
|
135
|
+
// "DEEPBOOKV2",
|
|
136
|
+
// "AFTERMATH",
|
|
137
|
+
// "FLOWX",
|
|
138
|
+
"KRIYA",
|
|
139
|
+
// "TURBOS",
|
|
139
140
|
],
|
|
140
141
|
})
|
|
141
142
|
|