@interest-protocol/vortex-sdk 6.1.0 → 6.2.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
@@ -39634,10 +39634,12 @@ const vortexSDK = new Vortex({
39634
39634
  });
39635
39635
 
39636
39636
  // packages/vortex/src/entities/merkle-tree.ts
39637
+ const merkleTreeHashFunction = (left, right) => poseidon2(BigInt(left), BigInt(right)).toString();
39637
39638
  const buildMerkleTree = (elements = []) => new MerkleTree(MERKLE_TREE_HEIGHT, elements, {
39638
- hashFunction: (left, right) => poseidon2(BigInt(left), BigInt(right)).toString(),
39639
+ hashFunction: merkleTreeHashFunction,
39639
39640
  zeroElement: ZERO_VALUE.toString(),
39640
39641
  });
39642
+ const deserializeMerkleTree = (data) => MerkleTree.deserialize(data, merkleTreeHashFunction);
39641
39643
 
39642
39644
  const prepareDepositProof = async ({ tx, amount, accountSecret, unspentUtxos, vortexSdk, vortexKeypair, vortexPool, root, getMerklePathFn, relayer, relayerFee, }) => {
39643
39645
  const vortexObjectId = typeof vortexPool === 'string' ? vortexPool : vortexPool.objectId;
@@ -39993,5 +39995,5 @@ const finishSwap = async ({ tx = new Transaction(), amount, vortexSdk, vortexPoo
39993
39995
  });
39994
39996
  };
39995
39997
 
39996
- export { Action, BASIS_POINTS, BN254_FIELD_MODULUS, DEPOSIT_FEE_IN_BASIS_POINTS, EMPTY_COMMITMENT, EMPTY_SUBTREE_HASHES, ERROR_CODES, INITIAL_SHARED_VERSION, LSK_ENCRYPTED_OUTPUTS, LSK_FETCH_OFFSET, MERKLE_TREE_HEIGHT, Modules, OPT, REGISTRY_OBJECT_ID, ROOT_HISTORY_SIZE, TREASURY_ADDRESS, Utxo, VORTEX_PACKAGE_ID, VORTEX_POOL_IDS, VORTEX_SIGNATURE_DOMAIN, VORTEX_SWAP_PACKAGE_ID, VORTEX_SWAP_UPGRADE_CAP, VORTEX_UPGRADE_CAP, Vortex, VortexKeypair, ZERO_VALUE, buildMerkleTree, deposit, depositWithAccount, finishSwap, getMerklePath, getUnspentUtxos, parseNewCommitmentEvent, parseVortexPool, poseidon1, poseidon2, poseidon3, poseidon4, prove, startSwap, toProveInput, verify, vortexSDK, withdraw, withdrawWithAccount };
39998
+ export { Action, BASIS_POINTS, BN254_FIELD_MODULUS, DEPOSIT_FEE_IN_BASIS_POINTS, EMPTY_COMMITMENT, EMPTY_SUBTREE_HASHES, ERROR_CODES, INITIAL_SHARED_VERSION, LSK_ENCRYPTED_OUTPUTS, LSK_FETCH_OFFSET, MERKLE_TREE_HEIGHT, Modules, OPT, REGISTRY_OBJECT_ID, ROOT_HISTORY_SIZE, TREASURY_ADDRESS, Utxo, VORTEX_PACKAGE_ID, VORTEX_POOL_IDS, VORTEX_SIGNATURE_DOMAIN, VORTEX_SWAP_PACKAGE_ID, VORTEX_SWAP_UPGRADE_CAP, VORTEX_UPGRADE_CAP, Vortex, VortexKeypair, ZERO_VALUE, buildMerkleTree, deposit, depositWithAccount, deserializeMerkleTree, finishSwap, getMerklePath, getUnspentUtxos, merkleTreeHashFunction, parseNewCommitmentEvent, parseVortexPool, poseidon1, poseidon2, poseidon3, poseidon4, prove, startSwap, toProveInput, verify, vortexSDK, withdraw, withdrawWithAccount };
39997
39999
  //# sourceMappingURL=index.mjs.map