@cetusprotocol/aggregator-sdk 0.0.0-experimental-20240929115104 → 0.0.0-experimental-20240929131950
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 +4 -8
- package/dist/index.mjs +4 -8
- package/package.json +1 -1
- package/src/client.ts +1 -1
- package/src/transaction/bluemove.ts +5 -8
package/dist/index.js
CHANGED
|
@@ -5979,16 +5979,12 @@ var Bluemove = class {
|
|
|
5979
5979
|
}
|
|
5980
5980
|
swap(client, txb, path, inputCoin) {
|
|
5981
5981
|
return __async(this, null, function* () {
|
|
5982
|
-
const { from, target } = path;
|
|
5983
|
-
const
|
|
5984
|
-
if (!direction) {
|
|
5985
|
-
throw new Error("Bluemove not support b2a swap");
|
|
5986
|
-
}
|
|
5987
|
-
const func = "swap_a2b";
|
|
5982
|
+
const { direction, from, target } = path;
|
|
5983
|
+
const [func, coinAType, coinBType] = direction ? ["swap_a2b", from, target] : ["swap_b2a", target, from];
|
|
5988
5984
|
const args = [txb.object(this.dexInfo), inputCoin];
|
|
5989
5985
|
const res = txb.moveCall({
|
|
5990
5986
|
target: `${client.publishedAt()}::bluemove::${func}`,
|
|
5991
|
-
typeArguments: [
|
|
5987
|
+
typeArguments: [coinAType, coinBType],
|
|
5992
5988
|
arguments: args
|
|
5993
5989
|
});
|
|
5994
5990
|
return res;
|
|
@@ -6246,7 +6242,7 @@ var AggregatorClient6 = class {
|
|
|
6246
6242
|
}
|
|
6247
6243
|
publishedAt() {
|
|
6248
6244
|
if (this.env === 0 /* Mainnet */) {
|
|
6249
|
-
return "
|
|
6245
|
+
return "0x57cb657a4f6401b07e975a4e4326206e8ba9c585d76e639793d9132e56e26c8b";
|
|
6250
6246
|
} else {
|
|
6251
6247
|
return "0x6cbaa3e9fbe902d90191b12f315932bc58079cba422bafbd4b4369f80e61f595";
|
|
6252
6248
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -5977,16 +5977,12 @@ var Bluemove = class {
|
|
|
5977
5977
|
}
|
|
5978
5978
|
swap(client, txb, path, inputCoin) {
|
|
5979
5979
|
return __async(this, null, function* () {
|
|
5980
|
-
const { from, target } = path;
|
|
5981
|
-
const
|
|
5982
|
-
if (!direction) {
|
|
5983
|
-
throw new Error("Bluemove not support b2a swap");
|
|
5984
|
-
}
|
|
5985
|
-
const func = "swap_a2b";
|
|
5980
|
+
const { direction, from, target } = path;
|
|
5981
|
+
const [func, coinAType, coinBType] = direction ? ["swap_a2b", from, target] : ["swap_b2a", target, from];
|
|
5986
5982
|
const args = [txb.object(this.dexInfo), inputCoin];
|
|
5987
5983
|
const res = txb.moveCall({
|
|
5988
5984
|
target: `${client.publishedAt()}::bluemove::${func}`,
|
|
5989
|
-
typeArguments: [
|
|
5985
|
+
typeArguments: [coinAType, coinBType],
|
|
5990
5986
|
arguments: args
|
|
5991
5987
|
});
|
|
5992
5988
|
return res;
|
|
@@ -6244,7 +6240,7 @@ var AggregatorClient6 = class {
|
|
|
6244
6240
|
}
|
|
6245
6241
|
publishedAt() {
|
|
6246
6242
|
if (this.env === 0 /* Mainnet */) {
|
|
6247
|
-
return "
|
|
6243
|
+
return "0x57cb657a4f6401b07e975a4e4326206e8ba9c585d76e639793d9132e56e26c8b";
|
|
6248
6244
|
} else {
|
|
6249
6245
|
return "0x6cbaa3e9fbe902d90191b12f315932bc58079cba422bafbd4b4369f80e61f595";
|
|
6250
6246
|
}
|
package/package.json
CHANGED
package/src/client.ts
CHANGED
|
@@ -338,7 +338,7 @@ export class AggregatorClient {
|
|
|
338
338
|
publishedAt(): string {
|
|
339
339
|
if (this.env === Env.Mainnet) {
|
|
340
340
|
// return "0xeffc8ae61f439bb34c9b905ff8f29ec56873dcedf81c7123ff2f1f67c45ec302"
|
|
341
|
-
return "
|
|
341
|
+
return "0x57cb657a4f6401b07e975a4e4326206e8ba9c585d76e639793d9132e56e26c8b"
|
|
342
342
|
} else {
|
|
343
343
|
return "0x6cbaa3e9fbe902d90191b12f315932bc58079cba422bafbd4b4369f80e61f595"
|
|
344
344
|
}
|
|
@@ -22,20 +22,17 @@ export class Bluemove implements Dex {
|
|
|
22
22
|
path: Path,
|
|
23
23
|
inputCoin: TransactionObjectArgument
|
|
24
24
|
): Promise<TransactionObjectArgument> {
|
|
25
|
-
const { from, target } = path
|
|
25
|
+
const { direction, from, target } = path
|
|
26
26
|
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
const func = "swap_a2b"
|
|
27
|
+
const [func, coinAType, coinBType] = direction
|
|
28
|
+
? ["swap_a2b", from, target]
|
|
29
|
+
: ["swap_b2a", target, from]
|
|
33
30
|
|
|
34
31
|
const args = [txb.object(this.dexInfo), inputCoin]
|
|
35
32
|
|
|
36
33
|
const res = txb.moveCall({
|
|
37
34
|
target: `${client.publishedAt()}::bluemove::${func}`,
|
|
38
|
-
typeArguments: [
|
|
35
|
+
typeArguments: [coinAType, coinBType],
|
|
39
36
|
arguments: args,
|
|
40
37
|
}) as TransactionObjectArgument
|
|
41
38
|
|