@hinkal/common 0.1.32 → 0.1.34
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/constants/deploy-data/deploy-data-localhost.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-localhost.json.mjs +4 -4
- package/constants/fees.constants.cjs +1 -1
- package/constants/fees.constants.mjs +22 -22
- package/constants/token-data/localhostRegistry.json.cjs +1 -1
- package/constants/token-data/localhostRegistry.json.mjs +18 -44
- package/crypto/babyJub.cjs +1 -1
- package/crypto/babyJub.mjs +4 -4
- package/crypto/poseidon.cjs +1 -1
- package/crypto/poseidon.mjs +12 -12
- package/crypto/preProcessing.cjs +1 -1
- package/crypto/preProcessing.mjs +5 -7
- package/data-structures/Hinkal/Hinkal.cjs +1 -1
- package/data-structures/Hinkal/Hinkal.d.ts +1 -0
- package/data-structures/Hinkal/Hinkal.mjs +16 -16
- package/data-structures/Hinkal/IHinkal.d.ts +2 -1
- package/data-structures/Hinkal/hinkalActionBeefy.cjs +1 -1
- package/data-structures/Hinkal/hinkalActionBeefy.mjs +18 -20
- package/data-structures/Hinkal/hinkalActionConvex.cjs +1 -1
- package/data-structures/Hinkal/hinkalActionConvex.mjs +18 -21
- package/data-structures/Hinkal/hinkalActionLidoEth.cjs +1 -1
- package/data-structures/Hinkal/hinkalActionLidoEth.mjs +31 -31
- package/data-structures/Hinkal/hinkalActionPendle.cjs +1 -1
- package/data-structures/Hinkal/hinkalActionPendle.mjs +77 -80
- package/data-structures/Hinkal/hinkalActionPendleLP.cjs +1 -1
- package/data-structures/Hinkal/hinkalActionPendleLP.mjs +34 -34
- package/data-structures/Hinkal/hinkalActionStake.cjs +1 -1
- package/data-structures/Hinkal/hinkalActionStake.mjs +49 -53
- package/data-structures/Hinkal/hinkalActionVolatile.cjs +1 -1
- package/data-structures/Hinkal/hinkalActionVolatile.mjs +38 -44
- package/data-structures/Hinkal/hinkalDeposit.cjs +1 -1
- package/data-structures/Hinkal/hinkalDeposit.mjs +27 -28
- package/data-structures/Hinkal/hinkalPrivateWallet.cjs +1 -1
- package/data-structures/Hinkal/hinkalPrivateWallet.mjs +8 -11
- package/data-structures/crypto-keys/encryptDecryptUtxo.cjs +1 -1
- package/data-structures/crypto-keys/encryptDecryptUtxo.mjs +9 -8
- package/data-structures/crypto-keys/keys.cjs +1 -1
- package/data-structures/crypto-keys/keys.mjs +7 -6
- package/data-structures/event-service/AbstractAccessTokenSnapshotService.cjs +1 -1
- package/data-structures/event-service/AbstractAccessTokenSnapshotService.mjs +6 -9
- package/data-structures/event-service/AbstractCommitmentsSnapshotService.cjs +1 -4
- package/data-structures/event-service/AbstractCommitmentsSnapshotService.mjs +18 -26
- package/data-structures/snapshot/ClientAccessTokenSnapshotService.cjs +1 -1
- package/data-structures/snapshot/ClientAccessTokenSnapshotService.mjs +9 -12
- package/data-structures/snapshot/ClientCommitmentsSnapshotService.cjs +1 -1
- package/data-structures/snapshot/ClientCommitmentsSnapshotService.mjs +9 -12
- package/data-structures/snapshot/ClientNullifierSnapshotService.cjs +1 -1
- package/data-structures/snapshot/ClientNullifierSnapshotService.mjs +3 -6
- package/data-structures/transactions-manager/TransactionsManager.cjs +1 -1
- package/data-structures/transactions-manager/TransactionsManager.mjs +67 -75
- package/data-structures/transactions-manager/history/getVolatileData.cjs +1 -1
- package/data-structures/transactions-manager/history/getVolatileData.mjs +13 -13
- package/data-structures/volatile-helper/VolatileHelper.cjs +1 -1
- package/data-structures/volatile-helper/VolatileHelper.mjs +60 -60
- package/error-handling/error-codes.constants.cjs +1 -1
- package/error-handling/error-codes.constants.d.ts +2 -0
- package/error-handling/error-codes.constants.mjs +2 -0
- package/functions/pre-transaction/getFlatFees.cjs +1 -1
- package/functions/pre-transaction/getFlatFees.mjs +42 -42
- package/functions/pre-transaction/outputUtxoProcessing.cjs +1 -1
- package/functions/pre-transaction/outputUtxoProcessing.mjs +5 -8
- package/functions/pre-transaction/process-gas-estimates.cjs +1 -1
- package/functions/pre-transaction/process-gas-estimates.mjs +17 -26
- package/functions/pre-transaction/processAmountChanges.cjs +1 -1
- package/functions/pre-transaction/processAmountChanges.mjs +10 -13
- package/functions/protocols/pendle.helpers.cjs +1 -1
- package/functions/protocols/pendle.helpers.mjs +37 -39
- package/functions/snarkjs/constructGeneralZkProof.cjs +1 -1
- package/functions/snarkjs/constructGeneralZkProof.mjs +35 -37
- package/functions/staking/index.cjs +1 -1
- package/functions/staking/index.mjs +22 -24
- package/functions/utils/cacheFunctions.cjs +1 -1
- package/functions/utils/cacheFunctions.mjs +27 -30
- package/functions/utils/index.d.ts +1 -0
- package/functions/utils/process.utils.cjs +1 -1
- package/functions/utils/process.utils.mjs +16 -2
- package/functions/utils/resolve-sync.utils.cjs +1 -1
- package/functions/utils/resolve-sync.utils.d.ts +0 -1
- package/functions/utils/resolve-sync.utils.mjs +3 -12
- package/functions/web3/events/getShieldedBalance.cjs +2 -2
- package/functions/web3/events/getShieldedBalance.mjs +25 -25
- package/functions/web3/functionCalls/transactCallDirect.cjs +1 -1
- package/functions/web3/functionCalls/transactCallDirect.mjs +15 -15
- package/functions/web3/functionCalls/transactCallRelayer.cjs +1 -1
- package/functions/web3/functionCalls/transactCallRelayer.mjs +2 -2
- package/functions/web3/odosAPI.cjs +1 -1
- package/functions/web3/odosAPI.mjs +11 -14
- package/functions/web3/oneInchAPI.cjs +1 -1
- package/functions/web3/oneInchAPI.mjs +7 -10
- package/functions/web3/runContractFunction.cjs +1 -1
- package/functions/web3/runContractFunction.mjs +35 -38
- package/functions/web3/uniswapAPI.cjs +1 -1
- package/functions/web3/uniswapAPI.mjs +30 -33
- package/index.cjs +1 -1
- package/index.mjs +281 -277
- package/package.json +3 -5
- package/providers/prepareEthersHinkal.cjs +1 -1
- package/providers/prepareEthersHinkal.mjs +5 -4
- package/providers/prepareWagmiv1Hinkal.cjs +1 -1
- package/providers/prepareWagmiv1Hinkal.mjs +5 -4
- package/webworker/snarkjsWorker/snarkjsWorkerLauncher.cjs +1 -1
- package/webworker/snarkjsWorker/snarkjsWorkerLauncher.mjs +1 -1
- package/webworker/snarkjsWorker/snarkjsWorkerLogic.cjs +1 -1
- package/webworker/snarkjsWorker/snarkjsWorkerLogic.mjs +16 -17
- package/webworker/utxoWorker/utxoWorkerLauncher.cjs +1 -1
- package/webworker/utxoWorker/utxoWorkerLauncher.mjs +1 -1
- package/webworker/zkProofWorker/zkProofWorkerLauncher.cjs +1 -1
- package/webworker/zkProofWorker/zkProofWorkerLauncher.mjs +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hinkal/common",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.34",
|
|
4
4
|
"homepage": "hinkal.pro",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Hinkal Protocol"
|
|
@@ -50,14 +50,12 @@
|
|
|
50
50
|
"axios": "^1.6.8",
|
|
51
51
|
"@axelar-network/axelarjs-sdk": "0.16.0",
|
|
52
52
|
"async-mutex": "^0.4.0",
|
|
53
|
-
"
|
|
54
|
-
"circomlibjs-hinkal-fork": "^0.0.3",
|
|
53
|
+
"circomlibjs": "^0.1.7",
|
|
55
54
|
"dotenv": "^16.4.5",
|
|
56
|
-
"ethers": "5.
|
|
55
|
+
"ethers": "5.7.2",
|
|
57
56
|
"idb-keyval": "6.2.1",
|
|
58
57
|
"snarkjs": "0.7.5",
|
|
59
58
|
"libsodium-wrappers": "^0.7.10",
|
|
60
|
-
"process": "0.11.10",
|
|
61
59
|
"ua-parser-js": "^1.0.37",
|
|
62
60
|
"uuid": "^9.0.1"
|
|
63
61
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("ethers");require("circomlibjs-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("ethers");require("circomlibjs");require("../data-structures/crypto-keys/keys.cjs");require("../data-structures/crypto-keys/encryptDecryptUtxo.cjs");const t=require("../data-structures/Hinkal/Hinkal.cjs");require("../constants/chains.constants.cjs");require("../types/circom-data.types.cjs");require("../types/transactions.types.cjs");require("../types/curve.types.cjs");require("../data-structures/custom-token-registry/CustomTokenRegistry.cjs");require("../constants/vite.constants.cjs");require("axios");require("../constants/coingecko.constants.cjs");require("../constants/contracts.constants.cjs");require("../constants/kyc.constants.cjs");require("../constants/axelar.constants.cjs");require("../constants/rewards.constants.cjs");require("../constants/reorg-depths.constants.cjs");const u=require("../crypto/preProcessing.cjs");require("../functions/utils/external-action.utils.cjs");require("../functions/web3/events/getShieldedBalance.cjs");require("../data-structures/volatile-helper/VolatileHelper.cjs");require("idb-keyval");const r=require("./EthersProviderAdapter.cjs"),q=async i=>{await u.preProcessing();const e=new t.Hinkal;return r.ethersProvierAdapter.initSigner?.(i),await e.initProviderAdapter(void 0,r.ethersProvierAdapter),await e.initUserKeys(),await e.resetMerkle(),e};exports.prepareEthersHinkal=q;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import "ethers";
|
|
2
|
-
import "circomlibjs
|
|
3
|
-
import "
|
|
2
|
+
import "circomlibjs";
|
|
3
|
+
import "../data-structures/crypto-keys/keys.mjs";
|
|
4
|
+
import "../data-structures/crypto-keys/encryptDecryptUtxo.mjs";
|
|
4
5
|
import { Hinkal as o } from "../data-structures/Hinkal/Hinkal.mjs";
|
|
5
6
|
import "../constants/chains.constants.mjs";
|
|
6
7
|
import "../types/circom-data.types.mjs";
|
|
@@ -21,11 +22,11 @@ import "../functions/web3/events/getShieldedBalance.mjs";
|
|
|
21
22
|
import "../data-structures/volatile-helper/VolatileHelper.mjs";
|
|
22
23
|
import "idb-keyval";
|
|
23
24
|
import { ethersProvierAdapter as i } from "./EthersProviderAdapter.mjs";
|
|
24
|
-
const
|
|
25
|
+
const U = async (t) => {
|
|
25
26
|
await p();
|
|
26
27
|
const r = new o();
|
|
27
28
|
return i.initSigner?.(t), await r.initProviderAdapter(void 0, i), await r.initUserKeys(), await r.resetMerkle(), r;
|
|
28
29
|
};
|
|
29
30
|
export {
|
|
30
|
-
|
|
31
|
+
U as prepareEthersHinkal
|
|
31
32
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("ethers");require("circomlibjs-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("ethers");require("circomlibjs");require("../data-structures/crypto-keys/keys.cjs");require("../data-structures/crypto-keys/encryptDecryptUtxo.cjs");const i=require("../data-structures/Hinkal/Hinkal.cjs");require("../constants/chains.constants.cjs");require("../types/circom-data.types.cjs");require("../types/transactions.types.cjs");require("../types/curve.types.cjs");require("../data-structures/custom-token-registry/CustomTokenRegistry.cjs");require("../constants/vite.constants.cjs");require("axios");require("../constants/coingecko.constants.cjs");require("../constants/contracts.constants.cjs");require("../constants/kyc.constants.cjs");require("../constants/axelar.constants.cjs");require("../constants/rewards.constants.cjs");require("../constants/reorg-depths.constants.cjs");const u=require("../crypto/preProcessing.cjs");require("../functions/utils/external-action.utils.cjs");require("../functions/web3/events/getShieldedBalance.cjs");require("../data-structures/volatile-helper/VolatileHelper.cjs");require("idb-keyval");const a=require("./Wagmiv1ProviderAdapter.cjs"),q=async r=>{await u.preProcessing();const e=new i.Hinkal;return await e.initProviderAdapter(r,a.wagmiv1ProvierAdapter),await e.initUserKeys(),await e.resetMerkle(),e};exports.prepareWagmiv1Hinkal=q;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import "ethers";
|
|
2
|
-
import "circomlibjs
|
|
3
|
-
import "
|
|
2
|
+
import "circomlibjs";
|
|
3
|
+
import "../data-structures/crypto-keys/keys.mjs";
|
|
4
|
+
import "../data-structures/crypto-keys/encryptDecryptUtxo.mjs";
|
|
4
5
|
import { Hinkal as t } from "../data-structures/Hinkal/Hinkal.mjs";
|
|
5
6
|
import "../constants/chains.constants.mjs";
|
|
6
7
|
import "../types/circom-data.types.mjs";
|
|
@@ -21,11 +22,11 @@ import "../functions/web3/events/getShieldedBalance.mjs";
|
|
|
21
22
|
import "../data-structures/volatile-helper/VolatileHelper.mjs";
|
|
22
23
|
import "idb-keyval";
|
|
23
24
|
import { wagmiv1ProvierAdapter as p } from "./Wagmiv1ProviderAdapter.mjs";
|
|
24
|
-
const
|
|
25
|
+
const b = async (i) => {
|
|
25
26
|
await o();
|
|
26
27
|
const r = new t();
|
|
27
28
|
return await r.initProviderAdapter(i, p), await r.initUserKeys(), await r.resetMerkle(), r;
|
|
28
29
|
};
|
|
29
30
|
export {
|
|
30
|
-
|
|
31
|
+
b as prepareWagmiv1Hinkal
|
|
31
32
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=""+(typeof document>"u"?require("url").pathToFileURL(__dirname+"/../../assets/snarkjsWorkerLauncher-
|
|
1
|
+
"use strict";const e=""+(typeof document>"u"?require("url").pathToFileURL(__dirname+"/../../assets/snarkjsWorkerLauncher-D2n9Ry7V.js").href:new URL("../../assets/snarkjsWorkerLauncher-D2n9Ry7V.js",document.currentScript&&document.currentScript.src||document.baseURI).href);module.exports=e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const P=require("../workerProxy.cjs"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const P=require("../workerProxy.cjs"),n=require("../../constants/vite.constants.cjs"),w=require("snarkjs");function $(t){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const s=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(i,e,s.get?s:{enumerable:!0,get:()=>t[e]})}}return i.default=t,Object.freeze(i)}const h=$(w),c=new P.WorkerProxy,p=async t=>{const{input:i,wasmFilePath:e,zKeyFilePath:s,chainId:f}=t.payload.data,{hostLocation:{origin:l},constants:{isDevelopment:g,chains:{chainIds:b}}}=t.metadata;let o=e,r=s;const u=o.startsWith("https://");if(n.isNode&&!u){n.isWebpack?(o=`libs/hardhat/test/circuits/${e}`,r=`libs/hardhat/test/circuits/${s}`):!n.isWebpack&&g&&(o=`test/circuits/${e}`,r=`test/circuits/${s}`);const a=require("path");o=a.resolve(o),r=a.resolve(r)}n.isNode&&u?process.browser=!0:f===b.localhost&&!n.isNode&&(o=`${l}/${e}`,r=`${l}/${s}`);try{const{proof:a,publicSignals:d}=await h.groth16.fullProve(i,o,r),k=await h.groth16.exportSolidityCallData(a,d),y=JSON.parse(`[${k}]`);c.postMessageToMainThread({zkCallData:y,proof:a,publicSignals:d})}catch(a){console.log(a)}};c.attachWorkerSideOnMessage(p);exports.default=c;exports.onWorkerMessage=p;
|
|
@@ -1,32 +1,31 @@
|
|
|
1
1
|
import { WorkerProxy as w } from "../workerProxy.mjs";
|
|
2
|
-
import { isNode as
|
|
2
|
+
import { isNode as i, isWebpack as h } from "../../constants/vite.constants.mjs";
|
|
3
3
|
import * as p from "snarkjs";
|
|
4
|
-
const
|
|
5
|
-
const { input:
|
|
6
|
-
hostLocation: { origin:
|
|
4
|
+
const u = new w(), y = async (r) => {
|
|
5
|
+
const { input: d, wasmFilePath: e, zKeyFilePath: o, chainId: f } = r.payload.data, {
|
|
6
|
+
hostLocation: { origin: l },
|
|
7
7
|
constants: {
|
|
8
8
|
isDevelopment: m,
|
|
9
|
-
chains: { chainIds:
|
|
9
|
+
chains: { chainIds: $ }
|
|
10
10
|
}
|
|
11
|
-
} =
|
|
12
|
-
let t =
|
|
13
|
-
const
|
|
14
|
-
if (
|
|
15
|
-
|
|
11
|
+
} = r.metadata;
|
|
12
|
+
let t = e, a = o;
|
|
13
|
+
const c = t.startsWith("https://");
|
|
14
|
+
if (i && !c) {
|
|
15
|
+
h ? (t = `libs/hardhat/test/circuits/${e}`, a = `libs/hardhat/test/circuits/${o}`) : !h && m && (t = `test/circuits/${e}`, a = `test/circuits/${o}`);
|
|
16
16
|
const s = require("path");
|
|
17
|
-
t = s.resolve(t),
|
|
17
|
+
t = s.resolve(t), a = s.resolve(a);
|
|
18
18
|
}
|
|
19
|
-
|
|
19
|
+
i && c ? process.browser = !0 : f === $.localhost && !i && (t = `${l}/${e}`, a = `${l}/${o}`);
|
|
20
20
|
try {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
f.postMessageToMainThread({ zkCallData: k, proof: s, publicSignals: h });
|
|
21
|
+
const { proof: s, publicSignals: n } = await p.groth16.fullProve(d, t, a), g = await p.groth16.exportSolidityCallData(s, n), k = JSON.parse(`[${g}]`);
|
|
22
|
+
u.postMessageToMainThread({ zkCallData: k, proof: s, publicSignals: n });
|
|
24
23
|
} catch (s) {
|
|
25
24
|
console.log(s);
|
|
26
25
|
}
|
|
27
26
|
};
|
|
28
|
-
|
|
27
|
+
u.attachWorkerSideOnMessage(y);
|
|
29
28
|
export {
|
|
30
|
-
|
|
29
|
+
u as default,
|
|
31
30
|
y as onWorkerMessage
|
|
32
31
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=""+(typeof document>"u"?require("url").pathToFileURL(__dirname+"/../../assets/utxoWorkerLauncher-
|
|
1
|
+
"use strict";const e=""+(typeof document>"u"?require("url").pathToFileURL(__dirname+"/../../assets/utxoWorkerLauncher-Bu-W3EAj.js").href:new URL("../../assets/utxoWorkerLauncher-Bu-W3EAj.js",document.currentScript&&document.currentScript.src||document.baseURI).href);module.exports=e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=""+(typeof document>"u"?require("url").pathToFileURL(__dirname+"/../../assets/zkProofWorkerLauncher-
|
|
1
|
+
"use strict";const e=""+(typeof document>"u"?require("url").pathToFileURL(__dirname+"/../../assets/zkProofWorkerLauncher-BwaZD8dV.js").href:new URL("../../assets/zkProofWorkerLauncher-BwaZD8dV.js",document.currentScript&&document.currentScript.src||document.baseURI).href);module.exports=e;
|