@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 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()}::aftermath::${func}`,
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
- a2b: path.direction,
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()}::aftermath::${func}`,
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
- a2b: path.direction,
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-20240816181354",
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.5",
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
@@ -446,7 +446,7 @@ export function parseRouterResponse(data: any): RouterData {
446
446
 
447
447
  return {
448
448
  id: path.id,
449
- a2b: path.direction,
449
+ direction: path.direction,
450
450
  provider: path.provider,
451
451
  from: path.from,
452
452
  target: path.target,
@@ -108,7 +108,7 @@ export class DeepbookV2 implements Dex {
108
108
  ]
109
109
 
110
110
  const res = txb.moveCall({
111
- target: `${client.publishedAt()}::aftermath::${func}`,
111
+ target: `${client.publishedAt()}::deepbook::${func}`,
112
112
  typeArguments: [coinAType, coinBType],
113
113
  arguments: args,
114
114
  }) as TransactionArgument
@@ -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
- // keypair = secret
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 = "949000000000"
122
+ const amount = "1000000"
122
123
 
123
- const from = M_SUI
124
- const target = M_USDC
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
- "KRIYAV2",
138
- "TURBOS",
134
+ // "CETUS",
135
+ // "DEEPBOOKV2",
136
+ // "AFTERMATH",
137
+ // "FLOWX",
138
+ "KRIYA",
139
+ // "TURBOS",
139
140
  ],
140
141
  })
141
142