@interest-protocol/vortex-sdk 8.1.0 → 8.2.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.
@@ -17,10 +17,16 @@ interface GetUnspentUtxosWithApiArgs {
17
17
  vortexSdk: Vortex;
18
18
  vortexPool: string | VortexPool;
19
19
  }
20
+ interface GetUnspentUtxosWithApiAndCommitmentsArgs {
21
+ commitments: Pick<Commitment, 'coinType' | 'encryptedOutput'>[];
22
+ vortexKeypair: VortexKeypair;
23
+ vortexSdk: Vortex;
24
+ vortexPool: string | VortexPool;
25
+ }
20
26
  export declare const getUnspentUtxosWithApi: ({ commitments, vortexKeypair, vortexSdk, vortexPool, }: GetUnspentUtxosWithApiArgs) => Promise<Utxo[]>;
21
- export declare const getUnspentUtxosWithApiAndCommitments: ({ commitments, vortexKeypair, vortexSdk, vortexPool, }: GetUnspentUtxosWithApiArgs) => Promise<{
27
+ export declare const getUnspentUtxosWithApiAndCommitments: ({ commitments, vortexKeypair, vortexSdk, vortexPool, }: GetUnspentUtxosWithApiAndCommitmentsArgs) => Promise<{
22
28
  unspentUtxos: Utxo[];
23
- userCommitments: Commitment[];
29
+ userCommitments: Pick<Commitment, "coinType" | "encryptedOutput">[];
24
30
  }>;
25
31
  export {};
26
32
  //# 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;AAErD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAExC,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAG7C,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AAM,CAAC;IAClB,UAAU,EAAE,MAAM,GAAG,UAAU,CAAC;CACjC;AAED,UAAU,wCAAwC;IAChD,WAAW,EAAE,IAAI,CAAC,UAAU,EAAE,UAAU,GAAG,iBAAiB,CAAC,EAAE,CAAC;IAChE,aAAa,EAAE,aAAa,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,GAAG,UAAU,CAAC;CACjC;AAED,eAAO,MAAM,sBAAsB,GAAU,wDAK1C,0BAA0B,oBA2C5B,CAAC;AAEF,eAAO,MAAM,oCAAoC,GAAU,wDAKxD,wCAAwC;;;EAmD1C,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@interest-protocol/vortex-sdk",
3
- "version": "8.1.0",
3
+ "version": "8.2.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "module": "./dist/index.mjs",
@@ -37,8 +37,8 @@
37
37
  "rimraf": "^6.0.1",
38
38
  "ts-jest": "^29.1.1",
39
39
  "tsup": "^8.3.5",
40
- "@interest-protocol/prettier-config": "1.0.0",
41
- "@interest-protocol/typescript-config": "1.0.0"
40
+ "@interest-protocol/typescript-config": "1.0.0",
41
+ "@interest-protocol/prettier-config": "1.0.0"
42
42
  },
43
43
  "publishConfig": {
44
44
  "access": "public",
@@ -64,6 +64,13 @@ interface GetUnspentUtxosWithApiArgs {
64
64
  vortexPool: string | VortexPool;
65
65
  }
66
66
 
67
+ interface GetUnspentUtxosWithApiAndCommitmentsArgs {
68
+ commitments: Pick<Commitment, 'coinType' | 'encryptedOutput'>[];
69
+ vortexKeypair: VortexKeypair;
70
+ vortexSdk: Vortex;
71
+ vortexPool: string | VortexPool;
72
+ }
73
+
67
74
  export const getUnspentUtxosWithApi = async ({
68
75
  commitments,
69
76
  vortexKeypair,
@@ -119,9 +126,12 @@ export const getUnspentUtxosWithApiAndCommitments = async ({
119
126
  vortexKeypair,
120
127
  vortexSdk,
121
128
  vortexPool,
122
- }: GetUnspentUtxosWithApiArgs) => {
129
+ }: GetUnspentUtxosWithApiAndCommitmentsArgs) => {
123
130
  const allUtxos = [] as UtxoPayload[];
124
- const userCommitments = [] as Commitment[];
131
+ const userCommitments = [] as Pick<
132
+ Commitment,
133
+ 'coinType' | 'encryptedOutput'
134
+ >[];
125
135
 
126
136
  const vortexObject = await vortexSdk.resolveVortexPool(vortexPool);
127
137
 
@@ -136,7 +146,10 @@ export const getUnspentUtxosWithApiAndCommitments = async ({
136
146
  Uint8Array.from(commitment.encryptedOutput)
137
147
  );
138
148
  const utxo = vortexKeypair.decryptUtxo(encryptedOutputHex);
139
- userCommitments.push(commitment);
149
+ userCommitments.push({
150
+ coinType: commitment.coinType,
151
+ encryptedOutput: commitment.encryptedOutput,
152
+ });
140
153
  allUtxos.push(utxo);
141
154
  } catch {
142
155
  // Do nothing