@cetusprotocol/aggregator-sdk 0.3.20 → 0.3.22

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.
@@ -33,9 +33,11 @@ describe("router module", () => {
33
33
  keypair = buildTestAccount()
34
34
  }
35
35
 
36
- const wallet = keypair.getPublicKey().toSuiAddress()
36
+ // const wallet = keypair.getPublicKey().toSuiAddress()
37
+ const wallet =
38
+ "0x073dfdcbb5d6552efd954273f7ab9e0b918d7bf30103e3f4e632502289cd92ee"
39
+
37
40
  console.log("wallet: ", wallet)
38
- // const wallet = "0x02e39bddb06f617112595378fef741f523fbf22ea188cca99ecb61a9904dda2a"
39
41
 
40
42
  const endpoint = aggregatorURL
41
43
 
@@ -62,7 +64,7 @@ describe("router module", () => {
62
64
  amount: new BN(amount),
63
65
  byAmountIn,
64
66
  pools: [
65
- '0xb8d7d9e66a60c239e7a60110efcf8de6c705580ed924d0dde141f4a0e2c90105'
67
+ "0xb8d7d9e66a60c239e7a60110efcf8de6c705580ed924d0dde141f4a0e2c90105",
66
68
  ],
67
69
  })
68
70
 
@@ -109,8 +111,9 @@ describe("router module", () => {
109
111
 
110
112
  test("Build router tx", async () => {
111
113
  const byAmountIn = true
112
- const amount = "10000"
113
- const from = "0x83556891f4a0f233ce7b05cfe7f957d4020492a34f5405b2cb9377d060bef4bf::spring_sui::SPRING_SUI"
114
+ const amount = "100000"
115
+ const from =
116
+ "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC"
114
117
  const target = "0x2::sui::SUI"
115
118
 
116
119
  const res = await client.findRouters({
@@ -119,7 +122,8 @@ describe("router module", () => {
119
122
  amount: new BN(amount),
120
123
  byAmountIn,
121
124
  depth: 3,
122
- providers: ["SUILEND"],
125
+ providers: ["CETUS"],
126
+ splitCount: 1,
123
127
  })
124
128
 
125
129
  if (res != null) {
@@ -205,8 +209,18 @@ describe("router module", () => {
205
209
 
206
210
  test("Test Multi Input", async () => {
207
211
  const amounts = [1000000000, 2000000000, 10000000000000]
208
- const froms = [testData.M_USDC, testData.M_SUI, testData.M_CETUS, testData.M_NAVI]
209
- const tos = [testData.M_SUI, testData.M_USDC, testData.M_USDC, testData.M_SUI]
212
+ const froms = [
213
+ testData.M_USDC,
214
+ testData.M_SUI,
215
+ testData.M_CETUS,
216
+ testData.M_NAVI,
217
+ ]
218
+ const tos = [
219
+ testData.M_SUI,
220
+ testData.M_USDC,
221
+ testData.M_USDC,
222
+ testData.M_SUI,
223
+ ]
210
224
 
211
225
  for (let i = 0; i < froms.length; i++) {
212
226
  const from = froms[i]
@@ -339,12 +353,12 @@ describe("router module", () => {
339
353
  console.log("config", config)
340
354
  }, 60000)
341
355
 
342
-
343
356
  test("Find router", async () => {
344
357
  const amount = "4239267610000000000"
345
358
  const res = await client.findRouters({
346
- from: '0x2::sui::SUI',
347
- target: '0x188c6239bda71ba5751990cc0271e91b6362c67bccf7aa381e018db7fe39c6d7::BUILD::BUILD',
359
+ from: "0x2::sui::SUI",
360
+ target:
361
+ "0x188c6239bda71ba5751990cc0271e91b6362c67bccf7aa381e018db7fe39c6d7::BUILD::BUILD",
348
362
  amount: new BN(amount),
349
363
  byAmountIn: true,
350
364
  depth: 3,