@hinkal/common 0.2.2 → 0.2.4
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/API/API.cjs +1 -1
- package/API/API.d.ts +2 -2
- package/API/API.mjs +22 -22
- package/API/duneAPI.cjs +1 -1
- package/API/duneAPI.mjs +3 -2
- package/API/userVerifyTransactions.cjs +1 -1
- package/API/userVerifyTransactions.d.ts +6 -7
- package/API/userVerifyTransactions.mjs +13 -14
- package/README.md +32 -22
- package/constants/chains.constants.cjs +1 -1
- package/constants/chains.constants.mjs +2 -2
- package/constants/contracts.constants.cjs +1 -1
- package/constants/contracts.constants.mjs +138 -134
- package/constants/deploy-data/deploy-data-arbMainnet.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-arbMainnet.json.mjs +846 -11
- package/constants/deploy-data/deploy-data-avalanche.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-avalanche.json.mjs +848 -13
- package/constants/deploy-data/deploy-data-base.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-base.json.mjs +852 -17
- package/constants/deploy-data/deploy-data-bnbMainnet.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-bnbMainnet.json.mjs +855 -20
- package/constants/deploy-data/deploy-data-ethMainnet.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-ethMainnet.json.mjs +850 -15
- package/constants/deploy-data/deploy-data-localhost.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-localhost.json.mjs +935 -100
- package/constants/deploy-data/deploy-data-optimism.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-optimism.json.mjs +844 -9
- package/constants/deploy-data/deploy-data-polygon.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-polygon.json.mjs +844 -9
- package/constants/kyc.constants.cjs +1 -1
- package/constants/kyc.constants.mjs +30 -18
- package/constants/server.constants.cjs +1 -1
- package/constants/server.constants.d.ts +3 -2
- package/constants/server.constants.mjs +7 -6
- package/constants/token-data/ERC20Registry.cjs +1 -1
- package/constants/token-data/ERC20Registry.mjs +48 -48
- package/constants/token-data/arbMainnetRegistry.json.cjs +1 -1
- package/constants/token-data/arbMainnetRegistry.json.mjs +4 -1
- package/constants/token-data/arbMainnetRegistryFixed.json.cjs +1 -1
- package/constants/token-data/arbMainnetRegistryFixed.json.mjs +4 -1
- package/constants/token-data/avalancheRegistry.json.cjs +1 -1
- package/constants/token-data/avalancheRegistry.json.mjs +4 -1
- package/constants/token-data/avalancheRegistryFixed.json.cjs +1 -1
- package/constants/token-data/avalancheRegistryFixed.json.mjs +4 -1
- package/constants/token-data/baseRegistry.json.cjs +1 -1
- package/constants/token-data/baseRegistry.json.mjs +4 -1
- package/constants/token-data/baseRegistryFixed.json.cjs +1 -1
- package/constants/token-data/baseRegistryFixed.json.mjs +4 -1
- package/constants/token-data/bnbMainnetRegistry.json.cjs +1 -1
- package/constants/token-data/bnbMainnetRegistry.json.mjs +12 -9
- package/constants/token-data/bnbMainnetRegistryFixed.json.cjs +1 -1
- package/constants/token-data/bnbMainnetRegistryFixed.json.mjs +12 -9
- package/constants/token-data/ethMainnetRegistry.json.cjs +1 -1
- package/constants/token-data/ethMainnetRegistry.json.mjs +15 -12
- package/constants/token-data/ethMainnetRegistryFixed.json.cjs +1 -1
- package/constants/token-data/ethMainnetRegistryFixed.json.mjs +15 -12
- package/constants/token-data/index.cjs +1 -0
- package/constants/token-data/index.d.ts +972 -15
- package/constants/token-data/index.mjs +34 -0
- package/constants/token-data/localhostRegistry.json.cjs +1 -1
- package/constants/token-data/localhostRegistry.json.mjs +15 -12
- package/constants/token-data/optimismRegistry.json.cjs +1 -1
- package/constants/token-data/optimismRegistry.json.mjs +4 -1
- package/constants/token-data/optimismRegistryFixed.json.cjs +1 -1
- package/constants/token-data/optimismRegistryFixed.json.mjs +4 -1
- package/constants/token-data/polygonRegistry.json.cjs +1 -1
- package/constants/token-data/polygonRegistry.json.mjs +4 -1
- package/constants/token-data/polygonRegistryFixed.json.cjs +1 -1
- package/constants/token-data/polygonRegistryFixed.json.mjs +4 -1
- package/data-structures/Hinkal/Hinkal.cjs +1 -1
- package/data-structures/Hinkal/Hinkal.d.ts +2 -0
- package/data-structures/Hinkal/Hinkal.mjs +38 -32
- package/data-structures/Hinkal/IHinkal.d.ts +2 -0
- package/data-structures/Hinkal/hinkalActionBeefy.cjs +1 -1
- package/data-structures/Hinkal/hinkalActionBeefy.mjs +21 -20
- package/data-structures/Hinkal/hinkalActionConvex.cjs +1 -1
- package/data-structures/Hinkal/hinkalActionConvex.mjs +13 -12
- package/data-structures/Hinkal/hinkalActionCurve.cjs +1 -1
- package/data-structures/Hinkal/hinkalActionCurve.mjs +15 -14
- package/data-structures/Hinkal/hinkalActionLidoEth.cjs +1 -1
- package/data-structures/Hinkal/hinkalActionLidoEth.mjs +17 -16
- package/data-structures/Hinkal/hinkalActionPendle.cjs +1 -1
- package/data-structures/Hinkal/hinkalActionPendle.d.ts +1 -1
- package/data-structures/Hinkal/hinkalActionPendle.mjs +24 -23
- package/data-structures/Hinkal/hinkalActionPendleLP.cjs +1 -1
- package/data-structures/Hinkal/hinkalActionPendleLP.mjs +21 -20
- package/data-structures/Hinkal/hinkalActionStake.cjs +1 -1
- package/data-structures/Hinkal/hinkalActionStake.d.ts +1 -1
- package/data-structures/Hinkal/hinkalActionStake.mjs +6 -5
- package/data-structures/Hinkal/hinkalActionVolatile.cjs +1 -1
- package/data-structures/Hinkal/hinkalActionVolatile.d.ts +1 -1
- package/data-structures/Hinkal/hinkalActionVolatile.mjs +9 -8
- package/data-structures/Hinkal/hinkalDeposit.cjs +1 -1
- package/data-structures/Hinkal/hinkalDeposit.d.ts +2 -2
- package/data-structures/Hinkal/hinkalDeposit.mjs +93 -54
- package/data-structures/Hinkal/hinkalGetZkMeProvider.cjs +1 -1
- package/data-structures/Hinkal/hinkalGetZkMeProvider.mjs +3 -2
- package/data-structures/Hinkal/hinkalPrivateWallet.cjs +1 -1
- package/data-structures/Hinkal/hinkalPrivateWallet.mjs +5 -4
- package/data-structures/Hinkal/hinkalSwap.cjs +1 -1
- package/data-structures/Hinkal/hinkalSwap.mjs +23 -22
- package/data-structures/Hinkal/hinkalWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalWithdraw.d.ts +1 -1
- package/data-structures/Hinkal/hinkalWithdraw.mjs +13 -12
- package/data-structures/merkle-tree/MerkleTree.cjs +1 -1
- package/data-structures/merkle-tree/MerkleTree.d.ts +2 -0
- package/data-structures/merkle-tree/MerkleTree.mjs +38 -25
- package/data-structures/merkle-tree/getPatchedAccessTokenMerkleTree.cjs +1 -0
- package/data-structures/merkle-tree/getPatchedAccessTokenMerkleTree.d.ts +3 -0
- package/data-structures/merkle-tree/getPatchedAccessTokenMerkleTree.mjs +9 -0
- package/data-structures/merkle-tree/index.d.ts +1 -0
- package/data-structures/transactions-manager/TransactionsManager.cjs +1 -1
- package/data-structures/transactions-manager/TransactionsManager.d.ts +6 -5
- package/data-structures/transactions-manager/TransactionsManager.mjs +118 -111
- package/error-handling/error-codes.constants.cjs +1 -1
- package/error-handling/error-codes.constants.d.ts +4 -0
- package/error-handling/error-codes.constants.mjs +6 -2
- package/externalABIs/BabPassport.json.cjs +1 -1
- package/externalABIs/BabPassport.json.mjs +8 -3
- package/externalABIs/BeefyRouterAbi.json.cjs +1 -1
- package/externalABIs/BeefyRouterAbi.json.mjs +5 -2
- package/externalABIs/BeefyStrategyAbi.json.cjs +1 -1
- package/externalABIs/BeefyStrategyAbi.json.mjs +5 -2
- package/externalABIs/BeefyVaultAbi.json.cjs +1 -1
- package/externalABIs/BeefyVaultAbi.json.mjs +5 -2
- package/externalABIs/BeefyZapAbi.json.cjs +1 -1
- package/externalABIs/BeefyZapAbi.json.mjs +5 -2
- package/externalABIs/BeefyZapOneInchAbi.json.cjs +1 -1
- package/externalABIs/BeefyZapOneInchAbi.json.mjs +5 -2
- package/externalABIs/ConvexBoosterAbi.json.cjs +1 -1
- package/externalABIs/ConvexBoosterAbi.json.mjs +5 -2
- package/externalABIs/ConvexBoosterAbiMainnet.json.cjs +1 -1
- package/externalABIs/ConvexBoosterAbiMainnet.json.mjs +5 -2
- package/externalABIs/ConvexRewardPoolAbi.json.cjs +1 -1
- package/externalABIs/ConvexRewardPoolAbi.json.mjs +5 -2
- package/externalABIs/CurveReadingWrapperAbi.json.cjs +1 -1
- package/externalABIs/CurveReadingWrapperAbi.json.mjs +5 -2
- package/externalABIs/CurveWrappedMainPool.json.cjs +1 -1
- package/externalABIs/CurveWrappedMainPool.json.mjs +5 -2
- package/externalABIs/CurveZap.json.cjs +1 -1
- package/externalABIs/CurveZap.json.mjs +5 -2
- package/externalABIs/CvxCrvUtilities.json.cjs +1 -1
- package/externalABIs/CvxCrvUtilities.json.mjs +5 -2
- package/externalABIs/ERC20.json.cjs +1 -1
- package/externalABIs/ERC20.json.mjs +20 -3
- package/externalABIs/GalxePassport.json.cjs +1 -1
- package/externalABIs/GalxePassport.json.mjs +8 -3
- package/externalABIs/IQuoterV2.json.cjs +1 -1
- package/externalABIs/IQuoterV2.json.mjs +20 -3
- package/externalABIs/ISwapRouter.json.cjs +1 -1
- package/externalABIs/ISwapRouter.json.mjs +5 -2
- package/externalABIs/IUniswapV3Factory.json.cjs +1 -1
- package/externalABIs/IUniswapV3Factory.json.mjs +20 -3
- package/externalABIs/IUniswapV3Pool.json.cjs +1 -1
- package/externalABIs/IUniswapV3Pool.json.mjs +20 -3
- package/externalABIs/PendleRouterAbi.json.cjs +1 -1
- package/externalABIs/PendleRouterAbi.json.mjs +5 -2
- package/externalABIs/UniswapV2PoolAbi.json.cjs +1 -1
- package/externalABIs/UniswapV2PoolAbi.json.mjs +16 -3
- package/externalABIs/index.cjs +1 -0
- package/externalABIs/index.d.ts +307 -11
- package/externalABIs/index.mjs +23 -0
- package/externalABIs/transactionsProver.json.cjs +1 -1
- package/externalABIs/transactionsProver.json.mjs +20 -3
- package/functions/kyc/zkMeHelper.cjs +1 -1
- package/functions/kyc/zkMeHelper.d.ts +0 -1
- package/functions/kyc/zkMeHelper.mjs +8 -11
- package/functions/pre-transaction/process-gas-estimates.cjs +1 -1
- package/functions/pre-transaction/process-gas-estimates.mjs +3 -2
- package/functions/private-wallet/opProducer.cjs +1 -1
- package/functions/private-wallet/opProducer.mjs +9 -10
- package/functions/protocols/convex.protocols.cjs +1 -1
- package/functions/protocols/convex.protocols.mjs +3 -2
- package/functions/protocols/pendle.helpers.cjs +1 -1
- package/functions/protocols/pendle.helpers.mjs +14 -13
- package/functions/snarkjs/constant.cjs +1 -1
- package/functions/snarkjs/constant.d.ts +1 -0
- package/functions/snarkjs/constant.mjs +6 -5
- package/functions/snarkjs/constructEmporiumProof.cjs +1 -1
- package/functions/snarkjs/constructEmporiumProof.d.ts +1 -1
- package/functions/snarkjs/constructEmporiumProof.mjs +31 -31
- package/functions/snarkjs/constructGeneralZkProof.cjs +1 -1
- package/functions/snarkjs/constructGeneralZkProof.d.ts +1 -1
- package/functions/snarkjs/constructGeneralZkProof.mjs +76 -75
- package/functions/snarkjs/generateZkProof.cjs +1 -1
- package/functions/snarkjs/generateZkProof.d.ts +1 -1
- package/functions/snarkjs/generateZkProof.mjs +4 -15
- package/functions/snarkjs/generateZkProofEnclave.cjs +1 -0
- package/functions/snarkjs/generateZkProofEnclave.d.ts +5 -0
- package/functions/snarkjs/generateZkProofEnclave.mjs +33 -0
- package/functions/snarkjs/generateZkProofSelf.cjs +1 -0
- package/functions/snarkjs/generateZkProofSelf.d.ts +5 -0
- package/functions/snarkjs/generateZkProofSelf.mjs +17 -0
- package/functions/utils/axelar.utils.cjs +1 -1
- package/functions/utils/axelar.utils.mjs +3 -2
- package/functions/utils/cacheDevice.utils.cjs +1 -1
- package/functions/utils/cacheDevice.utils.mjs +9 -8
- package/functions/utils/erc20tokenFunctions.cjs +1 -1
- package/functions/utils/erc20tokenFunctions.mjs +8 -7
- package/functions/utils/evmNetworkFunctions.cjs +1 -1
- package/functions/utils/evmNetworkFunctions.mjs +4 -3
- package/functions/utils/userAgent.cjs +1 -1
- package/functions/utils/userAgent.mjs +8 -8
- package/functions/web3/functionCalls/accessTokenCalls.cjs +1 -1
- package/functions/web3/functionCalls/accessTokenCalls.mjs +8 -8
- package/functions/web3/functionCalls/transactCallDirect.cjs +1 -1
- package/functions/web3/functionCalls/transactCallDirect.d.ts +1 -1
- package/functions/web3/functionCalls/transactCallDirect.mjs +43 -29
- package/functions/web3/functionCalls/transactCallRelayer.cjs +1 -1
- package/functions/web3/functionCalls/transactCallRelayer.mjs +10 -8
- package/functions/web3/getContractMetadata.cjs +1 -0
- package/functions/web3/getContractMetadata.d.ts +5 -0
- package/functions/web3/getContractMetadata.mjs +30 -0
- package/functions/web3/odosAPI.cjs +1 -1
- package/functions/web3/odosAPI.d.ts +1 -2
- package/functions/web3/odosAPI.mjs +19 -18
- package/functions/web3/oneInchAPI.cjs +1 -1
- package/functions/web3/oneInchAPI.d.ts +1 -2
- package/functions/web3/oneInchAPI.mjs +17 -15
- package/functions/web3/uniswapAPI.cjs +1 -1
- package/functions/web3/uniswapAPI.d.ts +4 -4
- package/functions/web3/uniswapAPI.mjs +54 -43
- package/index.cjs +1 -1
- package/index.mjs +617 -638
- package/package.json +4 -3
- package/providers/EthersProviderAdapter.cjs +1 -1
- package/providers/EthersProviderAdapter.d.ts +1 -0
- package/providers/EthersProviderAdapter.mjs +26 -37
- package/providers/WagmiProviderAdapter.cjs +1 -1
- package/providers/WagmiProviderAdapter.d.ts +1 -1
- package/providers/WagmiProviderAdapter.mjs +52 -66
- package/providers/exportProviers.d.ts +1 -1
- package/providers/prepareEthersHinkal.cjs +1 -1
- package/providers/prepareEthersHinkal.mjs +4 -2
- package/providers/prepareWagmiHinkal.cjs +1 -1
- package/providers/prepareWagmiHinkal.mjs +4 -2
- package/types/ethereum-network.types.cjs +1 -1
- package/types/ethereum-network.types.d.ts +62 -59
- package/types/ethereum-network.types.mjs +1 -1
- package/types/hinkal.types.d.ts +4 -0
- package/types/kyc.types.cjs +1 -1
- package/types/kyc.types.d.ts +1 -1
- package/types/kyc.types.mjs +1 -1
- package/types/remote-proof.types.d.ts +15 -0
- package/types/rewards.types.d.ts +5 -0
- package/types/time.types.cjs +1 -1
- package/types/time.types.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.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"homepage": "hinkal.pro",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Hinkal Protocol"
|
|
@@ -57,10 +57,11 @@
|
|
|
57
57
|
"libsodium-wrappers": "^0.7.10",
|
|
58
58
|
"process": "0.11.10",
|
|
59
59
|
"ua-parser-js": "^1.0.37",
|
|
60
|
-
"uuid": "^9.0.1"
|
|
60
|
+
"uuid": "^9.0.1",
|
|
61
|
+
"node-forge": "^1.3.1"
|
|
61
62
|
},
|
|
62
63
|
"peerDependencies": {
|
|
63
|
-
"wagmi": "2.
|
|
64
|
+
"wagmi": "2.13.3",
|
|
64
65
|
"ethers": "5.x"
|
|
65
66
|
},
|
|
66
67
|
"peerDependenciesMeta": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("../constants/chains.constants.cjs"),n=require("../error-handling/error-codes.constants.cjs"),s=require("ethers"),o=require("../functions/web3/getContractMetadata.cjs");class a{signer;chainId;originalProvider;fetchProvider;initConnector(){}initSigner(r){this.signer=r}requireSigner(){if(!this.signer)throw Error("No Connector In Provider Adapter")}async init(r){this.requireSigner(),r&&(this.chainId=r),this.originalProvider=this.signer.provider,this.fetchProvider=this.createFetchProvider()??this.originalProvider,this.fetchProvider===this.originalProvider&&console.warn("fetchProvider not available")}async disconnectFromConnector(){}async connectToConnector(){return 0}async waitForTransaction(r,t){if((await this.fetchProvider?.waitForTransaction(r,t))?.status)return!0;throw Error(n.transactionErrorCodes.TRANSACTION_NOT_CONFIRMED)}async signMessage(r){this.requireSigner();const t=await this.signer.signMessage(r);if(!t)throw new Error(n.transactionErrorCodes.SIGNING_FAILED);if(t.includes("error"))throw new Error(n.transactionErrorCodes.SIGNATURE_UNSUPPORTED_PERSONAL_SIGN);return t}async signTypedData(r,t,e){return this.signer._signTypedData(r,t,e)}getSelectedNetwork=()=>{if(!this.chainId)throw new Error("Illegal state: no chaindId");return i.networkRegistry[this.chainId]};async switchNetwork(){}createFetchProvider(){try{const t=i.networkRegistry[this.chainId]?.fetchRpcUrl;return t?t.includes("wss")?new s.providers.WebSocketProvider(t):new s.providers.StaticJsonRpcProvider(t):void 0}catch(r){console.log("create Fetch Provider error",r);return}}async getAddress(){this.requireSigner();const r=await this.signer.getAddress();if(!r)throw new Error("IllegalState");return s.utils.getAddress(r)}setChainEventListener(){}onAccountChanged(){return this.init()}onChainChanged(r){return this.init(r)}release(){}parseChainIdParam(r){const t=r??this.chainId;if(!t)throw new Error("No chainId provided in context");return t}getContractMetadata(r,t){const e=this.parseChainIdParam(t);return o.getContractMetadata(r,e)}getContract(r,t=void 0,e){const c=this.parseChainIdParam(e);return o.getContract(r,c,t)}getContractWithSigner(r,t=void 0){if(!this.signer)throw new Error("IllegalState: no signer");return this.getContract(r,t).connect(this.signer)}getContractWithFetcher(r,t=void 0){if(!this.fetchProvider)throw new Error("fetchProvider not initialized");return this.getContract(r,t).connect(this.fetchProvider)}getContractWithFetcherForEthereum(r,t=void 0){const e=this.chainId===i.chainIds.localhost&&i.localhostNetwork===i.chainIds.ethMainnet?i.chainIds.localhost:i.chainIds.ethMainnet;return o.getContractWithFetcherByChainId(e,r,t)}async sendTransaction(r){if(!this.signer)throw new Error("IllegalState: no signer");return await this.signer.sendTransaction(r)}async connectAndPatchProvider(){return this.requireSigner(),await this.signer.getChainId()}isPermitterAvailable(){return!1}async getGasPrice(){const r=await this.fetchProvider?.getGasPrice();if(!r)throw Error("Could not fetch gas price in getGasPrice");return r.toBigInt()}}const h=new a,d=()=>new a;exports.EthersProviderAdapter=a;exports.default=d;exports.ethersProvierAdapter=h;
|
|
@@ -23,6 +23,7 @@ export declare class EthersProviderAdapter implements IProviderAdapter<Signer> {
|
|
|
23
23
|
onAccountChanged(): Promise<unknown>;
|
|
24
24
|
onChainChanged(chainId?: number): Promise<unknown>;
|
|
25
25
|
release(): void;
|
|
26
|
+
private parseChainIdParam;
|
|
26
27
|
getContractMetadata(contractType: ContractType, chainId?: number): ContractMetadata;
|
|
27
28
|
getContract(contractType: ContractType, contractAddress?: undefined, chainId?: number): ethers.Contract;
|
|
28
29
|
getContractWithSigner(contract: ContractType, contractAddress?: undefined): ethers.Contract;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { networkRegistry as o, chainIds as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
class
|
|
1
|
+
import { networkRegistry as o, chainIds as i, localhostNetwork as h } from "../constants/chains.constants.mjs";
|
|
2
|
+
import { transactionErrorCodes as n } from "../error-handling/error-codes.constants.mjs";
|
|
3
|
+
import { providers as s, utils as d } from "ethers";
|
|
4
|
+
import { getContractMetadata as g, getContract as l, getContractWithFetcherByChainId as w } from "../functions/web3/getContractMetadata.mjs";
|
|
5
|
+
class a {
|
|
6
6
|
signer;
|
|
7
7
|
chainId;
|
|
8
8
|
originalProvider;
|
|
@@ -27,15 +27,15 @@ class d {
|
|
|
27
27
|
async waitForTransaction(r, t) {
|
|
28
28
|
if ((await this.fetchProvider?.waitForTransaction(r, t))?.status)
|
|
29
29
|
return !0;
|
|
30
|
-
throw Error(
|
|
30
|
+
throw Error(n.TRANSACTION_NOT_CONFIRMED);
|
|
31
31
|
}
|
|
32
32
|
async signMessage(r) {
|
|
33
33
|
this.requireSigner();
|
|
34
34
|
const t = await this.signer.signMessage(r);
|
|
35
35
|
if (!t)
|
|
36
|
-
throw new Error(
|
|
36
|
+
throw new Error(n.SIGNING_FAILED);
|
|
37
37
|
if (t.includes("error"))
|
|
38
|
-
throw new Error(
|
|
38
|
+
throw new Error(n.SIGNATURE_UNSUPPORTED_PERSONAL_SIGN);
|
|
39
39
|
return t;
|
|
40
40
|
}
|
|
41
41
|
async signTypedData(r, t, e) {
|
|
@@ -51,7 +51,7 @@ class d {
|
|
|
51
51
|
createFetchProvider() {
|
|
52
52
|
try {
|
|
53
53
|
const t = o[this.chainId]?.fetchRpcUrl;
|
|
54
|
-
return t ? t.includes("wss") ? new
|
|
54
|
+
return t ? t.includes("wss") ? new s.WebSocketProvider(t) : new s.StaticJsonRpcProvider(t) : void 0;
|
|
55
55
|
} catch (r) {
|
|
56
56
|
console.log("create Fetch Provider error", r);
|
|
57
57
|
return;
|
|
@@ -62,7 +62,7 @@ class d {
|
|
|
62
62
|
const r = await this.signer.getAddress();
|
|
63
63
|
if (!r)
|
|
64
64
|
throw new Error("IllegalState");
|
|
65
|
-
return
|
|
65
|
+
return d.getAddress(r);
|
|
66
66
|
}
|
|
67
67
|
setChainEventListener() {
|
|
68
68
|
}
|
|
@@ -74,28 +74,19 @@ class d {
|
|
|
74
74
|
}
|
|
75
75
|
release() {
|
|
76
76
|
}
|
|
77
|
-
|
|
78
|
-
const
|
|
79
|
-
if (!
|
|
77
|
+
parseChainIdParam(r) {
|
|
78
|
+
const t = r ?? this.chainId;
|
|
79
|
+
if (!t)
|
|
80
80
|
throw new Error("No chainId provided in context");
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
throw new Error(`Unsupported contractType: ${r}`);
|
|
87
|
-
return n(i.contractData);
|
|
81
|
+
return t;
|
|
82
|
+
}
|
|
83
|
+
getContractMetadata(r, t) {
|
|
84
|
+
const e = this.parseChainIdParam(t);
|
|
85
|
+
return g(r, e);
|
|
88
86
|
}
|
|
89
87
|
getContract(r, t = void 0, e) {
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
throw new Error(`No ABI configured for contractType: ${r}`);
|
|
93
|
-
if (i.address && t)
|
|
94
|
-
throw new Error(`Overriding address is not supported for contractType: ${r}`);
|
|
95
|
-
const n = i.address ?? t;
|
|
96
|
-
if (!n)
|
|
97
|
-
throw new Error(`No contractAddress configured for contractType: ${r}`);
|
|
98
|
-
return new h.Contract(n, i.abi);
|
|
88
|
+
const c = this.parseChainIdParam(e);
|
|
89
|
+
return l(r, c, t);
|
|
99
90
|
}
|
|
100
91
|
getContractWithSigner(r, t = void 0) {
|
|
101
92
|
if (!this.signer)
|
|
@@ -108,10 +99,8 @@ class d {
|
|
|
108
99
|
return this.getContract(r, t).connect(this.fetchProvider);
|
|
109
100
|
}
|
|
110
101
|
getContractWithFetcherForEthereum(r, t = void 0) {
|
|
111
|
-
const e = this.chainId ===
|
|
112
|
-
return
|
|
113
|
-
new h.providers.StaticJsonRpcProvider(o[e].fetchRpcUrl)
|
|
114
|
-
);
|
|
102
|
+
const e = this.chainId === i.localhost && h === i.ethMainnet ? i.localhost : i.ethMainnet;
|
|
103
|
+
return w(e, r, t);
|
|
115
104
|
}
|
|
116
105
|
async sendTransaction(r) {
|
|
117
106
|
if (!this.signer)
|
|
@@ -131,9 +120,9 @@ class d {
|
|
|
131
120
|
return r.toBigInt();
|
|
132
121
|
}
|
|
133
122
|
}
|
|
134
|
-
const
|
|
123
|
+
const C = new a(), p = () => new a();
|
|
135
124
|
export {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
125
|
+
a as EthersProviderAdapter,
|
|
126
|
+
p as default,
|
|
127
|
+
C as ethersProvierAdapter
|
|
139
128
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("../constants/chains.constants.cjs"),i=require("../error-handling/error-codes.constants.cjs"),o=require("ethers"),g=require("wagmi"),c=require("../functions/web3/getContractMetadata.cjs"),h=require("../node_modules/@wagmi/core/dist/esm/actions/disconnect.cjs"),u=require("../node_modules/@wagmi/core/dist/esm/actions/reconnect.cjs"),w=require("../node_modules/@wagmi/core/dist/esm/actions/connect.cjs"),l=require("../node_modules/@wagmi/core/dist/esm/actions/signMessage.cjs"),f=require("../node_modules/@wagmi/core/dist/esm/actions/switchChain.cjs"),v=require("../node_modules/@wagmi/core/dist/esm/actions/getAccount.cjs"),C=require("../node_modules/@wagmi/core/dist/esm/actions/watchAccount.cjs"),I=require("../node_modules/@wagmi/core/dist/esm/actions/watchChainId.cjs");class a{connector;chainId;originalProvider;fetchProvider;signer;chainEventListener;config;unsubscribeFns=[];initConnector(t){this.connector=t}requireConnector(){if(!this.connector)throw Error("No Connector In Provider Adapter")}initConfig(t){this.config=t}async init(t){this.requireConnector(),t&&(this.chainId=t),this.originalProvider=await this.connector.getProvider(),this.fetchProvider=this.createFetchProvider()??this.originalProvider,this.fetchProvider===this.originalProvider&&console.warn("fetchProvider not available");const r=await this.connector.getProvider(),e=await this.connector.getAccounts();this.signer=await this.walletClientToSigner({transport:r,account:e[0]},this.chainId)}async disconnectFromConnector(){if(!this.config)throw new Error("No Config In Provider Adapter");this.release(),await h.disconnect(this.config)}async connectToConnector(t){if(!this.config)throw new Error("No Config In Provider Adapter");if(t.id==="walletConnect")try{await u.reconnect(this.config,{connectors:[t]}),await h.disconnect(this.config)}catch{}try{return(await w.connect(this.config,{connector:t})).chainId}catch(r){if(r instanceof g.ConnectorAlreadyConnectedError)return t.getChainId();throw console.log(r),new Error(i.transactionErrorCodes.CONNECTION_FAILED)}}async waitForTransaction(t,r){if((await this.fetchProvider?.waitForTransaction(t,r))?.status)return!0;throw Error(i.transactionErrorCodes.TRANSACTION_NOT_CONFIRMED)}async signMessage(t){if(!this.config)throw new Error("No Config In Provider Adapter");const r=await l.signMessage(this.config,{message:t});if(!r)throw new Error(i.transactionErrorCodes.SIGNING_FAILED);if(r.includes("error"))throw new Error(i.transactionErrorCodes.SIGNATURE_UNSUPPORTED_PERSONAL_SIGN);return r}async signTypedData(t,r,e){return this.signer._signTypedData(t,r,e)}getSelectedNetwork=()=>{if(!this.chainId)throw new Error("Illegal state: no chaindId");return n.networkRegistry[this.chainId]};async switchNetwork(t){if(!this.config)throw new Error("No Config In Provider Adapter");return f.switchChain(this.config,{chainId:t.chainId})}createFetchProvider(){try{const r=n.networkRegistry[this.chainId]?.fetchRpcUrl;return r?r.includes("wss")?new o.providers.WebSocketProvider(r):new o.providers.StaticJsonRpcProvider(r):void 0}catch(t){console.log("create Fetch Provider error",t);return}}async getAddress(){if(!this.config)throw new Error("No Config In Provider Adapter");const{address:t}=v.getAccount(this.config);if(!t)throw new Error("IllegalState");return o.utils.getAddress(t)}setChainEventListener(t){if(!this.config)throw new Error("No Config In Provider Adapter");this.chainEventListener=t,this.chainEventListener&&(this.unsubscribeFns.push(C.watchAccount(this.config,{onChange:({address:r},{address:e})=>{if(!this.chainEventListener){console.warn("chainEventListener is not set");return}console.log("Account changed"),r!==e&&(console.log("Account changed"),this.chainEventListener.onAccountChanged())}})),this.unsubscribeFns.push(I.watchChainId(this.config,{onChange:r=>{if(!this.chainEventListener){console.warn("chainEventListener is not set");return}console.log("Chain ID changed!",r),this.chainEventListener.onChainChanged(r)}})))}onAccountChanged(){return this.init()}onChainChanged(t){return this.init(t)}release(){this.removeListeners()}removeListeners(){this.unsubscribeFns.forEach(t=>t()),this.unsubscribeFns=[]}parseChainIdParam(t){const r=t??this.chainId;if(!r)throw new Error("No chainId provided in context");return r}getContractMetadata(t,r){const e=this.parseChainIdParam(r);return c.getContractMetadata(t,e)}getContract(t,r=void 0,e){const s=this.parseChainIdParam(e);return c.getContract(t,s,r)}getContractWithSigner(t,r=void 0){if(!this.signer)throw new Error("IllegalState: no signer");return this.getContract(t,r).connect(this.signer)}getContractWithFetcher(t,r=void 0){if(!this.fetchProvider)throw new Error("fetchProvider not initialized");return this.getContract(t,r).connect(this.fetchProvider)}getContractWithFetcherForEthereum(t,r=void 0){const e=this.chainId===n.chainIds.localhost&&n.localhostNetwork===n.chainIds.ethMainnet?n.chainIds.localhost:n.chainIds.ethMainnet;return c.getContractWithFetcherByChainId(e,t,r)}async sendTransaction(t){if(!this.signer)throw new Error("IllegalState: no signer");return await this.signer.sendTransaction(t)}async connectAndPatchProvider(t){return await this.connectToConnector(t)}isPermitterAvailable(){return!!this.getSelectedNetwork()?.contractData?.permitterAddress}async getGasPrice(){const t=await this.fetchProvider?.getGasPrice();if(!t)throw Error("Could not fetch gas price in getGasPrice");return t.toBigInt()}async walletClientToSigner(t,r){const{account:e,transport:s}=t,d={chainId:r,name:""};return new o.providers.Web3Provider(s,d).getSigner(e)}}const P=new a,E=()=>new a;exports.WagmiProviderAdapter=a;exports.default=E;exports.wagmiProviderAdapter=P;
|
|
@@ -29,13 +29,13 @@ export declare class WagmiProviderAdapter implements IProviderAdapter<Connector>
|
|
|
29
29
|
onChainChanged(chainId?: number): Promise<unknown>;
|
|
30
30
|
release(): void;
|
|
31
31
|
private removeListeners;
|
|
32
|
+
private parseChainIdParam;
|
|
32
33
|
getContractMetadata(contractType: ContractType, chainId?: number): ContractMetadata;
|
|
33
34
|
getContract(contractType: ContractType, contractAddress?: undefined, chainId?: number): ethers.Contract;
|
|
34
35
|
getContractWithSigner(contract: ContractType, contractAddress?: undefined): ethers.Contract;
|
|
35
36
|
getContractWithFetcher(contract: ContractType, contractAddress?: undefined): ethers.Contract;
|
|
36
37
|
getContractWithFetcherForEthereum(contract: ContractType, contractAddress?: undefined): ethers.Contract;
|
|
37
38
|
sendTransaction(tx: ethers.providers.TransactionRequest): Promise<ethers.providers.TransactionResponse>;
|
|
38
|
-
patchExternalProvider(connector: Connector): Promise<void>;
|
|
39
39
|
connectAndPatchProvider(connector: Connector): Promise<number>;
|
|
40
40
|
isPermitterAvailable(): boolean;
|
|
41
41
|
getGasPrice(): Promise<bigint>;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { networkRegistry as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { disconnect as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
1
|
+
import { networkRegistry as c, chainIds as n, localhostNetwork as g } from "../constants/chains.constants.mjs";
|
|
2
|
+
import { transactionErrorCodes as i } from "../error-handling/error-codes.constants.mjs";
|
|
3
|
+
import { providers as s, utils as f } from "ethers";
|
|
4
|
+
import { ConnectorAlreadyConnectedError as w } from "wagmi";
|
|
5
|
+
import { getContractMetadata as l, getContract as u, getContractWithFetcherByChainId as v } from "../functions/web3/getContractMetadata.mjs";
|
|
6
|
+
import { disconnect as a } from "../node_modules/@wagmi/core/dist/esm/actions/disconnect.mjs";
|
|
7
|
+
import { reconnect as C } from "../node_modules/@wagmi/core/dist/esm/actions/reconnect.mjs";
|
|
8
|
+
import { connect as p } from "../node_modules/@wagmi/core/dist/esm/actions/connect.mjs";
|
|
9
|
+
import { signMessage as I } from "../node_modules/@wagmi/core/dist/esm/actions/signMessage.mjs";
|
|
10
|
+
import { switchChain as P } from "../node_modules/@wagmi/core/dist/esm/actions/switchChain.mjs";
|
|
11
|
+
import { getAccount as m } from "../node_modules/@wagmi/core/dist/esm/actions/getAccount.mjs";
|
|
11
12
|
import { watchAccount as E } from "../node_modules/@wagmi/core/dist/esm/actions/watchAccount.mjs";
|
|
12
|
-
import { watchChainId as
|
|
13
|
-
class
|
|
13
|
+
import { watchChainId as A } from "../node_modules/@wagmi/core/dist/esm/actions/watchChainId.mjs";
|
|
14
|
+
class h {
|
|
14
15
|
connector;
|
|
15
16
|
chainId;
|
|
16
17
|
originalProvider;
|
|
@@ -37,32 +38,37 @@ class d {
|
|
|
37
38
|
async disconnectFromConnector() {
|
|
38
39
|
if (!this.config)
|
|
39
40
|
throw new Error("No Config In Provider Adapter");
|
|
40
|
-
this.release(), await
|
|
41
|
+
this.release(), await a(this.config);
|
|
41
42
|
}
|
|
42
43
|
async connectToConnector(t) {
|
|
43
44
|
if (!this.config)
|
|
44
45
|
throw new Error("No Config In Provider Adapter");
|
|
46
|
+
if (t.id === "walletConnect")
|
|
47
|
+
try {
|
|
48
|
+
await C(this.config, { connectors: [t] }), await a(this.config);
|
|
49
|
+
} catch {
|
|
50
|
+
}
|
|
45
51
|
try {
|
|
46
|
-
return (await
|
|
52
|
+
return (await p(this.config, { connector: t })).chainId;
|
|
47
53
|
} catch (r) {
|
|
48
|
-
if (r instanceof
|
|
54
|
+
if (r instanceof w)
|
|
49
55
|
return t.getChainId();
|
|
50
|
-
throw console.log(r), new Error(
|
|
56
|
+
throw console.log(r), new Error(i.CONNECTION_FAILED);
|
|
51
57
|
}
|
|
52
58
|
}
|
|
53
59
|
async waitForTransaction(t, r) {
|
|
54
60
|
if ((await this.fetchProvider?.waitForTransaction(t, r))?.status)
|
|
55
61
|
return !0;
|
|
56
|
-
throw Error(
|
|
62
|
+
throw Error(i.TRANSACTION_NOT_CONFIRMED);
|
|
57
63
|
}
|
|
58
64
|
async signMessage(t) {
|
|
59
65
|
if (!this.config)
|
|
60
66
|
throw new Error("No Config In Provider Adapter");
|
|
61
|
-
const r = await
|
|
67
|
+
const r = await I(this.config, { message: t });
|
|
62
68
|
if (!r)
|
|
63
|
-
throw new Error(
|
|
69
|
+
throw new Error(i.SIGNING_FAILED);
|
|
64
70
|
if (r.includes("error"))
|
|
65
|
-
throw new Error(
|
|
71
|
+
throw new Error(i.SIGNATURE_UNSUPPORTED_PERSONAL_SIGN);
|
|
66
72
|
return r;
|
|
67
73
|
}
|
|
68
74
|
async signTypedData(t, r, e) {
|
|
@@ -71,17 +77,17 @@ class d {
|
|
|
71
77
|
getSelectedNetwork = () => {
|
|
72
78
|
if (!this.chainId)
|
|
73
79
|
throw new Error("Illegal state: no chaindId");
|
|
74
|
-
return
|
|
80
|
+
return c[this.chainId];
|
|
75
81
|
};
|
|
76
82
|
async switchNetwork(t) {
|
|
77
83
|
if (!this.config)
|
|
78
84
|
throw new Error("No Config In Provider Adapter");
|
|
79
|
-
return
|
|
85
|
+
return P(this.config, { chainId: t.chainId });
|
|
80
86
|
}
|
|
81
87
|
createFetchProvider() {
|
|
82
88
|
try {
|
|
83
|
-
const r =
|
|
84
|
-
return r ? r.includes("wss") ? new
|
|
89
|
+
const r = c[this.chainId]?.fetchRpcUrl;
|
|
90
|
+
return r ? r.includes("wss") ? new s.WebSocketProvider(r) : new s.StaticJsonRpcProvider(r) : void 0;
|
|
85
91
|
} catch (t) {
|
|
86
92
|
console.log("create Fetch Provider error", t);
|
|
87
93
|
return;
|
|
@@ -90,10 +96,10 @@ class d {
|
|
|
90
96
|
async getAddress() {
|
|
91
97
|
if (!this.config)
|
|
92
98
|
throw new Error("No Config In Provider Adapter");
|
|
93
|
-
const { address: t } =
|
|
99
|
+
const { address: t } = m(this.config);
|
|
94
100
|
if (!t)
|
|
95
101
|
throw new Error("IllegalState");
|
|
96
|
-
return
|
|
102
|
+
return f.getAddress(t);
|
|
97
103
|
}
|
|
98
104
|
setChainEventListener(t) {
|
|
99
105
|
if (!this.config)
|
|
@@ -109,7 +115,7 @@ class d {
|
|
|
109
115
|
}
|
|
110
116
|
})
|
|
111
117
|
), this.unsubscribeFns.push(
|
|
112
|
-
|
|
118
|
+
A(this.config, {
|
|
113
119
|
onChange: (r) => {
|
|
114
120
|
if (!this.chainEventListener) {
|
|
115
121
|
console.warn("chainEventListener is not set");
|
|
@@ -132,28 +138,19 @@ class d {
|
|
|
132
138
|
removeListeners() {
|
|
133
139
|
this.unsubscribeFns.forEach((t) => t()), this.unsubscribeFns = [];
|
|
134
140
|
}
|
|
135
|
-
|
|
136
|
-
const
|
|
137
|
-
if (!
|
|
141
|
+
parseChainIdParam(t) {
|
|
142
|
+
const r = t ?? this.chainId;
|
|
143
|
+
if (!r)
|
|
138
144
|
throw new Error("No chainId provided in context");
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
const
|
|
143
|
-
|
|
144
|
-
throw new Error(`Unsupported contractType: ${t}`);
|
|
145
|
-
return i(n.contractData);
|
|
145
|
+
return r;
|
|
146
|
+
}
|
|
147
|
+
getContractMetadata(t, r) {
|
|
148
|
+
const e = this.parseChainIdParam(r);
|
|
149
|
+
return l(t, e);
|
|
146
150
|
}
|
|
147
151
|
getContract(t, r = void 0, e) {
|
|
148
|
-
const
|
|
149
|
-
|
|
150
|
-
throw new Error(`No ABI configured for contractType: ${t}`);
|
|
151
|
-
if (n.address && r)
|
|
152
|
-
throw new Error(`Overriding address is not supported for contractType: ${t}`);
|
|
153
|
-
const i = n.address ?? r;
|
|
154
|
-
if (!i)
|
|
155
|
-
throw new Error(`No contractAddress configured for contractType: ${t}`);
|
|
156
|
-
return new h.Contract(i, n.abi);
|
|
152
|
+
const o = this.parseChainIdParam(e);
|
|
153
|
+
return u(t, o, r);
|
|
157
154
|
}
|
|
158
155
|
getContractWithSigner(t, r = void 0) {
|
|
159
156
|
if (!this.signer)
|
|
@@ -166,27 +163,16 @@ class d {
|
|
|
166
163
|
return this.getContract(t, r).connect(this.fetchProvider);
|
|
167
164
|
}
|
|
168
165
|
getContractWithFetcherForEthereum(t, r = void 0) {
|
|
169
|
-
const e = this.chainId ===
|
|
170
|
-
return
|
|
171
|
-
new h.providers.StaticJsonRpcProvider(s[e].fetchRpcUrl)
|
|
172
|
-
);
|
|
166
|
+
const e = this.chainId === n.localhost && g === n.ethMainnet ? n.localhost : n.ethMainnet;
|
|
167
|
+
return v(e, t, r);
|
|
173
168
|
}
|
|
174
169
|
async sendTransaction(t) {
|
|
175
170
|
if (!this.signer)
|
|
176
171
|
throw new Error("IllegalState: no signer");
|
|
177
172
|
return await this.signer.sendTransaction(t);
|
|
178
173
|
}
|
|
179
|
-
async patchExternalProvider(t) {
|
|
180
|
-
const r = await t.getProvider();
|
|
181
|
-
let e;
|
|
182
|
-
if (r instanceof h.providers.Web3Provider ? e = r.provider : e = r, "isWalletConnect" in e) {
|
|
183
|
-
const n = await t.getChainId();
|
|
184
|
-
e.http = e.setHttpProvider?.(n);
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
174
|
async connectAndPatchProvider(t) {
|
|
188
|
-
|
|
189
|
-
return await this.patchExternalProvider(t), r;
|
|
175
|
+
return await this.connectToConnector(t);
|
|
190
176
|
}
|
|
191
177
|
isPermitterAvailable() {
|
|
192
178
|
return !!this.getSelectedNetwork()?.contractData?.permitterAddress;
|
|
@@ -198,16 +184,16 @@ class d {
|
|
|
198
184
|
return t.toBigInt();
|
|
199
185
|
}
|
|
200
186
|
async walletClientToSigner(t, r) {
|
|
201
|
-
const { account: e, transport:
|
|
187
|
+
const { account: e, transport: o } = t, d = {
|
|
202
188
|
chainId: r,
|
|
203
189
|
name: ""
|
|
204
190
|
};
|
|
205
|
-
return new
|
|
191
|
+
return new s.Web3Provider(o, d).getSigner(e);
|
|
206
192
|
}
|
|
207
193
|
}
|
|
208
|
-
const
|
|
194
|
+
const x = new h(), q = () => new h();
|
|
209
195
|
export {
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
196
|
+
h as WagmiProviderAdapter,
|
|
197
|
+
q as default,
|
|
198
|
+
x as wagmiProviderAdapter
|
|
213
199
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { IProviderAdapter } from '../data-structures/provider-adapter/IProviderAdapter';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const exportWagmiProvider: <T = unknown>() => Promise<IProviderAdapter<T>>;
|
|
3
3
|
export declare const exportEthersProvider: () => Promise<IProviderAdapter<unknown>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("ethers");require("circomlibjs-hinkal-fork");require("libsodium-wrappers");const
|
|
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;
|
|
@@ -6,6 +6,7 @@ import "../constants/chains.constants.mjs";
|
|
|
6
6
|
import "../types/circom-data.types.mjs";
|
|
7
7
|
import "../types/transactions.types.mjs";
|
|
8
8
|
import "../types/curve.types.mjs";
|
|
9
|
+
import "../constants/token-data/index.mjs";
|
|
9
10
|
import "../data-structures/custom-token-registry/CustomTokenRegistry.mjs";
|
|
10
11
|
import "../constants/vite.constants.mjs";
|
|
11
12
|
import "axios";
|
|
@@ -17,15 +18,16 @@ import "../constants/rewards.constants.mjs";
|
|
|
17
18
|
import "../constants/reorg-depths.constants.mjs";
|
|
18
19
|
import { preProcessing as m } from "../crypto/preProcessing.mjs";
|
|
19
20
|
import "../functions/utils/external-action.utils.mjs";
|
|
21
|
+
import "node-forge";
|
|
20
22
|
import "../functions/web3/events/getShieldedBalance.mjs";
|
|
21
23
|
import "../data-structures/volatile-helper/VolatileHelper.mjs";
|
|
22
24
|
import "idb-keyval";
|
|
23
25
|
import e from "./EthersProviderAdapter.mjs";
|
|
24
|
-
const
|
|
26
|
+
const q = async (t, o) => {
|
|
25
27
|
await m();
|
|
26
28
|
const r = new p(o), i = e();
|
|
27
29
|
return i.initSigner?.(t), await r.initProviderAdapter(void 0, i), await r.initUserKeys(), await r.resetMerkle(), r;
|
|
28
30
|
};
|
|
29
31
|
export {
|
|
30
|
-
|
|
32
|
+
q as prepareEthersHinkal
|
|
31
33
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("ethers");require("circomlibjs-hinkal-fork");require("libsodium-wrappers");const
|
|
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;
|
|
@@ -6,6 +6,7 @@ import "../constants/chains.constants.mjs";
|
|
|
6
6
|
import "../types/circom-data.types.mjs";
|
|
7
7
|
import "../types/transactions.types.mjs";
|
|
8
8
|
import "../types/curve.types.mjs";
|
|
9
|
+
import "../constants/token-data/index.mjs";
|
|
9
10
|
import "../data-structures/custom-token-registry/CustomTokenRegistry.mjs";
|
|
10
11
|
import "../constants/vite.constants.mjs";
|
|
11
12
|
import "axios";
|
|
@@ -17,15 +18,16 @@ import "../constants/rewards.constants.mjs";
|
|
|
17
18
|
import "../constants/reorg-depths.constants.mjs";
|
|
18
19
|
import { preProcessing as m } from "../crypto/preProcessing.mjs";
|
|
19
20
|
import "../functions/utils/external-action.utils.mjs";
|
|
21
|
+
import "node-forge";
|
|
20
22
|
import "../functions/web3/events/getShieldedBalance.mjs";
|
|
21
23
|
import "../data-structures/volatile-helper/VolatileHelper.mjs";
|
|
22
24
|
import "idb-keyval";
|
|
23
25
|
import { wagmiProviderAdapter as r } from "./WagmiProviderAdapter.mjs";
|
|
24
|
-
const
|
|
26
|
+
const j = async (t, o) => {
|
|
25
27
|
await m();
|
|
26
28
|
const i = new p();
|
|
27
29
|
return r.initConfig(o), await i.initProviderAdapter(t, r), await i.initUserKeys(), await i.resetMerkle(), i;
|
|
28
30
|
};
|
|
29
31
|
export {
|
|
30
|
-
|
|
32
|
+
j as prepareWagmiHinkal
|
|
31
33
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var l=(e=>(e[e.HinkalContract=0]="HinkalContract",e[e.HinkalHelperContract=1]="HinkalHelperContract",e[e.CrossChainAccessTokenContract=2]="CrossChainAccessTokenContract",e[e.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var l=(e=>(e[e.HinkalContract=0]="HinkalContract",e[e.HinkalHelperContract=1]="HinkalHelperContract",e[e.CrossChainAccessTokenContract=2]="CrossChainAccessTokenContract",e[e.CrossChainAccessTokenManagerContract=3]="CrossChainAccessTokenManagerContract",e[e.UniswapV3FactoryContract=4]="UniswapV3FactoryContract",e[e.UniswapV3PoolContract=5]="UniswapV3PoolContract",e[e.UniswapV3QuoterContract=6]="UniswapV3QuoterContract",e[e.ERC20Contract=7]="ERC20Contract",e[e.WATokenContract=8]="WATokenContract",e[e.OneInchExternalActionContract=9]="OneInchExternalActionContract",e[e.MerkleTreeContract=10]="MerkleTreeContract",e[e.ContractWithNonces=11]="ContractWithNonces",e[e.PermitterContract=12]="PermitterContract",e[e.CurveWrappedMainPool=13]="CurveWrappedMainPool",e[e.CurveReadingWrapper=14]="CurveReadingWrapper",e[e.CurvePoolLPTokenAmountCalculator2=15]="CurvePoolLPTokenAmountCalculator2",e[e.CurvePoolLPTokenAmountCalculator3=16]="CurvePoolLPTokenAmountCalculator3",e[e.CurvePoolLPTokenAmountCalculator4=17]="CurvePoolLPTokenAmountCalculator4",e[e.CurvePoolLPTokenAmountCalculatorDynamic=18]="CurvePoolLPTokenAmountCalculatorDynamic",e[e.CurvePoolLPTokenAmountCalculator2OneArg=19]="CurvePoolLPTokenAmountCalculator2OneArg",e[e.CurvePoolLPTokenAmountCalculator3OneArg=20]="CurvePoolLPTokenAmountCalculator3OneArg",e[e.CurvePoolLPTokenAmountCalculator4OneArg=21]="CurvePoolLPTokenAmountCalculator4OneArg",e[e.CurvePoolWithIntCoins=22]="CurvePoolWithIntCoins",e[e.CurveExternalAction=23]="CurveExternalAction",e[e.WrappedStakedCurveLp=24]="WrappedStakedCurveLp",e[e.WrappedStakedRewardsCurveLp=25]="WrappedStakedRewardsCurveLp",e[e.CurveGauge=26]="CurveGauge",e[e.ConvexBooster=27]="ConvexBooster",e[e.ConvexBoosterMainnet=28]="ConvexBoosterMainnet",e[e.ConvexRewardPool=29]="ConvexRewardPool",e[e.ConvexCvxLocker=30]="ConvexCvxLocker",e[e.ConvexStakePool=31]="ConvexStakePool",e[e.ConvexCvxCRVWrapper=32]="ConvexCvxCRVWrapper",e[e.ConvexCxvCrvUtillities=33]="ConvexCxvCrvUtillities",e[e.ConvexExternalAction=34]="ConvexExternalAction",e[e.WrappedStakedConvexLp=35]="WrappedStakedConvexLp",e[e.CurvePoolWithIntBalances=36]="CurvePoolWithIntBalances",e[e.CurveZaps=37]="CurveZaps",e[e.BeefyVault=38]="BeefyVault",e[e.BeefyZap=39]="BeefyZap",e[e.BeefyRouter=40]="BeefyRouter",e[e.BeefyZapOneInch=41]="BeefyZapOneInch",e[e.BeefyExternalAction=42]="BeefyExternalAction",e[e.BeefyStakeExternalAction=43]="BeefyStakeExternalAction",e[e.BeefyStrategy=44]="BeefyStrategy",e[e.WrappedStakedBeefyLp=45]="WrappedStakedBeefyLp",e[e.UniswapV2PoolContract=46]="UniswapV2PoolContract",e[e.LidoWstEther=47]="LidoWstEther",e[e.LidoStEther=48]="LidoStEther",e[e.LidoStMatic=49]="LidoStMatic",e[e.LidoWithdrawalQueueERC721=50]="LidoWithdrawalQueueERC721",e[e.LidoStakeManager=51]="LidoStakeManager",e[e.PoLidoNFT=52]="PoLidoNFT",e[e.PendleGeneralExternalAction=53]="PendleGeneralExternalAction",e[e.PendleRouter=54]="PendleRouter",e[e.WstPendleLPToken=55]="WstPendleLPToken",e[e.WstYtToken=56]="WstYtToken",e[e.VolatileVault=57]="VolatileVault",e[e.VolatileTokenAction=58]="VolatileTokenAction",e[e.HinkalWrapper=59]="HinkalWrapper",e[e.HinkalWrapper2=60]="HinkalWrapper2",e[e.HinkalStakeExternalAction=61]="HinkalStakeExternalAction",e[e.HToken=62]="HToken",e))(l||{});exports.ContractType=l;
|