@interest-protocol/vortex-sdk 8.1.0 → 8.3.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.js +23 -20
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +23 -20
- package/dist/index.mjs.map +1 -1
- package/dist/utils/decrypt.d.ts +8 -2
- package/dist/utils/decrypt.d.ts.map +1 -1
- package/dist/utils/index.d.ts +19 -19
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/withdraw.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/utils/decrypt.ts +16 -3
- package/src/utils/index.ts +23 -21
- package/src/utils/withdraw.ts +4 -1
package/dist/index.js
CHANGED
|
@@ -38792,7 +38792,10 @@ const getUnspentUtxosWithApiAndCommitments = async ({ commitments, vortexKeypair
|
|
|
38792
38792
|
try {
|
|
38793
38793
|
const encryptedOutputHex = toHex(Uint8Array.from(commitment.encryptedOutput));
|
|
38794
38794
|
const utxo = vortexKeypair.decryptUtxo(encryptedOutputHex);
|
|
38795
|
-
userCommitments.push(
|
|
38795
|
+
userCommitments.push({
|
|
38796
|
+
coinType: commitment.coinType,
|
|
38797
|
+
encryptedOutput: commitment.encryptedOutput,
|
|
38798
|
+
});
|
|
38796
38799
|
allUtxos.push(utxo);
|
|
38797
38800
|
}
|
|
38798
38801
|
catch {
|
|
@@ -39011,31 +39014,31 @@ function getMerklePath(merkleTree, utxo) {
|
|
|
39011
39014
|
}
|
|
39012
39015
|
const toProveInput = ({ root, merklePath0, merklePath1, publicAmount, nullifier0, nullifier1, commitment0, commitment1, vortexKeypair, inputUtxo0, inputUtxo1, outputUtxo0, outputUtxo1, vortexObjectId, accountSecret, }) => {
|
|
39013
39016
|
return {
|
|
39014
|
-
vortex: BigInt(normalizeSuiAddress(vortexObjectId, !vortexObjectId.startsWith('0x'))) % BN254_FIELD_MODULUS,
|
|
39015
|
-
root,
|
|
39016
|
-
publicAmount,
|
|
39017
|
-
inputNullifier0: nullifier0,
|
|
39018
|
-
inputNullifier1: nullifier1,
|
|
39019
|
-
outputCommitment0: commitment0,
|
|
39020
|
-
outputCommitment1: commitment1,
|
|
39021
|
-
hashedAccountSecret: accountSecret === 0n ?
|
|
39022
|
-
accountSecret: accountSecret === 0n ?
|
|
39017
|
+
vortex: (BigInt(normalizeSuiAddress(vortexObjectId, !vortexObjectId.startsWith('0x'))) % BN254_FIELD_MODULUS).toString(),
|
|
39018
|
+
root: root.toString(),
|
|
39019
|
+
publicAmount: publicAmount.toString(),
|
|
39020
|
+
inputNullifier0: nullifier0.toString(),
|
|
39021
|
+
inputNullifier1: nullifier1.toString(),
|
|
39022
|
+
outputCommitment0: commitment0.toString(),
|
|
39023
|
+
outputCommitment1: commitment1.toString(),
|
|
39024
|
+
hashedAccountSecret: accountSecret === 0n ? '0' : poseidon1(accountSecret).toString(),
|
|
39025
|
+
accountSecret: accountSecret === 0n ? '12345' : accountSecret.toString(),
|
|
39023
39026
|
inPrivateKey0: vortexKeypair.privateKey,
|
|
39024
39027
|
inPrivateKey1: vortexKeypair.privateKey,
|
|
39025
|
-
inAmount0: inputUtxo0.amount,
|
|
39026
|
-
inAmount1: inputUtxo1.amount,
|
|
39027
|
-
inBlinding0: inputUtxo0.blinding,
|
|
39028
|
-
inBlinding1: inputUtxo1.blinding,
|
|
39029
|
-
inPathIndex0: inputUtxo0.index,
|
|
39030
|
-
inPathIndex1: inputUtxo1.index,
|
|
39028
|
+
inAmount0: inputUtxo0.amount.toString(),
|
|
39029
|
+
inAmount1: inputUtxo1.amount.toString(),
|
|
39030
|
+
inBlinding0: inputUtxo0.blinding.toString(),
|
|
39031
|
+
inBlinding1: inputUtxo1.blinding.toString(),
|
|
39032
|
+
inPathIndex0: inputUtxo0.index.toString(),
|
|
39033
|
+
inPathIndex1: inputUtxo1.index.toString(),
|
|
39031
39034
|
merklePath0,
|
|
39032
39035
|
merklePath1,
|
|
39033
39036
|
outPublicKey0: vortexKeypair.publicKey,
|
|
39034
39037
|
outPublicKey1: vortexKeypair.publicKey,
|
|
39035
|
-
outAmount0: outputUtxo0.amount,
|
|
39036
|
-
outAmount1: outputUtxo1.amount,
|
|
39037
|
-
outBlinding0: outputUtxo0.blinding,
|
|
39038
|
-
outBlinding1: outputUtxo1.blinding,
|
|
39038
|
+
outAmount0: outputUtxo0.amount.toString(),
|
|
39039
|
+
outAmount1: outputUtxo1.amount.toString(),
|
|
39040
|
+
outBlinding0: outputUtxo0.blinding.toString(),
|
|
39041
|
+
outBlinding1: outputUtxo1.blinding.toString(),
|
|
39039
39042
|
};
|
|
39040
39043
|
};
|
|
39041
39044
|
const extractCoinType = (typeString) => {
|