@interest-protocol/vortex-sdk 8.3.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.
@@ -31,8 +31,8 @@ export declare const toProveInput: ({ root, merklePath0, merklePath1, publicAmou
31
31
  outputCommitment1: string;
32
32
  hashedAccountSecret: string;
33
33
  accountSecret: string;
34
- inPrivateKey0: bigint;
35
- inPrivateKey1: bigint;
34
+ inPrivateKey0: string;
35
+ inPrivateKey1: string;
36
36
  inAmount0: string;
37
37
  inAmount1: string;
38
38
  inBlinding0: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@interest-protocol/vortex-sdk",
3
- "version": "8.3.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
  };
@@ -134,8 +134,8 @@ export const toProveInput = ({
134
134
  accountSecret === 0n ? '0' : poseidon1(accountSecret).toString(),
135
135
 
136
136
  accountSecret: accountSecret === 0n ? '12345' : accountSecret.toString(),
137
- inPrivateKey0: vortexKeypair.privateKey,
138
- inPrivateKey1: vortexKeypair.privateKey,
137
+ inPrivateKey0: vortexKeypair.privateKey.toString(),
138
+ inPrivateKey1: vortexKeypair.privateKey.toString(),
139
139
  inAmount0: inputUtxo0.amount.toString(),
140
140
  inAmount1: inputUtxo1.amount.toString(),
141
141
  inBlinding0: inputUtxo0.blinding.toString(),