@gurge/sdk 0.3.28 → 0.3.29
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/common/src/data-structures/Hinkal/hinkalWithdraw.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalWithdraw.mjs +40 -34
- package/common/src/functions/pre-transaction/buildCommitmentValidationData.cjs +1 -1
- package/common/src/functions/pre-transaction/buildCommitmentValidationData.mjs +40 -38
- package/common/src/functions/pre-transaction/outputUtxoProcessing.cjs +1 -1
- package/common/src/functions/pre-transaction/outputUtxoProcessing.mjs +20 -19
- package/common/src/functions/snarkjs/constructGeneralZkProof.cjs +1 -1
- package/common/src/functions/snarkjs/constructGeneralZkProof.mjs +74 -71
- package/common/src/functions/utils/hinkalTiming.utils.cjs +1 -0
- package/common/src/functions/utils/hinkalTiming.utils.d.ts +5 -0
- package/common/src/functions/utils/hinkalTiming.utils.mjs +16 -0
- package/common/src/webworker/package.json +1 -1
- package/common/src/webworker/viteWorkerURL.constant.cjs +3 -3
- package/common/src/webworker/viteWorkerURL.constant.mjs +3 -3
- package/package.json +1 -1
- package/sdk/package.json.cjs +1 -1
- package/sdk/package.json.mjs +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../../constants/chains.constants.cjs`),t=require(`../../constants/protocol.constants.cjs`),n=require(`../../types/hinkal.types.cjs`),r=require(`../../error-handling/error-codes.constants.cjs`),i=require(`../../functions/utils/time.utils.cjs`),a=require(`../../types/external-action.types.cjs`),o=require(`../../functions/utils/tron.utils.cjs`),s=require(`../../functions/utils/token-check.utils.cjs`),c=require(`../../functions/web3/events/getShieldedBalance.cjs`),l=require(`../../functions/pre-transaction/outputUtxoProcessing.cjs`),
|
|
1
|
+
const e=require(`../../constants/chains.constants.cjs`),t=require(`../../constants/protocol.constants.cjs`),n=require(`../../types/hinkal.types.cjs`),r=require(`../../error-handling/error-codes.constants.cjs`),i=require(`../../functions/utils/time.utils.cjs`),a=require(`../../types/external-action.types.cjs`),o=require(`../../functions/utils/tron.utils.cjs`),s=require(`../../functions/utils/token-check.utils.cjs`),c=require(`../../functions/web3/events/getShieldedBalance.cjs`),l=require(`../../functions/utils/hinkalTiming.utils.cjs`),u=require(`../../functions/pre-transaction/outputUtxoProcessing.cjs`),d=require(`../../functions/pre-transaction/getVolatileTransferAmount.cjs`),f=require(`../../functions/pre-transaction/constructAdminData.cjs`),p=require(`../../functions/pre-transaction/getFeeStructure.cjs`);require(`../../functions/pre-transaction/index.cjs`);const m=require(`../../functions/utils/fees.utils.cjs`),h=require(`../../functions/snarkjs/constructGeneralZkProof.cjs`),g=require(`../../functions/web3/functionCalls/transactCallDirect.cjs`),_=require(`../../functions/web3/functionCalls/transactCallRelayer.cjs`),v=require(`../../functions/web3/functionCalls/transactCallDirectTron.cjs`),y=require(`../../functions/pre-transaction/merge-with-fee-structure.cjs`);var b=async(e,t,n,r)=>{let a=l.createRnDeltaTiming(`withdraw.utxoPrep`),o=[...await c.addPaddingToUtxos(e,t,n,r)];a.log(`padding-done`,{inputCounts:o.map(e=>e.length)});let s=[],d=i.getCurrentTimeInSeconds().toString();for(let t=0;t<n.length;t+=1){let{outputUtxos:n}=u.outputUtxoProcessing(e.userKeys,o[t],r[t],d);s.push(n)}return a.log(`outputUtxos-done`,{outputCounts:s.map(e=>e.length)}),{inputUtxosArray:o,outputUtxosArray:s}},x=async(i,c,u,x,S,C,w,T)=>{let E=s.validateAndGetChainId(c),D=e.isTronLike(E),O=o.addressToHexFormat(await i.getEthereumAddressByChain(E)),k=c.map(e=>e.erc20TokenAddress),A=await d.modifyVolatileTokenAmountChanges(E,c,u),j=c[0];if(!j)throw Error(`Deposit Action: No Token Found`);let M;if(!S){let e=w??await p.getFeeStructure(E,C,k,a.ExternalActionId.Transact);M=await m.calculateModifiedFeeStructure(E,j,-A[0],e),await y.mergeWithFeeStructure(E,k,A,M)}let N={externalActionId:0n,externalAddress:o.addressToHexFormat(x),externalActionMetadata:`0x00`},[P,{inputUtxosArray:F,outputUtxosArray:I}]=await Promise.all([i.getRandomRelay(E,!0),b(i,E,k,A)]);if(!S&&!P)throw Error(r.transactionErrorCodes.RELAYER_NOT_AVAILABLE);let L=l.createRnDeltaTiming(`withdraw.constructZkProof`),{zkCallData:R,circomData:z,dimData:B,commitmentValidationData:V}=await h.constructZkProof(i.merkleTreeHinkalByChain[E],F,I,i.userKeys,N.externalActionId,N.externalAddress,N.externalActionMetadata,i.generateProofRemotely,M??n.zeroFeeStructure,S?t.zeroAddress:P,E,void 0,void 0,S?O:void 0);L.log(`done`);let H=D&&S?void 0:await o.reorderZkCallData(D,R,B,z);if(S){if(!j)throw Error(`Withdraw Action: No Token Found`);return D?await v.transactCallDirectTron(i,E,A[0],j,R,z,B):await g.transactCallDirect(i,E,A[0],j,R,z,B)}let U=f.constructAdminData(T,E,k,A,O),W=l.createRnDeltaTiming(`withdraw.relayer`),G=await _.transactCallRelayer(E,R,B,z,V,void 0,void 0,U,H);return W.log(`done`,{txHash:G}),G};exports.hinkalWithdraw=x;
|
|
@@ -7,48 +7,54 @@ import { ExternalActionId as a } from "../../types/external-action.types.mjs";
|
|
|
7
7
|
import { addressToHexFormat as o, reorderZkCallData as s } from "../../functions/utils/tron.utils.mjs";
|
|
8
8
|
import { validateAndGetChainId as c } from "../../functions/utils/token-check.utils.mjs";
|
|
9
9
|
import { addPaddingToUtxos as l } from "../../functions/web3/events/getShieldedBalance.mjs";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
10
|
+
import { createRnDeltaTiming as u } from "../../functions/utils/hinkalTiming.utils.mjs";
|
|
11
|
+
import { outputUtxoProcessing as d } from "../../functions/pre-transaction/outputUtxoProcessing.mjs";
|
|
12
|
+
import { modifyVolatileTokenAmountChanges as f } from "../../functions/pre-transaction/getVolatileTransferAmount.mjs";
|
|
13
|
+
import { constructAdminData as p } from "../../functions/pre-transaction/constructAdminData.mjs";
|
|
14
|
+
import { getFeeStructure as m } from "../../functions/pre-transaction/getFeeStructure.mjs";
|
|
14
15
|
import "../../functions/pre-transaction/index.mjs";
|
|
15
|
-
import { calculateModifiedFeeStructure as
|
|
16
|
-
import { constructZkProof as
|
|
17
|
-
import { transactCallDirect as
|
|
18
|
-
import { transactCallRelayer as
|
|
19
|
-
import { transactCallDirectTron as
|
|
20
|
-
import { mergeWithFeeStructure as
|
|
16
|
+
import { calculateModifiedFeeStructure as h } from "../../functions/utils/fees.utils.mjs";
|
|
17
|
+
import { constructZkProof as g } from "../../functions/snarkjs/constructGeneralZkProof.mjs";
|
|
18
|
+
import { transactCallDirect as _ } from "../../functions/web3/functionCalls/transactCallDirect.mjs";
|
|
19
|
+
import { transactCallRelayer as v } from "../../functions/web3/functionCalls/transactCallRelayer.mjs";
|
|
20
|
+
import { transactCallDirectTron as y } from "../../functions/web3/functionCalls/transactCallDirectTron.mjs";
|
|
21
|
+
import { mergeWithFeeStructure as b } from "../../functions/pre-transaction/merge-with-fee-structure.mjs";
|
|
21
22
|
//#region libs/shared/common/src/data-structures/Hinkal/hinkalWithdraw.ts
|
|
22
|
-
var
|
|
23
|
-
let a = [...await l(e, t, n, r)]
|
|
23
|
+
var x = async (e, t, n, r) => {
|
|
24
|
+
let a = u("withdraw.utxoPrep"), o = [...await l(e, t, n, r)];
|
|
25
|
+
a.log("padding-done", { inputCounts: o.map((e) => e.length) });
|
|
26
|
+
let s = [], c = i().toString();
|
|
24
27
|
for (let t = 0; t < n.length; t += 1) {
|
|
25
|
-
let { outputUtxos: n } =
|
|
26
|
-
|
|
28
|
+
let { outputUtxos: n } = d(e.userKeys, o[t], r[t], c);
|
|
29
|
+
s.push(n);
|
|
27
30
|
}
|
|
28
|
-
return {
|
|
29
|
-
inputUtxosArray:
|
|
30
|
-
outputUtxosArray:
|
|
31
|
+
return a.log("outputUtxos-done", { outputCounts: s.map((e) => e.length) }), {
|
|
32
|
+
inputUtxosArray: o,
|
|
33
|
+
outputUtxosArray: s
|
|
31
34
|
};
|
|
32
|
-
},
|
|
33
|
-
let
|
|
34
|
-
if (!
|
|
35
|
-
let
|
|
36
|
-
if (!
|
|
37
|
-
let e =
|
|
38
|
-
|
|
35
|
+
}, S = async (i, l, d, S, C, w, T, E) => {
|
|
36
|
+
let D = c(l), O = e(D), k = o(await i.getEthereumAddressByChain(D)), A = l.map((e) => e.erc20TokenAddress), j = await f(D, l, d), M = l[0];
|
|
37
|
+
if (!M) throw Error("Deposit Action: No Token Found");
|
|
38
|
+
let N;
|
|
39
|
+
if (!C) {
|
|
40
|
+
let e = T ?? await m(D, w, A, a.Transact);
|
|
41
|
+
N = await h(D, M, -j[0], e), await b(D, A, j, N);
|
|
39
42
|
}
|
|
40
|
-
let
|
|
43
|
+
let P = {
|
|
41
44
|
externalActionId: 0n,
|
|
42
|
-
externalAddress: o(
|
|
45
|
+
externalAddress: o(S),
|
|
43
46
|
externalActionMetadata: "0x00"
|
|
44
|
-
}, [
|
|
45
|
-
if (!
|
|
46
|
-
let { zkCallData:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
}, [F, { inputUtxosArray: I, outputUtxosArray: L }] = await Promise.all([i.getRandomRelay(D, !0), x(i, D, A, j)]);
|
|
48
|
+
if (!C && !F) throw Error(r.RELAYER_NOT_AVAILABLE);
|
|
49
|
+
let R = u("withdraw.constructZkProof"), { zkCallData: z, circomData: B, dimData: V, commitmentValidationData: H } = await g(i.merkleTreeHinkalByChain[D], I, L, i.userKeys, P.externalActionId, P.externalAddress, P.externalActionMetadata, i.generateProofRemotely, N ?? n, C ? t : F, D, void 0, void 0, C ? k : void 0);
|
|
50
|
+
R.log("done");
|
|
51
|
+
let U = O && C ? void 0 : await s(O, z, V, B);
|
|
52
|
+
if (C) {
|
|
53
|
+
if (!M) throw Error("Withdraw Action: No Token Found");
|
|
54
|
+
return O ? await y(i, D, j[0], M, z, B, V) : await _(i, D, j[0], M, z, B, V);
|
|
50
55
|
}
|
|
51
|
-
|
|
56
|
+
let W = p(E, D, A, j, k), G = u("withdraw.relayer"), K = await v(D, z, V, B, H, void 0, void 0, W, U);
|
|
57
|
+
return G.log("done", { txHash: K }), K;
|
|
52
58
|
};
|
|
53
59
|
//#endregion
|
|
54
|
-
export {
|
|
60
|
+
export { S as hinkalWithdraw };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../../constants/chains.constants.cjs`),t=require(`../../data-structures/crypto-keys/keys.cjs`),n=require(`../utils/solanaMint.utils.cjs`),r=require(`../snarkjs/common.snarkjs.cjs`),
|
|
1
|
+
const e=require(`../../constants/chains.constants.cjs`),t=require(`../../data-structures/crypto-keys/keys.cjs`),n=require(`../utils/solanaMint.utils.cjs`),r=require(`../utils/hinkalTiming.utils.cjs`),i=require(`../snarkjs/common.snarkjs.cjs`),a=require(`../../webworker/worker.registry.cjs`),o=require(`../../webworker/performTaskWithWorker.cjs`),s=require(`../../webworker/zkProofWorker/zkProofWorker.types.cjs`);var c=async(c,l,u,d)=>{if(i.hasOnlyZeroAmounts(d))return;let f=e.isSolanaLike(c),p=d.map(e=>e.map(e=>e.amount.toString())),m=d.map(e=>e.map(e=>e.timeStamp)),h=d.map(e=>e.map(e=>i.getUtxoCircuitInRandomization(e))),g=d.map(e=>e.map(e=>e.getConstructableParams())),_=d.map(e=>e.map(e=>e.amount===0n?`0`:BigInt(e.getCommitment()).toString())),v=await o.performTaskWithWorker({type:a.WorkerVariant.ZKProof,payload:{type:s.ZKProofWorkerActionType.BUILD_IN_NULLIFIERS,data:{inputUtxosSerialized:g}}}),y=l.getShieldedPrivateKey(),b=l.getSpendingKeyPair().pubSpendingBJJPoint,x=f?u.map(e=>{let{compressedAddress:t}=n.formatMintAddress(e);return BigInt(t).toString()}):u.map(e=>BigInt(e).toString()),S=r.createRnDeltaTiming(`withdraw.stealthValidation`),C=0;d.forEach((e,n)=>{e.forEach((e,r)=>{C+=1;let i=e.getStealthAddress(),a=e.spendingPublicKey??b,o=e.isNewStyle&&e.H0?t.UserKeys.getStealthAddressNewStyle(e.H0,y,a):t.UserKeys.getStealthAddress(BigInt(e.randomization),y);if(BigInt(i).toString()!==BigInt(o).toString())throw Error(`Commitment validation stealth mismatch at tokenIdx=${n}, utxoIdx=${r}`)})}),S.log(`done`,{stealthChecks:C});let w={nullifyingPrivateKey:y,spendingPublicKey:b,erc20TokenAddresses:x,inAmounts:p,inRandomizations:h,inH0Ax:d.map(e=>e.map(e=>i.getUtxoCircuitH0Coords(e)[0].toString())),inH0Ay:d.map(e=>e.map(e=>i.getUtxoCircuitH0Coords(e)[1].toString())),isNewStyle:d.map(e=>e.map(e=>!!e.isNewStyle)),inTimeStamps:m,inCommitments:_,inNullifiers:v};if(!(!u.length||!d[0]?.length))return{tokenAddresses:x,inAmounts:p,inTimeStamps:m,inRandomizations:h,inCommitments:_,inNullifiers:v,verifierName:`commitmentCalculator${u.length}x${d[0].length}`,commitmentInput:w}},l=(e,t)=>{if(!(!e||!t))return{tokenAddresses:e.tokenAddresses,inAmounts:e.inAmounts,inTimeStamps:e.inTimeStamps,inRandomizations:e.inRandomizations,inCommitments:e.inCommitments,inNullifiers:e.inNullifiers,proof:{a:t.zkCallData[0],b:t.zkCallData[1],c:t.zkCallData[2]}}};exports.buildCommitmentValidationData=c,exports.buildCommitmentValidationDataFromProof=l;
|
|
@@ -1,53 +1,55 @@
|
|
|
1
1
|
import { isSolanaLike as e } from "../../constants/chains.constants.mjs";
|
|
2
2
|
import { UserKeys as t } from "../../data-structures/crypto-keys/keys.mjs";
|
|
3
3
|
import { formatMintAddress as n } from "../utils/solanaMint.utils.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
4
|
+
import { createRnDeltaTiming as r } from "../utils/hinkalTiming.utils.mjs";
|
|
5
|
+
import { getUtxoCircuitH0Coords as i, getUtxoCircuitInRandomization as a, hasOnlyZeroAmounts as o } from "../snarkjs/common.snarkjs.mjs";
|
|
6
|
+
import { WorkerVariant as s } from "../../webworker/worker.registry.mjs";
|
|
7
|
+
import { performTaskWithWorker as c } from "../../webworker/performTaskWithWorker.mjs";
|
|
8
|
+
import { ZKProofWorkerActionType as l } from "../../webworker/zkProofWorker/zkProofWorker.types.mjs";
|
|
8
9
|
//#region libs/shared/common/src/functions/pre-transaction/buildCommitmentValidationData.ts
|
|
9
|
-
var
|
|
10
|
-
if (
|
|
11
|
-
let
|
|
12
|
-
type:
|
|
10
|
+
var u = async (u, d, f, p) => {
|
|
11
|
+
if (o(p)) return;
|
|
12
|
+
let m = e(u), h = p.map((e) => e.map((e) => e.amount.toString())), g = p.map((e) => e.map((e) => e.timeStamp)), _ = p.map((e) => e.map((e) => a(e))), v = p.map((e) => e.map((e) => e.getConstructableParams())), y = p.map((e) => e.map((e) => e.amount === 0n ? "0" : BigInt(e.getCommitment()).toString())), b = await c({
|
|
13
|
+
type: s.ZKProof,
|
|
13
14
|
payload: {
|
|
14
|
-
type:
|
|
15
|
-
data: { inputUtxosSerialized:
|
|
15
|
+
type: l.BUILD_IN_NULLIFIERS,
|
|
16
|
+
data: { inputUtxosSerialized: v }
|
|
16
17
|
}
|
|
17
|
-
}),
|
|
18
|
+
}), x = d.getShieldedPrivateKey(), S = d.getSpendingKeyPair().pubSpendingBJJPoint, C = m ? f.map((e) => {
|
|
18
19
|
let { compressedAddress: t } = n(e);
|
|
19
20
|
return BigInt(t).toString();
|
|
20
|
-
}) :
|
|
21
|
-
|
|
21
|
+
}) : f.map((e) => BigInt(e).toString()), w = r("withdraw.stealthValidation"), T = 0;
|
|
22
|
+
p.forEach((e, n) => {
|
|
22
23
|
e.forEach((e, r) => {
|
|
23
|
-
|
|
24
|
+
T += 1;
|
|
25
|
+
let i = e.getStealthAddress(), a = e.spendingPublicKey ?? S, o = e.isNewStyle && e.H0 ? t.getStealthAddressNewStyle(e.H0, x, a) : t.getStealthAddress(BigInt(e.randomization), x);
|
|
24
26
|
if (BigInt(i).toString() !== BigInt(o).toString()) throw Error(`Commitment validation stealth mismatch at tokenIdx=${n}, utxoIdx=${r}`);
|
|
25
27
|
});
|
|
26
|
-
});
|
|
27
|
-
let
|
|
28
|
-
nullifyingPrivateKey:
|
|
29
|
-
spendingPublicKey:
|
|
30
|
-
erc20TokenAddresses:
|
|
31
|
-
inAmounts:
|
|
32
|
-
inRandomizations:
|
|
33
|
-
inH0Ax:
|
|
34
|
-
inH0Ay:
|
|
35
|
-
isNewStyle:
|
|
36
|
-
inTimeStamps:
|
|
37
|
-
inCommitments:
|
|
38
|
-
inNullifiers:
|
|
28
|
+
}), w.log("done", { stealthChecks: T });
|
|
29
|
+
let E = {
|
|
30
|
+
nullifyingPrivateKey: x,
|
|
31
|
+
spendingPublicKey: S,
|
|
32
|
+
erc20TokenAddresses: C,
|
|
33
|
+
inAmounts: h,
|
|
34
|
+
inRandomizations: _,
|
|
35
|
+
inH0Ax: p.map((e) => e.map((e) => i(e)[0].toString())),
|
|
36
|
+
inH0Ay: p.map((e) => e.map((e) => i(e)[1].toString())),
|
|
37
|
+
isNewStyle: p.map((e) => e.map((e) => !!e.isNewStyle)),
|
|
38
|
+
inTimeStamps: g,
|
|
39
|
+
inCommitments: y,
|
|
40
|
+
inNullifiers: b
|
|
39
41
|
};
|
|
40
|
-
if (!(!
|
|
41
|
-
tokenAddresses:
|
|
42
|
-
inAmounts:
|
|
43
|
-
inTimeStamps:
|
|
44
|
-
inRandomizations:
|
|
45
|
-
inCommitments:
|
|
46
|
-
inNullifiers:
|
|
47
|
-
verifierName: `commitmentCalculator${
|
|
48
|
-
commitmentInput:
|
|
42
|
+
if (!(!f.length || !p[0]?.length)) return {
|
|
43
|
+
tokenAddresses: C,
|
|
44
|
+
inAmounts: h,
|
|
45
|
+
inTimeStamps: g,
|
|
46
|
+
inRandomizations: _,
|
|
47
|
+
inCommitments: y,
|
|
48
|
+
inNullifiers: b,
|
|
49
|
+
verifierName: `commitmentCalculator${f.length}x${p[0].length}`,
|
|
50
|
+
commitmentInput: E
|
|
49
51
|
};
|
|
50
|
-
},
|
|
52
|
+
}, d = (e, t) => {
|
|
51
53
|
if (!(!e || !t)) return {
|
|
52
54
|
tokenAddresses: e.tokenAddresses,
|
|
53
55
|
inAmounts: e.inAmounts,
|
|
@@ -63,4 +65,4 @@ var l = async (l, u, d, f) => {
|
|
|
63
65
|
};
|
|
64
66
|
};
|
|
65
67
|
//#endregion
|
|
66
|
-
export {
|
|
68
|
+
export { u as buildCommitmentValidationData, d as buildCommitmentValidationDataFromProof };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../utils/amounts.utils.cjs`),t=require(`../../error-handling/error-codes.constants.cjs`),n=require(`../../data-structures/utxo/Utxo.cjs`);var
|
|
1
|
+
const e=require(`../utils/amounts.utils.cjs`),t=require(`../../error-handling/error-codes.constants.cjs`),n=require(`../../data-structures/utxo/Utxo.cjs`),r=require(`../utils/hinkalTiming.utils.cjs`);var i=(i,a,o,s,c=!0,l,u)=>{let d=e.countTotalAmountInUtxos(a),{erc20TokenAddress:f,mintAddress:p}=a[0];if(c&&o<0n&&d+o<0n)throw Error(t.transactionErrorCodes.INSUFFICIENT_FUNDS_TO_TRANSACT);let m=r.createRnDeltaTiming(`withdraw.outputUtxo`),h=[new n.Utxo({amount:e.bigintMax(d+o,0n),erc20TokenAddress:f,mintAddress:p,nullifyingKey:i.getShieldedPrivateKey(),timeStamp:s,spendingPublicKey:i.getSpendingKeyPair().pubSpendingBJJPoint,isNewStyle:!0})];if(m.log(`newUtxo-change`),l!==void 0&&u!==void 0){let[e,t,r,,i]=l.split(`,`);h.push(new n.Utxo({amount:u,erc20TokenAddress:f,mintAddress:p,H0:[BigInt(t),BigInt(r)],stealthAddress:e,encryptionKey:i,timeStamp:s,isNewStyle:!0}))}return{outputUtxos:h}};exports.outputUtxoProcessing=i;
|
|
@@ -1,33 +1,34 @@
|
|
|
1
1
|
import { bigintMax as e, countTotalAmountInUtxos as t } from "../utils/amounts.utils.mjs";
|
|
2
2
|
import { transactionErrorCodes as n } from "../../error-handling/error-codes.constants.mjs";
|
|
3
3
|
import { Utxo as r } from "../../data-structures/utxo/Utxo.mjs";
|
|
4
|
+
import { createRnDeltaTiming as i } from "../utils/hinkalTiming.utils.mjs";
|
|
4
5
|
//#region libs/shared/common/src/functions/pre-transaction/outputUtxoProcessing.ts
|
|
5
|
-
var
|
|
6
|
-
let
|
|
7
|
-
if (
|
|
8
|
-
let
|
|
9
|
-
amount: e(
|
|
10
|
-
erc20TokenAddress:
|
|
11
|
-
mintAddress:
|
|
12
|
-
nullifyingKey:
|
|
13
|
-
timeStamp:
|
|
14
|
-
spendingPublicKey:
|
|
6
|
+
var a = (a, o, s, c, l = !0, u, d) => {
|
|
7
|
+
let f = t(o), { erc20TokenAddress: p, mintAddress: m } = o[0];
|
|
8
|
+
if (l && s < 0n && f + s < 0n) throw Error(n.INSUFFICIENT_FUNDS_TO_TRANSACT);
|
|
9
|
+
let h = i("withdraw.outputUtxo"), g = [new r({
|
|
10
|
+
amount: e(f + s, 0n),
|
|
11
|
+
erc20TokenAddress: p,
|
|
12
|
+
mintAddress: m,
|
|
13
|
+
nullifyingKey: a.getShieldedPrivateKey(),
|
|
14
|
+
timeStamp: c,
|
|
15
|
+
spendingPublicKey: a.getSpendingKeyPair().pubSpendingBJJPoint,
|
|
15
16
|
isNewStyle: !0
|
|
16
17
|
})];
|
|
17
|
-
if (
|
|
18
|
-
let [e, t, n, , i] =
|
|
19
|
-
|
|
20
|
-
amount:
|
|
21
|
-
erc20TokenAddress:
|
|
22
|
-
mintAddress:
|
|
18
|
+
if (h.log("newUtxo-change"), u !== void 0 && d !== void 0) {
|
|
19
|
+
let [e, t, n, , i] = u.split(",");
|
|
20
|
+
g.push(new r({
|
|
21
|
+
amount: d,
|
|
22
|
+
erc20TokenAddress: p,
|
|
23
|
+
mintAddress: m,
|
|
23
24
|
H0: [BigInt(t), BigInt(n)],
|
|
24
25
|
stealthAddress: e,
|
|
25
26
|
encryptionKey: i,
|
|
26
|
-
timeStamp:
|
|
27
|
+
timeStamp: c,
|
|
27
28
|
isNewStyle: !0
|
|
28
29
|
}));
|
|
29
30
|
}
|
|
30
|
-
return { outputUtxos:
|
|
31
|
+
return { outputUtxos: g };
|
|
31
32
|
};
|
|
32
33
|
//#endregion
|
|
33
|
-
export {
|
|
34
|
+
export { a as outputUtxoProcessing };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../../constants/chains.constants.cjs`),t=require(`../../constants/protocol.constants.cjs`),
|
|
1
|
+
const e=require(`../../constants/chains.constants.cjs`),t=require(`../../constants/protocol.constants.cjs`),ee=require(`../../crypto/poseidon.cjs`),n=require(`../web3/etherFunctions.cjs`),r=require(`../../data-structures/crypto-keys/keys.cjs`),i=require(`../utils/time.utils.cjs`),a=require(`../../types/external-action.types.cjs`),o=require(`../../error-handling/logger.cjs`),s=require(`../utils/hinkalTiming.utils.cjs`),c=require(`../utils/bit.operations.cjs`),l=require(`./common.snarkjs.cjs`),u=require(`./signedMessageHash.cjs`),te=require(`./generateCircomData.cjs`),d=require(`../../data-structures/AccountActions/AccountActions.cjs`),f=require(`./generateMainAndCommitmentZkProof.cjs`),p=require(`./getMerkleTreeSiblingsAndRootHashes.cjs`),m=require(`../private-wallet/emporium.helpers.cjs`);var h=async(h,g,_,v,y,b,x,S,C,w=t.zeroAddress,T=e.chainIds.localhost,E=g.map(()=>!1),D=void 0,O,k)=>{let A=s.createRnDeltaTiming(`withdraw.zkProof`),j=l.getZkProofVerifierName(g,_),M=l.calcAmountChanges(g,_),N=g.map(e=>e[0].erc20TokenAddress),P=l.calcEncryptedOutputs(_),F=t.defaultSignatureData,I=v.getShieldedPrivateKey(),{pubSpendingBJJPoint:ne}=v.getSpendingKeyPair(),L=l.calcStealthAddressStructure(r.UserKeys.findCorrectRandomization(n.randomBigInt(31),I),I,v.getSpendingKeyPair().pubSpendingBJJPoint),{inCommitmentSiblings:re,inCommitmentSiblingSides:ie,rootHashHinkal:R,inNullifiers:z}=await p.getDataFromWorkers(T,h,g.map(e=>e.map(e=>e.getConstructableParams())));A.log(`getDataFromWorkers`,{verifierName:j});let B=l.buildOutCommitments(_),V=n.randomBigInt(31),H=ee.poseidonFunction(V),U=BigInt(_.length>0?_[0][0].timeStamp:i.getCurrentTimeInSeconds()),W={rootHashHinkal:R,spendingPublicKey:ne,nullifyingPrivateKey:I,erc20TokenAddresses:N,amountChanges:M,inAmounts:g.map(e=>e.map(e=>e.amount.toString())),inRandomizations:g.map(e=>e.map(e=>l.getUtxoCircuitInRandomization(e))),inH0Ax:g.map(e=>e.map(e=>l.getUtxoCircuitH0Coords(e)[0].toString())),inH0Ay:g.map(e=>e.map(e=>l.getUtxoCircuitH0Coords(e)[1].toString())),isNewStyle:g.map(e=>e.map(e=>!!e.isNewStyle)),inTimeStamps:g.map(e=>e.map(e=>e.timeStamp)),inNullifiers:z,inCommitmentSiblings:re,inCommitmentSiblingSides:ie,outAmounts:_.map(e=>e.map(e=>e.amount.toString())),outTimeStamp:U,outPublicKeys:_.map(e=>e.map(e=>e.getStealthAddress())),outCommitments:B,calldataHash:0n,messageSeed:V,H0Ax:c.takeOffHighestBit(L.extraRandomization),H0Ay:L.H0},G=l.calcPublicSignalCount(j,W.erc20TokenAddresses,W.amountChanges,W.inNullifiers,W.outCommitments),K=l.calcAmountChanges(g,_,!0),q=l.getSlippageValues(K);o.Logger.log({publicSignalCount:G});let J=Array.isArray(x)?x:[x],Y=e.getOnchainChainId(T),ae=k?d.AccountActions.getSignerAddressFromPrivateKey(Y,k):void 0,X=y===a.ExternalActionId.Emporium?await m.encodeEmporiumMetadata(T,b??t.zeroAddress,k,J,H,ae):await m.encodeEmporiumMetadata(T,t.zeroAddress,void 0,y===0n?[]:J,H,t.zeroAddress);W.calldataHash=l.createCallDataHash(G,w,b,y,X,P,D,q,E,C,F,O);let Z=u.computeSignedMessageHashEvm({rootHashHinkal:R,erc20TokenAddresses:N,amountChanges:M,outTimeStamp:U,inNullifiers:z,outCommitments:B,calldataHash:W.calldataHash,message:H,outH1Ay:L.H1,H0Ax:W.H0Ax,H0Ay:L.H0}),{R8:Q,S:oe}=v.signEddsa(Z);A.log(`signEddsa`),W.eddsaSignature=[Q[0],Q[1],oe],W.signedMessageHash=Z;let $=j.startsWith(`mainEVMCircuitMin0`),se={outTimeStamp:U,calldataHash:W.calldataHash,messageSeed:V},{zkCallData:ce,commitmentValidationData:le}=await f.generateMainAndCommitmentZkProof(T,v,N,g,j,$?se:W,S);return A.log(`generateZkProof`),{zkCallData:ce,circomData:te.generateCircomData(B,z,R,K,N,_,P,G,y,b,X,w,W.calldataHash,L,E,D,$?Number(U):void 0,q,C,F,O),dimData:{tokenNumber:g.length,nullifierAmount:g.length>0?g[0].length:0,outputAmount:_.length>0?_[0].length:0},encryptedOutputs:P,commitmentValidationData:le}};exports.constructZkProof=h;
|
|
@@ -1,82 +1,85 @@
|
|
|
1
1
|
import { chainIds as e, getOnchainChainId as t } from "../../constants/chains.constants.mjs";
|
|
2
2
|
import { defaultSignatureData as ee, zeroAddress as n } from "../../constants/protocol.constants.mjs";
|
|
3
|
-
import { poseidonFunction as
|
|
4
|
-
import { randomBigInt as
|
|
5
|
-
import { UserKeys as
|
|
6
|
-
import { getCurrentTimeInSeconds as
|
|
7
|
-
import { ExternalActionId as
|
|
8
|
-
import { Logger as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
3
|
+
import { poseidonFunction as r } from "../../crypto/poseidon.mjs";
|
|
4
|
+
import { randomBigInt as i } from "../web3/etherFunctions.mjs";
|
|
5
|
+
import { UserKeys as te } from "../../data-structures/crypto-keys/keys.mjs";
|
|
6
|
+
import { getCurrentTimeInSeconds as ne } from "../utils/time.utils.mjs";
|
|
7
|
+
import { ExternalActionId as re } from "../../types/external-action.types.mjs";
|
|
8
|
+
import { Logger as ie } from "../../error-handling/logger.mjs";
|
|
9
|
+
import { createRnDeltaTiming as ae } from "../utils/hinkalTiming.utils.mjs";
|
|
10
|
+
import { takeOffHighestBit as oe } from "../utils/bit.operations.mjs";
|
|
11
|
+
import { buildOutCommitments as se, calcAmountChanges as a, calcEncryptedOutputs as o, calcPublicSignalCount as s, calcStealthAddressStructure as c, createCallDataHash as l, getSlippageValues as ce, getUtxoCircuitH0Coords as u, getUtxoCircuitInRandomization as le, getZkProofVerifierName as ue } from "./common.snarkjs.mjs";
|
|
11
12
|
import { computeSignedMessageHashEvm as de } from "./signedMessageHash.mjs";
|
|
12
13
|
import { generateCircomData as fe } from "./generateCircomData.mjs";
|
|
13
|
-
import { AccountActions as
|
|
14
|
-
import { generateMainAndCommitmentZkProof as
|
|
15
|
-
import { getDataFromWorkers as
|
|
16
|
-
import { encodeEmporiumMetadata as
|
|
14
|
+
import { AccountActions as pe } from "../../data-structures/AccountActions/AccountActions.mjs";
|
|
15
|
+
import { generateMainAndCommitmentZkProof as me } from "./generateMainAndCommitmentZkProof.mjs";
|
|
16
|
+
import { getDataFromWorkers as d } from "./getMerkleTreeSiblingsAndRootHashes.mjs";
|
|
17
|
+
import { encodeEmporiumMetadata as f } from "../private-wallet/emporium.helpers.mjs";
|
|
17
18
|
//#region libs/shared/common/src/functions/snarkjs/constructGeneralZkProof.ts
|
|
18
|
-
var
|
|
19
|
-
let O = ue(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
19
|
+
var p = async (p, m, h, g, _, v, y, b, x, S = n, C = e.localhost, w = m.map(() => !1), T = void 0, E, D) => {
|
|
20
|
+
let O = ae("withdraw.zkProof"), k = ue(m, h), A = a(m, h), j = m.map((e) => e[0].erc20TokenAddress), M = o(h), N = ee, P = g.getShieldedPrivateKey(), { pubSpendingBJJPoint: F } = g.getSpendingKeyPair(), I = c(te.findCorrectRandomization(i(31), P), P, g.getSpendingKeyPair().pubSpendingBJJPoint), { inCommitmentSiblings: L, inCommitmentSiblingSides: R, rootHashHinkal: z, inNullifiers: B } = await d(C, p, m.map((e) => e.map((e) => e.getConstructableParams())));
|
|
21
|
+
O.log("getDataFromWorkers", { verifierName: k });
|
|
22
|
+
let V = se(h), H = i(31), U = r(H), W = BigInt(h.length > 0 ? h[0][0].timeStamp : ne()), G = {
|
|
23
|
+
rootHashHinkal: z,
|
|
24
|
+
spendingPublicKey: F,
|
|
25
|
+
nullifyingPrivateKey: P,
|
|
26
|
+
erc20TokenAddresses: j,
|
|
27
|
+
amountChanges: A,
|
|
28
|
+
inAmounts: m.map((e) => e.map((e) => e.amount.toString())),
|
|
29
|
+
inRandomizations: m.map((e) => e.map((e) => le(e))),
|
|
30
|
+
inH0Ax: m.map((e) => e.map((e) => u(e)[0].toString())),
|
|
31
|
+
inH0Ay: m.map((e) => e.map((e) => u(e)[1].toString())),
|
|
32
|
+
isNewStyle: m.map((e) => e.map((e) => !!e.isNewStyle)),
|
|
33
|
+
inTimeStamps: m.map((e) => e.map((e) => e.timeStamp)),
|
|
34
|
+
inNullifiers: B,
|
|
35
|
+
inCommitmentSiblings: L,
|
|
36
|
+
inCommitmentSiblingSides: R,
|
|
37
|
+
outAmounts: h.map((e) => e.map((e) => e.amount.toString())),
|
|
38
|
+
outTimeStamp: W,
|
|
39
|
+
outPublicKeys: h.map((e) => e.map((e) => e.getStealthAddress())),
|
|
40
|
+
outCommitments: V,
|
|
38
41
|
calldataHash: 0n,
|
|
39
|
-
messageSeed:
|
|
40
|
-
H0Ax:
|
|
41
|
-
H0Ay:
|
|
42
|
-
},
|
|
43
|
-
|
|
44
|
-
let
|
|
45
|
-
|
|
46
|
-
let
|
|
47
|
-
rootHashHinkal:
|
|
48
|
-
erc20TokenAddresses:
|
|
49
|
-
amountChanges:
|
|
50
|
-
outTimeStamp:
|
|
51
|
-
inNullifiers:
|
|
52
|
-
outCommitments:
|
|
53
|
-
calldataHash:
|
|
54
|
-
message:
|
|
55
|
-
outH1Ay:
|
|
56
|
-
H0Ax:
|
|
57
|
-
H0Ay:
|
|
58
|
-
}), { R8:
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
],
|
|
64
|
-
let
|
|
65
|
-
outTimeStamp:
|
|
66
|
-
calldataHash:
|
|
67
|
-
messageSeed:
|
|
68
|
-
}, { zkCallData:
|
|
69
|
-
return {
|
|
70
|
-
zkCallData:
|
|
71
|
-
circomData: fe(B, z,
|
|
42
|
+
messageSeed: H,
|
|
43
|
+
H0Ax: oe(I.extraRandomization),
|
|
44
|
+
H0Ay: I.H0
|
|
45
|
+
}, K = s(k, G.erc20TokenAddresses, G.amountChanges, G.inNullifiers, G.outCommitments), q = a(m, h, !0), J = ce(q);
|
|
46
|
+
ie.log({ publicSignalCount: K });
|
|
47
|
+
let Y = Array.isArray(y) ? y : [y], he = t(C), ge = D ? pe.getSignerAddressFromPrivateKey(he, D) : void 0, X = _ === re.Emporium ? await f(C, v ?? n, D, Y, U, ge) : await f(C, n, void 0, _ === 0n ? [] : Y, U, n);
|
|
48
|
+
G.calldataHash = l(K, S, v, _, X, M, T, J, w, x, N, E);
|
|
49
|
+
let Z = de({
|
|
50
|
+
rootHashHinkal: z,
|
|
51
|
+
erc20TokenAddresses: j,
|
|
52
|
+
amountChanges: A,
|
|
53
|
+
outTimeStamp: W,
|
|
54
|
+
inNullifiers: B,
|
|
55
|
+
outCommitments: V,
|
|
56
|
+
calldataHash: G.calldataHash,
|
|
57
|
+
message: U,
|
|
58
|
+
outH1Ay: I.H1,
|
|
59
|
+
H0Ax: G.H0Ax,
|
|
60
|
+
H0Ay: I.H0
|
|
61
|
+
}), { R8: Q, S: _e } = g.signEddsa(Z);
|
|
62
|
+
O.log("signEddsa"), G.eddsaSignature = [
|
|
63
|
+
Q[0],
|
|
64
|
+
Q[1],
|
|
65
|
+
_e
|
|
66
|
+
], G.signedMessageHash = Z;
|
|
67
|
+
let $ = k.startsWith("mainEVMCircuitMin0"), ve = {
|
|
68
|
+
outTimeStamp: W,
|
|
69
|
+
calldataHash: G.calldataHash,
|
|
70
|
+
messageSeed: H
|
|
71
|
+
}, { zkCallData: ye, commitmentValidationData: be } = await me(C, g, j, m, k, $ ? ve : G, b);
|
|
72
|
+
return O.log("generateZkProof"), {
|
|
73
|
+
zkCallData: ye,
|
|
74
|
+
circomData: fe(V, B, z, q, j, h, M, K, _, v, X, S, G.calldataHash, I, w, T, $ ? Number(W) : void 0, J, x, N, E),
|
|
72
75
|
dimData: {
|
|
73
|
-
tokenNumber:
|
|
74
|
-
nullifierAmount:
|
|
75
|
-
outputAmount:
|
|
76
|
+
tokenNumber: m.length,
|
|
77
|
+
nullifierAmount: m.length > 0 ? m[0].length : 0,
|
|
78
|
+
outputAmount: h.length > 0 ? h[0].length : 0
|
|
76
79
|
},
|
|
77
|
-
encryptedOutputs:
|
|
78
|
-
commitmentValidationData:
|
|
80
|
+
encryptedOutputs: M,
|
|
81
|
+
commitmentValidationData: be
|
|
79
82
|
};
|
|
80
83
|
};
|
|
81
84
|
//#endregion
|
|
82
|
-
export {
|
|
85
|
+
export { p as constructZkProof };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../../constants/vite.constants.cjs`);var t=t=>{let n=Date.now(),r=n;return{log(i,a){if(!e.isReactNative)return;let o=Date.now();console.log(`[HinkalRnDelta] at=${o} [${t}] ${i}`,{ms:o-r,totalMs:o-n,...a}),r=o}}};exports.createRnDeltaTiming=t;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** RN withdraw profiling — no-op on web. */
|
|
2
|
+
export declare const logRnDelta: (scope: string, phase: string, extra?: Record<string, unknown>) => void;
|
|
3
|
+
export declare const createRnDeltaTiming: (scope: string) => {
|
|
4
|
+
log(phase: string, extra?: Record<string, unknown>): void;
|
|
5
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { isReactNative as e } from "../../constants/vite.constants.mjs";
|
|
2
|
+
//#region libs/shared/common/src/functions/utils/hinkalTiming.utils.ts
|
|
3
|
+
var t = (t) => {
|
|
4
|
+
let n = Date.now(), r = n;
|
|
5
|
+
return { log(i, a) {
|
|
6
|
+
if (!e) return;
|
|
7
|
+
let o = Date.now();
|
|
8
|
+
console.log(`[HinkalRnDelta] at=${o} [${t}] ${i}`, {
|
|
9
|
+
ms: o - r,
|
|
10
|
+
totalMs: o - n,
|
|
11
|
+
...a
|
|
12
|
+
}), r = o;
|
|
13
|
+
} };
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { t as createRnDeltaTiming };
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
var e = /* @__PURE__ */ ((r) => (r.ZKProof = "ZKProof", r.SnarkJS = "SnarkJS", r.UTXO = "UTXO", r))(e || {});
|
|
15
15
|
|
|
16
16
|
const n = async () => ({
|
|
17
|
-
[e.ZKProof]: await getWorkerURL(domain + '/0.3.
|
|
18
|
-
[e.SnarkJS]: await getWorkerURL(domain + '/0.3.
|
|
19
|
-
[e.UTXO]: await getWorkerURL(domain + '/0.3.
|
|
17
|
+
[e.ZKProof]: await getWorkerURL(domain + '/0.3.29/' + 'zkProofWorkerLauncher.js'),
|
|
18
|
+
[e.SnarkJS]: await getWorkerURL(domain + '/0.3.29/' + 'snarkjsWorkerLauncher.js'),
|
|
19
|
+
[e.UTXO]: await getWorkerURL(domain + '/0.3.29/' + 'utxoWorkerLauncher.js'),
|
|
20
20
|
});
|
|
21
21
|
exports.getWorkerViteURL = n;
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
var e = /* @__PURE__ */ ((r) => (r.ZKProof = "ZKProof", r.SnarkJS = "SnarkJS", r.UTXO = "UTXO", r))(e || {});
|
|
15
15
|
|
|
16
16
|
const n = async () => ({
|
|
17
|
-
[e.ZKProof]: await getWorkerURL(domain + '/0.3.
|
|
18
|
-
[e.SnarkJS]: await getWorkerURL(domain + '/0.3.
|
|
19
|
-
[e.UTXO]: await getWorkerURL(domain + '/0.3.
|
|
17
|
+
[e.ZKProof]: await getWorkerURL(domain + '/0.3.29/' + 'zkProofWorkerLauncher.js'),
|
|
18
|
+
[e.SnarkJS]: await getWorkerURL(domain + '/0.3.29/' + 'snarkjsWorkerLauncher.js'),
|
|
19
|
+
[e.UTXO]: await getWorkerURL(domain + '/0.3.29/' + 'utxoWorkerLauncher.js'),
|
|
20
20
|
});
|
|
21
21
|
export { n as getWorkerViteURL };
|
package/package.json
CHANGED
package/sdk/package.json.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e={name:`@gurge/sdk`,version:`0.3.
|
|
1
|
+
var e={name:`@gurge/sdk`,version:`0.3.28`,homepage:`hinkal.io`,author:{name:`Hinkal Protocol`},keywords:[`blockchain`,`privacy`,`zero-knowledge`,`stealth addresses`],exports:{".":{types:`./index.d.ts`,"react-native":`./index.cjs`,import:`./index.mjs`,default:`./index.cjs`},"./providers/WagmiProviderAdapter":{types:`./providers/WagmiProviderAdapter.d.ts`,"react-native":`./providers/WagmiProviderAdapter.cjs`,import:`./providers/WagmiProviderAdapter.mjs`,default:`./providers/WagmiProviderAdapter.cjs`},"./providers/EthersProviderAdapter":{types:`./providers/EthersProviderAdapter.d.ts`,"react-native":`./providers/EthersProviderAdapter.cjs`,import:`./providers/EthersProviderAdapter.mjs`,default:`./providers/EthersProviderAdapter.cjs`},"./providers/TronProviderAdapter":{types:`./providers/TronProviderAdapter.d.ts`,"react-native":`./providers/TronProviderAdapter.cjs`,import:`./providers/TronProviderAdapter.mjs`,default:`./providers/TronProviderAdapter.cjs`},"./providers/SolanaProviderAdapter":{types:`./providers/SolanaProviderAdapter.d.ts`,"react-native":`./providers/SolanaProviderAdapter.cjs`,import:`./providers/SolanaProviderAdapter.mjs`,default:`./providers/SolanaProviderAdapter.cjs`},"./providers/prepareEthersHinkal":{types:`./providers/prepareEthersHinkal.d.ts`,"react-native":`./providers/prepareEthersHinkal.cjs`,import:`./providers/prepareEthersHinkal.mjs`,default:`./providers/prepareEthersHinkal.cjs`},"./providers/prepareWagmiHinkal":{types:`./providers/prepareWagmiHinkal.d.ts`,"react-native":`./providers/prepareWagmiHinkal.cjs`,import:`./providers/prepareWagmiHinkal.mjs`,default:`./providers/prepareWagmiHinkal.cjs`},"./providers/prepareTronHinkal":{types:`./providers/prepareTronHinkal.d.ts`,"react-native":`./providers/prepareTronHinkal.cjs`,import:`./providers/prepareTronHinkal.mjs`,default:`./providers/prepareTronHinkal.cjs`},"./providers/prepareSolanaHinkal":{types:`./providers/prepareSolanaHinkal.d.ts`,"react-native":`./providers/prepareSolanaHinkal.cjs`,import:`./providers/prepareSolanaHinkal.mjs`,default:`./providers/prepareSolanaHinkal.cjs`},"./react-native/HinkalWebViewWorker":{types:`./react-native/HinkalWebViewWorker.d.ts`,"react-native":`./react-native/HinkalWebViewWorker.cjs`,import:`./react-native/HinkalWebViewWorker.mjs`,default:`./react-native/HinkalWebViewWorker.cjs`},"./react-native/metro-config":`./react-native/metro-config.js`,"./react-native/shims/*":`./react-native/shims/*`},types:`./index.d.ts`,scripts:{prebuild:`nx prebuild:workers`,build:`nx build`,lint:`nx lint`,test:`nx test`},devDependencies:{nx:`22.6.4`,vite:`^8.0.4`,"vite-plugin-dts":`^4.5.4`,"vite-tsconfig-paths":`^6.1.1`},dependencies:{"@coral-xyz/anchor":`^0.31.0`,"@solana/spl-token":`^0.4.14`,"@solana/web3.js":`^1.98.4`,"@solana/wallet-adapter-react":`^0.15.39`,axios:`^1.15.0`,"async-mutex":`^0.4.0`,bs58:`^6.0.0`,buffer:`6.0.3`,"circomlibjs-hinkal-fork":`^0.0.10`,dotenv:`^16.4.5`,ethers:`^6.15.0`,"idb-keyval":`6.2.1`,multiformats:`^9.4.2`,snarkjs:`0.7.5`,"libsodium-wrappers":`^0.8.2`,lodash:`^4.17.21`,tweetnacl:`^1.0.3`,process:`0.11.10`,"ua-parser-js":`^1.0.37`,uuid:`^9.0.1`,"node-forge":`^1.3.1`,"poseidon-lite":`^0.3.0`,tronweb:`^6.2.0`},peerDependencies:{wagmi:`2.13.3`,"@walletconnect/utils":`^2.17.2`,react:`*`,"react-native":`*`,"react-native-webview":`*`},peerDependenciesMeta:{wagmi:{optional:!0},"@walletconnect/utils":{optional:!0},react:{optional:!0},"react-native":{optional:!0},"react-native-webview":{optional:!0}}};exports.default=e;
|