@interest-protocol/vortex-sdk 4.2.0 → 5.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/dist/index.mjs CHANGED
@@ -3370,10 +3370,10 @@ const ERROR_CODES = {
3370
3370
  13: 'Invalid relayer',
3371
3371
  14: 'Invalid output flag',
3372
3372
  };
3373
- const VORTEX_PACKAGE_ID = '0x4d505443700db57e664f024b4cdfe315a6b80ddc4d6b9f1013c7b68682edd4ab';
3374
- const UPGRADE_CAP = '0x6c4464ca68d4bcd0c0626dcbb7c2b7ec37cb65a6cc74ffb2c16cd8cff3184004';
3375
- const REGISTRY_OBJECT_ID = '0x58bde5ffed343073d012d28c6955a8ee50caaefd085196e837150bc810e996c0';
3376
- const INITIAL_SHARED_VERSION = '4';
3373
+ const VORTEX_PACKAGE_ID = '0x083c6d01af7707749d6c93e54deae4ef582ef71306f8faade671e9255ad4494c';
3374
+ const UPGRADE_CAP = '0xc51649a7ecd42fff5bdf56ff6f7c9f0cad9cdb15c0c0ed4ce464314df821dfb4';
3375
+ const REGISTRY_OBJECT_ID = '0x4189526def3e9af0a5cd5f24c3a1d736fff7792bbc6f320d02db6f15e47577ba';
3376
+ const INITIAL_SHARED_VERSION = '395367340';
3377
3377
  const LSK_FETCH_OFFSET = 'fetch_offset';
3378
3378
  const LSK_ENCRYPTED_OUTPUTS = 'encrypted_outputs';
3379
3379
  const VORTEX_SIGNATURE_DOMAIN = 'VORTEXFI.XYZ';
@@ -3382,7 +3382,7 @@ const TREASURY_ADDRESS = '0x894261575b948c035d002adc3ca4d73c683c01a1bfafac183870
3382
3382
  const DEPOSIT_FEE_IN_BASIS_POINTS = 50n;
3383
3383
  const BASIS_POINTS = 10000n;
3384
3384
  const VORTEX_POOL_IDS = {
3385
- [SUI_TYPE_ARG]: '0x1d8ddda4727146fd39f8181578ae71cd0f828039c68b4bfdba8a7499dda1d84d',
3385
+ [SUI_TYPE_ARG]: '0x31d848dbd5a19cbfa99f880023cab2533766cca30267e9f45665acf9cfc9cc8c',
3386
3386
  };
3387
3387
 
3388
3388
  /******************************************************************************
@@ -39597,7 +39597,7 @@ const vortexSDK = new Vortex({
39597
39597
  objectId: REGISTRY_OBJECT_ID,
39598
39598
  initialSharedVersion: INITIAL_SHARED_VERSION,
39599
39599
  },
39600
- fullNodeUrl: getFullnodeUrl('devnet'),
39600
+ fullNodeUrl: getFullnodeUrl('testnet'),
39601
39601
  });
39602
39602
 
39603
39603
  // packages/vortex/src/entities/merkle-tree.ts
@@ -39626,7 +39626,11 @@ const prepareDepositProof = async ({ tx, amount, accountSecret, unspentUtxos, vo
39626
39626
  keypair: vortexKeypair,
39627
39627
  vortexPool: vortexObjectId,
39628
39628
  });
39629
- const nextIndex = await vortexSdk.nextIndex(vortexPool);
39629
+ const [nextIndex, merklePath0, merklePath1] = await Promise.all([
39630
+ vortexSdk.nextIndex(vortexPool),
39631
+ getMerklePathFn(inputUtxo0),
39632
+ getMerklePathFn(inputUtxo1),
39633
+ ]);
39630
39634
  // Calculate output UTXO0 amount: if using unspent UTXOs, include their amounts
39631
39635
  const outputUtxo0 = new Utxo({
39632
39636
  amount: amount + inputUtxo0.amount + inputUtxo1.amount - relayerFee,
@@ -39655,8 +39659,8 @@ const prepareDepositProof = async ({ tx, amount, accountSecret, unspentUtxos, vo
39655
39659
  vortexObjectId,
39656
39660
  accountSecret,
39657
39661
  root,
39658
- merklePath0: await getMerklePathFn(inputUtxo0),
39659
- merklePath1: await getMerklePathFn(inputUtxo1),
39662
+ merklePath0,
39663
+ merklePath1,
39660
39664
  publicAmount: amount - relayerFee,
39661
39665
  nullifier0,
39662
39666
  nullifier1,
@@ -39750,7 +39754,11 @@ const prepareWithdraw = async ({ tx = new Transaction(), amount, unspentUtxos =
39750
39754
  });
39751
39755
  const totalWithdrawAmount = inputUtxo0.amount + inputUtxo1.amount;
39752
39756
  const changeAmount = totalWithdrawAmount - amount;
39753
- const nextIndex = await vortexSdk.nextIndex(vortexPool);
39757
+ const [nextIndex, merklePath0, merklePath1] = await Promise.all([
39758
+ vortexSdk.nextIndex(vortexPool),
39759
+ getMerklePathFn(inputUtxo0),
39760
+ getMerklePathFn(inputUtxo1),
39761
+ ]);
39754
39762
  const outputUtxo0 = new Utxo({
39755
39763
  amount: changeAmount,
39756
39764
  index: nextIndex,
@@ -39779,8 +39787,8 @@ const prepareWithdraw = async ({ tx = new Transaction(), amount, unspentUtxos =
39779
39787
  vortexObjectId,
39780
39788
  accountSecret,
39781
39789
  root,
39782
- merklePath0: await getMerklePathFn(inputUtxo0),
39783
- merklePath1: await getMerklePathFn(inputUtxo1),
39790
+ merklePath0,
39791
+ merklePath1,
39784
39792
  publicAmount: BN254_FIELD_MODULUS - amount,
39785
39793
  nullifier0,
39786
39794
  nullifier1,