@hinkal/common 0.2.5 → 0.2.6

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.
Files changed (48) hide show
  1. package/API/rewardsPointsCalls.cjs +1 -1
  2. package/API/rewardsPointsCalls.d.ts +3 -3
  3. package/API/rewardsPointsCalls.mjs +1 -3
  4. package/constants/deploy-data/deploy-data-optimism.json.cjs +1 -1
  5. package/constants/deploy-data/deploy-data-optimism.json.mjs +17 -21
  6. package/constants/server.constants.cjs +1 -1
  7. package/constants/server.constants.d.ts +3 -3
  8. package/constants/server.constants.mjs +1 -1
  9. package/data-structures/Hinkal/Hinkal.cjs +1 -1
  10. package/data-structures/Hinkal/Hinkal.d.ts +1 -0
  11. package/data-structures/Hinkal/Hinkal.mjs +30 -26
  12. package/data-structures/Hinkal/IHinkal.d.ts +1 -0
  13. package/data-structures/Hinkal/hinkalGetRecipientInfo.cjs +1 -0
  14. package/data-structures/Hinkal/hinkalGetRecipientInfo.d.ts +2 -0
  15. package/data-structures/Hinkal/hinkalGetRecipientInfo.mjs +16 -0
  16. package/data-structures/cacheDevices/LocalStorageCacheDevice.cjs +1 -1
  17. package/data-structures/cacheDevices/LocalStorageCacheDevice.d.ts +1 -1
  18. package/data-structures/cacheDevices/LocalStorageCacheDevice.mjs +2 -2
  19. package/data-structures/custom-token-registry/CustomTokenRegistry.cjs +1 -1
  20. package/data-structures/custom-token-registry/CustomTokenRegistry.mjs +18 -14
  21. package/functions/private-wallet/emporium.helpers.cjs +1 -1
  22. package/functions/private-wallet/emporium.helpers.d.ts +3 -8
  23. package/functions/private-wallet/emporium.helpers.mjs +11 -23
  24. package/functions/private-wallet/index.d.ts +0 -1
  25. package/functions/private-wallet/opProducer.cjs +1 -1
  26. package/functions/private-wallet/opProducer.mjs +1 -1
  27. package/functions/protocols/pendle.helpers.cjs +1 -1
  28. package/functions/protocols/pendle.helpers.mjs +14 -13
  29. package/functions/utils/cacheDevice.utils.cjs +1 -1
  30. package/functions/utils/cacheDevice.utils.mjs +8 -8
  31. package/functions/utils/string.utils.cjs +1 -1
  32. package/functions/utils/string.utils.d.ts +0 -1
  33. package/functions/utils/string.utils.mjs +6 -16
  34. package/index.cjs +1 -1
  35. package/index.mjs +226 -229
  36. package/package.json +1 -1
  37. package/providers/prepareEthersHinkal.cjs +1 -1
  38. package/providers/prepareEthersHinkal.mjs +3 -2
  39. package/providers/prepareWagmiHinkal.cjs +1 -1
  40. package/providers/prepareWagmiHinkal.mjs +3 -2
  41. package/types/ethereum-network.types.d.ts +0 -2
  42. package/types/hinkal.types.d.ts +0 -1
  43. package/types/rewards.types.d.ts +4 -0
  44. package/webworker/snarkjsWorker/snarkjsWorkerLauncher.cjs +1 -1
  45. package/webworker/snarkjsWorker/snarkjsWorkerLauncher.mjs +1 -1
  46. package/functions/private-wallet/smartContractWalletCalculator.cjs +0 -1
  47. package/functions/private-wallet/smartContractWalletCalculator.d.ts +0 -1
  48. package/functions/private-wallet/smartContractWalletCalculator.mjs +0 -20
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hinkal/common",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "homepage": "hinkal.pro",
5
5
  "author": {
6
6
  "name": "Hinkal Protocol"
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("ethers");require("circomlibjs-hinkal-fork");require("libsodium-wrappers");const u=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("../constants/token-data/index.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 q=require("../crypto/preProcessing.cjs");require("../functions/utils/external-action.utils.cjs");require("node-forge");require("../functions/web3/events/getShieldedBalance.cjs");require("../data-structures/volatile-helper/VolatileHelper.cjs");require("idb-keyval");const a=require("./EthersProviderAdapter.cjs"),n=async(i,t)=>{await q.preProcessing();const e=new u.Hinkal(t),r=a.default();return r.initSigner?.(i),await e.initProviderAdapter(void 0,r),await e.initUserKeys(),await e.resetMerkle(),e};exports.prepareEthersHinkal=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("ethers");require("circomlibjs-hinkal-fork");require("libsodium-wrappers");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("../constants/token-data/index.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 q=require("../crypto/preProcessing.cjs");require("../functions/utils/external-action.utils.cjs");require("node-forge");require("../functions/web3/events/getShieldedBalance.cjs");require("../data-structures/volatile-helper/VolatileHelper.cjs");require("idb-keyval");const a=require("./EthersProviderAdapter.cjs"),n=async(i,u)=>{await q.preProcessing();const e=new t.Hinkal(u),r=a.default();return r.initSigner?.(i),await e.initProviderAdapter(void 0,r),await e.initUserKeys(),await e.resetMerkle(),e};exports.prepareEthersHinkal=n;
@@ -7,6 +7,7 @@ import "../types/circom-data.types.mjs";
7
7
  import "../types/transactions.types.mjs";
8
8
  import "../types/curve.types.mjs";
9
9
  import "../constants/token-data/index.mjs";
10
+ import "../data-structures/custom-token-registry/CustomTokenRegistry.mjs";
10
11
  import "../constants/vite.constants.mjs";
11
12
  import "axios";
12
13
  import "../constants/coingecko.constants.mjs";
@@ -22,11 +23,11 @@ import "../functions/web3/events/getShieldedBalance.mjs";
22
23
  import "../data-structures/volatile-helper/VolatileHelper.mjs";
23
24
  import "idb-keyval";
24
25
  import e from "./EthersProviderAdapter.mjs";
25
- const j = async (t, o) => {
26
+ const q = async (t, o) => {
26
27
  await m();
27
28
  const r = new p(o), i = e();
28
29
  return i.initSigner?.(t), await r.initProviderAdapter(void 0, i), await r.initUserKeys(), await r.resetMerkle(), r;
29
30
  };
30
31
  export {
31
- j as prepareEthersHinkal
32
+ q as prepareEthersHinkal
32
33
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("ethers");require("circomlibjs-hinkal-fork");require("libsodium-wrappers");const a=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("../constants/token-data/index.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 q=require("../crypto/preProcessing.cjs");require("../functions/utils/external-action.utils.cjs");require("node-forge");require("../functions/web3/events/getShieldedBalance.cjs");require("../data-structures/volatile-helper/VolatileHelper.cjs");require("idb-keyval");const r=require("./WagmiProviderAdapter.cjs"),t=async(i,u)=>{await q.preProcessing();const e=new a.Hinkal;return r.wagmiProviderAdapter.initConfig(u),await e.initProviderAdapter(i,r.wagmiProviderAdapter),await e.initUserKeys(),await e.resetMerkle(),e};exports.prepareWagmiHinkal=t;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("ethers");require("circomlibjs-hinkal-fork");require("libsodium-wrappers");const a=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("../constants/token-data/index.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 q=require("../crypto/preProcessing.cjs");require("../functions/utils/external-action.utils.cjs");require("node-forge");require("../functions/web3/events/getShieldedBalance.cjs");require("../data-structures/volatile-helper/VolatileHelper.cjs");require("idb-keyval");const r=require("./WagmiProviderAdapter.cjs"),t=async(i,u)=>{await q.preProcessing();const e=new a.Hinkal;return r.wagmiProviderAdapter.initConfig(u),await e.initProviderAdapter(i,r.wagmiProviderAdapter),await e.initUserKeys(),await e.resetMerkle(),e};exports.prepareWagmiHinkal=t;
@@ -7,6 +7,7 @@ import "../types/circom-data.types.mjs";
7
7
  import "../types/transactions.types.mjs";
8
8
  import "../types/curve.types.mjs";
9
9
  import "../constants/token-data/index.mjs";
10
+ import "../data-structures/custom-token-registry/CustomTokenRegistry.mjs";
10
11
  import "../constants/vite.constants.mjs";
11
12
  import "axios";
12
13
  import "../constants/coingecko.constants.mjs";
@@ -22,11 +23,11 @@ import "../functions/web3/events/getShieldedBalance.mjs";
22
23
  import "../data-structures/volatile-helper/VolatileHelper.mjs";
23
24
  import "idb-keyval";
24
25
  import { wagmiProviderAdapter as r } from "./WagmiProviderAdapter.mjs";
25
- const b = async (t, o) => {
26
+ const j = async (t, o) => {
26
27
  await m();
27
28
  const i = new p();
28
29
  return r.initConfig(o), await i.initProviderAdapter(t, r), await i.initUserKeys(), await i.resetMerkle(), i;
29
30
  };
30
31
  export {
31
- b as prepareWagmiHinkal
32
+ j as prepareWagmiHinkal
32
33
  };
@@ -123,8 +123,6 @@ export interface ContractData {
123
123
  hETHOracleAddress?: string;
124
124
  HTokenOracleABI?: ContractInterface;
125
125
  emporiumAddress?: string;
126
- hinkalWalletFactoryAddress?: string;
127
- hinkalWalletBeaconAddress?: string;
128
126
  }
129
127
  export interface EthereumNetwork {
130
128
  name: string;
@@ -13,7 +13,6 @@ export type HinkalConfig = {
13
13
  * Node only.
14
14
  */
15
15
  useFileCache?: boolean;
16
- disableCaching?: boolean;
17
16
  /**
18
17
  * Indicator controlling wether the proof should be constructed remotely in secure enclave.
19
18
  */
@@ -223,3 +223,7 @@ export type HashInfoByChain = Record<keyof typeof networkRegistry, {
223
223
  lastCertifiedHash: string;
224
224
  week: number;
225
225
  }>;
226
+ export type WeekOption = {
227
+ value: number;
228
+ label: string;
229
+ };
@@ -1 +1 @@
1
- "use strict";const e=""+(typeof document>"u"?require("url").pathToFileURL(__dirname+"/../../assets/snarkjsWorkerLauncher-VrNXXTje.js").href:new URL("../../assets/snarkjsWorkerLauncher-VrNXXTje.js",document.currentScript&&document.currentScript.src||document.baseURI).href);module.exports=e;
1
+ "use strict";const e=""+(typeof document>"u"?require("url").pathToFileURL(__dirname+"/../../assets/snarkjsWorkerLauncher-DS9mXD9U.js").href:new URL("../../assets/snarkjsWorkerLauncher-DS9mXD9U.js",document.currentScript&&document.currentScript.src||document.baseURI).href);module.exports=e;
@@ -1,4 +1,4 @@
1
- const r = "" + new URL("../../assets/snarkjsWorkerLauncher-VrNXXTje.js", import.meta.url).href;
1
+ const r = "" + new URL("../../assets/snarkjsWorkerLauncher-DS9mXD9U.js", import.meta.url).href;
2
2
  export {
3
3
  r as default
4
4
  };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("ethers"),l=require("../../constants/chains.constants.cjs"),u=async(s,r,t)=>{const o=await new e.ethers.providers.JsonRpcProvider(l.networkRegistry[`${s}`].fetchRpcUrl).getCode(r),n=[t],i=["address"],a=e.utils.defaultAbiCoder.encode(i,n);return o+a.slice(2)},y=async(s,r)=>{const{hinkalWalletFactoryAddress:t,hinkalWalletBeaconAddress:c}=l.networkRegistry[s].contractData;if(!t||!c||!e.utils.isAddress(t))throw new Error(`Invalid deployer address ${t}`);const o=e.utils.hexlify(e.utils.zeroPad(e.utils.arrayify(r),32)),n=`0xff${t.slice(2)}`,i=await u(s,t,c),a=e.utils.keccak256(i),d=e.utils.keccak256(`${n}${o.slice(2)}${a.slice(2)}`);return e.utils.getAddress(`0x${d.slice(-40)}`)};exports.calculateSmartContractWalletAddress=y;
@@ -1 +0,0 @@
1
- export declare const calculateSmartContractWalletAddress: (chainId: number, salt: number) => Promise<string>;
@@ -1,20 +0,0 @@
1
- import { utils as e, ethers as f } from "ethers";
2
- import { networkRegistry as l } from "../../constants/chains.constants.mjs";
3
- const p = async (s, r, t) => {
4
- const c = await new f.providers.JsonRpcProvider(l[`${s}`].fetchRpcUrl).getCode(r), d = [t], n = ["address"], a = e.defaultAbiCoder.encode(
5
- n,
6
- // Constructor argument types
7
- d
8
- // Constructor argument values
9
- );
10
- return c + a.slice(2);
11
- }, C = async (s, r) => {
12
- const { hinkalWalletFactoryAddress: t, hinkalWalletBeaconAddress: o } = l[s].contractData;
13
- if (!t || !o || !e.isAddress(t))
14
- throw new Error(`Invalid deployer address ${t}`);
15
- const c = e.hexlify(e.zeroPad(e.arrayify(r), 32)), d = `0xff${t.slice(2)}`, n = await p(s, t, o), a = e.keccak256(n), i = e.keccak256(`${d}${c.slice(2)}${a.slice(2)}`);
16
- return e.getAddress(`0x${i.slice(-40)}`);
17
- };
18
- export {
19
- C as calculateSmartContractWalletAddress
20
- };