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