@interest-protocol/vortex-sdk 8.4.0 → 9.0.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@interest-protocol/vortex-sdk",
3
- "version": "8.4.0",
3
+ "version": "9.0.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "module": "./dist/index.mjs",
@@ -37,8 +37,8 @@
37
37
  "rimraf": "^6.0.1",
38
38
  "ts-jest": "^29.1.1",
39
39
  "tsup": "^8.3.5",
40
- "@interest-protocol/prettier-config": "1.0.0",
41
- "@interest-protocol/typescript-config": "1.0.0"
40
+ "@interest-protocol/typescript-config": "1.0.0",
41
+ "@interest-protocol/prettier-config": "1.0.0"
42
42
  },
43
43
  "publishConfig": {
44
44
  "access": "public",
package/src/deposit.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Transaction } from '@mysten/sui/transactions';
1
+ import { Transaction, coinWithBalance } from '@mysten/sui/transactions';
2
2
  import invariant from 'tiny-invariant';
3
3
  import { BN254_FIELD_MODULUS } from './constants';
4
4
  import { DepositArgs } from './vortex.types';
@@ -26,7 +26,7 @@ export const deposit = async ({
26
26
 
27
27
  const {
28
28
  extData,
29
- tx: tx3,
29
+ tx: tx2,
30
30
  moveProof,
31
31
  } = await prepareDepositProof({
32
32
  tx,
@@ -41,13 +41,18 @@ export const deposit = async ({
41
41
  relayerFee,
42
42
  });
43
43
 
44
- const suiCoinDeposit = tx3.splitCoins(tx3.gas, [tx3.pure.u64(amount)]);
44
+ const vortexPoolObject = await vortexSdk.resolveVortexPool(vortexPool);
45
+
46
+ const deposit = coinWithBalance({
47
+ balance: amount,
48
+ type: vortexPoolObject.coinType,
49
+ })(tx2);
45
50
 
46
51
  return vortexSdk.transact({
47
52
  vortexPool,
48
- tx: tx3,
53
+ tx: tx2,
49
54
  proof: moveProof,
50
55
  extData: extData,
51
- deposit: suiCoinDeposit,
56
+ deposit,
52
57
  });
53
58
  };