@cetusprotocol/aggregator-sdk 0.3.16 → 0.3.17
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/README.md +1 -1
- package/dist/index.js +5 -2
- package/dist/index.mjs +5 -2
- package/package.json +1 -1
- package/src/api.ts +1 -1
- package/src/utils/coin.ts +5 -1
- package/tests/router.test.ts +5 -5
package/README.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -5708,8 +5708,11 @@ function buildInputCoin(txb, allCoins, amount, coinType) {
|
|
|
5708
5708
|
mergedCoin.map((coin) => txb.object(coin))
|
|
5709
5709
|
);
|
|
5710
5710
|
}
|
|
5711
|
+
const targetCoin = txb.splitCoins(txb.object(masterCoin), [
|
|
5712
|
+
txb.pure.u64(amount.toString())
|
|
5713
|
+
]);
|
|
5711
5714
|
return {
|
|
5712
|
-
targetCoin
|
|
5715
|
+
targetCoin,
|
|
5713
5716
|
isMintZeroCoin: false,
|
|
5714
5717
|
targetCoinAmount: Number(amount.toString())
|
|
5715
5718
|
};
|
|
@@ -6795,7 +6798,7 @@ function getRouter(endpoint, params) {
|
|
|
6795
6798
|
url += `&providers=${providers.join(",")}`;
|
|
6796
6799
|
}
|
|
6797
6800
|
}
|
|
6798
|
-
url += "&v=
|
|
6801
|
+
url += "&v=1000317";
|
|
6799
6802
|
const response = yield fetch(url);
|
|
6800
6803
|
return response;
|
|
6801
6804
|
} catch (error) {
|
package/dist/index.mjs
CHANGED
|
@@ -5706,8 +5706,11 @@ function buildInputCoin(txb, allCoins, amount, coinType) {
|
|
|
5706
5706
|
mergedCoin.map((coin) => txb.object(coin))
|
|
5707
5707
|
);
|
|
5708
5708
|
}
|
|
5709
|
+
const targetCoin = txb.splitCoins(txb.object(masterCoin), [
|
|
5710
|
+
txb.pure.u64(amount.toString())
|
|
5711
|
+
]);
|
|
5709
5712
|
return {
|
|
5710
|
-
targetCoin
|
|
5713
|
+
targetCoin,
|
|
5711
5714
|
isMintZeroCoin: false,
|
|
5712
5715
|
targetCoinAmount: Number(amount.toString())
|
|
5713
5716
|
};
|
|
@@ -6793,7 +6796,7 @@ function getRouter(endpoint, params) {
|
|
|
6793
6796
|
url += `&providers=${providers.join(",")}`;
|
|
6794
6797
|
}
|
|
6795
6798
|
}
|
|
6796
|
-
url += "&v=
|
|
6799
|
+
url += "&v=1000317";
|
|
6797
6800
|
const response = yield fetch(url);
|
|
6798
6801
|
return response;
|
|
6799
6802
|
} catch (error) {
|
package/package.json
CHANGED
package/src/api.ts
CHANGED
package/src/utils/coin.ts
CHANGED
|
@@ -116,8 +116,12 @@ export function buildInputCoin(
|
|
|
116
116
|
)
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
+
const targetCoin = txb.splitCoins(txb.object(masterCoin), [
|
|
120
|
+
txb.pure.u64(amount.toString()),
|
|
121
|
+
])
|
|
122
|
+
|
|
119
123
|
return {
|
|
120
|
-
targetCoin
|
|
124
|
+
targetCoin,
|
|
121
125
|
isMintZeroCoin: false,
|
|
122
126
|
targetCoinAmount: Number(amount.toString()),
|
|
123
127
|
}
|
package/tests/router.test.ts
CHANGED
|
@@ -33,9 +33,9 @@ describe("router module", () => {
|
|
|
33
33
|
keypair = buildTestAccount()
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const wallet = "
|
|
36
|
+
const wallet = keypair.getPublicKey().toSuiAddress()
|
|
37
|
+
console.log("wallet: ", wallet)
|
|
38
|
+
// const wallet = "0x02e39bddb06f617112595378fef741f523fbf22ea188cca99ecb61a9904dda2a"
|
|
39
39
|
|
|
40
40
|
const endpoint = aggregatorURL
|
|
41
41
|
|
|
@@ -110,9 +110,9 @@ describe("router module", () => {
|
|
|
110
110
|
|
|
111
111
|
test("Build router tx", async () => {
|
|
112
112
|
const byAmountIn = true
|
|
113
|
-
const amount = "
|
|
113
|
+
const amount = "30000000"
|
|
114
114
|
const target = "0x375f70cf2ae4c00bf37117d0c85a2c71545e6ee05c4a5c7d282cd66a4504b068::usdt::USDT"
|
|
115
|
-
const from = "
|
|
115
|
+
const from = "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC"
|
|
116
116
|
|
|
117
117
|
const res = await client.findRouters({
|
|
118
118
|
from,
|