@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.mjs
CHANGED
|
@@ -38790,7 +38790,10 @@ const getUnspentUtxosWithApiAndCommitments = async ({ commitments, vortexKeypair
|
|
|
38790
38790
|
try {
|
|
38791
38791
|
const encryptedOutputHex = toHex(Uint8Array.from(commitment.encryptedOutput));
|
|
38792
38792
|
const utxo = vortexKeypair.decryptUtxo(encryptedOutputHex);
|
|
38793
|
-
userCommitments.push(
|
|
38793
|
+
userCommitments.push({
|
|
38794
|
+
coinType: commitment.coinType,
|
|
38795
|
+
encryptedOutput: commitment.encryptedOutput,
|
|
38796
|
+
});
|
|
38794
38797
|
allUtxos.push(utxo);
|
|
38795
38798
|
}
|
|
38796
38799
|
catch {
|
|
@@ -39009,31 +39012,31 @@ function getMerklePath(merkleTree, utxo) {
|
|
|
39009
39012
|
}
|
|
39010
39013
|
const toProveInput = ({ root, merklePath0, merklePath1, publicAmount, nullifier0, nullifier1, commitment0, commitment1, vortexKeypair, inputUtxo0, inputUtxo1, outputUtxo0, outputUtxo1, vortexObjectId, accountSecret, }) => {
|
|
39011
39014
|
return {
|
|
39012
|
-
vortex: BigInt(normalizeSuiAddress(vortexObjectId, !vortexObjectId.startsWith('0x'))) % BN254_FIELD_MODULUS,
|
|
39013
|
-
root,
|
|
39014
|
-
publicAmount,
|
|
39015
|
-
inputNullifier0: nullifier0,
|
|
39016
|
-
inputNullifier1: nullifier1,
|
|
39017
|
-
outputCommitment0: commitment0,
|
|
39018
|
-
outputCommitment1: commitment1,
|
|
39019
|
-
hashedAccountSecret: accountSecret === 0n ?
|
|
39020
|
-
accountSecret: accountSecret === 0n ?
|
|
39015
|
+
vortex: (BigInt(normalizeSuiAddress(vortexObjectId, !vortexObjectId.startsWith('0x'))) % BN254_FIELD_MODULUS).toString(),
|
|
39016
|
+
root: root.toString(),
|
|
39017
|
+
publicAmount: publicAmount.toString(),
|
|
39018
|
+
inputNullifier0: nullifier0.toString(),
|
|
39019
|
+
inputNullifier1: nullifier1.toString(),
|
|
39020
|
+
outputCommitment0: commitment0.toString(),
|
|
39021
|
+
outputCommitment1: commitment1.toString(),
|
|
39022
|
+
hashedAccountSecret: accountSecret === 0n ? '0' : poseidon1(accountSecret).toString(),
|
|
39023
|
+
accountSecret: accountSecret === 0n ? '12345' : accountSecret.toString(),
|
|
39021
39024
|
inPrivateKey0: vortexKeypair.privateKey,
|
|
39022
39025
|
inPrivateKey1: vortexKeypair.privateKey,
|
|
39023
|
-
inAmount0: inputUtxo0.amount,
|
|
39024
|
-
inAmount1: inputUtxo1.amount,
|
|
39025
|
-
inBlinding0: inputUtxo0.blinding,
|
|
39026
|
-
inBlinding1: inputUtxo1.blinding,
|
|
39027
|
-
inPathIndex0: inputUtxo0.index,
|
|
39028
|
-
inPathIndex1: inputUtxo1.index,
|
|
39026
|
+
inAmount0: inputUtxo0.amount.toString(),
|
|
39027
|
+
inAmount1: inputUtxo1.amount.toString(),
|
|
39028
|
+
inBlinding0: inputUtxo0.blinding.toString(),
|
|
39029
|
+
inBlinding1: inputUtxo1.blinding.toString(),
|
|
39030
|
+
inPathIndex0: inputUtxo0.index.toString(),
|
|
39031
|
+
inPathIndex1: inputUtxo1.index.toString(),
|
|
39029
39032
|
merklePath0,
|
|
39030
39033
|
merklePath1,
|
|
39031
39034
|
outPublicKey0: vortexKeypair.publicKey,
|
|
39032
39035
|
outPublicKey1: vortexKeypair.publicKey,
|
|
39033
|
-
outAmount0: outputUtxo0.amount,
|
|
39034
|
-
outAmount1: outputUtxo1.amount,
|
|
39035
|
-
outBlinding0: outputUtxo0.blinding,
|
|
39036
|
-
outBlinding1: outputUtxo1.blinding,
|
|
39036
|
+
outAmount0: outputUtxo0.amount.toString(),
|
|
39037
|
+
outAmount1: outputUtxo1.amount.toString(),
|
|
39038
|
+
outBlinding0: outputUtxo0.blinding.toString(),
|
|
39039
|
+
outBlinding1: outputUtxo1.blinding.toString(),
|
|
39037
39040
|
};
|
|
39038
39041
|
};
|
|
39039
39042
|
const extractCoinType = (typeString) => {
|