@sabaaa1/common 0.0.1
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/.env.example +5 -0
- package/.eslintrc.json +18 -0
- package/README.md +164 -0
- package/copyPackageJson.js +81 -0
- package/handleCDNWorkers.js +92 -0
- package/jest.config.ts +10 -0
- package/package.json +101 -0
- package/polyfillWorker.ts +15 -0
- package/project.json +32 -0
- package/src/API/API.ts +203 -0
- package/src/API/admin-calls.ts +8 -0
- package/src/API/ai-calls.ts +48 -0
- package/src/API/brotherhoodCalls.ts +184 -0
- package/src/API/callLifiAPI.ts +41 -0
- package/src/API/callMonitor.ts +9 -0
- package/src/API/callOdosAPI.ts +89 -0
- package/src/API/callOneInchAPI.ts +47 -0
- package/src/API/callRelayer.ts +23 -0
- package/src/API/checkRisk.ts +7 -0
- package/src/API/duneAPI.ts +26 -0
- package/src/API/enclaveCalls.ts +23 -0
- package/src/API/fetchCommitmentsCache.ts +63 -0
- package/src/API/generate-trading-points.ts +77 -0
- package/src/API/get-token-data.ts +12 -0
- package/src/API/getBridgeProtocols.ts +16 -0
- package/src/API/getCoingeckoPrice.ts +59 -0
- package/src/API/getGasEstimates.ts +30 -0
- package/src/API/getLifiStatus.ts +35 -0
- package/src/API/getRelayerURL.ts +27 -0
- package/src/API/getServerURL.ts +116 -0
- package/src/API/getTokenPrice.ts +39 -0
- package/src/API/getWebsiteURL.ts +58 -0
- package/src/API/index.ts +19 -0
- package/src/API/is-tx-stateless.ts +32 -0
- package/src/API/kycCalls.ts +81 -0
- package/src/API/leaderboardCalls.ts +32 -0
- package/src/API/mysteryBoxesCalls.ts +141 -0
- package/src/API/passwordCalls.ts +34 -0
- package/src/API/proxyAccountsCalls.ts +40 -0
- package/src/API/referralsCalls.ts +52 -0
- package/src/API/relayCalls.ts +14 -0
- package/src/API/restoreSnapshots.ts +7 -0
- package/src/API/rewardsUserCalls.ts +124 -0
- package/src/API/send-telegram-callback.ts +17 -0
- package/src/API/simulate-batch-tx.ts +19 -0
- package/src/API/tenderly.api.ts +96 -0
- package/src/API/token-calls.ts +19 -0
- package/src/API/weeklyAnalyticCalls.ts +43 -0
- package/src/constants/activity.constants.ts +10 -0
- package/src/constants/addresses.constants.ts +74 -0
- package/src/constants/assets.constants.ts +15 -0
- package/src/constants/backend.constants.ts +16 -0
- package/src/constants/balance.constants.ts +1 -0
- package/src/constants/bridging.constants.ts +5 -0
- package/src/constants/chains.constants.ts +194 -0
- package/src/constants/coingecko.constants.ts +67 -0
- package/src/constants/contracts.constants.ts +106 -0
- package/src/constants/conversion.constants.ts +1 -0
- package/src/constants/deploy-data/deploy-data-arbMainnet.json +5685 -0
- package/src/constants/deploy-data/deploy-data-arcTestnet.json +6157 -0
- package/src/constants/deploy-data/deploy-data-avalanche.json +5921 -0
- package/src/constants/deploy-data/deploy-data-base.json +5695 -0
- package/src/constants/deploy-data/deploy-data-bnbMainnet.json +5921 -0
- package/src/constants/deploy-data/deploy-data-ethMainnet.json +5922 -0
- package/src/constants/deploy-data/deploy-data-localhost.json +5921 -0
- package/src/constants/deploy-data/deploy-data-optimism.json +5687 -0
- package/src/constants/deploy-data/deploy-data-polygon.json +5695 -0
- package/src/constants/deploy-data/index.ts +21 -0
- package/src/constants/events.constants.ts +10 -0
- package/src/constants/fees.constants.ts +4 -0
- package/src/constants/function-signatures.constants.ts +6 -0
- package/src/constants/index.ts +30 -0
- package/src/constants/kyc.constants.ts +202 -0
- package/src/constants/lifi.constants.ts +1 -0
- package/src/constants/mediaUrls.constants.ts +25 -0
- package/src/constants/mystery-boxes.constants.ts +402 -0
- package/src/constants/oauthUrls.constants.ts +7 -0
- package/src/constants/permit2.constants.ts +28 -0
- package/src/constants/presale.constants.ts +503 -0
- package/src/constants/protocol.constants.ts +65 -0
- package/src/constants/reorg-depths.constants.ts +13 -0
- package/src/constants/rewards.constants.ts +27 -0
- package/src/constants/save-depths.ts +13 -0
- package/src/constants/server.constants.ts +233 -0
- package/src/constants/tasks.constants.ts +205 -0
- package/src/constants/token-data/ERC20Registry.ts +90 -0
- package/src/constants/token-data/arbMainnetRegistry.json +1841 -0
- package/src/constants/token-data/arbMainnetRegistryFixed.json +1841 -0
- package/src/constants/token-data/arcTestnetRegistry.json +436 -0
- package/src/constants/token-data/avalancheRegistry.json +729 -0
- package/src/constants/token-data/avalancheRegistryFixed.json +729 -0
- package/src/constants/token-data/baseRegistry.json +1134 -0
- package/src/constants/token-data/baseRegistryFixed.json +1134 -0
- package/src/constants/token-data/bnbMainnetRegistry.json +900 -0
- package/src/constants/token-data/bnbMainnetRegistryFixed.json +900 -0
- package/src/constants/token-data/ethMainnetRegistry.json +4298 -0
- package/src/constants/token-data/ethMainnetRegistryFixed.json +4298 -0
- package/src/constants/token-data/index.ts +60 -0
- package/src/constants/token-data/localhostRegistry.json +2784 -0
- package/src/constants/token-data/optimismRegistry.json +701 -0
- package/src/constants/token-data/optimismRegistryFixed.json +701 -0
- package/src/constants/token-data/polygonRegistry.json +2309 -0
- package/src/constants/token-data/polygonRegistryFixed.json +2309 -0
- package/src/constants/token-data/popularTokens.constants.ts +11 -0
- package/src/constants/token-data/tokenPricing.consts.ts +2 -0
- package/src/constants/token.limits.constants.ts +31 -0
- package/src/constants/vite.constants.ts +74 -0
- package/src/constants/wallet.constants.ts +9 -0
- package/src/crypto/babyJub.ts +31 -0
- package/src/crypto/index.ts +3 -0
- package/src/crypto/poseidon.ts +36 -0
- package/src/crypto/preProcessing.ts +20 -0
- package/src/data-structures/ApprovalDBs/EventsPublicApprovalsDB.ts +288 -0
- package/src/data-structures/ApprovalDBs/index.ts +1 -0
- package/src/data-structures/Hinkal/Hinkal.ts +746 -0
- package/src/data-structures/Hinkal/IHinkal.ts +315 -0
- package/src/data-structures/Hinkal/handleAutoDepositBack.ts +138 -0
- package/src/data-structures/Hinkal/hinkalActionFundApproveAndTransact.ts +64 -0
- package/src/data-structures/Hinkal/hinkalActionReceive.ts +65 -0
- package/src/data-structures/Hinkal/hinkalActionStake.ts +152 -0
- package/src/data-structures/Hinkal/hinkalApprove.ts +170 -0
- package/src/data-structures/Hinkal/hinkalCheckTokenRegistry.ts +26 -0
- package/src/data-structures/Hinkal/hinkalDeposit.ts +199 -0
- package/src/data-structures/Hinkal/hinkalGetRecipientInfo.ts +12 -0
- package/src/data-structures/Hinkal/hinkalGetZkMeProvider.ts +31 -0
- package/src/data-structures/Hinkal/hinkalInsideTransact.ts +190 -0
- package/src/data-structures/Hinkal/hinkalMultiSend.ts +26 -0
- package/src/data-structures/Hinkal/hinkalPrivateWallet.ts +198 -0
- package/src/data-structures/Hinkal/hinkalProoflessDeposit.ts +91 -0
- package/src/data-structures/Hinkal/hinkalProxySwap.ts +91 -0
- package/src/data-structures/Hinkal/hinkalSignSubAccount.ts +28 -0
- package/src/data-structures/Hinkal/hinkalSwap.ts +157 -0
- package/src/data-structures/Hinkal/hinkalTransfer.ts +171 -0
- package/src/data-structures/Hinkal/hinkalWithdraw.ts +161 -0
- package/src/data-structures/Hinkal/index.ts +9 -0
- package/src/data-structures/Hinkal/resetMerkleTrees.ts +64 -0
- package/src/data-structures/IndexedDB/activity-db.ts +204 -0
- package/src/data-structures/IndexedDB/balances-db.ts +97 -0
- package/src/data-structures/IndexedDB/contact-db.ts +81 -0
- package/src/data-structures/IndexedDB/index.ts +6 -0
- package/src/data-structures/IndexedDB/prices-db.ts +89 -0
- package/src/data-structures/IndexedDB/private-balances-db.ts +31 -0
- package/src/data-structures/IndexedDB/signatures-db.ts +62 -0
- package/src/data-structures/MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.ts +152 -0
- package/src/data-structures/TokenDBs/AlchemyPublicTokensDB.ts +224 -0
- package/src/data-structures/TokenDBs/ArcPublicTokensDB.ts +198 -0
- package/src/data-structures/TokenDBs/EventsPublicTokensDB.ts +216 -0
- package/src/data-structures/TokenDBs/IPublicTokensDB.ts +7 -0
- package/src/data-structures/TokenDBs/PrivateTokensDB.ts +96 -0
- package/src/data-structures/TokenDBs/PublicTokensDB.ts +49 -0
- package/src/data-structures/TokenDBs/index.ts +4 -0
- package/src/data-structures/TokenDBs/token-visibility-db.ts +154 -0
- package/src/data-structures/ValueCache/ValueCache.ts +29 -0
- package/src/data-structures/ValueCache/index.ts +1 -0
- package/src/data-structures/cacheDevices/AttachableMemoryCacheDevice.ts +33 -0
- package/src/data-structures/cacheDevices/BaseCacheDevice.ts +30 -0
- package/src/data-structures/cacheDevices/FileCacheDevice.ts +59 -0
- package/src/data-structures/cacheDevices/LocalStorageCacheDevice.ts +36 -0
- package/src/data-structures/cacheDevices/index.ts +2 -0
- package/src/data-structures/crypto-keys/decodeUTXO.ts +60 -0
- package/src/data-structures/crypto-keys/encryptDecryptUtxo.ts +74 -0
- package/src/data-structures/crypto-keys/index.ts +4 -0
- package/src/data-structures/crypto-keys/keyUtils.ts +8 -0
- package/src/data-structures/crypto-keys/keys.ts +203 -0
- package/src/data-structures/custom-token-registry/CustomTokenRegistry.ts +49 -0
- package/src/data-structures/event-service/AbstractAccessTokenSnapshotService.ts +142 -0
- package/src/data-structures/event-service/AbstractApprovalsSnapshotService.ts +152 -0
- package/src/data-structures/event-service/AbstractCommitmentsSnapshotService.ts +116 -0
- package/src/data-structures/event-service/AbstractEventService.ts +44 -0
- package/src/data-structures/event-service/AbstractNullifierSnapshotService.ts +76 -0
- package/src/data-structures/event-service/AbstractSnapshotService.ts +63 -0
- package/src/data-structures/event-service/BlockchainEventEmitter.ts +132 -0
- package/src/data-structures/event-service/index.ts +7 -0
- package/src/data-structures/index.ts +18 -0
- package/src/data-structures/merkle-tree/MerkleTree.test.ts +77 -0
- package/src/data-structures/merkle-tree/MerkleTree.ts +253 -0
- package/src/data-structures/merkle-tree/MerkleTreeIncompleteError.ts +6 -0
- package/src/data-structures/merkle-tree/getPatchedAccessTokenMerkleTree.ts +24 -0
- package/src/data-structures/merkle-tree/index.ts +3 -0
- package/src/data-structures/presale/PresaleContractWrapper.ts +80 -0
- package/src/data-structures/presale/index.ts +1 -0
- package/src/data-structures/provider-adapter/IProviderAdapter.ts +43 -0
- package/src/data-structures/snapshot/ClientAccessTokenSnapshotService.ts +41 -0
- package/src/data-structures/snapshot/ClientApprovalsSnapshotService.ts +36 -0
- package/src/data-structures/snapshot/ClientCommitmentsSnapshotService.ts +30 -0
- package/src/data-structures/snapshot/ClientNullifierSnapshotService.ts +28 -0
- package/src/data-structures/snapshot/SnapshotFetcherService.ts +68 -0
- package/src/data-structures/snapshot/index.ts +1 -0
- package/src/data-structures/token-price-fetcher/TokenChecker.ts +45 -0
- package/src/data-structures/token-price-fetcher/index.ts +1 -0
- package/src/data-structures/tor/HttpClient.ts +118 -0
- package/src/data-structures/tor/TorAdapter.ts +94 -0
- package/src/data-structures/tor/TorClient.ts +283 -0
- package/src/data-structures/tor/WebSocketDuplex.ts +32 -0
- package/src/data-structures/tor/index.ts +3 -0
- package/src/data-structures/transactions-manager/history/history.types.ts +14 -0
- package/src/data-structures/transactions-manager/index.ts +1 -0
- package/src/data-structures/utxo/Utxo.ts +189 -0
- package/src/error-handling/customErrors/ErrorWithAmount.ts +8 -0
- package/src/error-handling/customErrors/ErrorWithTx.ts +10 -0
- package/src/error-handling/customErrors/FeeOverTransactionValueError.ts +16 -0
- package/src/error-handling/customErrors/SimulationFailureError.ts +9 -0
- package/src/error-handling/customErrors/customErrors.helpers.ts +39 -0
- package/src/error-handling/customErrors/index.ts +5 -0
- package/src/error-handling/error-codes.constants.ts +214 -0
- package/src/error-handling/get-error.message.ts +149 -0
- package/src/error-handling/handleErrorRestore.ts +25 -0
- package/src/error-handling/index.ts +7 -0
- package/src/error-handling/logError.ts +8 -0
- package/src/error-handling/logger.ts +21 -0
- package/src/error-handling/types.ts +10 -0
- package/src/externalABIs/BUSD.ts +516 -0
- package/src/externalABIs/BabPassport.json +24 -0
- package/src/externalABIs/DAI.ts +331 -0
- package/src/externalABIs/ERC1155.json +316 -0
- package/src/externalABIs/ERC20.json +297 -0
- package/src/externalABIs/ERC20.ts +1 -0
- package/src/externalABIs/ERC721.json +205 -0
- package/src/externalABIs/GalxePassport.json +23 -0
- package/src/externalABIs/IQuoterV2.json +211 -0
- package/src/externalABIs/ISwapRouter.json +568 -0
- package/src/externalABIs/IUniswapV3Factory.json +207 -0
- package/src/externalABIs/IUniswapV3Pool.json +999 -0
- package/src/externalABIs/NodeInterfaceABI.json +1 -0
- package/src/externalABIs/OptimismGasPriceOracle.json +1 -0
- package/src/externalABIs/PoLidoNftAbi.json +307 -0
- package/src/externalABIs/SanctionsList.ts +86 -0
- package/src/externalABIs/USDC.ts +718 -0
- package/src/externalABIs/USDR.ts +343 -0
- package/src/externalABIs/USDR3CRV.ts +539 -0
- package/src/externalABIs/USDT.ts +390 -0
- package/src/externalABIs/UniswapV2PoolAbi.json +66 -0
- package/src/externalABIs/WETH.ts +153 -0
- package/src/externalABIs/amToken.ts +347 -0
- package/src/externalABIs/index.ts +53 -0
- package/src/externalABIs/swapAbi.ts +442 -0
- package/src/externalABIs/transactionsProver.json +45 -0
- package/src/functions/index.ts +16 -0
- package/src/functions/kyc/aiPriseHelper.ts +0 -0
- package/src/functions/kyc/authentoHelper.ts +44 -0
- package/src/functions/kyc/index.ts +3 -0
- package/src/functions/kyc/openDefaultPassportWindow.ts +9 -0
- package/src/functions/kyc/passportHelper.ts +13 -0
- package/src/functions/kyc/zkMeHelper.ts +69 -0
- package/src/functions/pre-transaction/constructAdminData.ts +21 -0
- package/src/functions/pre-transaction/getExternalSwapAddress.ts +30 -0
- package/src/functions/pre-transaction/getFeeStructure.ts +44 -0
- package/src/functions/pre-transaction/getFlatFees.ts +88 -0
- package/src/functions/pre-transaction/getSignatureDataForTransact.ts +16 -0
- package/src/functions/pre-transaction/getVolatileTransferAmount.ts +56 -0
- package/src/functions/pre-transaction/index.ts +7 -0
- package/src/functions/pre-transaction/interaction-to-action.ts +17 -0
- package/src/functions/pre-transaction/merge-with-fee-structure-emporium.ts +50 -0
- package/src/functions/pre-transaction/merge-with-fee-structure.ts +35 -0
- package/src/functions/pre-transaction/outputApprovalDataProcessing.ts +95 -0
- package/src/functions/pre-transaction/outputUtxoProcessing.ts +52 -0
- package/src/functions/pre-transaction/process-gas-estimates.ts +36 -0
- package/src/functions/pre-transaction/shouldPatchAccessTokenMerkleTree.ts +15 -0
- package/src/functions/private-wallet/emporium.helpers.ts +296 -0
- package/src/functions/private-wallet/emporium.swap.helpers.ts +284 -0
- package/src/functions/private-wallet/index.ts +3 -0
- package/src/functions/private-wallet/opProducer.ts +33 -0
- package/src/functions/snarkjs/common.snarkjs.ts +377 -0
- package/src/functions/snarkjs/constant.ts +490 -0
- package/src/functions/snarkjs/constructEmporiumProof.ts +301 -0
- package/src/functions/snarkjs/constructGeneralZkProof.ts +281 -0
- package/src/functions/snarkjs/generateCircomData.ts +81 -0
- package/src/functions/snarkjs/generateZkProof.ts +21 -0
- package/src/functions/snarkjs/generateZkProofEnclave.ts +45 -0
- package/src/functions/snarkjs/generateZkProofSelf.ts +29 -0
- package/src/functions/snarkjs/getOriginalSender.ts +4 -0
- package/src/functions/snarkjs/getZKFiles.ts +29 -0
- package/src/functions/snarkjs/index.ts +4 -0
- package/src/functions/staking/index.ts +78 -0
- package/src/functions/utils/addresses.ts +37 -0
- package/src/functions/utils/amounts.utils.test.ts +91 -0
- package/src/functions/utils/amounts.utils.ts +119 -0
- package/src/functions/utils/arraysMatch.ts +4 -0
- package/src/functions/utils/cacheDevice.utils.ts +21 -0
- package/src/functions/utils/cacheFunctions.ts +154 -0
- package/src/functions/utils/caseInsensitive.utils.ts +10 -0
- package/src/functions/utils/convertEmporiumOpToCallInfo.ts +19 -0
- package/src/functions/utils/convertIntegrationProviderToExternalActionId.ts +14 -0
- package/src/functions/utils/create-provider.ts +11 -0
- package/src/functions/utils/encodeTokenWithId.ts +4 -0
- package/src/functions/utils/encryptInputForEnclave.ts +119 -0
- package/src/functions/utils/enum.utils.ts +30 -0
- package/src/functions/utils/erc20tokenFunctions.ts +110 -0
- package/src/functions/utils/ethers-formatter.utils.ts +32 -0
- package/src/functions/utils/evmNetworkFunctions.ts +9 -0
- package/src/functions/utils/external-action.utils.ts +15 -0
- package/src/functions/utils/fees.utils.ts +26 -0
- package/src/functions/utils/get-hinkal-approvals.ts +36 -0
- package/src/functions/utils/get-signature-header.ts +5 -0
- package/src/functions/utils/getBlockExplorerUrl.ts +14 -0
- package/src/functions/utils/getDataFromTransaction.ts +79 -0
- package/src/functions/utils/getRecipientInfoFromUserKeys.ts +28 -0
- package/src/functions/utils/inLogicMetadata.ts +9 -0
- package/src/functions/utils/index.ts +43 -0
- package/src/functions/utils/involves-permit2-op.ts +17 -0
- package/src/functions/utils/ipfs.ts +74 -0
- package/src/functions/utils/is-valid-url.ts +5 -0
- package/src/functions/utils/lifi.utils.ts +3 -0
- package/src/functions/utils/memoize.utils.ts +23 -0
- package/src/functions/utils/merkleTree.utils.ts +27 -0
- package/src/functions/utils/mutexes.utils.ts +3 -0
- package/src/functions/utils/mystery-box-auction.utils.ts +61 -0
- package/src/functions/utils/networks.utils.ts +6 -0
- package/src/functions/utils/nftTokenFunctions.ts +25 -0
- package/src/functions/utils/nickname.utils.ts +4 -0
- package/src/functions/utils/postToOffscreen.ts +6 -0
- package/src/functions/utils/prepareHinkal.ts +78 -0
- package/src/functions/utils/process.utils.ts +23 -0
- package/src/functions/utils/processUseApprovalUtxoData.ts +26 -0
- package/src/functions/utils/publicBalance.utils.ts +131 -0
- package/src/functions/utils/reloadPage.ts +1 -0
- package/src/functions/utils/replaceAddressInCalldata.ts +6 -0
- package/src/functions/utils/requireEnv.ts +10 -0
- package/src/functions/utils/resolve-sync.utils.ts +40 -0
- package/src/functions/utils/rpc-int-encode.ts +7 -0
- package/src/functions/utils/serialize.utils.ts +12 -0
- package/src/functions/utils/string.utils.ts +92 -0
- package/src/functions/utils/time.utils.ts +80 -0
- package/src/functions/utils/token-check.utils.ts +12 -0
- package/src/functions/utils/trimFieldValues.ts +24 -0
- package/src/functions/utils/upToDateState.ts +12 -0
- package/src/functions/utils/userAgent.ts +26 -0
- package/src/functions/utils/walletBalances.utils.ts +117 -0
- package/src/functions/web3/EIP-712.test.ts +302 -0
- package/src/functions/web3/EIP-712.ts +243 -0
- package/src/functions/web3/etherFunctions.test.ts +129 -0
- package/src/functions/web3/etherFunctions.ts +84 -0
- package/src/functions/web3/events/balanceChangedCustomHandler.ts +13 -0
- package/src/functions/web3/events/balanceChangedHandler.ts +10 -0
- package/src/functions/web3/events/getApprovedBalance.ts +154 -0
- package/src/functions/web3/events/getInputUtxoAndBalance.ts +305 -0
- package/src/functions/web3/events/getInputUtxosEnclave.ts +40 -0
- package/src/functions/web3/events/getShieldedBalance.ts +163 -0
- package/src/functions/web3/events/getTransactionLogEvents.ts +55 -0
- package/src/functions/web3/events/index.ts +7 -0
- package/src/functions/web3/events/web3RetrieveEvents.ts +33 -0
- package/src/functions/web3/functionCalls/accessTokenCalls.ts +27 -0
- package/src/functions/web3/functionCalls/approveToken.ts +180 -0
- package/src/functions/web3/functionCalls/approveTokensToHinkal.ts +21 -0
- package/src/functions/web3/functionCalls/estimateGasRelayer.ts +40 -0
- package/src/functions/web3/functionCalls/getRootHash.ts +7 -0
- package/src/functions/web3/functionCalls/inHinkalApprovalCalls.ts +60 -0
- package/src/functions/web3/functionCalls/relayFunctions.ts +12 -0
- package/src/functions/web3/functionCalls/transactCallDirect.ts +71 -0
- package/src/functions/web3/functionCalls/transactCallRelayer.ts +57 -0
- package/src/functions/web3/getContractMetadata.ts +43 -0
- package/src/functions/web3/getPublicAddressBalance.ts +17 -0
- package/src/functions/web3/getTokenHolder.ts +53 -0
- package/src/functions/web3/index.ts +9 -0
- package/src/functions/web3/lifiAPI.ts +41 -0
- package/src/functions/web3/odosAPI.ts +50 -0
- package/src/functions/web3/oneInchAPI.ts +47 -0
- package/src/functions/web3/runContractFunction.ts +116 -0
- package/src/functions/web3/uniswapAPI.ts +156 -0
- package/src/index.ts +9 -0
- package/src/mutexes/index.ts +1 -0
- package/src/mutexes/mutex.ts +3 -0
- package/src/providers/EthersProviderAdapter.ts +230 -0
- package/src/providers/TorExternalProvider.ts +36 -0
- package/src/providers/WagmiProviderAdapter.ts +311 -0
- package/src/providers/exportProviers.ts +11 -0
- package/src/providers/prepareEthersHinkal.ts +18 -0
- package/src/providers/prepareWagmiHinkal.ts +16 -0
- package/src/types/API.types.ts +23 -0
- package/src/types/ICacheDevice.ts +5 -0
- package/src/types/IMultiThreadedUtxoUtils.ts +16 -0
- package/src/types/RewardUserEnums.ts +12 -0
- package/src/types/TransactionSimulator.types.ts +30 -0
- package/src/types/WeeklyAnalytics.types.ts +44 -0
- package/src/types/activities.types.ts +90 -0
- package/src/types/admin.types.ts +30 -0
- package/src/types/all-points.types.ts +8 -0
- package/src/types/approvals.types.ts +45 -0
- package/src/types/balances.types.ts +20 -0
- package/src/types/big-intable.types.ts +3 -0
- package/src/types/bridging.types.ts +30 -0
- package/src/types/brotherhood-user.types.ts +13 -0
- package/src/types/cache.types.ts +42 -0
- package/src/types/circom-data.types.ts +120 -0
- package/src/types/coingecko.types.ts +216 -0
- package/src/types/commitments.types.ts +39 -0
- package/src/types/confirmation-request.types.ts +10 -0
- package/src/types/contacts.types.ts +6 -0
- package/src/types/crypto.types.ts +8 -0
- package/src/types/duneAPI.types.ts +9 -0
- package/src/types/eip5792.types.ts +31 -0
- package/src/types/ethereum-network.types.ts +70 -0
- package/src/types/external-action.types.ts +19 -0
- package/src/types/fee.types.ts +11 -0
- package/src/types/generatePoints.ts +14 -0
- package/src/types/hinkal.stake.types.ts +12 -0
- package/src/types/hinkal.types.ts +150 -0
- package/src/types/index.ts +50 -0
- package/src/types/kyc.types.ts +49 -0
- package/src/types/merch-order.types.ts +18 -0
- package/src/types/message.types.ts +6 -0
- package/src/types/mystery-boxes.types.ts +50 -0
- package/src/types/new-rewards.type.ts +181 -0
- package/src/types/offscreen.types.ts +8 -0
- package/src/types/presaleReferral.types.ts +4 -0
- package/src/types/proxy.types.ts +11 -0
- package/src/types/referral.types.ts +13 -0
- package/src/types/relayer.types.ts +16 -0
- package/src/types/remote-proof.types.ts +18 -0
- package/src/types/rewards.types.ts +53 -0
- package/src/types/routing.types.ts +7 -0
- package/src/types/sandbox.types.ts +246 -0
- package/src/types/session.types.ts +12 -0
- package/src/types/signature.types.ts +11 -0
- package/src/types/slippage.types.ts +3 -0
- package/src/types/snark.types.ts +43 -0
- package/src/types/tenderly.api.types.ts +200 -0
- package/src/types/token-prices.types.ts +8 -0
- package/src/types/token-with-id.types.ts +4 -0
- package/src/types/token.types.ts +86 -0
- package/src/types/transactions.types.ts +120 -0
- package/src/types/wc.types.ts +83 -0
- package/src/types/with-id.types.ts +1 -0
- package/src/webworker/performTaskWithWorker.ts +50 -0
- package/src/webworker/snarkjsWorker/snarkjs.d.ts +2 -0
- package/src/webworker/snarkjsWorker/snarkjsWorker.types.ts +18 -0
- package/src/webworker/snarkjsWorker/snarkjsWorkerLauncher.ts +19 -0
- package/src/webworker/snarkjsWorker/snarkjsWorkerLogic.ts +90 -0
- package/src/webworker/utxoWorker/utxoWorker.types.ts +41 -0
- package/src/webworker/utxoWorker/utxoWorkerLauncher.ts +19 -0
- package/src/webworker/utxoWorker/utxoWorkerLogic.ts +107 -0
- package/src/webworker/viteWorkerURL.constant.ts +25 -0
- package/src/webworker/worker.registry.ts +11 -0
- package/src/webworker/worker.types.ts +35 -0
- package/src/webworker/workerErrorHandler.ts +10 -0
- package/src/webworker/workerFactory.ts +47 -0
- package/src/webworker/workerProxy.ts +88 -0
- package/src/webworker/zkProofWorker/zkProofWorker.types.ts +52 -0
- package/src/webworker/zkProofWorker/zkProofWorkerLauncher.ts +19 -0
- package/src/webworker/zkProofWorker/zkProofWorkerLogic.ts +84 -0
- package/tsconfig.json +23 -0
- package/tsconfig.lib.json +10 -0
- package/tsconfig.spec.json +15 -0
- package/vite.config.ts +97 -0
- package/vite.config.workers.ts +51 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import bnbMainnetData from './deploy-data-bnbMainnet.json';
|
|
2
|
+
import arbMainnetData from './deploy-data-arbMainnet.json';
|
|
3
|
+
import ethMainnetData from './deploy-data-ethMainnet.json';
|
|
4
|
+
import optimismData from './deploy-data-optimism.json';
|
|
5
|
+
import polygonData from './deploy-data-polygon.json';
|
|
6
|
+
import avalancheData from './deploy-data-avalanche.json';
|
|
7
|
+
import baseData from './deploy-data-base.json';
|
|
8
|
+
import localhostData from './deploy-data-localhost.json';
|
|
9
|
+
import arcTestnetData from './deploy-data-arcTestnet.json';
|
|
10
|
+
|
|
11
|
+
export {
|
|
12
|
+
bnbMainnetData,
|
|
13
|
+
arbMainnetData,
|
|
14
|
+
ethMainnetData,
|
|
15
|
+
polygonData,
|
|
16
|
+
avalancheData,
|
|
17
|
+
optimismData,
|
|
18
|
+
baseData,
|
|
19
|
+
localhostData,
|
|
20
|
+
arcTestnetData,
|
|
21
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { chainIds } from './chains.constants';
|
|
2
|
+
|
|
3
|
+
export const EVENTS_INITIAL_BLOCKS: Record<number, number> = {
|
|
4
|
+
[chainIds.arbMainnet]: 352723141,
|
|
5
|
+
[chainIds.base]: 32241698,
|
|
6
|
+
[chainIds.ethMainnet]: 22816077,
|
|
7
|
+
[chainIds.optimism]: 137836964,
|
|
8
|
+
[chainIds.polygon]: 73399299,
|
|
9
|
+
[chainIds.arcTestnet]: 9965946,
|
|
10
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export const APPROVE_FUNCTION_SIGNATURE = 'function approve(address spender, uint256 amount) external returns (bool)';
|
|
2
|
+
export const PERMIT2_APPROVE_FUNCTION_SIGNATURE =
|
|
3
|
+
'function approve(address token, address spender, uint160 amount, uint48 expiration)';
|
|
4
|
+
export const NFT_APPROVE_FUNCTION_SIGNATURE = 'function setApprovalForAll(address operator, bool _approved) public';
|
|
5
|
+
export const NFT_APPROVE_SINGLE_FUNCTION_SIGNATURE = 'function approve(address to, uint256 tokenId) public';
|
|
6
|
+
export const TRANSFER_FUNCTION_SIGNATURE = 'function transfer(address to, uint256 amount)';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export * from './assets.constants';
|
|
2
|
+
export * from './token-data';
|
|
3
|
+
export * from './deploy-data';
|
|
4
|
+
export * from './chains.constants';
|
|
5
|
+
export * from './fees.constants';
|
|
6
|
+
export * from './contracts.constants';
|
|
7
|
+
export * from './kyc.constants';
|
|
8
|
+
export * from './server.constants';
|
|
9
|
+
export * from './vite.constants';
|
|
10
|
+
export * from './protocol.constants';
|
|
11
|
+
export * from './coingecko.constants';
|
|
12
|
+
export * from './backend.constants';
|
|
13
|
+
export * from './rewards.constants';
|
|
14
|
+
export * from './reorg-depths.constants';
|
|
15
|
+
export * from './mediaUrls.constants';
|
|
16
|
+
export * from './permit2.constants';
|
|
17
|
+
export * from './addresses.constants';
|
|
18
|
+
export * from './conversion.constants';
|
|
19
|
+
export * from './token.limits.constants';
|
|
20
|
+
export * from './balance.constants';
|
|
21
|
+
export * from './bridging.constants';
|
|
22
|
+
export * from './wallet.constants';
|
|
23
|
+
export * from './presale.constants';
|
|
24
|
+
export * from './lifi.constants';
|
|
25
|
+
export * from './oauthUrls.constants';
|
|
26
|
+
export * from './mystery-boxes.constants';
|
|
27
|
+
export * from './activity.constants';
|
|
28
|
+
export * from './tasks.constants';
|
|
29
|
+
export * from './events.constants';
|
|
30
|
+
export * from './function-signatures.constants';
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { IHinkal } from '../data-structures/Hinkal/IHinkal';
|
|
2
|
+
|
|
3
|
+
import { zkMeKycHandler } from '../functions/kyc/zkMeHelper';
|
|
4
|
+
import { authentoKycHandler } from '../functions/kyc/authentoHelper';
|
|
5
|
+
|
|
6
|
+
import { Passports } from '../types/kyc.types';
|
|
7
|
+
|
|
8
|
+
import { chainIds } from './chains.constants';
|
|
9
|
+
|
|
10
|
+
export const aipriseBaseOnboardingProductionUrl = 'https://onboard.aiprise.com';
|
|
11
|
+
export const aipriseBaseOnboardingSandboxUrl = 'https://onboard-sandbox.aiprise.com';
|
|
12
|
+
|
|
13
|
+
export type PassportDetails = {
|
|
14
|
+
id: Passports;
|
|
15
|
+
shortName: string;
|
|
16
|
+
fullName: string;
|
|
17
|
+
apiURL: string;
|
|
18
|
+
onboardURL: string;
|
|
19
|
+
customHandleKYC?: (hinkal: IHinkal, shortName: string, onboardURL: string) => Promise<void>;
|
|
20
|
+
params?: Record<string, number | string>;
|
|
21
|
+
supportsAllChains?: boolean;
|
|
22
|
+
supportedChainIds: number[];
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const StandardPassports: { [passport: number]: PassportDetails } = {
|
|
26
|
+
[Passports.AiPriseKyc]: {
|
|
27
|
+
id: Passports.AiPriseKyc,
|
|
28
|
+
shortName: 'AiPriseKyc',
|
|
29
|
+
fullName: 'AiPrice Kyc',
|
|
30
|
+
apiURL: '',
|
|
31
|
+
onboardURL: '',
|
|
32
|
+
supportedChainIds: [],
|
|
33
|
+
supportsAllChains: true,
|
|
34
|
+
},
|
|
35
|
+
[Passports.AiPriseKyb]: {
|
|
36
|
+
id: Passports.AiPriseKyb,
|
|
37
|
+
shortName: 'AiPriseKyb',
|
|
38
|
+
fullName: 'AiPrice Kyb',
|
|
39
|
+
apiURL: '',
|
|
40
|
+
onboardURL: '',
|
|
41
|
+
supportedChainIds: [],
|
|
42
|
+
supportsAllChains: true,
|
|
43
|
+
},
|
|
44
|
+
[Passports.BABPassport]: {
|
|
45
|
+
id: Passports.BABPassport,
|
|
46
|
+
shortName: 'Bab',
|
|
47
|
+
fullName: 'Bab Token',
|
|
48
|
+
apiURL: 'BabPassport',
|
|
49
|
+
onboardURL: 'https://www.binance.com/en/BABT',
|
|
50
|
+
supportedChainIds: [chainIds.bnbMainnet],
|
|
51
|
+
},
|
|
52
|
+
[Passports.GalxePassport]: {
|
|
53
|
+
id: Passports.GalxePassport,
|
|
54
|
+
shortName: 'Galxe',
|
|
55
|
+
fullName: 'Galxe Passport',
|
|
56
|
+
apiURL: 'GalxePassport',
|
|
57
|
+
onboardURL: 'https://galxe.com/passport',
|
|
58
|
+
supportedChainIds: [chainIds.bnbMainnet],
|
|
59
|
+
},
|
|
60
|
+
// [Passports.QuadrataPassport]: {
|
|
61
|
+
// id: Passports.QuadrataPassport,
|
|
62
|
+
// shortName: 'Quadrata',
|
|
63
|
+
// fullName: 'Quadrata Passport',
|
|
64
|
+
// apiURL: 'QuadrataPassport',
|
|
65
|
+
// onboardURL: 'https://quadrata.com/onboard',
|
|
66
|
+
// supportedChainIds: [
|
|
67
|
+
// chainIds.ethMainnet,
|
|
68
|
+
// chainIds.arbMainnet,
|
|
69
|
+
// chainIds.optimism,
|
|
70
|
+
// chainIds.polygon,
|
|
71
|
+
// chainIds.avalanche,
|
|
72
|
+
// ],
|
|
73
|
+
// },
|
|
74
|
+
[Passports.ZkMePassport]: {
|
|
75
|
+
id: Passports.ZkMePassport,
|
|
76
|
+
shortName: 'zkMe',
|
|
77
|
+
fullName: 'zkMe Passport',
|
|
78
|
+
apiURL: 'ZkMePassport',
|
|
79
|
+
onboardURL: 'https://widget.zk.me/',
|
|
80
|
+
customHandleKYC: (hinkal, shortName, onboardURL) =>
|
|
81
|
+
zkMeKycHandler(hinkal, shortName, onboardURL, {
|
|
82
|
+
merchId: 'M2023090671844574053042402155408',
|
|
83
|
+
}),
|
|
84
|
+
supportedChainIds: [],
|
|
85
|
+
supportsAllChains: true,
|
|
86
|
+
},
|
|
87
|
+
[Passports.CoinbasePassport]: {
|
|
88
|
+
id: Passports.CoinbasePassport,
|
|
89
|
+
shortName: 'coinbase',
|
|
90
|
+
fullName: 'coinbase Passport',
|
|
91
|
+
apiURL: 'coinbasePassport',
|
|
92
|
+
onboardURL: 'https://www.coinbase.com/onchain-verify',
|
|
93
|
+
supportedChainIds: [],
|
|
94
|
+
supportsAllChains: true,
|
|
95
|
+
},
|
|
96
|
+
[Passports.AuthentoPassport]: {
|
|
97
|
+
id: Passports.AuthentoPassport,
|
|
98
|
+
shortName: 'Authento',
|
|
99
|
+
fullName: 'Authento Passport',
|
|
100
|
+
apiURL: 'AuthentoPassport',
|
|
101
|
+
onboardURL: 'https://app.authento.io/',
|
|
102
|
+
customHandleKYC: (hinkal, shortName, onboardURL) => authentoKycHandler(hinkal, shortName, onboardURL),
|
|
103
|
+
supportedChainIds: [],
|
|
104
|
+
supportsAllChains: true,
|
|
105
|
+
},
|
|
106
|
+
[Passports.AuthentoPassportKyb]: {
|
|
107
|
+
id: Passports.AuthentoPassportKyb,
|
|
108
|
+
shortName: 'Authento',
|
|
109
|
+
fullName: 'Authento Passport',
|
|
110
|
+
apiURL: 'AuthentoPassport',
|
|
111
|
+
onboardURL: 'https://app.authento.io/',
|
|
112
|
+
customHandleKYC: (hinkal, shortName, onboardURL) => authentoKycHandler(hinkal, shortName, onboardURL),
|
|
113
|
+
supportedChainIds: [],
|
|
114
|
+
supportsAllChains: true,
|
|
115
|
+
},
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
export const ReclaimPassports: { [passport: number]: PassportDetails } = {
|
|
119
|
+
[Passports.ReclaimCoinbasePassport]: {
|
|
120
|
+
id: Passports.ReclaimCoinbasePassport,
|
|
121
|
+
shortName: 'ReclaimCoinbase',
|
|
122
|
+
fullName: ' Reclaim Coinbase',
|
|
123
|
+
apiURL: '',
|
|
124
|
+
onboardURL: '',
|
|
125
|
+
supportedChainIds: [],
|
|
126
|
+
supportsAllChains: true,
|
|
127
|
+
params: {
|
|
128
|
+
providerId: '4ee4ebac-3012-4842-8b7b-e73f3293c97d',
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
[Passports.ReclaimBNBPassport]: {
|
|
132
|
+
id: Passports.ReclaimBNBPassport,
|
|
133
|
+
shortName: 'ReclaimBNB',
|
|
134
|
+
fullName: ' Reclaim BNB',
|
|
135
|
+
apiURL: '',
|
|
136
|
+
onboardURL: '',
|
|
137
|
+
supportedChainIds: [],
|
|
138
|
+
supportsAllChains: true,
|
|
139
|
+
params: {
|
|
140
|
+
providerId: '9a8127e6-c5c1-4336-bc49-24a0197f6c56',
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
[Passports.ReclaimOKXPassport]: {
|
|
144
|
+
id: Passports.ReclaimOKXPassport,
|
|
145
|
+
shortName: 'ReclaimOKX',
|
|
146
|
+
fullName: ' Reclaim OKX',
|
|
147
|
+
apiURL: '',
|
|
148
|
+
onboardURL: '',
|
|
149
|
+
supportedChainIds: [],
|
|
150
|
+
supportsAllChains: true,
|
|
151
|
+
params: {
|
|
152
|
+
providerId: '4f464d13-d3b0-45b9-bed9-db160a1a5426',
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
[Passports.ReclaimGatePassport]: {
|
|
156
|
+
id: Passports.ReclaimGatePassport,
|
|
157
|
+
shortName: 'ReclaimGate',
|
|
158
|
+
fullName: ' Reclaim Gate',
|
|
159
|
+
apiURL: '',
|
|
160
|
+
onboardURL: '',
|
|
161
|
+
supportedChainIds: [],
|
|
162
|
+
supportsAllChains: true,
|
|
163
|
+
params: {
|
|
164
|
+
providerId: 'a824a912-52ad-4a84-a096-55728518c3d5',
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
[Passports.ReclaimMexcPassport]: {
|
|
168
|
+
id: Passports.ReclaimMexcPassport,
|
|
169
|
+
shortName: 'ReclaimMexc',
|
|
170
|
+
fullName: ' Reclaim Mexc',
|
|
171
|
+
apiURL: '',
|
|
172
|
+
onboardURL: '',
|
|
173
|
+
supportedChainIds: [],
|
|
174
|
+
supportsAllChains: true,
|
|
175
|
+
params: {
|
|
176
|
+
providerId: 'b9a7fa32-41f3-4708-bebf-18869b96bf41',
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
[Passports.ReclaimHtxPassport]: {
|
|
180
|
+
id: Passports.ReclaimHtxPassport,
|
|
181
|
+
shortName: 'ReclaimHtx',
|
|
182
|
+
fullName: ' Reclaim Htx',
|
|
183
|
+
apiURL: '',
|
|
184
|
+
onboardURL: '',
|
|
185
|
+
supportedChainIds: [],
|
|
186
|
+
supportsAllChains: true,
|
|
187
|
+
params: {
|
|
188
|
+
providerId: '2fc15466-9106-4a80-b6f3-d21a77445c0a',
|
|
189
|
+
},
|
|
190
|
+
},
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
export const SupportedPassports = { ...StandardPassports, ...ReclaimPassports };
|
|
194
|
+
|
|
195
|
+
export const supportedPassportLinks = Object.values(SupportedPassports)
|
|
196
|
+
.filter((obj, index) => obj.onboardURL?.length > 0 && Object.values(SupportedPassports).indexOf(obj) === index)
|
|
197
|
+
.map((obj) => obj.onboardURL); // we also remove the same copies
|
|
198
|
+
|
|
199
|
+
export const AIPRISE_KYC_TEMPLATE_ID_PROD = 'dbda56e5-31f5-4a37-a895-d4adca6c53fd';
|
|
200
|
+
export const AIPRISE_KYB_TEMPLATE_ID_PROD = '96050d8d-23c9-4908-b285-2e6dec4c020b';
|
|
201
|
+
|
|
202
|
+
export const RECLAIM_MESSAGE_TO_SIGN = 'Approve Integrity Status proof generation using Reclaim Protocol.';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const LIFISCAN_URL = 'https://scan.lifi';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// social media platform URLs
|
|
2
|
+
export const mediaUrls = {
|
|
3
|
+
GITHUB: 'https://github.com/Novelty-Today/privacy-first-mixer',
|
|
4
|
+
TWITTER: 'https://bit.ly/hinkal_tw',
|
|
5
|
+
TELEGRAM: 'https://bit.ly/hinkal_tg',
|
|
6
|
+
DOCS: '/Whitepaper.pdf',
|
|
7
|
+
AUDIT: '/Hinkal_final_Secure3_Audit_Report.pdf',
|
|
8
|
+
AIPRISE: 'https://aiprise.com/',
|
|
9
|
+
DEMO: 'https://www.loom.com/share/a03b147d930d4efdbb993b6bf72746ca',
|
|
10
|
+
POLY_SCAN: 'https://polygonscan.com/',
|
|
11
|
+
ETH_SCAN: 'https://etherscan.io/',
|
|
12
|
+
BSC_SCAN: 'https://bscscan.com/',
|
|
13
|
+
ARB_SCAN: 'https://arbiscan.io/',
|
|
14
|
+
SNOW_TRACE: 'https://snowtrace.io/',
|
|
15
|
+
OPTIMISM_SCAN: 'https://optimistic.etherscan.io/',
|
|
16
|
+
ETHER_SCAN: 'https://etherscan.io/',
|
|
17
|
+
AVAX_SCAN: 'https://snowtrace.io/',
|
|
18
|
+
BASE_SCAN: 'https://basescan.org/',
|
|
19
|
+
MUMBAI_SCAN: 'https://mumbai.polygonscan.com/',
|
|
20
|
+
OPENSEA_TEST: 'https://testnets.opensea.io/',
|
|
21
|
+
LINKTREE: 'https://linktr.ee/hinkal_protocol',
|
|
22
|
+
DISCORD: 'https://discord.gg/hinkalofficial',
|
|
23
|
+
LINKEDIN: 'https://bit.ly/hinkal_li',
|
|
24
|
+
ARC_TESTNET_EXPLORER: 'https://testnet.arcscan.app/',
|
|
25
|
+
};
|