@interest-protocol/vortex-sdk 1.0.0 → 1.1.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.
@@ -4,9 +4,9 @@ import { Utxo } from '../entities/utxo';
4
4
  import { Vortex } from '../vortex';
5
5
  interface GetUnspentUtxosArgs {
6
6
  commitmentEvents: PaginatedEvents;
7
- senderVortexKeypair: VortexKeypair;
7
+ vortexKeypair: VortexKeypair;
8
8
  vortex: Vortex;
9
9
  }
10
- export declare const getUnspentUtxos: ({ commitmentEvents, senderVortexKeypair, vortex, }: GetUnspentUtxosArgs) => Promise<Utxo[]>;
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,mBAAmB,EAAE,aAAa,CAAC;IACnC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,eAAe,GAAU,oDAInC,mBAAmB,oBA2BrB,CAAC"}
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": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "module": "./dist/index.mjs",
@@ -36,8 +36,8 @@
36
36
  "rimraf": "^6.0.1",
37
37
  "ts-jest": "^29.1.1",
38
38
  "tsup": "^8.3.5",
39
- "@interest-protocol/prettier-config": "1.0.0",
40
- "@interest-protocol/typescript-config": "1.0.0"
39
+ "@interest-protocol/typescript-config": "1.0.0",
40
+ "@interest-protocol/prettier-config": "1.0.0"
41
41
  },
42
42
  "publishConfig": {
43
43
  "access": "public",
@@ -8,13 +8,13 @@ import { Vortex } from '../vortex';
8
8
 
9
9
  interface GetUnspentUtxosArgs {
10
10
  commitmentEvents: PaginatedEvents;
11
- senderVortexKeypair: VortexKeypair;
11
+ vortexKeypair: VortexKeypair;
12
12
  vortex: Vortex;
13
13
  }
14
14
 
15
15
  export const getUnspentUtxos = async ({
16
16
  commitmentEvents,
17
- senderVortexKeypair,
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 = senderVortexKeypair.decryptUtxo(commitment.encryptedOutput);
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: senderVortexKeypair })
34
+ (utxo) => new Utxo({ ...utxo, keypair: vortexKeypair })
35
35
  );
36
36
 
37
37
  const nullifiers = utxos.map((utxo) => utxo.nullifier());