@interest-protocol/vortex-sdk 1.0.0 → 2.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.
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -4
- package/dist/index.mjs.map +1 -1
- package/dist/utils/decrypt.d.ts +2 -2
- package/dist/utils/decrypt.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/pkg/nodejs/vortex.js +1 -1
- package/src/pkg/web/vortex.js +1 -1
- package/src/pkg/web/vortex_bg.web.wasm +0 -0
- package/src/utils/decrypt.ts +4 -4
- /package/dist/{vortex_bg.wasm → vortex_bg.nodejs.wasm} +0 -0
- /package/{src/pkg/web/vortex_bg.wasm → dist/vortex_bg.web.wasm} +0 -0
- /package/src/pkg/nodejs/{vortex_bg.wasm → vortex_bg.nodejs.wasm} +0 -0
package/dist/utils/decrypt.d.ts
CHANGED
|
@@ -4,9 +4,9 @@ import { Utxo } from '../entities/utxo';
|
|
|
4
4
|
import { Vortex } from '../vortex';
|
|
5
5
|
interface GetUnspentUtxosArgs {
|
|
6
6
|
commitmentEvents: PaginatedEvents;
|
|
7
|
-
|
|
7
|
+
vortexKeypair: VortexKeypair;
|
|
8
8
|
vortex: Vortex;
|
|
9
9
|
}
|
|
10
|
-
export declare const getUnspentUtxos: ({ commitmentEvents,
|
|
10
|
+
export declare const getUnspentUtxos: ({ commitmentEvents, vortexKeypair, vortex, }: GetUnspentUtxosArgs) => Promise<Utxo[]>;
|
|
11
11
|
export {};
|
|
12
12
|
//# sourceMappingURL=decrypt.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decrypt.d.ts","sourceRoot":"","sources":["../../src/utils/decrypt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAGrD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAExC,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC,UAAU,mBAAmB;IAC3B,gBAAgB,EAAE,eAAe,CAAC;IAClC,
|
|
1
|
+
{"version":3,"file":"decrypt.d.ts","sourceRoot":"","sources":["../../src/utils/decrypt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAGrD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAExC,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC,UAAU,mBAAmB;IAC3B,gBAAgB,EAAE,eAAe,CAAC;IAClC,aAAa,EAAE,aAAa,CAAC;IAC7B,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,eAAe,GAAU,8CAInC,mBAAmB,oBA2BrB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@interest-protocol/vortex-sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"scripts": {
|
|
59
59
|
"prebuild": "rimraf dist",
|
|
60
60
|
"build": "rollup -c rollup.config.js",
|
|
61
|
-
"postbuild": "mkdir -p dist && cp src/pkg/nodejs/vortex_bg.wasm dist/vortex_bg.wasm",
|
|
61
|
+
"postbuild": "mkdir -p dist && cp src/pkg/nodejs/vortex_bg.nodejs.wasm dist/vortex_bg.nodejs.wasm && cp src/pkg/web/vortex_bg.web.wasm dist/vortex_bg.web.wasm",
|
|
62
62
|
"build:types": "tsc --emitDeclarationOnly"
|
|
63
63
|
}
|
|
64
64
|
}
|
package/src/pkg/nodejs/vortex.js
CHANGED
|
@@ -321,7 +321,7 @@ exports.__wbindgen_init_externref_table = function () {
|
|
|
321
321
|
table.set(offset + 3, false);
|
|
322
322
|
};
|
|
323
323
|
|
|
324
|
-
const wasmPath = `${__dirname}/vortex_bg.wasm`;
|
|
324
|
+
const wasmPath = `${__dirname}/vortex_bg.nodejs.wasm`;
|
|
325
325
|
const wasmBytes = require('fs').readFileSync(wasmPath);
|
|
326
326
|
const wasmModule = new WebAssembly.Module(wasmBytes);
|
|
327
327
|
const wasm = (exports.__wasm = new WebAssembly.Instance(
|
package/src/pkg/web/vortex.js
CHANGED
|
@@ -421,7 +421,7 @@ async function __wbg_init(module_or_path) {
|
|
|
421
421
|
}
|
|
422
422
|
|
|
423
423
|
if (typeof module_or_path === 'undefined') {
|
|
424
|
-
module_or_path = new URL('vortex_bg.wasm', import.meta.url);
|
|
424
|
+
module_or_path = new URL('vortex_bg.web.wasm', import.meta.url);
|
|
425
425
|
}
|
|
426
426
|
const imports = __wbg_get_imports();
|
|
427
427
|
|
|
Binary file
|
package/src/utils/decrypt.ts
CHANGED
|
@@ -8,13 +8,13 @@ import { Vortex } from '../vortex';
|
|
|
8
8
|
|
|
9
9
|
interface GetUnspentUtxosArgs {
|
|
10
10
|
commitmentEvents: PaginatedEvents;
|
|
11
|
-
|
|
11
|
+
vortexKeypair: VortexKeypair;
|
|
12
12
|
vortex: Vortex;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
export const getUnspentUtxos = async ({
|
|
16
16
|
commitmentEvents,
|
|
17
|
-
|
|
17
|
+
vortexKeypair,
|
|
18
18
|
vortex,
|
|
19
19
|
}: GetUnspentUtxosArgs) => {
|
|
20
20
|
const commitments = parseNewCommitmentEvent(commitmentEvents);
|
|
@@ -23,7 +23,7 @@ export const getUnspentUtxos = async ({
|
|
|
23
23
|
|
|
24
24
|
commitments.forEach((commitment) => {
|
|
25
25
|
try {
|
|
26
|
-
const utxo =
|
|
26
|
+
const utxo = vortexKeypair.decryptUtxo(commitment.encryptedOutput);
|
|
27
27
|
allUtxos.push(utxo);
|
|
28
28
|
} catch {
|
|
29
29
|
// Do nothing
|
|
@@ -31,7 +31,7 @@ export const getUnspentUtxos = async ({
|
|
|
31
31
|
});
|
|
32
32
|
|
|
33
33
|
const utxos = allUtxos.map(
|
|
34
|
-
(utxo) => new Utxo({ ...utxo, keypair:
|
|
34
|
+
(utxo) => new Utxo({ ...utxo, keypair: vortexKeypair })
|
|
35
35
|
);
|
|
36
36
|
|
|
37
37
|
const nullifiers = utxos.map((utxo) => utxo.nullifier());
|
|
File without changes
|
|
File without changes
|
|
File without changes
|