@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.
@@ -26,10 +26,10 @@ export declare const ERROR_CODES: {
26
26
  13: string;
27
27
  14: string;
28
28
  };
29
- export declare const VORTEX_PACKAGE_ID = "0x4d505443700db57e664f024b4cdfe315a6b80ddc4d6b9f1013c7b68682edd4ab";
30
- export declare const UPGRADE_CAP = "0x6c4464ca68d4bcd0c0626dcbb7c2b7ec37cb65a6cc74ffb2c16cd8cff3184004";
31
- export declare const REGISTRY_OBJECT_ID = "0x58bde5ffed343073d012d28c6955a8ee50caaefd085196e837150bc810e996c0";
32
- export declare const INITIAL_SHARED_VERSION = "4";
29
+ export declare const VORTEX_PACKAGE_ID = "0x083c6d01af7707749d6c93e54deae4ef582ef71306f8faade671e9255ad4494c";
30
+ export declare const UPGRADE_CAP = "0xc51649a7ecd42fff5bdf56ff6f7c9f0cad9cdb15c0c0ed4ce464314df821dfb4";
31
+ export declare const REGISTRY_OBJECT_ID = "0x4189526def3e9af0a5cd5f24c3a1d736fff7792bbc6f320d02db6f15e47577ba";
32
+ export declare const INITIAL_SHARED_VERSION = "395367340";
33
33
  export declare const LSK_FETCH_OFFSET = "fetch_offset";
34
34
  export declare const LSK_ENCRYPTED_OUTPUTS = "encrypted_outputs";
35
35
  export declare const VORTEX_SIGNATURE_DOMAIN = "VORTEXFI.XYZ";
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,mBAAmB,iFACgD,CAAC;AAGjF,eAAO,MAAM,UAAU,iFACyD,CAAC;AAEjF,eAAO,MAAM,gBAAgB,iFAAa,CAAC;AAE3C,eAAO,MAAM,oBAAoB,UAiChC,CAAC;AAEF,oBAAY,OAAO;IACjB,OAAO,oBAAoB;IAC3B,KAAK,iBAAiB;IACtB,MAAM,WAAW;CAClB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,eAAO,MAAM,qBAAqB,sBAAsB,CAAC;AAEzD,eAAO,MAAM,uBAAuB,iBAAiB,CAAC;AAEtD,eAAO,MAAM,gBAAgB,uEACyC,CAAC;AAGvE,eAAO,MAAM,2BAA2B,MAAM,CAAC;AAE/C,eAAO,MAAM,YAAY,SAAU,CAAC;AAEpC,eAAO,MAAM,eAAe;;CAG3B,CAAC"}
package/dist/index.js CHANGED
@@ -3372,10 +3372,10 @@ const ERROR_CODES = {
3372
3372
  13: 'Invalid relayer',
3373
3373
  14: 'Invalid output flag',
3374
3374
  };
3375
- const VORTEX_PACKAGE_ID = '0x4d505443700db57e664f024b4cdfe315a6b80ddc4d6b9f1013c7b68682edd4ab';
3376
- const UPGRADE_CAP = '0x6c4464ca68d4bcd0c0626dcbb7c2b7ec37cb65a6cc74ffb2c16cd8cff3184004';
3377
- const REGISTRY_OBJECT_ID = '0x58bde5ffed343073d012d28c6955a8ee50caaefd085196e837150bc810e996c0';
3378
- const INITIAL_SHARED_VERSION = '4';
3375
+ const VORTEX_PACKAGE_ID = '0x083c6d01af7707749d6c93e54deae4ef582ef71306f8faade671e9255ad4494c';
3376
+ const UPGRADE_CAP = '0xc51649a7ecd42fff5bdf56ff6f7c9f0cad9cdb15c0c0ed4ce464314df821dfb4';
3377
+ const REGISTRY_OBJECT_ID = '0x4189526def3e9af0a5cd5f24c3a1d736fff7792bbc6f320d02db6f15e47577ba';
3378
+ const INITIAL_SHARED_VERSION = '395367340';
3379
3379
  const LSK_FETCH_OFFSET = 'fetch_offset';
3380
3380
  const LSK_ENCRYPTED_OUTPUTS = 'encrypted_outputs';
3381
3381
  const VORTEX_SIGNATURE_DOMAIN = 'VORTEXFI.XYZ';
@@ -3384,7 +3384,7 @@ const TREASURY_ADDRESS = '0x894261575b948c035d002adc3ca4d73c683c01a1bfafac183870
3384
3384
  const DEPOSIT_FEE_IN_BASIS_POINTS = 50n;
3385
3385
  const BASIS_POINTS = 10000n;
3386
3386
  const VORTEX_POOL_IDS = {
3387
- [SUI_TYPE_ARG]: '0x1d8ddda4727146fd39f8181578ae71cd0f828039c68b4bfdba8a7499dda1d84d',
3387
+ [SUI_TYPE_ARG]: '0x31d848dbd5a19cbfa99f880023cab2533766cca30267e9f45665acf9cfc9cc8c',
3388
3388
  };
3389
3389
 
3390
3390
  /******************************************************************************
@@ -39599,7 +39599,7 @@ const vortexSDK = new Vortex({
39599
39599
  objectId: REGISTRY_OBJECT_ID,
39600
39600
  initialSharedVersion: INITIAL_SHARED_VERSION,
39601
39601
  },
39602
- fullNodeUrl: getFullnodeUrl('devnet'),
39602
+ fullNodeUrl: getFullnodeUrl('testnet'),
39603
39603
  });
39604
39604
 
39605
39605
  // packages/vortex/src/entities/merkle-tree.ts
@@ -39628,7 +39628,11 @@ const prepareDepositProof = async ({ tx, amount, accountSecret, unspentUtxos, vo
39628
39628
  keypair: vortexKeypair,
39629
39629
  vortexPool: vortexObjectId,
39630
39630
  });
39631
- const nextIndex = await vortexSdk.nextIndex(vortexPool);
39631
+ const [nextIndex, merklePath0, merklePath1] = await Promise.all([
39632
+ vortexSdk.nextIndex(vortexPool),
39633
+ getMerklePathFn(inputUtxo0),
39634
+ getMerklePathFn(inputUtxo1),
39635
+ ]);
39632
39636
  // Calculate output UTXO0 amount: if using unspent UTXOs, include their amounts
39633
39637
  const outputUtxo0 = new Utxo({
39634
39638
  amount: amount + inputUtxo0.amount + inputUtxo1.amount - relayerFee,
@@ -39657,8 +39661,8 @@ const prepareDepositProof = async ({ tx, amount, accountSecret, unspentUtxos, vo
39657
39661
  vortexObjectId,
39658
39662
  accountSecret,
39659
39663
  root,
39660
- merklePath0: await getMerklePathFn(inputUtxo0),
39661
- merklePath1: await getMerklePathFn(inputUtxo1),
39664
+ merklePath0,
39665
+ merklePath1,
39662
39666
  publicAmount: amount - relayerFee,
39663
39667
  nullifier0,
39664
39668
  nullifier1,
@@ -39752,7 +39756,11 @@ const prepareWithdraw = async ({ tx = new Transaction(), amount, unspentUtxos =
39752
39756
  });
39753
39757
  const totalWithdrawAmount = inputUtxo0.amount + inputUtxo1.amount;
39754
39758
  const changeAmount = totalWithdrawAmount - amount;
39755
- const nextIndex = await vortexSdk.nextIndex(vortexPool);
39759
+ const [nextIndex, merklePath0, merklePath1] = await Promise.all([
39760
+ vortexSdk.nextIndex(vortexPool),
39761
+ getMerklePathFn(inputUtxo0),
39762
+ getMerklePathFn(inputUtxo1),
39763
+ ]);
39756
39764
  const outputUtxo0 = new Utxo({
39757
39765
  amount: changeAmount,
39758
39766
  index: nextIndex,
@@ -39781,8 +39789,8 @@ const prepareWithdraw = async ({ tx = new Transaction(), amount, unspentUtxos =
39781
39789
  vortexObjectId,
39782
39790
  accountSecret,
39783
39791
  root,
39784
- merklePath0: await getMerklePathFn(inputUtxo0),
39785
- merklePath1: await getMerklePathFn(inputUtxo1),
39792
+ merklePath0,
39793
+ merklePath1,
39786
39794
  publicAmount: BN254_FIELD_MODULUS - amount,
39787
39795
  nullifier0,
39788
39796
  nullifier1,