@interest-protocol/vortex-sdk 6.2.0 → 6.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/entities/utxo.d.ts +7 -0
- package/dist/entities/utxo.d.ts.map +1 -1
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/entities/utxo.ts +28 -8
package/dist/index.mjs
CHANGED
|
@@ -39184,11 +39184,19 @@ class Utxo {
|
|
|
39184
39184
|
this.index = index ?? 0n;
|
|
39185
39185
|
this.vortexPool = vortexPool;
|
|
39186
39186
|
}
|
|
39187
|
+
static makeCommitment({ amount, publicKey, blinding, vortexPool, }) {
|
|
39188
|
+
return poseidon4(amount, BigInt(publicKey), blinding, BigInt(normalizeSuiAddress(vortexPool, !vortexPool.startsWith('0x'))));
|
|
39189
|
+
}
|
|
39187
39190
|
static blinding() {
|
|
39188
39191
|
return BigInt(Math.floor(Math.random() * 1000000000));
|
|
39189
39192
|
}
|
|
39190
39193
|
commitment() {
|
|
39191
|
-
return
|
|
39194
|
+
return Utxo.makeCommitment({
|
|
39195
|
+
amount: this.amount,
|
|
39196
|
+
publicKey: this.keypair.publicKey,
|
|
39197
|
+
blinding: this.blinding,
|
|
39198
|
+
vortexPool: this.vortexPool,
|
|
39199
|
+
});
|
|
39192
39200
|
}
|
|
39193
39201
|
nullifier() {
|
|
39194
39202
|
const commitment = this.commitment();
|