@hinkal/common 0.1.52 → 0.1.55
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/axelar.constants.cjs +1 -1
- package/constants/axelar.constants.mjs +27 -28
- package/constants/chains.constants.cjs +1 -1
- package/constants/chains.constants.mjs +49 -49
- package/constants/kyc.constants.cjs +1 -1
- package/constants/kyc.constants.mjs +27 -3
- 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 +7 -5
- package/data-structures/Hinkal/Hinkal.cjs +1 -1
- package/data-structures/Hinkal/Hinkal.mjs +6 -3
- package/data-structures/Hinkal/hinkalActionStake.cjs +1 -1
- package/data-structures/Hinkal/hinkalActionStake.mjs +1 -1
- package/data-structures/Hinkal/hinkalPrivateWallet.cjs +1 -1
- package/data-structures/Hinkal/hinkalPrivateWallet.mjs +11 -8
- package/data-structures/crypto-keys/encryptDecryptUtxo.cjs +1 -1
- package/data-structures/crypto-keys/encryptDecryptUtxo.mjs +8 -9
- package/data-structures/crypto-keys/keys.cjs +1 -1
- package/data-structures/crypto-keys/keys.mjs +6 -7
- package/data-structures/event-service/AbstractAccessTokenSnapshotService.cjs +1 -1
- package/data-structures/event-service/AbstractAccessTokenSnapshotService.mjs +9 -6
- package/data-structures/event-service/AbstractCommitmentsSnapshotService.cjs +1 -1
- package/data-structures/event-service/AbstractCommitmentsSnapshotService.mjs +11 -8
- package/data-structures/event-service/AbstractEventService.cjs +1 -1
- package/data-structures/event-service/AbstractEventService.mjs +24 -21
- package/data-structures/snapshot/ClientAccessTokenSnapshotService.cjs +1 -1
- package/data-structures/snapshot/ClientAccessTokenSnapshotService.mjs +6 -3
- package/data-structures/snapshot/ClientCommitmentsSnapshotService.cjs +1 -1
- package/data-structures/snapshot/ClientCommitmentsSnapshotService.mjs +6 -3
- package/data-structures/snapshot/ClientNullifierSnapshotService.cjs +1 -1
- package/data-structures/snapshot/ClientNullifierSnapshotService.mjs +7 -4
- package/data-structures/transactions-manager/TransactionsManager.cjs +1 -1
- package/data-structures/transactions-manager/TransactionsManager.mjs +1 -1
- package/functions/pre-transaction/outputUtxoProcessing.cjs +1 -1
- package/functions/pre-transaction/outputUtxoProcessing.mjs +8 -5
- package/functions/pre-transaction/processAmountChanges.cjs +1 -1
- package/functions/pre-transaction/processAmountChanges.mjs +13 -10
- package/functions/protocols/pendle.helpers.cjs +1 -1
- package/functions/protocols/pendle.helpers.mjs +18 -16
- package/functions/staking/index.cjs +1 -1
- package/functions/staking/index.mjs +24 -22
- package/functions/utils/resolve-sync.utils.cjs +1 -1
- package/functions/utils/resolve-sync.utils.d.ts +1 -0
- package/functions/utils/resolve-sync.utils.mjs +12 -3
- 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 +14 -11
- package/functions/web3/oneInchAPI.cjs +1 -1
- package/functions/web3/oneInchAPI.mjs +10 -7
- package/functions/web3/runContractFunction.cjs +1 -1
- package/functions/web3/runContractFunction.mjs +23 -20
- package/functions/web3/uniswapAPI.cjs +1 -1
- package/functions/web3/uniswapAPI.mjs +6 -3
- package/index.cjs +1 -1
- package/index.mjs +210 -209
- package/package.json +4 -3
- package/providers/prepareEthersHinkal.cjs +1 -1
- package/providers/prepareEthersHinkal.mjs +4 -5
- package/providers/prepareWagmiv1Hinkal.cjs +1 -1
- package/providers/prepareWagmiv1Hinkal.mjs +4 -5
- package/types/kyc.types.cjs +1 -1
- package/types/kyc.types.d.ts +3 -1
- package/types/kyc.types.mjs +3 -3
- 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
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chains.constants.cjs"),s=require("./deploy-data/deploy-data-bnbMainnet.json.cjs"),a=require("./deploy-data/deploy-data-arbMainnet.json.cjs"),n=require("./deploy-data/deploy-data-ethMainnet.json.cjs"),c=require("./deploy-data/deploy-data-optimism.json.cjs"),r=require("./deploy-data/deploy-data-polygon.json.cjs"),d=require("./deploy-data/deploy-data-avalanche.json.cjs"),o=require("./deploy-data/deploy-data-base.json.cjs"),i=[{chainId:e.chainIds.ethMainnet,sourceChain:"Ethereum",sourceAddress:n.default.crossChainAccessTokenAddress},{chainId:e.chainIds.arbMainnet,sourceChain:"arbitrum",sourceAddress:a.default.crossChainAccessTokenAddress},{chainId:e.chainIds.polygon,sourceChain:"Polygon",sourceAddress:r.default.crossChainAccessTokenAddress},{chainId:e.chainIds.avalanche,sourceChain:"Avalanche",sourceAddress:d.default.crossChainAccessTokenAddress},{chainId:e.chainIds.bnbMainnet,sourceChain:"binance",sourceAddress:s.default.crossChainAccessTokenAddress},{chainId:e.chainIds.optimism,sourceChain:"optimism",sourceAddress:c.default.crossChainAccessTokenAddress},{chainId:e.chainIds.base,sourceChain:"base",sourceAddress:o.default.crossChainAccessTokenAddress}];exports.AxelarRegistry=i;
|
|
@@ -1,49 +1,48 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { chainIds as r } from "./chains.constants.mjs";
|
|
1
|
+
import { chainIds as s } from "./chains.constants.mjs";
|
|
3
2
|
import e from "./deploy-data/deploy-data-bnbMainnet.json.mjs";
|
|
4
|
-
import
|
|
3
|
+
import r from "./deploy-data/deploy-data-arbMainnet.json.mjs";
|
|
5
4
|
import a from "./deploy-data/deploy-data-ethMainnet.json.mjs";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
const
|
|
5
|
+
import o from "./deploy-data/deploy-data-optimism.json.mjs";
|
|
6
|
+
import n from "./deploy-data/deploy-data-polygon.json.mjs";
|
|
7
|
+
import c from "./deploy-data/deploy-data-avalanche.json.mjs";
|
|
8
|
+
import i from "./deploy-data/deploy-data-base.json.mjs";
|
|
9
|
+
const b = [
|
|
11
10
|
{
|
|
12
|
-
chainId:
|
|
13
|
-
sourceChain:
|
|
11
|
+
chainId: s.ethMainnet,
|
|
12
|
+
sourceChain: "Ethereum",
|
|
14
13
|
sourceAddress: a.crossChainAccessTokenAddress
|
|
15
14
|
},
|
|
16
15
|
{
|
|
17
|
-
chainId:
|
|
18
|
-
sourceChain:
|
|
19
|
-
sourceAddress:
|
|
16
|
+
chainId: s.arbMainnet,
|
|
17
|
+
sourceChain: "arbitrum",
|
|
18
|
+
sourceAddress: r.crossChainAccessTokenAddress
|
|
20
19
|
},
|
|
21
20
|
{
|
|
22
|
-
chainId:
|
|
23
|
-
sourceChain:
|
|
24
|
-
sourceAddress:
|
|
21
|
+
chainId: s.polygon,
|
|
22
|
+
sourceChain: "Polygon",
|
|
23
|
+
sourceAddress: n.crossChainAccessTokenAddress
|
|
25
24
|
},
|
|
26
25
|
{
|
|
27
|
-
chainId:
|
|
28
|
-
sourceChain:
|
|
29
|
-
sourceAddress:
|
|
26
|
+
chainId: s.avalanche,
|
|
27
|
+
sourceChain: "Avalanche",
|
|
28
|
+
sourceAddress: c.crossChainAccessTokenAddress
|
|
30
29
|
},
|
|
31
30
|
{
|
|
32
|
-
chainId:
|
|
33
|
-
sourceChain:
|
|
31
|
+
chainId: s.bnbMainnet,
|
|
32
|
+
sourceChain: "binance",
|
|
34
33
|
sourceAddress: e.crossChainAccessTokenAddress
|
|
35
34
|
},
|
|
36
35
|
{
|
|
37
|
-
chainId:
|
|
38
|
-
sourceChain:
|
|
39
|
-
sourceAddress:
|
|
36
|
+
chainId: s.optimism,
|
|
37
|
+
sourceChain: "optimism",
|
|
38
|
+
sourceAddress: o.crossChainAccessTokenAddress
|
|
40
39
|
},
|
|
41
40
|
{
|
|
42
|
-
chainId:
|
|
43
|
-
sourceChain:
|
|
44
|
-
sourceAddress:
|
|
41
|
+
chainId: s.base,
|
|
42
|
+
sourceChain: "base",
|
|
43
|
+
sourceAddress: i.crossChainAccessTokenAddress
|
|
45
44
|
}
|
|
46
45
|
];
|
|
47
46
|
export {
|
|
48
|
-
|
|
47
|
+
b as AxelarRegistry
|
|
49
48
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./deploy-data/deploy-data-bnbMainnet.json.cjs"),l=require("./deploy-data/deploy-data-arbMainnet.json.cjs"),d=require("./deploy-data/deploy-data-ethMainnet.json.cjs"),h=require("./deploy-data/deploy-data-optimism.json.cjs"),u=require("./deploy-data/deploy-data-polygon.json.cjs"),m=require("./deploy-data/deploy-data-avalanche.json.cjs"),b=require("./deploy-data/deploy-data-base.json.cjs"),F=require("./deploy-data/deploy-data-localhost.json.cjs"),y=require("./deploy-data/deploy-data-axelar1.json.cjs"),g=require("./deploy-data/deploy-data-axelar2.json.cjs"),s=require("./vite.constants.cjs"),e={polygon:137,arbMainnet:42161,ethMainnet:1,avalanche:43114,bnbMainnet:56,optimism:10,base:8453,bnbTestnet:97,polygonMumbai:80001,mainnetSepolia:11155111,optimismSepolia:11155420,axelar1:2500,axelar2:2501,localhost:31337,hardhat:31337},n=e.ethMainnet,
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./deploy-data/deploy-data-bnbMainnet.json.cjs"),l=require("./deploy-data/deploy-data-arbMainnet.json.cjs"),d=require("./deploy-data/deploy-data-ethMainnet.json.cjs"),h=require("./deploy-data/deploy-data-optimism.json.cjs"),u=require("./deploy-data/deploy-data-polygon.json.cjs"),m=require("./deploy-data/deploy-data-avalanche.json.cjs"),b=require("./deploy-data/deploy-data-base.json.cjs"),F=require("./deploy-data/deploy-data-localhost.json.cjs"),y=require("./deploy-data/deploy-data-axelar1.json.cjs"),g=require("./deploy-data/deploy-data-axelar2.json.cjs"),s=require("./vite.constants.cjs"),e={polygon:137,arbMainnet:42161,ethMainnet:1,avalanche:43114,bnbMainnet:56,optimism:10,base:8453,bnbTestnet:97,polygonMumbai:80001,mainnetSepolia:11155111,optimismSepolia:11155420,axelar1:2500,axelar2:2501,localhost:31337,hardhat:31337},n=e.ethMainnet,o=t=>!![e.axelar1,e.axelar2,e.localhost].includes(t),k=t=>t?o(t)?n:t:n,a={[e.ethMainnet]:{name:"Ethereum",chainId:e.ethMainnet,rpcUrl:"https://rpc.ankr.com/eth",fetchRpcUrl:"https://eth-mainnet.g.alchemy.com/v2/XzUgeU8YiIIzkD7j2GWnTsFUck7wGgK9",supported:!0,contractData:d.default,quoterV2Address:"0x61fFE014bA17989E743c5F6cB21bF9697530B21e",uniswapV3FactoryAddress:"0x1F98431c8aD98523631AE4a59f267346ea31F984",accessTokenMintingFee:"0",priority:1,privateMempoolRpcUrl:"https://relay.flashbots.net"},[e.arbMainnet]:{name:"Arbitrum",chainId:e.arbMainnet,rpcUrl:"https://endpoints.omniatech.io/v1/arbitrum/one/public",fetchRpcUrl:"https://arb-mainnet.g.alchemy.com/v2/XzUgeU8YiIIzkD7j2GWnTsFUck7wGgK9",supported:!0,contractData:l.default,quoterV2Address:"0x61fFE014bA17989E743c5F6cB21bF9697530B21e",uniswapV3FactoryAddress:"0x1F98431c8aD98523631AE4a59f267346ea31F984",accessTokenMintingFee:"0",priority:2},[e.optimism]:{name:"Optimism",chainId:e.optimism,rpcUrl:"https://optimism-mainnet.infura.io/v3/c26b99456bb6464bb498926ff5162903",fetchRpcUrl:"https://opt-mainnet.g.alchemy.com/v2/XzUgeU8YiIIzkD7j2GWnTsFUck7wGgK9",supported:!0,contractData:h.default,quoterV2Address:"0x61fFE014bA17989E743c5F6cB21bF9697530B21e",uniswapV3FactoryAddress:"0x1F98431c8aD98523631AE4a59f267346ea31F984",accessTokenMintingFee:"0",priority:3},[e.polygon]:{name:"Polygon",chainId:e.polygon,rpcUrl:"https://polygon-rpc.com",fetchRpcUrl:"https://polygon-mainnet.g.alchemy.com/v2/XzUgeU8YiIIzkD7j2GWnTsFUck7wGgK9",supported:!0,contractData:u.default,quoterV2Address:"0x61fFE014bA17989E743c5F6cB21bF9697530B21e",uniswapV3FactoryAddress:"0x1F98431c8aD98523631AE4a59f267346ea31F984",accessTokenMintingFee:"0",priority:4},[e.avalanche]:{name:"Avalanche",chainId:e.avalanche,rpcUrl:"https://api.avax.network/ext/bc/C/rpc",fetchRpcUrl:"https://avax-mainnet.g.alchemy.com/v2/XzUgeU8YiIIzkD7j2GWnTsFUck7wGgK9",supported:!0,contractData:m.default,quoterV2Address:"0xbe0F5544EC67e9B3b2D979aaA43f18Fd87E6257F",uniswapV3FactoryAddress:"0x740b1c1de25031C31FF4fC9A62f554A55cdC1baD",accessTokenMintingFee:"0",priority:5},[e.bnbMainnet]:{name:"BNB Chain",chainId:e.bnbMainnet,rpcUrl:"https://bsc-dataseed.binance.org",fetchRpcUrl:"https://bnb-mainnet.g.alchemy.com/v2/XzUgeU8YiIIzkD7j2GWnTsFUck7wGgK9",supported:!0,contractData:p.default,quoterV2Address:"0x78D78E420Da98ad378D7799bE8f4AF69033EB077",uniswapV3FactoryAddress:"0xdB1d10011AD0Ff90774D0C6Bb92e5C5c8b4461F7",accessTokenMintingFee:"0",priority:6},[e.base]:{name:"Base",chainId:e.base,rpcUrl:"https://mainnet.base.org/",fetchRpcUrl:"https://base-mainnet.g.alchemy.com/v2/XzUgeU8YiIIzkD7j2GWnTsFUck7wGgK9",supported:!0,contractData:b.default,quoterV2Address:"0x3d4e44Eb1374240CE5F1B871ab261CD16335B76a",uniswapV3FactoryAddress:"0x33128a8fC17869897dcE68Ed026d694621f6FDfD",accessTokenMintingFee:"0",priority:7},...s.isDevelopment?{}:{}},A={name:"Localhost",chainId:e.localhost,rpcUrl:"http://localhost:8545",fetchRpcUrl:"http://localhost:8545",supported:!0,contractData:F.default,quoterV2Address:a[n].quoterV2Address,uniswapV3FactoryAddress:a[n].uniswapV3FactoryAddress,accessTokenMintingFee:a[n].accessTokenMintingFee,priority:7},f={name:"axelar1",chainId:e.axelar1,rpcUrl:"http://localhost:8600/0",fetchRpcUrl:"http://localhost:8600/0",supported:!0,contractData:y.default,quoterV2Address:a[n].quoterV2Address,uniswapV3FactoryAddress:a[n].uniswapV3FactoryAddress,accessTokenMintingFee:a[n].accessTokenMintingFee,priority:8},D={name:"axelar2",chainId:e.axelar2,rpcUrl:"http://localhost:8600/1",fetchRpcUrl:"http://localhost:8600/1",supported:!0,contractData:g.default,quoterV2Address:a[n].quoterV2Address,uniswapV3FactoryAddress:a[n].uniswapV3FactoryAddress,accessTokenMintingFee:a[n].accessTokenMintingFee,priority:9};s.isDevelopment&&(a[e.localhost]=A,a[e.axelar1]=f,a[e.axelar2]=D);const U=[e.ethMainnet,e.arbMainnet,e.avalanche,e.bnbMainnet,e.polygon,e.optimism,e.base];var r=(t=>(t.Mainnet="Mainnet",t.Testnet="Testnet",t.Local="Local",t))(r||{});const M={Mainnet:[e.polygon,e.arbMainnet,e.ethMainnet,e.bnbMainnet,e.optimism,e.avalanche,e.base],Testnet:[e.bnbTestnet,e.polygonMumbai],Local:[e.localhost,e.axelar1,e.axelar2]},c=t=>[e.optimism,e.base].includes(t),i=t=>!1,x=t=>c(t)||i();exports.EthereumNetworkType=r;exports.chainIds=e;exports.chainIdsByType=M;exports.crossChainAccessTokenNetworks=U;exports.getNonLocalhostChainId=k;exports.isLocalNetwork=o;exports.isOptimismBedrockLike=i;exports.isOptimismEcotoneLike=c;exports.isOptimismLike=x;exports.localhostNetwork=n;exports.networkRegistry=a;
|
|
@@ -9,7 +9,7 @@ import m from "./deploy-data/deploy-data-localhost.json.mjs";
|
|
|
9
9
|
import h from "./deploy-data/deploy-data-axelar1.json.mjs";
|
|
10
10
|
import b from "./deploy-data/deploy-data-axelar2.json.mjs";
|
|
11
11
|
import { isDevelopment as r } from "./vite.constants.mjs";
|
|
12
|
-
const
|
|
12
|
+
const t = {
|
|
13
13
|
polygon: 137,
|
|
14
14
|
arbMainnet: 42161,
|
|
15
15
|
ethMainnet: 1,
|
|
@@ -25,10 +25,10 @@ const a = {
|
|
|
25
25
|
axelar2: 2501,
|
|
26
26
|
localhost: 31337,
|
|
27
27
|
hardhat: 31337
|
|
28
|
-
}, n =
|
|
29
|
-
[
|
|
28
|
+
}, n = t.ethMainnet, F = (a) => !![t.axelar1, t.axelar2, t.localhost].includes(a), z = (a) => a ? F(a) ? n : a : n, e = {
|
|
29
|
+
[t.ethMainnet]: {
|
|
30
30
|
name: "Ethereum",
|
|
31
|
-
chainId:
|
|
31
|
+
chainId: t.ethMainnet,
|
|
32
32
|
rpcUrl: "https://rpc.ankr.com/eth",
|
|
33
33
|
fetchRpcUrl: "https://eth-mainnet.g.alchemy.com/v2/XzUgeU8YiIIzkD7j2GWnTsFUck7wGgK9",
|
|
34
34
|
supported: !0,
|
|
@@ -39,9 +39,9 @@ const a = {
|
|
|
39
39
|
priority: 1,
|
|
40
40
|
privateMempoolRpcUrl: "https://relay.flashbots.net"
|
|
41
41
|
},
|
|
42
|
-
[
|
|
42
|
+
[t.arbMainnet]: {
|
|
43
43
|
name: "Arbitrum",
|
|
44
|
-
chainId:
|
|
44
|
+
chainId: t.arbMainnet,
|
|
45
45
|
rpcUrl: "https://endpoints.omniatech.io/v1/arbitrum/one/public",
|
|
46
46
|
fetchRpcUrl: "https://arb-mainnet.g.alchemy.com/v2/XzUgeU8YiIIzkD7j2GWnTsFUck7wGgK9",
|
|
47
47
|
supported: !0,
|
|
@@ -51,9 +51,9 @@ const a = {
|
|
|
51
51
|
accessTokenMintingFee: "0",
|
|
52
52
|
priority: 2
|
|
53
53
|
},
|
|
54
|
-
[
|
|
54
|
+
[t.optimism]: {
|
|
55
55
|
name: "Optimism",
|
|
56
|
-
chainId:
|
|
56
|
+
chainId: t.optimism,
|
|
57
57
|
rpcUrl: "https://optimism-mainnet.infura.io/v3/c26b99456bb6464bb498926ff5162903",
|
|
58
58
|
fetchRpcUrl: "https://opt-mainnet.g.alchemy.com/v2/XzUgeU8YiIIzkD7j2GWnTsFUck7wGgK9",
|
|
59
59
|
supported: !0,
|
|
@@ -63,9 +63,9 @@ const a = {
|
|
|
63
63
|
accessTokenMintingFee: "0",
|
|
64
64
|
priority: 3
|
|
65
65
|
},
|
|
66
|
-
[
|
|
66
|
+
[t.polygon]: {
|
|
67
67
|
name: "Polygon",
|
|
68
|
-
chainId:
|
|
68
|
+
chainId: t.polygon,
|
|
69
69
|
rpcUrl: "https://polygon-rpc.com",
|
|
70
70
|
fetchRpcUrl: "https://polygon-mainnet.g.alchemy.com/v2/XzUgeU8YiIIzkD7j2GWnTsFUck7wGgK9",
|
|
71
71
|
supported: !0,
|
|
@@ -75,9 +75,9 @@ const a = {
|
|
|
75
75
|
accessTokenMintingFee: "0",
|
|
76
76
|
priority: 4
|
|
77
77
|
},
|
|
78
|
-
[
|
|
78
|
+
[t.avalanche]: {
|
|
79
79
|
name: "Avalanche",
|
|
80
|
-
chainId:
|
|
80
|
+
chainId: t.avalanche,
|
|
81
81
|
rpcUrl: "https://api.avax.network/ext/bc/C/rpc",
|
|
82
82
|
fetchRpcUrl: "https://avax-mainnet.g.alchemy.com/v2/XzUgeU8YiIIzkD7j2GWnTsFUck7wGgK9",
|
|
83
83
|
supported: !0,
|
|
@@ -87,12 +87,12 @@ const a = {
|
|
|
87
87
|
accessTokenMintingFee: "0",
|
|
88
88
|
priority: 5
|
|
89
89
|
},
|
|
90
|
-
[
|
|
90
|
+
[t.bnbMainnet]: {
|
|
91
91
|
name: "BNB Chain",
|
|
92
|
-
chainId:
|
|
92
|
+
chainId: t.bnbMainnet,
|
|
93
93
|
rpcUrl: "https://bsc-dataseed.binance.org",
|
|
94
|
-
maxPageSize:
|
|
95
|
-
fetchRpcUrl: "https://
|
|
94
|
+
// maxPageSize: 1000,
|
|
95
|
+
fetchRpcUrl: "https://bnb-mainnet.g.alchemy.com/v2/XzUgeU8YiIIzkD7j2GWnTsFUck7wGgK9",
|
|
96
96
|
supported: !0,
|
|
97
97
|
contractData: o,
|
|
98
98
|
quoterV2Address: "0x78D78E420Da98ad378D7799bE8f4AF69033EB077",
|
|
@@ -100,9 +100,9 @@ const a = {
|
|
|
100
100
|
accessTokenMintingFee: "0",
|
|
101
101
|
priority: 6
|
|
102
102
|
},
|
|
103
|
-
[
|
|
103
|
+
[t.base]: {
|
|
104
104
|
name: "Base",
|
|
105
|
-
chainId:
|
|
105
|
+
chainId: t.base,
|
|
106
106
|
rpcUrl: "https://mainnet.base.org/",
|
|
107
107
|
// maxPageSize: 1000,
|
|
108
108
|
fetchRpcUrl: "https://base-mainnet.g.alchemy.com/v2/XzUgeU8YiIIzkD7j2GWnTsFUck7wGgK9",
|
|
@@ -116,7 +116,7 @@ const a = {
|
|
|
116
116
|
...r ? {} : {}
|
|
117
117
|
}, u = {
|
|
118
118
|
name: "Localhost",
|
|
119
|
-
chainId:
|
|
119
|
+
chainId: t.localhost,
|
|
120
120
|
rpcUrl: "http://localhost:8545",
|
|
121
121
|
fetchRpcUrl: "http://localhost:8545",
|
|
122
122
|
supported: !0,
|
|
@@ -125,9 +125,9 @@ const a = {
|
|
|
125
125
|
uniswapV3FactoryAddress: e[n].uniswapV3FactoryAddress,
|
|
126
126
|
accessTokenMintingFee: e[n].accessTokenMintingFee,
|
|
127
127
|
priority: 7
|
|
128
|
-
},
|
|
128
|
+
}, g = {
|
|
129
129
|
name: "axelar1",
|
|
130
|
-
chainId:
|
|
130
|
+
chainId: t.axelar1,
|
|
131
131
|
rpcUrl: "http://localhost:8600/0",
|
|
132
132
|
fetchRpcUrl: "http://localhost:8600/0",
|
|
133
133
|
supported: !0,
|
|
@@ -136,9 +136,9 @@ const a = {
|
|
|
136
136
|
uniswapV3FactoryAddress: e[n].uniswapV3FactoryAddress,
|
|
137
137
|
accessTokenMintingFee: e[n].accessTokenMintingFee,
|
|
138
138
|
priority: 8
|
|
139
|
-
},
|
|
139
|
+
}, f = {
|
|
140
140
|
name: "axelar2",
|
|
141
|
-
chainId:
|
|
141
|
+
chainId: t.axelar2,
|
|
142
142
|
rpcUrl: "http://localhost:8600/1",
|
|
143
143
|
fetchRpcUrl: "http://localhost:8600/1",
|
|
144
144
|
supported: !0,
|
|
@@ -148,40 +148,40 @@ const a = {
|
|
|
148
148
|
accessTokenMintingFee: e[n].accessTokenMintingFee,
|
|
149
149
|
priority: 9
|
|
150
150
|
};
|
|
151
|
-
r && (e[
|
|
152
|
-
const
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
151
|
+
r && (e[t.localhost] = u, e[t.axelar1] = g, e[t.axelar2] = f);
|
|
152
|
+
const G = [
|
|
153
|
+
t.ethMainnet,
|
|
154
|
+
t.arbMainnet,
|
|
155
|
+
t.avalanche,
|
|
156
|
+
t.bnbMainnet,
|
|
157
|
+
t.polygon,
|
|
158
|
+
t.optimism,
|
|
159
|
+
t.base
|
|
160
160
|
];
|
|
161
|
-
var y = /* @__PURE__ */ ((
|
|
162
|
-
const
|
|
161
|
+
var y = /* @__PURE__ */ ((a) => (a.Mainnet = "Mainnet", a.Testnet = "Testnet", a.Local = "Local", a))(y || {});
|
|
162
|
+
const q = {
|
|
163
163
|
Mainnet: [
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
164
|
+
t.polygon,
|
|
165
|
+
t.arbMainnet,
|
|
166
|
+
t.ethMainnet,
|
|
167
|
+
t.bnbMainnet,
|
|
168
|
+
t.optimism,
|
|
169
|
+
t.avalanche,
|
|
170
|
+
t.base
|
|
171
171
|
],
|
|
172
|
-
Testnet: [
|
|
173
|
-
Local: [
|
|
174
|
-
}, A = (
|
|
172
|
+
Testnet: [t.bnbTestnet, t.polygonMumbai],
|
|
173
|
+
Local: [t.localhost, t.axelar1, t.axelar2]
|
|
174
|
+
}, A = (a) => [t.optimism, t.base].includes(a), D = (a) => !1, C = (a) => A(a) || D();
|
|
175
175
|
export {
|
|
176
176
|
y as EthereumNetworkType,
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
177
|
+
t as chainIds,
|
|
178
|
+
q as chainIdsByType,
|
|
179
|
+
G as crossChainAccessTokenNetworks,
|
|
180
|
+
z as getNonLocalhostChainId,
|
|
181
181
|
F as isLocalNetwork,
|
|
182
182
|
D as isOptimismBedrockLike,
|
|
183
183
|
A as isOptimismEcotoneLike,
|
|
184
|
-
|
|
184
|
+
C as isOptimismLike,
|
|
185
185
|
n as localhostNetwork,
|
|
186
186
|
e as networkRegistry
|
|
187
187
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("../functions/kyc/zkMeHelper.cjs"),p=require("../functions/kyc/authentoHelper.cjs"),s=require("../types/kyc.types.cjs"),r=require("./chains.constants.cjs"),l="https://onboard.aiprise.com",
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("../functions/kyc/zkMeHelper.cjs"),p=require("../functions/kyc/authentoHelper.cjs"),s=require("../types/kyc.types.cjs"),r=require("./chains.constants.cjs"),l="https://onboard.aiprise.com",c="https://onboard-sandbox.aiprise.com",i={[s.Passports.AiPriseKyc]:{id:s.Passports.AiPriseKyc,shortName:"AiPriseKyc",fullName:" AiPrice Kyc",apiURL:"",onboardURL:"",supportedChainIds:[],supportsAllChains:!0},[s.Passports.AiPriseKyb]:{id:s.Passports.AiPriseKyb,shortName:"AiPriseKyb",fullName:" AiPrice Kyb",apiURL:"",onboardURL:"",supportedChainIds:[],supportsAllChains:!0},[s.Passports.BABPassport]:{id:s.Passports.BABPassport,shortName:"Bab",fullName:"Bab Token",apiURL:"BabPassport",onboardURL:"https://www.binance.com/en/BABT",supportedChainIds:[r.chainIds.bnbMainnet]},[s.Passports.GalxePassport]:{id:s.Passports.GalxePassport,shortName:"Galxe",fullName:"Galxe Passport",apiURL:"GalxePassport",onboardURL:"https://galxe.com/passport",supportedChainIds:[r.chainIds.bnbMainnet]},[s.Passports.ZkMePassport]:{id:s.Passports.ZkMePassport,shortName:"zkMe",fullName:"zkMe Passport",apiURL:"ZkMePassport",onboardURL:"https://widget.zk.me/",customHandleKYC:(a,o,t)=>d.zkMeKycHandler(a,o,t,{merchId:"M2023090671844574053042402155408",zkChainId:r.chainIds.polygon}),supportedChainIds:[r.chainIds.polygon]},[s.Passports.CoinbasePassport]:{id:s.Passports.CoinbasePassport,shortName:"coinbase",fullName:"coinbase Passport",apiURL:"coinbasePassport",onboardURL:"https://www.coinbase.com/onchain-verify",supportedChainIds:[],supportsAllChains:!0},[s.Passports.AuthentoPassport]:{id:s.Passports.AuthentoPassport,shortName:"Authento",fullName:"Authento Passport",apiURL:"AuthentoPassport",onboardURL:"https://app.authento.io/",customHandleKYC:(a,o,t)=>p.authentoKycHandler(a,o,t),supportedChainIds:[],supportsAllChains:!0},[s.Passports.AuthentoPassportKyb]:{id:s.Passports.AuthentoPassportKyb,shortName:"Authento",fullName:"Authento Passport",apiURL:"AuthentoPassport",onboardURL:"https://app.authento.io/",customHandleKYC:(a,o,t)=>p.authentoKycHandler(a,o,t),supportedChainIds:[],supportsAllChains:!0}},n={[s.Passports.ReclaimBNBPassport]:{id:s.Passports.ReclaimBNBPassport,shortName:"ReclaimBNB",fullName:" Reclaim BNB",apiURL:"",onboardURL:"",supportedChainIds:[],supportsAllChains:!0,params:{providerId:"9a8127e6-c5c1-4336-bc49-24a0197f6c56"}},[s.Passports.ReclaimOKXPassport]:{id:s.Passports.ReclaimOKXPassport,shortName:"ReclaimOKX",fullName:" Reclaim OKX",apiURL:"",onboardURL:"",supportedChainIds:[],supportsAllChains:!0,params:{providerId:"4f464d13-d3b0-45b9-bed9-db160a1a5426"}},[s.Passports.ReclaimGatePassport]:{id:s.Passports.ReclaimGatePassport,shortName:"ReclaimGate",fullName:" Reclaim Gate",apiURL:"",onboardURL:"",supportedChainIds:[],supportsAllChains:!0,params:{providerId:"a824a912-52ad-4a84-a096-55728518c3d5"}},[s.Passports.ReclaimKucoinPassport]:{id:s.Passports.ReclaimKucoinPassport,shortName:"ReclaimKraken",fullName:" Reclaim Kraken",apiURL:"",onboardURL:"",supportedChainIds:[],supportsAllChains:!0,params:{providerId:"2a7a2124-04bb-4d8c-bb3b-54b0ddd97342"}},[s.Passports.ReclaimMexcPassport]:{id:s.Passports.ReclaimMexcPassport,shortName:"ReclaimMexc",fullName:" Reclaim Mexc",apiURL:"",onboardURL:"",supportedChainIds:[],supportsAllChains:!0,params:{providerId:"b9a7fa32-41f3-4708-bebf-18869b96bf41"}},[s.Passports.ReclaimHtxPassport]:{id:s.Passports.ReclaimHtxPassport,shortName:"ReclaimHtx",fullName:" Reclaim Htx",apiURL:"",onboardURL:"",supportedChainIds:[],supportsAllChains:!0,params:{providerId:"2fc15466-9106-4a80-b6f3-d21a77445c0a"}}},e={...i,...n},P=Object.values(e).filter((a,o)=>a.onboardURL?.length>0&&Object.values(e).indexOf(a)===o).map(a=>a.onboardURL),u="dbda56e5-31f5-4a37-a895-d4adca6c53fd",m="96050d8d-23c9-4908-b285-2e6dec4c020b",h="Approve Integrity Status proof generation using Reclaim Protocol.";exports.AIPRISE_KYB_TEMPLATE_ID_PROD=m;exports.AIPRISE_KYC_TEMPLATE_ID_PROD=u;exports.RECLAIM_MESSAGE_TO_SIGN=h;exports.ReclaimPassports=n;exports.StandardPassports=i;exports.SupportedPassports=e;exports.aipriseBaseOnboardingProductionUrl=l;exports.aipriseBaseOnboardingSandboxUrl=c;exports.supportedPassportLinks=P;
|
|
@@ -140,16 +140,40 @@ const h = "https://onboard.aiprise.com", b = "https://onboard-sandbox.aiprise.co
|
|
|
140
140
|
params: {
|
|
141
141
|
providerId: "2a7a2124-04bb-4d8c-bb3b-54b0ddd97342"
|
|
142
142
|
}
|
|
143
|
+
},
|
|
144
|
+
[a.ReclaimMexcPassport]: {
|
|
145
|
+
id: a.ReclaimMexcPassport,
|
|
146
|
+
shortName: "ReclaimMexc",
|
|
147
|
+
fullName: " Reclaim Mexc",
|
|
148
|
+
apiURL: "",
|
|
149
|
+
onboardURL: "",
|
|
150
|
+
supportedChainIds: [],
|
|
151
|
+
supportsAllChains: !0,
|
|
152
|
+
params: {
|
|
153
|
+
providerId: "b9a7fa32-41f3-4708-bebf-18869b96bf41"
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
[a.ReclaimHtxPassport]: {
|
|
157
|
+
id: a.ReclaimHtxPassport,
|
|
158
|
+
shortName: "ReclaimHtx",
|
|
159
|
+
fullName: " Reclaim Htx",
|
|
160
|
+
apiURL: "",
|
|
161
|
+
onboardURL: "",
|
|
162
|
+
supportedChainIds: [],
|
|
163
|
+
supportsAllChains: !0,
|
|
164
|
+
params: {
|
|
165
|
+
providerId: "2fc15466-9106-4a80-b6f3-d21a77445c0a"
|
|
166
|
+
}
|
|
143
167
|
}
|
|
144
|
-
}, p = { ...n, ...d },
|
|
168
|
+
}, p = { ...n, ...d }, R = Object.values(p).filter((s, o) => s.onboardURL?.length > 0 && Object.values(p).indexOf(s) === o).map((s) => s.onboardURL), P = "dbda56e5-31f5-4a37-a895-d4adca6c53fd", A = "96050d8d-23c9-4908-b285-2e6dec4c020b", L = "Approve Integrity Status proof generation using Reclaim Protocol.";
|
|
145
169
|
export {
|
|
146
170
|
A as AIPRISE_KYB_TEMPLATE_ID_PROD,
|
|
147
|
-
|
|
171
|
+
P as AIPRISE_KYC_TEMPLATE_ID_PROD,
|
|
148
172
|
L as RECLAIM_MESSAGE_TO_SIGN,
|
|
149
173
|
d as ReclaimPassports,
|
|
150
174
|
n as StandardPassports,
|
|
151
175
|
p as SupportedPassports,
|
|
152
176
|
h as aipriseBaseOnboardingProductionUrl,
|
|
153
177
|
b as aipriseBaseOnboardingSandboxUrl,
|
|
154
|
-
|
|
178
|
+
R as supportedPassportLinks
|
|
155
179
|
};
|
package/crypto/babyJub.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("circomlibjs-hinkal-fork");class e{babyjub=void 0;async init(){this.babyjub||(this.babyjub=await t.buildBabyjub())}getJub(){return this.babyjub}}const b=new e,u=()=>b.getJub();exports.babyJubInstance=u;exports.jubHolder=b;
|
package/crypto/babyJub.mjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { buildBabyjub as b } from "circomlibjs";
|
|
1
|
+
import { buildBabyjub as b } from "circomlibjs-hinkal-fork";
|
|
2
2
|
class t {
|
|
3
3
|
babyjub = void 0;
|
|
4
4
|
async init() {
|
|
5
|
-
this.babyjub = await b();
|
|
5
|
+
this.babyjub || (this.babyjub = await b());
|
|
6
6
|
}
|
|
7
7
|
getJub() {
|
|
8
8
|
return this.babyjub;
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
|
-
const u = new t(),
|
|
11
|
+
const u = new t(), e = () => u.getJub();
|
|
12
12
|
export {
|
|
13
|
-
|
|
13
|
+
e as babyJubInstance,
|
|
14
14
|
u as jubHolder
|
|
15
15
|
};
|
package/crypto/poseidon.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("ethers"),t=require("../functions/utils/amounts.utils.cjs"),s=require("circomlibjs-hinkal-fork");class r{poseidon=void 0;async init(){this.poseidon||(this.poseidon=await s.buildPoseidon())}getPoseidon(){return this.poseidon}}const n=new r;function d(...e){const o=n.getPoseidon();return t.toBigInt(o.F.toString(o(e)))}const u=(...e)=>{const o=n.getPoseidon();return i.BigNumber.from(o.F.toString(o([...e]))).toHexString()};exports.poseidonFunction=d;exports.poseidonHash=u;exports.poseidonHolder=n;
|
package/crypto/poseidon.mjs
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { BigNumber as t } from "ethers";
|
|
2
|
+
import { toBigInt as e } from "../functions/utils/amounts.utils.mjs";
|
|
3
|
+
import { buildPoseidon as s } from "circomlibjs-hinkal-fork";
|
|
4
4
|
class r {
|
|
5
5
|
poseidon = void 0;
|
|
6
6
|
async init() {
|
|
7
|
-
this.poseidon = await
|
|
7
|
+
this.poseidon || (this.poseidon = await s());
|
|
8
8
|
}
|
|
9
9
|
getPoseidon() {
|
|
10
10
|
return this.poseidon;
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
|
-
const
|
|
14
|
-
function g(...
|
|
15
|
-
const o =
|
|
16
|
-
return
|
|
13
|
+
const n = new r();
|
|
14
|
+
function g(...i) {
|
|
15
|
+
const o = n.getPoseidon();
|
|
16
|
+
return e(o.F.toString(o(i)));
|
|
17
17
|
}
|
|
18
|
-
const m = (...
|
|
19
|
-
const o =
|
|
20
|
-
return
|
|
18
|
+
const m = (...i) => {
|
|
19
|
+
const o = n.getPoseidon();
|
|
20
|
+
return t.from(o.F.toString(o([...i]))).toHexString();
|
|
21
21
|
};
|
|
22
22
|
export {
|
|
23
23
|
g as poseidonFunction,
|
|
24
24
|
m as poseidonHash,
|
|
25
|
-
|
|
25
|
+
n as poseidonHolder
|
|
26
26
|
};
|
package/crypto/preProcessing.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./babyJub.cjs"),o=require("./poseidon.cjs"),i=require("libsodium-wrappers"),r=require("process"),n=require("buffer"),s=async()=>{(typeof window<"u"||typeof WorkerGlobalScope<"u")&&(typeof window<"u"&&(window.global=window),globalThis.Buffer=n.Buffer,globalThis.process=r),await Promise.all([i.ready,o.poseidonHolder.init(),e.jubHolder.init()])};exports.preProcessing=s;
|
package/crypto/preProcessing.mjs
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { jubHolder as
|
|
1
|
+
import { jubHolder as o } from "./babyJub.mjs";
|
|
2
2
|
import { poseidonHolder as i } from "./poseidon.mjs";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import e from "libsodium-wrappers";
|
|
4
|
+
import r from "process";
|
|
5
|
+
import { Buffer as f } from "buffer";
|
|
6
|
+
const l = async () => {
|
|
7
|
+
(typeof window < "u" || typeof WorkerGlobalScope < "u") && (typeof window < "u" && (window.global = window), globalThis.Buffer = f, globalThis.process = r), await Promise.all([e.ready, i.init(), o.init()]);
|
|
6
8
|
};
|
|
7
9
|
export {
|
|
8
|
-
|
|
10
|
+
l as preProcessing
|
|
9
11
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../../types/hinkal.types.cjs"),h=require("../../types/ethereum-network.types.cjs"),a=require("../../functions/web3/functionCalls/accessTokenCalls.cjs"),A=require("../../functions/web3/events/getShieldedBalance.cjs"),o=require("../crypto-keys/keys.cjs"),y=require("./hinkalActionBeefy.cjs"),C=require("./hinkalActionConvex.cjs"),P=require("./hinkalActionCurve.cjs"),w=require("./hinkalActionPendle.cjs"),d=require("./hinkalDeposit.cjs"),m=require("./hinkalSwap.cjs"),T=require("./hinkalWithdraw.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../../types/hinkal.types.cjs"),h=require("../../types/ethereum-network.types.cjs"),a=require("../../functions/web3/functionCalls/accessTokenCalls.cjs"),A=require("../../functions/web3/events/getShieldedBalance.cjs"),o=require("../crypto-keys/keys.cjs"),y=require("./hinkalActionBeefy.cjs"),C=require("./hinkalActionConvex.cjs"),P=require("./hinkalActionCurve.cjs"),w=require("./hinkalActionPendle.cjs"),d=require("./hinkalDeposit.cjs"),m=require("./hinkalSwap.cjs"),T=require("./hinkalWithdraw.cjs"),q=require("./resetMerkleTrees.cjs"),l=require("../merkle-tree/MerkleTree.cjs"),u=require("../../crypto/poseidon.cjs");require("circomlibjs-hinkal-fork");require("libsodium-wrappers");require("process");require("buffer");const S=require("../../constants/chains.constants.cjs"),g=require("../../error-handling/error-codes.constants.cjs"),f=require("../../API/callMonitor.cjs"),E=require("./hinkalActionLidoEth.cjs");require("../../constants/vite.constants.cjs");require("axios");require("../../constants/coingecko.constants.cjs");const M=require("../../API/getAxelarGasEstimate.cjs"),p=require("../../API/API.cjs");require("ethers");require("../../types/curve.types.cjs");require("../../constants/contracts.constants.cjs");const F=require("../../constants/kyc.constants.cjs");require("../../constants/axelar.constants.cjs");require("../../constants/rewards.constants.cjs");require("../../constants/reorg-depths.constants.cjs");const H=require("../transactions-manager/TransactionsManager.cjs");require("../../functions/utils/external-action.utils.cjs");require("../../types/circom-data.types.cjs");require("../../types/transactions.types.cjs");const I=require("../../functions/utils/reloadPage.cjs"),R=require("./hinkalActionVolatile.cjs"),k=require("./hinkalActionPendleLP.cjs"),L=require("../../API/getConnextReceiveFee.cjs"),W=require("./hinkalActionStake.cjs"),x=require("../MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.cjs"),K=require("./hinkalPrivateWallet.cjs");class N{providerAdapter;userKeys;signingMessage="Login to Hinkal Protocol";merkleTreeHinkal;merkleTreeAccessToken;nullifiers;encryptedOutputs;commitmentsSnapshotService;nullifierSnapshotService;accessTokenSnapshotService;transactionsManager;utxoUtils;inMemoryCache;constructor(){this.userKeys=new o.UserKeys(void 0),this.merkleTreeHinkal=l.MerkleTree.create(u.poseidonFunction,25n,0n),this.merkleTreeAccessToken=l.MerkleTree.create(u.poseidonFunction,25n,0n),this.nullifiers=new Set,this.encryptedOutputs=[],this.transactionsManager=new H.TransactionsManager,this.utxoUtils=new x.MultiThreadedUtxoUtils,this.inMemoryCache=new Map}async initProviderAdapter(e,t){await this.updateProviderAdapter(t),this.providerAdapter?.initConnector(e);const r=await this.connectAndPatchProvider(e);await t.init(r),await this.setListeners()}async initUserKeys(){this.userKeys=new o.UserKeys(await this.getProviderAdapter().signMessage(this.signingMessage))}async initUserKeysWithPassword(e){this.userKeys=new o.UserKeys(e)}async resetMerkle(){this.isSelectedNetworkSupported()&&await q.resetMerkleTrees(this)}getProviderAdapter(){if(!this.providerAdapter)throw new Error("ProviderAdapter is not initialized");return this.providerAdapter}async waitForTransaction(e,t=1){return!!await this.providerAdapter?.waitForTransaction(e,t)}getContractMetadata(e,t){return this.getProviderAdapter().getContractMetadata(e,t)}getContract(e,t=void 0,r){return this.getProviderAdapter().getContract(e,t,r)}async signMessage(e){return await this.getProviderAdapter().signMessage(e)}async signTypedData(e,t,r){return await this.getProviderAdapter().signTypedData(e,t,r)}getContractWithSigner(e,t=""){return this.getProviderAdapter().getContractWithSigner(e,t)}getContractWithFetcher(e,t=""){return this.getProviderAdapter().getContractWithFetcher(e,t)}getContractWithFetcherForEthereum(e,t){return this.getProviderAdapter().getContractWithFetcherForEthereum(e,t)}isSelectedNetworkSupported(){return!!S.networkRegistry[this.getCurrentChainId()]}async switchNetwork(e){try{await this.getProviderAdapter().switchNetwork(e)}catch{throw new Error(g.transactionErrorCodes.FAILED_TO_SWITCH_NETWORKS)}}getCurrentChainId(){const{chainId:e}=this.getProviderAdapter();if(!e)throw new Error("Illegal State: no chainId");return e}getSelectedNetwork(){return this.providerAdapter?.getSelectedNetwork()}isPermitterAvailable(){return this.getProviderAdapter().isPermitterAvailable()}async connectAndPatchProvider(e){return await this.getProviderAdapter().connectAndPatchProvider(e)}async disconnectFromConnector(){await this.getProviderAdapter().disconnectFromConnector()}async updateProviderAdapter(e){try{this.providerAdapter&&this.providerAdapter.release(),this.providerAdapter=e}catch(t){throw console.error(t),Error("updateProviderAdapter failed, please try again.")}}async setListeners(){this.providerAdapter?.setChainEventListener({onAccountChanged:()=>{this.onAccountChanged()},onChainChanged:e=>{this.onChainChanged(e)}})}async onAccountChanged(){await this.getProviderAdapter().onAccountChanged();const e=c.EventType.AccountChanged;typeof document<"u"?document?.dispatchEvent(new Event(e)):process?.emit("message",e,void 0)}async onChainChanged(e){if(e){await this.getProviderAdapter().onChainChanged(e);const t=c.EventType.NetworkChange;typeof document<"u"?document.dispatchEvent(new Event(t)):process?.emit("message",t,void 0)}else await this.disconnectFromConnector(),I.reloadPage()}async monitorConnectedAddress(){f.monitor(await this.getEthereumAddress(),this.getCurrentChainId())}async getBalances(){return A.getShieldedBalance(this)}getSupportedPassportLinks(){return F.supportedPassportLinks}checkAccessToken(){return a.checkHinkalAccessToken(this)}async getAxelarEstimate(e,t,r,n){return M.getAxelarGasEstimate(e,t,r,n,this.userKeys.getAccessKey())}async getConnextReceiveFee(e,t){return L.getConnextReceiveFee(this.getCurrentChainId(),e,t)}async mintHinkalAccessToken(e){return a.mintAccessToken(this,e)}async mintHinkalAccessTokenCrossChain(e,t){return a.mintTokenCrossChain(this,e,t)}async getHinkalTreeRootHash(){return this.getContractWithFetcher(h.ContractType.HinkalContract).getRootHash()}async getAccessTokenTreeRootHash(){return this.getContractWithFetcher(h.ContractType.CrossChainAccessTokenContract).getRootHash()}async resetMerkleTreesIfNecessary(){if(!this.isSelectedNetworkSupported())throw new Error(g.transactionErrorCodes.UNSUPPORTED_NETWORK);const[e,t]=await Promise.all([this.getHinkalTreeRootHash(),this.getAccessTokenTreeRootHash()]);(e.toBigInt()!==this.merkleTreeHinkal.getRootHash()||t.toBigInt()!==this.merkleTreeAccessToken.getRootHash())&&await this.resetMerkle()}async getEventsFromHinkal(){await Promise.all([this.accessTokenSnapshotService?.retrieveEventsFromLatestBlock(),this.commitmentsSnapshotService?.retrieveEventsFromLatestBlock(),this.nullifierSnapshotService?.retrieveEventsFromLatestBlock()])}getEthereumAddress(){return this.getProviderAdapter().getAddress()}async getRandomRelay(){return(await p.API.getIdleRelay(this.getCurrentChainId())).relay}getGasPrice(){if(!this.providerAdapter?.chainId)throw new Error("Illegal State of providerAdapter in Hinkal: no chainId");return this.providerAdapter.getGasPrice()}getAPI(){return p.API}snapshotsClearInterval(){this.commitmentsSnapshotService?.intervalClear(),this.accessTokenSnapshotService?.intervalClear(),this.nullifierSnapshotService?.intervalClear()}async deposit(e,t){return d.hinkalDeposit(this,e,t)}async depositForOther(e,t,r){return d.hinkalDepositForOther(this,e,t,r)}async withdraw(e,t,r,n,i=!1){return T.hinkalWithdraw(this,e,t,r,n,i)}async swap(e,t,r,n,i=!1,s=!1){return m.hinkalSwap(this,e,t,r,n,i,s)}async actionCurve(e,t,r,n,i,s=!1){return P.hinkalActionCurve(this,e,t,r,n,i,s)}async actionConvex(e,t,r,n,i=!1){return C.hinkalActionConvex(this,e,t,r,n,i)}async actionBeefy(e,t,r,n,i,s,v=!1){return y.hinkalActionBeefy(this,e,t,r,n,i,s,v)}async actionLido(e,t,r,n,i,s=!1){return E.hinkalActionLido(this,e,t,r,n,i,s)}async actionPendle(e,t,r,n,i=!1){return w.hinkalActionPendle(this,e,t,r,n,i)}async actionPendleLP(e,t,r,n,i=!1){return k.hinkalActionPendleLP(this,e,t,r,n,i)}async actionVolatile(e,t,r,n=!1){return R.hinkalActionVolatile(this,e,t,r,n)}async actionStake(e,t,r,n){return W.hinkalActionStake(this,e,t,r,n)}async actionPrivateWallet(e,t,r,n=[],i,s=!1){return K.hinkalPrivateWallet(this,e,t,r,n,i,s)}async getPendleLPClaimableParams(e,t){return k.hinkalGetPendleLPClaimableParams(this,e,t)}}exports.Hinkal=N;
|
|
@@ -13,7 +13,10 @@ import { hinkalWithdraw as S } from "./hinkalWithdraw.mjs";
|
|
|
13
13
|
import { resetMerkleTrees as E } from "./resetMerkleTrees.mjs";
|
|
14
14
|
import { MerkleTree as h } from "../merkle-tree/MerkleTree.mjs";
|
|
15
15
|
import { poseidonFunction as d } from "../../crypto/poseidon.mjs";
|
|
16
|
-
import "circomlibjs";
|
|
16
|
+
import "circomlibjs-hinkal-fork";
|
|
17
|
+
import "libsodium-wrappers";
|
|
18
|
+
import "process";
|
|
19
|
+
import "buffer";
|
|
17
20
|
import { networkRegistry as H } from "../../constants/chains.constants.mjs";
|
|
18
21
|
import { transactionErrorCodes as p } from "../../error-handling/error-codes.constants.mjs";
|
|
19
22
|
import { monitor as F } from "../../API/callMonitor.mjs";
|
|
@@ -41,7 +44,7 @@ import { getConnextReceiveFee as O } from "../../API/getConnextReceiveFee.mjs";
|
|
|
41
44
|
import { hinkalActionStake as B } from "./hinkalActionStake.mjs";
|
|
42
45
|
import { MultiThreadedUtxoUtils as U } from "../MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.mjs";
|
|
43
46
|
import { hinkalPrivateWallet as b } from "./hinkalPrivateWallet.mjs";
|
|
44
|
-
class
|
|
47
|
+
class Ne {
|
|
45
48
|
providerAdapter;
|
|
46
49
|
userKeys;
|
|
47
50
|
signingMessage = "Login to Hinkal Protocol";
|
|
@@ -299,5 +302,5 @@ class Re {
|
|
|
299
302
|
}
|
|
300
303
|
}
|
|
301
304
|
export {
|
|
302
|
-
|
|
305
|
+
Ne as Hinkal
|
|
303
306
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("../../constants/protocol.constants.cjs"),p=require("../../functions/staking/index.cjs"),f=require("../../functions/utils/erc20tokenFunctions.cjs"),B=require("../../functions/web3/etherFunctions.cjs"),O=require("../../functions/pre-transaction/outputUtxoProcessing.cjs"),_=require("../../functions/snarkjs/constructGeneralZkProof.cjs"),b=require("../../functions/web3/events/getShieldedBalance.cjs"),l=require("../utxo/Utxo.cjs");require("../../types/circom-data.types.cjs");const S=require("../../types/ethereum-network.types.cjs"),M=require("../../types/external-action.types.cjs");require("../../types/transactions.types.cjs");require("../../types/curve.types.cjs");const m=require("../../types/hinkal.stake.types.cjs");require("ethers");const j=require("../crypto-keys/keys.cjs");require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("../../constants/protocol.constants.cjs"),p=require("../../functions/staking/index.cjs"),f=require("../../functions/utils/erc20tokenFunctions.cjs"),B=require("../../functions/web3/etherFunctions.cjs"),O=require("../../functions/pre-transaction/outputUtxoProcessing.cjs"),_=require("../../functions/snarkjs/constructGeneralZkProof.cjs"),b=require("../../functions/web3/events/getShieldedBalance.cjs"),l=require("../utxo/Utxo.cjs");require("../../types/circom-data.types.cjs");const S=require("../../types/ethereum-network.types.cjs"),M=require("../../types/external-action.types.cjs");require("../../types/transactions.types.cjs");require("../../types/curve.types.cjs");const m=require("../../types/hinkal.stake.types.cjs");require("ethers");const j=require("../crypto-keys/keys.cjs");require("libsodium-wrappers");const w=require("../../functions/web3/functionCalls/transactCallDirect.cjs"),z=async(t,g,o,s,a)=>{const C=await t.getEthereumAddress(),i=f.getERC20Token(g[0],t.getCurrentChainId());if(!i)throw Error("Deposit Action: No Token Found");const u=s===m.HinkalStakeMode.Stake,n=s===m.HinkalStakeMode.Unstake,{erc20TokenAddress:E}=i,r=[...await b.addPaddingToUtxos(t,g,o,2,void 0,s!==m.HinkalStakeMode.Deposit)];if(u||n){r[0][0]=l.Utxo.createFrom(r[0][0],{amount:o[0]*(u?1n:-1n),isStakeOrUnstakeInput:!0});for(let e=0;e<r.length;e+=1)for(let c=0;c<r[e].length;c+=1)e===0&&c===0||(r[e][c]=l.Utxo.createFrom(r[e][c],{amount:0n}))}const{outputUtxos:H}=O.outputUtxoProcessing(t.userKeys,r[0],o[0]),d=[H.map(e=>l.Utxo.createFrom(e,{isStake:u,isUnstakeOutput:n}))];n&&(d[0][0]=l.Utxo.createFrom(d[0][0],{amount:0n,isUnstakeOutput:n}));const P=[!1],k=B.randomBigInt(30),h=j.UserKeys.getEncryptionKeyPair(t.userKeys.getShieldedPrivateKey()),K=p.encryptStake(k,a,T.ownerPublicKey),D=p.encryptStake(k,a,h.publicKey),F=n?0n:p.createStakeCommitment(!0,a,k,E,o[0],BigInt(d[0][0].timeStamp)),I=u?0:1,v=p.encodeHStakeMetadata(I,F,C,K,D),x=t.getContractWithSigner(S.ContractType.HinkalWrapper2),y=t.getContractWithSigner(S.ContractType.HinkalStakeExternalAction),{zkCallData:q,dimData:A,circomData:U}=await _.constructZkProof(t.merkleTreeHinkal,t.merkleTreeAccessToken,r,d,t.userKeys,"swapperME1x2x1",M.ExternalActionId.HinkalStake,y.address,v,T.zeroAddress,t.getCurrentChainId(),P,void 0,void 0,{stakedTokenRecipient:a,stakeBlinding:k,mode:s,depositorAddress:C});if(n){const e=f.getHToken(i,t.getCurrentChainId());if(!e)throw new Error("hToken not found");const W=(await t.getContractWithFetcher(S.ContractType.HToken,e.erc20TokenAddress).previewWithdraw(-o[0])).toBigInt();return w.transactCallDirect(t,W,e,q,U,A,y,x)}return w.transactCallDirect(t,o[0],i,q,U,A,y,x)};exports.hinkalActionStake=z;
|
|
@@ -14,7 +14,7 @@ import "../../types/curve.types.mjs";
|
|
|
14
14
|
import { HinkalStakeMode as y } from "../../types/hinkal.stake.types.mjs";
|
|
15
15
|
import "ethers";
|
|
16
16
|
import { UserKeys as G } from "../crypto-keys/keys.mjs";
|
|
17
|
-
import "
|
|
17
|
+
import "libsodium-wrappers";
|
|
18
18
|
import { transactCallDirect as w } from "../../functions/web3/functionCalls/transactCallDirect.mjs";
|
|
19
19
|
const pt = async (t, g, e, a, s) => {
|
|
20
20
|
const A = await t.getEthereumAddress(), c = b(g[0], t.getCurrentChainId());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("../../constants/chains.constants.cjs"),x=require("../../error-handling/error-codes.constants.cjs");require("ethers");require("axios");require("../../constants/vite.constants.cjs");require("../../types/circom-data.types.cjs");const A=require("../../types/external-action.types.cjs");require("../../types/transactions.types.cjs");require("../../types/curve.types.cjs");require("circomlibjs");require("../../constants/reorg-depths.constants.cjs");const C=require("../../functions/snarkjs/constructEmporiumProof.cjs"),P=require("../../functions/pre-transaction/processAmountChanges.cjs"),R=require("../../functions/pre-transaction/outputUtxoProcessing.cjs"),w=require("../../functions/web3/events/getShieldedBalance.cjs"),U=require("../../functions/web3/functionCalls/estimateGasRelayer.cjs"),I=require("../../functions/web3/functionCalls/transactCallRelayer.cjs"),T=async(e,o,r,d
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("../../constants/chains.constants.cjs"),x=require("../../error-handling/error-codes.constants.cjs");require("ethers");require("axios");require("../../constants/vite.constants.cjs");require("../../types/circom-data.types.cjs");const A=require("../../types/external-action.types.cjs");require("../../types/transactions.types.cjs");require("../../types/curve.types.cjs");require("circomlibjs-hinkal-fork");require("libsodium-wrappers");require("process");require("buffer");require("../../constants/reorg-depths.constants.cjs");const C=require("../../functions/snarkjs/constructEmporiumProof.cjs"),P=require("../../functions/pre-transaction/processAmountChanges.cjs"),R=require("../../functions/pre-transaction/outputUtxoProcessing.cjs"),w=require("../../functions/web3/events/getShieldedBalance.cjs"),U=require("../../functions/web3/functionCalls/estimateGasRelayer.cjs"),I=require("../../functions/web3/functionCalls/transactCallRelayer.cjs"),T=async(e,o,r,m,d=[],p,y=!1)=>{const i=o.map(t=>0n);r=P.processAmountChanges({erc20Addresses:o,amountChanges:r,flatFees:i,feeUnit:void 0,externalActionId:A.ExternalActionId.Emporium});const s=[...await w.addPaddingToUtxos(e,o,r)],a=[];for(let t=0;t<o.length;t+=1){const{outputUtxos:E}=R.outputUtxoProcessing(e.userKeys,s[t],r[t]);a.push(E)}const n=await e.getRandomRelay();if(!n)throw Error(x.transactionErrorCodes.RELAYER_NOT_AVAILABLE);const{contractData:g}=f.networkRegistry[e.getCurrentChainId()],{emporiumAddress:c}=g;if(!c)throw Error("No Emporium Address Provided");const{zkCallData:u,circomData:l,dimData:q}=await C.constructEmporiumProof(e.merkleTreeHinkal,e.merkleTreeAccessToken,s,a,e.userKeys,r.length,s[0].length,c,d,n,e.getCurrentChainId(),m,i,p);return y?await U.estimateGasRelayer(e,u,q,l):await I.transactCallRelayer(e.getCurrentChainId(),u,q,l)};exports.hinkalPrivateWallet=T;
|