@sabaaa1/common 0.1.6 → 0.1.14
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 +16 -12
- package/API/API.mjs +73 -69
- package/API/accessCodeCalls.cjs +1 -0
- package/API/accessCodeCalls.d.ts +23 -0
- package/API/accessCodeCalls.mjs +23 -0
- package/API/admin-calls.cjs +1 -1
- package/API/admin-calls.mjs +5 -7
- package/API/ai-calls.cjs +1 -1
- package/API/ai-calls.mjs +11 -10
- package/API/brotherhoodCalls.cjs +1 -1
- package/API/brotherhoodCalls.mjs +43 -69
- package/API/callLifiAPI.cjs +1 -1
- package/API/callLifiAPI.mjs +8 -7
- package/API/callOdosAPI.cjs +1 -1
- package/API/callOdosAPI.mjs +16 -16
- package/API/callOkxAPI.cjs +1 -0
- package/API/callOkxAPI.d.ts +10 -0
- package/API/callOkxAPI.mjs +13 -0
- package/API/callOneInchAPI.cjs +1 -1
- package/API/callOneInchAPI.mjs +8 -7
- package/API/callRelayer.cjs +1 -1
- package/API/callRelayer.d.ts +11 -0
- package/API/callRelayer.mjs +15 -7
- package/API/checkRisk.cjs +1 -1
- package/API/checkRisk.mjs +5 -4
- package/API/duneAPI.cjs +1 -1
- package/API/duneAPI.mjs +2 -3
- package/API/enclaveCalls.cjs +1 -1
- package/API/enclaveCalls.mjs +9 -11
- package/API/fetchCommitmentsCache.cjs +1 -1
- package/API/fetchCommitmentsCache.d.ts +2 -2
- package/API/fetchCommitmentsCache.mjs +13 -10
- package/API/generate-trading-points.cjs +1 -1
- package/API/generate-trading-points.mjs +34 -39
- package/API/get-token-data.cjs +1 -1
- package/API/get-token-data.mjs +5 -4
- package/API/getBridgeProtocols.cjs +1 -1
- package/API/getBridgeProtocols.mjs +4 -3
- package/API/getGasEstimates.cjs +1 -1
- package/API/getGasEstimates.d.ts +2 -1
- package/API/getGasEstimates.mjs +14 -16
- package/API/getLifiStatus.cjs +1 -1
- package/API/getLifiStatus.mjs +11 -10
- package/API/getRelayerURL.cjs +1 -1
- package/API/getRelayerURL.mjs +4 -4
- package/API/getServerURL.cjs +1 -1
- package/API/getServerURL.mjs +42 -36
- package/API/getTokenPrice.cjs +1 -1
- package/API/getTokenPrice.d.ts +0 -11
- package/API/getTokenPrice.mjs +8 -23
- package/API/getWebsiteURL.cjs +1 -1
- package/API/getWebsiteURL.d.ts +1 -1
- package/API/getWebsiteURL.mjs +6 -7
- package/API/index.d.ts +2 -1
- package/API/is-tx-stateless.cjs +1 -1
- package/API/is-tx-stateless.mjs +17 -22
- package/API/kycCalls.cjs +1 -1
- package/API/kycCalls.d.ts +2 -2
- package/API/kycCalls.mjs +31 -30
- package/API/leaderboardCalls.cjs +1 -1
- package/API/leaderboardCalls.mjs +11 -16
- package/API/proxyAccountsCalls.cjs +1 -1
- package/API/proxyAccountsCalls.mjs +19 -18
- package/API/referralsCalls.cjs +1 -1
- package/API/referralsCalls.mjs +16 -24
- package/API/relayCalls.cjs +1 -1
- package/API/relayCalls.mjs +6 -8
- package/API/resolve-sns.cjs +1 -0
- package/API/resolve-sns.d.ts +1 -0
- package/API/resolve-sns.mjs +12 -0
- package/API/restoreSnapshots.cjs +1 -1
- package/API/restoreSnapshots.mjs +5 -5
- package/API/rewardsUserCalls.cjs +1 -1
- package/API/rewardsUserCalls.mjs +37 -54
- package/API/seedless-calls.cjs +1 -0
- package/API/seedless-calls.d.ts +53 -0
- package/API/seedless-calls.mjs +12 -0
- package/API/send-telegram-callback.cjs +1 -1
- package/API/send-telegram-callback.mjs +9 -11
- package/API/simulate-batch-tx.cjs +1 -1
- package/API/simulate-batch-tx.mjs +11 -13
- package/API/solana-calls.cjs +1 -0
- package/API/solana-calls.d.ts +34 -0
- package/API/solana-calls.mjs +19 -0
- package/API/tenderly.api.cjs +1 -1
- package/API/tenderly.api.mjs +48 -59
- package/API/token-calls.cjs +1 -1
- package/API/token-calls.mjs +11 -13
- package/API/weeklyAnalyticCalls.cjs +1 -1
- package/API/weeklyAnalyticCalls.mjs +9 -14
- package/README.md +164 -0
- package/_virtual/_commonjsHelpers.cjs +1 -0
- package/_virtual/_commonjsHelpers.mjs +30 -0
- package/_virtual/bn.cjs +1 -0
- package/_virtual/bn.mjs +4 -0
- package/_virtual/bn2.cjs +1 -0
- package/_virtual/bn2.mjs +4 -0
- package/_virtual/common.cjs +1 -0
- package/_virtual/common.mjs +4 -0
- package/_virtual/common2.cjs +1 -0
- package/_virtual/common2.mjs +4 -0
- package/_virtual/hash.cjs +1 -0
- package/_virtual/hash.mjs +4 -0
- package/_virtual/index.cjs +1 -0
- package/_virtual/index.mjs +6 -0
- package/_virtual/index10.cjs +1 -0
- package/_virtual/index10.mjs +6 -0
- package/_virtual/index11.cjs +1 -0
- package/_virtual/index11.mjs +6 -0
- package/_virtual/index12.cjs +1 -0
- package/_virtual/index12.mjs +6 -0
- package/_virtual/index13.cjs +1 -0
- package/_virtual/index13.mjs +6 -0
- package/_virtual/index14.cjs +1 -0
- package/_virtual/index14.mjs +6 -0
- package/_virtual/index15.cjs +1 -0
- package/_virtual/index15.mjs +6 -0
- package/_virtual/index16.cjs +1 -0
- package/_virtual/index16.mjs +6 -0
- package/_virtual/index17.cjs +1 -0
- package/_virtual/index17.mjs +6 -0
- package/_virtual/index18.cjs +1 -0
- package/_virtual/index18.mjs +6 -0
- package/_virtual/index19.cjs +1 -0
- package/_virtual/index19.mjs +6 -0
- package/_virtual/index2.cjs +1 -0
- package/_virtual/index2.mjs +6 -0
- package/_virtual/index20.cjs +1 -0
- package/_virtual/index20.mjs +6 -0
- package/_virtual/index21.cjs +1 -0
- package/_virtual/index21.mjs +6 -0
- package/_virtual/index22.cjs +1 -0
- package/_virtual/index22.mjs +4 -0
- package/_virtual/index3.cjs +1 -0
- package/_virtual/index3.mjs +6 -0
- package/_virtual/index4.cjs +1 -0
- package/_virtual/index4.mjs +6 -0
- package/_virtual/index5.cjs +1 -0
- package/_virtual/index5.mjs +6 -0
- package/_virtual/index6.cjs +1 -0
- package/_virtual/index6.mjs +6 -0
- package/_virtual/index7.cjs +1 -0
- package/_virtual/index7.mjs +6 -0
- package/_virtual/index8.cjs +1 -0
- package/_virtual/index8.mjs +6 -0
- package/_virtual/index9.cjs +1 -0
- package/_virtual/index9.mjs +6 -0
- package/_virtual/inherits_browser.cjs +1 -0
- package/_virtual/inherits_browser.mjs +4 -0
- package/_virtual/ripemd.cjs +1 -0
- package/_virtual/ripemd.mjs +4 -0
- package/_virtual/scrypt.cjs +1 -0
- package/_virtual/scrypt.mjs +4 -0
- package/_virtual/sha.cjs +1 -0
- package/_virtual/sha.mjs +4 -0
- package/_virtual/sha3.cjs +1 -0
- package/_virtual/sha3.mjs +4 -0
- package/_virtual/utils.cjs +1 -0
- package/_virtual/utils.mjs +4 -0
- package/_virtual/utils2.cjs +1 -0
- package/_virtual/utils2.mjs +4 -0
- package/constants/backend.constants.cjs +1 -1
- package/constants/backend.constants.d.ts +2 -1
- package/constants/backend.constants.mjs +5 -7
- package/constants/chains.constants.cjs +1 -1
- package/constants/chains.constants.d.ts +5 -0
- package/constants/chains.constants.mjs +63 -35
- package/constants/coingecko.constants.cjs +1 -1
- package/constants/coingecko.constants.d.ts +1 -1
- package/constants/coingecko.constants.mjs +18 -11
- package/constants/contracts.constants.cjs +1 -1
- package/constants/contracts.constants.mjs +19 -15
- package/constants/deploy-data/deploy-data-arbMainnet.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-arbMainnet.json.mjs +1218 -8
- package/constants/deploy-data/deploy-data-arcTestnet.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-arcTestnet.json.mjs +1214 -4
- package/constants/deploy-data/deploy-data-base.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-base.json.mjs +1218 -8
- package/constants/deploy-data/deploy-data-ethMainnet.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-ethMainnet.json.mjs +1213 -3
- package/constants/deploy-data/deploy-data-optimism.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-optimism.json.mjs +1218 -8
- package/constants/deploy-data/deploy-data-polygon.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-polygon.json.mjs +1218 -8
- package/constants/deploy-data/deploy-data-solana.json.cjs +1 -0
- package/constants/deploy-data/deploy-data-solana.json.mjs +6111 -0
- package/constants/deploy-data/index.d.ts +2 -1
- package/constants/index.d.ts +1 -1
- package/constants/mediaUrls.constants.cjs +1 -1
- package/constants/mediaUrls.constants.d.ts +9 -0
- package/constants/mediaUrls.constants.mjs +13 -4
- package/constants/okx.constants.cjs +1 -0
- package/constants/okx.constants.d.ts +2 -0
- package/constants/okx.constants.mjs +5 -0
- package/constants/protocol.constants.cjs +1 -1
- package/constants/protocol.constants.d.ts +12 -1
- package/constants/protocol.constants.mjs +37 -29
- package/constants/save-depths.cjs +1 -1
- package/constants/save-depths.mjs +4 -1
- package/constants/server.constants.cjs +1 -1
- package/constants/server.constants.d.ts +23 -10
- package/constants/server.constants.mjs +102 -89
- package/constants/token-data/ERC20Registry.cjs +1 -1
- package/constants/token-data/ERC20Registry.mjs +49 -35
- package/constants/token-data/index.cjs +1 -1
- package/constants/token-data/index.d.ts +17 -1
- package/constants/token-data/index.mjs +29 -25
- package/constants/token-data/solanaLocalnetRegistry.json.cjs +1 -0
- package/constants/token-data/solanaLocalnetRegistry.json.mjs +24 -0
- package/constants/token-data/solanaMainnetRegistry.json.cjs +1 -0
- package/constants/token-data/solanaMainnetRegistry.json.mjs +560 -0
- package/data-structures/ApprovalDBs/EventsPublicApprovalsDB.cjs +1 -1
- package/data-structures/ApprovalDBs/EventsPublicApprovalsDB.mjs +41 -41
- package/data-structures/Hinkal/Hinkal.cjs +1 -1
- package/data-structures/Hinkal/Hinkal.d.ts +19 -10
- package/data-structures/Hinkal/Hinkal.mjs +290 -125
- package/data-structures/Hinkal/IHinkal.d.ts +18 -11
- package/data-structures/Hinkal/handleAutoDepositBack.cjs +1 -1
- package/data-structures/Hinkal/handleAutoDepositBack.mjs +36 -32
- package/data-structures/Hinkal/hinkalActionFundApproveAndTransact.cjs +1 -1
- package/data-structures/Hinkal/hinkalActionFundApproveAndTransact.mjs +24 -23
- package/data-structures/Hinkal/hinkalActionReceive.cjs +1 -1
- package/data-structures/Hinkal/hinkalActionReceive.mjs +13 -12
- package/data-structures/Hinkal/hinkalCheckSolanaTokenRegistry.cjs +1 -0
- package/data-structures/Hinkal/hinkalCheckSolanaTokenRegistry.d.ts +3 -0
- package/data-structures/Hinkal/hinkalCheckSolanaTokenRegistry.mjs +28 -0
- package/data-structures/Hinkal/hinkalCheckTokenRegistry.cjs +1 -1
- package/data-structures/Hinkal/hinkalCheckTokenRegistry.mjs +11 -8
- package/data-structures/Hinkal/hinkalDepositAndWithdraw.cjs +1 -0
- package/data-structures/Hinkal/hinkalDepositAndWithdraw.d.ts +4 -0
- package/data-structures/Hinkal/hinkalDepositAndWithdraw.mjs +167 -0
- package/data-structures/Hinkal/hinkalGetRecipientInfo.cjs +1 -1
- package/data-structures/Hinkal/hinkalGetRecipientInfo.d.ts +1 -1
- package/data-structures/Hinkal/hinkalGetRecipientInfo.mjs +4 -4
- package/data-structures/Hinkal/hinkalMultiSend.cjs +1 -1
- package/data-structures/Hinkal/hinkalMultiSend.mjs +6 -6
- package/data-structures/Hinkal/hinkalPrivateWallet.cjs +1 -1
- package/data-structures/Hinkal/hinkalPrivateWallet.d.ts +2 -2
- package/data-structures/Hinkal/hinkalPrivateWallet.mjs +109 -93
- package/data-structures/Hinkal/hinkalProxySwap.cjs +1 -1
- package/data-structures/Hinkal/hinkalProxySwap.mjs +23 -22
- package/data-structures/Hinkal/hinkalProxyToPrivate.cjs +1 -0
- package/data-structures/Hinkal/hinkalProxyToPrivate.d.ts +6 -0
- package/data-structures/Hinkal/hinkalProxyToPrivate.mjs +45 -0
- package/data-structures/Hinkal/hinkalSignSubAccount.cjs +1 -1
- package/data-structures/Hinkal/hinkalSignSubAccount.mjs +11 -9
- package/data-structures/Hinkal/hinkalSolanaDeposit.cjs +1 -0
- package/data-structures/Hinkal/hinkalSolanaDeposit.d.ts +4 -0
- package/data-structures/Hinkal/hinkalSolanaDeposit.mjs +133 -0
- package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.cjs +1 -0
- package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.d.ts +3 -0
- package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.mjs +216 -0
- package/data-structures/Hinkal/hinkalSolanaProxySend.cjs +1 -0
- package/data-structures/Hinkal/hinkalSolanaProxySend.d.ts +6 -0
- package/data-structures/Hinkal/hinkalSolanaProxySend.mjs +55 -0
- package/data-structures/Hinkal/hinkalSolanaProxyShield.cjs +1 -0
- package/data-structures/Hinkal/hinkalSolanaProxyShield.d.ts +6 -0
- package/data-structures/Hinkal/hinkalSolanaProxyShield.mjs +99 -0
- package/data-structures/Hinkal/hinkalSolanaProxySwap.cjs +1 -0
- package/data-structures/Hinkal/hinkalSolanaProxySwap.d.ts +5 -0
- package/data-structures/Hinkal/hinkalSolanaProxySwap.mjs +96 -0
- package/data-structures/Hinkal/hinkalSolanaSwap.cjs +1 -0
- package/data-structures/Hinkal/hinkalSolanaSwap.d.ts +4 -0
- package/data-structures/Hinkal/hinkalSolanaSwap.mjs +120 -0
- package/data-structures/Hinkal/hinkalSolanaTransfer.cjs +1 -0
- package/data-structures/Hinkal/hinkalSolanaTransfer.d.ts +3 -0
- package/data-structures/Hinkal/hinkalSolanaTransfer.mjs +90 -0
- package/data-structures/Hinkal/hinkalSolanaWithdraw.cjs +1 -0
- package/data-structures/Hinkal/hinkalSolanaWithdraw.d.ts +3 -0
- package/data-structures/Hinkal/hinkalSolanaWithdraw.mjs +106 -0
- package/data-structures/Hinkal/hinkalSwap.cjs +1 -1
- package/data-structures/Hinkal/hinkalSwap.mjs +33 -27
- package/data-structures/Hinkal/hinkalTransfer.cjs +1 -1
- package/data-structures/Hinkal/hinkalTransfer.mjs +20 -14
- package/data-structures/Hinkal/hinkalWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalWithdraw.mjs +15 -9
- package/data-structures/Hinkal/index.d.ts +4 -0
- package/data-structures/Hinkal/resetMerkleTrees.cjs +1 -1
- package/data-structures/Hinkal/resetMerkleTrees.mjs +56 -23
- package/data-structures/IndexedDB/activity-db.cjs +1 -1
- package/data-structures/IndexedDB/activity-db.d.ts +0 -1
- package/data-structures/IndexedDB/activity-db.mjs +86 -86
- package/data-structures/IndexedDB/balances-db.cjs +1 -1
- package/data-structures/IndexedDB/balances-db.mjs +15 -12
- package/data-structures/IndexedDB/contact-db.cjs +1 -1
- package/data-structures/IndexedDB/contact-db.mjs +29 -26
- package/data-structures/IndexedDB/signatures-db.cjs +1 -1
- package/data-structures/IndexedDB/signatures-db.mjs +14 -10
- package/data-structures/MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.cjs +1 -1
- package/data-structures/MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.d.ts +2 -2
- package/data-structures/MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.mjs +32 -31
- package/data-structures/TokenDBs/AlchemyPublicTokensDB.cjs +1 -1
- package/data-structures/TokenDBs/AlchemyPublicTokensDB.d.ts +6 -1
- package/data-structures/TokenDBs/AlchemyPublicTokensDB.mjs +154 -79
- package/data-structures/TokenDBs/EventsPublicTokensDB.cjs +1 -1
- package/data-structures/TokenDBs/EventsPublicTokensDB.mjs +24 -21
- package/data-structures/TokenDBs/PrivateTokensDB.cjs +1 -1
- package/data-structures/TokenDBs/PrivateTokensDB.mjs +39 -34
- package/data-structures/crypto-keys/decodeUTXO.cjs +1 -1
- package/data-structures/crypto-keys/decodeUTXO.d.ts +15 -3
- package/data-structures/crypto-keys/decodeUTXO.mjs +84 -26
- package/data-structures/crypto-keys/encryptDecryptUtxo.cjs +1 -1
- package/data-structures/crypto-keys/encryptDecryptUtxo.mjs +36 -30
- package/data-structures/crypto-keys/keys.cjs +1 -1
- package/data-structures/crypto-keys/keys.d.ts +19 -5
- package/data-structures/crypto-keys/keys.mjs +117 -60
- package/data-structures/event-service/evm/AbstractAccessTokenSnapshotService.cjs +1 -0
- package/data-structures/event-service/{AbstractAccessTokenSnapshotService.d.ts → evm/AbstractAccessTokenSnapshotService.d.ts} +2 -2
- package/data-structures/event-service/{AbstractAccessTokenSnapshotService.mjs → evm/AbstractAccessTokenSnapshotService.mjs} +6 -6
- package/data-structures/event-service/evm/AbstractApprovalsSnapshotService.cjs +1 -0
- package/data-structures/event-service/{AbstractApprovalsSnapshotService.d.ts → evm/AbstractApprovalsSnapshotService.d.ts} +2 -2
- package/data-structures/event-service/{AbstractApprovalsSnapshotService.mjs → evm/AbstractApprovalsSnapshotService.mjs} +2 -2
- package/data-structures/event-service/evm/AbstractCommitmentsSnapshotService.cjs +1 -0
- package/data-structures/event-service/{AbstractCommitmentsSnapshotService.d.ts → evm/AbstractCommitmentsSnapshotService.d.ts} +3 -3
- package/data-structures/event-service/{AbstractCommitmentsSnapshotService.mjs → evm/AbstractCommitmentsSnapshotService.mjs} +24 -21
- package/data-structures/event-service/evm/AbstractEventService.cjs +1 -0
- package/data-structures/event-service/{AbstractEventService.d.ts → evm/AbstractEventService.d.ts} +1 -1
- package/data-structures/event-service/evm/AbstractEventService.mjs +37 -0
- package/data-structures/event-service/{AbstractNullifierSnapshotService.d.ts → evm/AbstractNullifierSnapshotService.d.ts} +1 -1
- package/data-structures/event-service/evm/AbstractSnapshotService.cjs +1 -0
- package/data-structures/event-service/{AbstractSnapshotService.mjs → evm/AbstractSnapshotService.mjs} +1 -1
- package/data-structures/event-service/evm/BlockchainEventEmitter.cjs +1 -0
- package/data-structures/event-service/{BlockchainEventEmitter.d.ts → evm/BlockchainEventEmitter.d.ts} +2 -1
- package/data-structures/event-service/evm/BlockchainEventEmitter.mjs +89 -0
- package/data-structures/event-service/index.d.ts +13 -7
- package/data-structures/event-service/solana/AbstractSolanaAccessTokenSnapshotService.cjs +1 -0
- package/data-structures/event-service/solana/AbstractSolanaAccessTokenSnapshotService.d.ts +34 -0
- package/data-structures/event-service/solana/AbstractSolanaAccessTokenSnapshotService.mjs +87 -0
- package/data-structures/event-service/solana/AbstractSolanaCommitmentsSnapshotService.cjs +1 -0
- package/data-structures/event-service/solana/AbstractSolanaCommitmentsSnapshotService.d.ts +29 -0
- package/data-structures/event-service/solana/AbstractSolanaCommitmentsSnapshotService.mjs +96 -0
- package/data-structures/event-service/solana/AbstractSolanaEventService.cjs +1 -0
- package/data-structures/event-service/solana/AbstractSolanaEventService.d.ts +22 -0
- package/data-structures/event-service/solana/AbstractSolanaEventService.mjs +33 -0
- package/data-structures/event-service/solana/AbstractSolanaNullifierSnapshotService.cjs +1 -0
- package/data-structures/event-service/solana/AbstractSolanaNullifierSnapshotService.d.ts +21 -0
- package/data-structures/event-service/solana/AbstractSolanaNullifierSnapshotService.mjs +49 -0
- package/data-structures/event-service/solana/AbstractSolanaSnapshotService.cjs +1 -0
- package/data-structures/event-service/solana/AbstractSolanaSnapshotService.d.ts +22 -0
- package/data-structures/event-service/solana/AbstractSolanaSnapshotService.mjs +33 -0
- package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.cjs +1 -0
- package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.d.ts +39 -0
- package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.mjs +153 -0
- package/data-structures/http/BasicHttpClient.cjs +1 -0
- package/data-structures/http/BasicHttpClient.d.ts +11 -0
- package/data-structures/http/BasicHttpClient.mjs +25 -0
- package/data-structures/http/HttpClient.cjs +1 -0
- package/data-structures/http/HttpClient.d.ts +10 -0
- package/data-structures/http/HttpClient.mjs +15 -0
- package/data-structures/http/index.d.ts +2 -0
- package/data-structures/index.d.ts +1 -0
- package/data-structures/provider-adapter/IProviderAdapter.d.ts +1 -3
- package/data-structures/snapshot/SnapshotFetcherService.d.ts +1 -1
- package/data-structures/snapshot/evm-snapshots/ClientAccessTokenSnapshotService.cjs +1 -0
- package/data-structures/snapshot/{ClientAccessTokenSnapshotService.d.ts → evm-snapshots/ClientAccessTokenSnapshotService.d.ts} +2 -2
- package/data-structures/snapshot/{ClientAccessTokenSnapshotService.mjs → evm-snapshots/ClientAccessTokenSnapshotService.mjs} +13 -9
- package/data-structures/snapshot/evm-snapshots/ClientApprovalsSnapshotService.cjs +1 -0
- package/data-structures/snapshot/{ClientApprovalsSnapshotService.d.ts → evm-snapshots/ClientApprovalsSnapshotService.d.ts} +2 -3
- package/data-structures/snapshot/evm-snapshots/ClientApprovalsSnapshotService.mjs +43 -0
- package/data-structures/snapshot/evm-snapshots/ClientCommitmentsSnapshotService.cjs +1 -0
- package/data-structures/snapshot/{ClientCommitmentsSnapshotService.d.ts → evm-snapshots/ClientCommitmentsSnapshotService.d.ts} +2 -2
- package/data-structures/snapshot/evm-snapshots/ClientCommitmentsSnapshotService.mjs +35 -0
- package/data-structures/snapshot/evm-snapshots/ClientNullifierSnapshotService.cjs +1 -0
- package/data-structures/snapshot/{ClientNullifierSnapshotService.d.ts → evm-snapshots/ClientNullifierSnapshotService.d.ts} +2 -2
- package/data-structures/snapshot/evm-snapshots/ClientNullifierSnapshotService.mjs +34 -0
- package/data-structures/snapshot/index.d.ts +7 -0
- package/data-structures/snapshot/solana-snapshots/ClientSolanaAccessTokenSnapshotService.cjs +1 -0
- package/data-structures/snapshot/solana-snapshots/ClientSolanaAccessTokenSnapshotService.d.ts +8 -0
- package/data-structures/snapshot/solana-snapshots/ClientSolanaAccessTokenSnapshotService.mjs +42 -0
- package/data-structures/snapshot/solana-snapshots/ClientSolanaCommitmentsSnapshotService.cjs +1 -0
- package/data-structures/snapshot/solana-snapshots/ClientSolanaCommitmentsSnapshotService.d.ts +8 -0
- package/data-structures/snapshot/solana-snapshots/ClientSolanaCommitmentsSnapshotService.mjs +34 -0
- package/data-structures/snapshot/solana-snapshots/ClientSolanaNullifierSnapshotService.cjs +1 -0
- package/data-structures/snapshot/solana-snapshots/ClientSolanaNullifierSnapshotService.d.ts +8 -0
- package/data-structures/snapshot/solana-snapshots/ClientSolanaNullifierSnapshotService.mjs +34 -0
- package/data-structures/token-price-fetcher/TokenChecker.cjs +1 -1
- package/data-structures/token-price-fetcher/TokenChecker.mjs +5 -4
- package/data-structures/utxo/Utxo.cjs +1 -1
- package/data-structures/utxo/Utxo.d.ts +6 -1
- package/data-structures/utxo/Utxo.mjs +37 -24
- package/error-handling/error-codes.constants.cjs +1 -1
- package/error-handling/error-codes.constants.d.ts +2 -0
- package/error-handling/error-codes.constants.mjs +4 -2
- package/functions/connectors.types.d.ts +14 -0
- package/functions/index.d.ts +1 -0
- package/functions/pre-transaction/addressTableLookup.cjs +1 -0
- package/functions/pre-transaction/addressTableLookup.d.ts +4 -0
- package/functions/pre-transaction/addressTableLookup.mjs +44 -0
- package/functions/pre-transaction/constructAdminData.cjs +1 -1
- package/functions/pre-transaction/constructAdminData.d.ts +2 -1
- package/functions/pre-transaction/constructAdminData.mjs +30 -12
- package/functions/pre-transaction/convert-okx-instructions.cjs +1 -0
- package/functions/pre-transaction/convert-okx-instructions.d.ts +12 -0
- package/functions/pre-transaction/convert-okx-instructions.mjs +30 -0
- package/functions/pre-transaction/getSolanaCalldataHash.cjs +1 -0
- package/functions/pre-transaction/getSolanaCalldataHash.d.ts +4 -0
- package/functions/pre-transaction/getSolanaCalldataHash.mjs +36 -0
- package/functions/pre-transaction/getVolatileTransferAmount.cjs +1 -1
- package/functions/pre-transaction/getVolatileTransferAmount.mjs +11 -7
- package/functions/pre-transaction/index.d.ts +10 -0
- package/functions/pre-transaction/initTokenLimitIfNeeded.cjs +1 -0
- package/functions/pre-transaction/initTokenLimitIfNeeded.d.ts +3 -0
- package/functions/pre-transaction/initTokenLimitIfNeeded.mjs +20 -0
- package/functions/pre-transaction/outputUtxoProcessing.cjs +1 -1
- package/functions/pre-transaction/outputUtxoProcessing.mjs +14 -13
- package/functions/pre-transaction/process-gas-estimates.cjs +1 -1
- package/functions/pre-transaction/process-gas-estimates.d.ts +2 -2
- package/functions/pre-transaction/process-gas-estimates.mjs +13 -12
- package/functions/pre-transaction/recipientUtxoProcessing.cjs +1 -0
- package/functions/pre-transaction/recipientUtxoProcessing.d.ts +3 -0
- package/functions/pre-transaction/recipientUtxoProcessing.mjs +36 -0
- package/functions/pre-transaction/sendInitNullifiersTransaction.cjs +1 -0
- package/functions/pre-transaction/sendInitNullifiersTransaction.d.ts +11 -0
- package/functions/pre-transaction/sendInitNullifiersTransaction.mjs +41 -0
- package/functions/pre-transaction/sendV0Transaction.cjs +1 -0
- package/functions/pre-transaction/sendV0Transaction.d.ts +22 -0
- package/functions/pre-transaction/sendV0Transaction.mjs +121 -0
- package/functions/pre-transaction/solana-public-signals.cjs +1 -0
- package/functions/pre-transaction/solana-public-signals.d.ts +19 -0
- package/functions/pre-transaction/solana-public-signals.mjs +60 -0
- package/functions/pre-transaction/solana.cjs +1 -0
- package/functions/pre-transaction/solana.d.ts +17 -0
- package/functions/pre-transaction/solana.mjs +96 -0
- package/functions/pre-transaction/solanaTransfer.utils.cjs +1 -0
- package/functions/pre-transaction/solanaTransfer.utils.d.ts +6 -0
- package/functions/pre-transaction/solanaTransfer.utils.mjs +38 -0
- package/functions/pre-transaction/store-instructions.cjs +1 -0
- package/functions/pre-transaction/store-instructions.d.ts +4 -0
- package/functions/pre-transaction/store-instructions.mjs +9 -0
- package/functions/pre-transaction/store-proof.cjs +1 -0
- package/functions/pre-transaction/store-proof.d.ts +7 -0
- package/functions/pre-transaction/store-proof.mjs +55 -0
- package/functions/private-wallet/emporium.helpers.cjs +1 -1
- package/functions/private-wallet/emporium.helpers.mjs +33 -29
- package/functions/private-wallet/emporium.swap.helpers.cjs +1 -1
- package/functions/private-wallet/emporium.swap.helpers.d.ts +1 -1
- package/functions/private-wallet/emporium.swap.helpers.mjs +79 -69
- package/functions/snarkjs/constant.cjs +1 -1
- package/functions/snarkjs/constant.d.ts +40 -0
- package/functions/snarkjs/constant.mjs +66 -23
- package/functions/snarkjs/constructEmporiumProof.cjs +1 -1
- package/functions/snarkjs/constructEmporiumProof.mjs +32 -32
- package/functions/snarkjs/constructGeneralZkProof.cjs +1 -1
- package/functions/snarkjs/constructGeneralZkProof.d.ts +1 -1
- package/functions/snarkjs/constructGeneralZkProof.mjs +63 -61
- package/functions/snarkjs/constructSolanaZkProof.cjs +1 -0
- package/functions/snarkjs/constructSolanaZkProof.d.ts +13 -0
- package/functions/snarkjs/constructSolanaZkProof.mjs +109 -0
- package/functions/snarkjs/generateCircomData.cjs +1 -1
- package/functions/snarkjs/generateCircomData.d.ts +1 -1
- package/functions/snarkjs/generateCircomData.mjs +9 -9
- package/functions/snarkjs/generateZkProofEnclave.cjs +1 -1
- package/functions/snarkjs/generateZkProofEnclave.mjs +10 -9
- package/functions/snarkjs/getZKFiles.cjs +1 -1
- package/functions/snarkjs/getZKFiles.mjs +13 -13
- package/functions/snarkjs/index.d.ts +1 -0
- package/functions/utils/addresses.cjs +1 -1
- package/functions/utils/addresses.d.ts +1 -1
- package/functions/utils/addresses.mjs +21 -17
- package/functions/utils/amounts.utils.cjs +1 -1
- package/functions/utils/amounts.utils.d.ts +1 -0
- package/functions/utils/amounts.utils.mjs +53 -40
- package/functions/utils/bytes32.utils.cjs +1 -0
- package/functions/utils/bytes32.utils.d.ts +2 -0
- package/functions/utils/bytes32.utils.mjs +10 -0
- package/functions/utils/cacheDevice.utils.cjs +1 -1
- package/functions/utils/cacheDevice.utils.mjs +2 -3
- package/functions/utils/cacheFunctions.cjs +1 -1
- package/functions/utils/cacheFunctions.mjs +53 -52
- package/functions/utils/convertIntegrationProviderToExternalActionId.cjs +1 -1
- package/functions/utils/convertIntegrationProviderToExternalActionId.mjs +1 -0
- package/functions/utils/create-provider.cjs +1 -1
- package/functions/utils/create-provider.d.ts +4 -1
- package/functions/utils/create-provider.mjs +8 -6
- package/functions/utils/encodeTokenWithId.cjs +1 -1
- package/functions/utils/encodeTokenWithId.d.ts +1 -1
- package/functions/utils/encodeTokenWithId.mjs +6 -2
- package/functions/utils/encryptInputForEnclave.cjs +1 -1
- package/functions/utils/encryptInputForEnclave.mjs +29 -28
- package/functions/utils/erc20tokenFunctions.cjs +1 -1
- package/functions/utils/erc20tokenFunctions.mjs +29 -29
- package/functions/utils/ethers-formatter.utils.cjs +1 -1
- package/functions/utils/ethers-formatter.utils.d.ts +2 -0
- package/functions/utils/ethers-formatter.utils.mjs +45 -15
- package/functions/utils/evmNetworkFunctions.cjs +1 -1
- package/functions/utils/evmNetworkFunctions.mjs +3 -4
- package/functions/utils/fees.utils.cjs +1 -1
- package/functions/utils/fees.utils.d.ts +1 -0
- package/functions/utils/fees.utils.mjs +19 -9
- package/functions/utils/get-hinkal-approvals.cjs +1 -1
- package/functions/utils/get-hinkal-approvals.mjs +1 -1
- package/functions/utils/getBlockExplorerUrl.cjs +1 -1
- package/functions/utils/getBlockExplorerUrl.mjs +2 -2
- package/functions/utils/getRecipientInfoFromUserKeys.cjs +1 -1
- package/functions/utils/getRecipientInfoFromUserKeys.d.ts +0 -1
- package/functions/utils/getRecipientInfoFromUserKeys.mjs +10 -13
- package/functions/utils/getUtxosFromReceipt.utils.cjs +1 -0
- package/functions/utils/getUtxosFromReceipt.utils.d.ts +4 -0
- package/functions/utils/getUtxosFromReceipt.utils.mjs +29 -0
- package/functions/utils/getUtxosFromReceiptSolana.cjs +1 -0
- package/functions/utils/getUtxosFromReceiptSolana.d.ts +5 -0
- package/functions/utils/getUtxosFromReceiptSolana.mjs +19 -0
- package/functions/utils/index.d.ts +5 -1
- package/functions/utils/networks.utils.cjs +1 -1
- package/functions/utils/networks.utils.mjs +2 -3
- package/functions/utils/nftTokenFunctions.cjs +1 -1
- package/functions/utils/nftTokenFunctions.mjs +8 -4
- package/functions/utils/prepareHinkal.cjs +1 -0
- package/functions/utils/prepareHinkal.d.ts +7 -1
- package/functions/utils/prepareHinkal.mjs +88 -0
- package/functions/utils/publicBalance.utils.cjs +1 -1
- package/functions/utils/publicBalance.utils.d.ts +1 -0
- package/functions/utils/publicBalance.utils.mjs +75 -45
- package/functions/utils/solanaMint.utils.cjs +1 -0
- package/functions/utils/solanaMint.utils.d.ts +10 -0
- package/functions/utils/solanaMint.utils.mjs +14 -0
- package/functions/utils/time.utils.cjs +1 -1
- package/functions/utils/time.utils.d.ts +1 -1
- package/functions/utils/time.utils.mjs +11 -11
- package/functions/utils/userAgent.cjs +1 -1
- package/functions/utils/userAgent.mjs +6 -7
- package/functions/utils/walletBalances.utils.cjs +1 -1
- package/functions/utils/walletBalances.utils.d.ts +2 -1
- package/functions/utils/walletBalances.utils.mjs +18 -17
- package/functions/web3/events/getInputUtxoAndBalance.cjs +1 -1
- package/functions/web3/events/getInputUtxoAndBalance.mjs +98 -91
- package/functions/web3/events/getInputUtxosEnclave.cjs +1 -1
- package/functions/web3/events/getInputUtxosEnclave.mjs +38 -16
- package/functions/web3/events/getShieldedBalance.cjs +2 -2
- package/functions/web3/events/getShieldedBalance.mjs +70 -62
- package/functions/web3/events/getTransactionLogEvents.cjs +1 -1
- package/functions/web3/events/getTransactionLogEvents.d.ts +3 -2
- package/functions/web3/events/getTransactionLogEvents.mjs +12 -9
- package/functions/web3/fetchSolanaMerkleTreeRootHash.cjs +1 -0
- package/functions/web3/fetchSolanaMerkleTreeRootHash.d.ts +4 -0
- package/functions/web3/fetchSolanaMerkleTreeRootHash.mjs +45 -0
- package/functions/web3/functionCalls/accessTokenCalls.cjs +1 -1
- package/functions/web3/functionCalls/accessTokenCalls.d.ts +2 -0
- package/functions/web3/functionCalls/accessTokenCalls.mjs +25 -7
- package/functions/web3/functionCalls/transactCallRelayer.cjs +1 -1
- package/functions/web3/functionCalls/transactCallRelayer.d.ts +20 -0
- package/functions/web3/functionCalls/transactCallRelayer.mjs +61 -19
- package/functions/web3/getContractMetadata.cjs +1 -1
- package/functions/web3/getContractMetadata.mjs +20 -50
- package/functions/web3/getTokenHolder.cjs +1 -1
- package/functions/web3/getTokenHolder.mjs +29 -24
- package/functions/web3/index.d.ts +2 -0
- package/functions/web3/odosAPI.cjs +1 -1
- package/functions/web3/odosAPI.mjs +11 -8
- package/functions/web3/okxAPI.cjs +1 -0
- package/functions/web3/okxAPI.d.ts +8 -0
- package/functions/web3/okxAPI.mjs +43 -0
- package/functions/web3/oneInchAPI.cjs +1 -1
- package/functions/web3/oneInchAPI.mjs +7 -4
- package/functions/web3/runContractFunction.cjs +1 -1
- package/functions/web3/runContractFunction.mjs +22 -18
- package/functions/web3/signAndSendSerializedTransaction.cjs +1 -0
- package/functions/web3/signAndSendSerializedTransaction.d.ts +2 -0
- package/functions/web3/signAndSendSerializedTransaction.mjs +11 -0
- package/functions/web3/uniswapAPI.cjs +1 -1
- package/functions/web3/uniswapAPI.mjs +7 -4
- package/index.cjs +1 -1
- package/index.mjs +922 -810
- package/package.json +12 -16
- package/providers/CustomEthersProvider.cjs +1 -0
- package/providers/{TorExternalProvider.d.ts → CustomEthersProvider.d.ts} +2 -2
- package/providers/CustomEthersProvider.mjs +29 -0
- package/providers/CustomSolanaConnection.cjs +1 -0
- package/providers/CustomSolanaConnection.d.ts +4 -0
- package/providers/CustomSolanaConnection.mjs +33 -0
- package/providers/EthersProviderAdapter.cjs +1 -1
- package/providers/EthersProviderAdapter.d.ts +1 -2
- package/providers/EthersProviderAdapter.mjs +8 -48
- package/providers/SolanaProviderAdapter.cjs +1 -0
- package/providers/SolanaProviderAdapter.d.ts +44 -0
- package/providers/SolanaProviderAdapter.mjs +125 -0
- package/providers/WagmiProviderAdapter.cjs +1 -1
- package/providers/WagmiProviderAdapter.d.ts +1 -2
- package/providers/WagmiProviderAdapter.mjs +26 -24
- package/providers/prepareEthersHinkal.cjs +1 -1
- package/providers/prepareEthersHinkal.mjs +10 -7
- package/providers/prepareWagmiHinkal.cjs +1 -1
- package/providers/prepareWagmiHinkal.mjs +9 -6
- package/types/IMultiThreadedUtxoUtils.d.ts +2 -2
- package/types/TransactionSimulator.types.d.ts +1 -0
- package/types/activities.types.cjs +1 -1
- package/types/activities.types.d.ts +1 -0
- package/types/activities.types.mjs +6 -4
- package/types/admin.types.cjs +1 -1
- package/types/admin.types.d.ts +16 -0
- package/types/admin.types.mjs +1 -1
- package/types/all-points.types.d.ts +0 -1
- package/types/cache.types.cjs +1 -1
- package/types/cache.types.d.ts +8 -1
- package/types/cache.types.mjs +1 -1
- package/types/circom-data.types.d.ts +6 -0
- package/types/commitments.types.d.ts +12 -0
- package/types/ethereum-network.types.cjs +1 -1
- package/types/ethereum-network.types.d.ts +9 -3
- package/types/ethereum-network.types.mjs +1 -1
- package/types/external-action.types.cjs +1 -1
- package/types/external-action.types.d.ts +3 -1
- package/types/external-action.types.mjs +2 -2
- package/types/hinkal.types.cjs +1 -1
- package/types/hinkal.types.d.ts +3 -2
- package/types/hinkal.types.mjs +8 -8
- package/types/http.types.d.ts +8 -0
- package/types/index.d.ts +3 -2
- package/types/new-rewards.type.d.ts +2 -9
- package/types/offscreen.types.cjs +1 -1
- package/types/offscreen.types.d.ts +2 -1
- package/types/offscreen.types.mjs +2 -2
- package/types/okx.types.d.ts +57 -0
- package/types/rewards.types.d.ts +0 -11
- package/types/sandbox.types.cjs +1 -1
- package/types/sandbox.types.d.ts +19 -2
- package/types/sandbox.types.mjs +2 -2
- package/types/solana.types.d.ts +75 -0
- package/types/token.types.d.ts +6 -0
- package/webworker/snarkjsWorker/snarkjsWorkerLauncher.cjs +1 -1
- package/webworker/snarkjsWorker/snarkjsWorkerLauncher.mjs +1 -1
- package/webworker/snarkjsWorker/snarkjsWorkerLogic.cjs +1 -1
- package/webworker/snarkjsWorker/snarkjsWorkerLogic.d.ts +0 -1
- package/webworker/snarkjsWorker/snarkjsWorkerLogic.mjs +28 -30
- package/webworker/utxoWorker/utxoWorker.types.d.ts +2 -0
- package/webworker/utxoWorker/utxoWorkerLauncher.cjs +1 -1
- package/webworker/utxoWorker/utxoWorkerLauncher.mjs +1 -1
- package/webworker/utxoWorker/utxoWorkerLogic.cjs +1 -1
- package/webworker/utxoWorker/utxoWorkerLogic.mjs +33 -31
- package/webworker/viteWorkerURL.constant.cjs +21 -1
- package/webworker/viteWorkerURL.constant.mjs +21 -12
- package/webworker/zkProofWorker/zkProofWorkerLauncher.cjs +1 -1
- package/webworker/zkProofWorker/zkProofWorkerLauncher.mjs +1 -1
- package/API/mysteryBoxesCalls.cjs +0 -1
- package/API/mysteryBoxesCalls.d.ts +0 -60
- package/API/mysteryBoxesCalls.mjs +0 -66
- package/assets/snarkjsWorkerLauncher-CWaDqRaL.js +0 -14803
- package/assets/utxoWorkerLauncher-BUhBaUSg.js +0 -115868
- package/assets/zkProofWorkerLauncher-DlWQP3l9.js +0 -115360
- package/constants/mystery-boxes.constants.cjs +0 -1
- package/constants/mystery-boxes.constants.d.ts +0 -63
- package/constants/mystery-boxes.constants.mjs +0 -355
- package/data-structures/event-service/AbstractAccessTokenSnapshotService.cjs +0 -1
- package/data-structures/event-service/AbstractApprovalsSnapshotService.cjs +0 -1
- package/data-structures/event-service/AbstractCommitmentsSnapshotService.cjs +0 -1
- package/data-structures/event-service/AbstractEventService.cjs +0 -1
- package/data-structures/event-service/AbstractEventService.mjs +0 -33
- package/data-structures/event-service/AbstractSnapshotService.cjs +0 -1
- package/data-structures/event-service/BlockchainEventEmitter.cjs +0 -1
- package/data-structures/event-service/BlockchainEventEmitter.mjs +0 -80
- package/data-structures/snapshot/ClientAccessTokenSnapshotService.cjs +0 -1
- package/data-structures/snapshot/ClientApprovalsSnapshotService.cjs +0 -1
- package/data-structures/snapshot/ClientApprovalsSnapshotService.mjs +0 -23
- package/data-structures/snapshot/ClientCommitmentsSnapshotService.cjs +0 -1
- package/data-structures/snapshot/ClientCommitmentsSnapshotService.mjs +0 -31
- package/data-structures/snapshot/ClientNullifierSnapshotService.cjs +0 -1
- package/data-structures/snapshot/ClientNullifierSnapshotService.mjs +0 -30
- package/functions/utils/mystery-box-auction.utils.cjs +0 -1
- package/functions/utils/mystery-box-auction.utils.d.ts +0 -8
- package/functions/utils/mystery-box-auction.utils.mjs +0 -51
- package/providers/TorExternalProvider.cjs +0 -1
- package/providers/TorExternalProvider.mjs +0 -29
- package/types/merch-order.types.cjs +0 -1
- package/types/merch-order.types.d.ts +0 -16
- package/types/merch-order.types.mjs +0 -4
- package/types/mystery-boxes.types.cjs +0 -1
- package/types/mystery-boxes.types.d.ts +0 -43
- package/types/mystery-boxes.types.mjs +0 -6
- /package/data-structures/event-service/{AbstractNullifierSnapshotService.cjs → evm/AbstractNullifierSnapshotService.cjs} +0 -0
- /package/data-structures/event-service/{AbstractNullifierSnapshotService.mjs → evm/AbstractNullifierSnapshotService.mjs} +0 -0
- /package/data-structures/event-service/{AbstractSnapshotService.d.ts → evm/AbstractSnapshotService.d.ts} +0 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ethers as e } from "ethers";
|
|
2
|
+
import "idb-keyval";
|
|
3
|
+
import "../../constants/chains.constants.mjs";
|
|
4
|
+
import "@solana/web3.js";
|
|
5
|
+
import "../../data-structures/http/HttpClient.mjs";
|
|
6
|
+
import "../../constants/vite.constants.mjs";
|
|
7
|
+
import "../../constants/token-data/index.mjs";
|
|
8
|
+
import "../../error-handling/error-codes.constants.mjs";
|
|
9
|
+
import "../utils/convertIntegrationProviderToExternalActionId.mjs";
|
|
10
|
+
import "../../types/circom-data.types.mjs";
|
|
11
|
+
import "../../types/transactions.types.mjs";
|
|
12
|
+
import "../../types/activities.types.mjs";
|
|
13
|
+
import "circomlibjs-hinkal-fork";
|
|
14
|
+
import "../../data-structures/crypto-keys/keys.mjs";
|
|
15
|
+
import "../../constants/server.constants.mjs";
|
|
16
|
+
import "axios";
|
|
17
|
+
import "../../API/getServerURL.mjs";
|
|
18
|
+
import "libsodium-wrappers";
|
|
19
|
+
import "process";
|
|
20
|
+
import "buffer";
|
|
21
|
+
import "../../constants/save-depths.mjs";
|
|
22
|
+
import "../../constants/reorg-depths.constants.mjs";
|
|
23
|
+
import "../utils/mutexes.utils.mjs";
|
|
24
|
+
import "@coral-xyz/anchor";
|
|
25
|
+
import "@solana/spl-token";
|
|
26
|
+
import { convertBytes32ToBigInt as t } from "../utils/bytes32.utils.mjs";
|
|
27
|
+
import "../../constants/contracts.constants.mjs";
|
|
28
|
+
import "../../constants/kyc.constants.mjs";
|
|
29
|
+
import "../../constants/coingecko.constants.mjs";
|
|
30
|
+
import "../../constants/addresses.constants.mjs";
|
|
31
|
+
import "../../constants/token.limits.constants.mjs";
|
|
32
|
+
import "../../constants/presale.constants.mjs";
|
|
33
|
+
import "../../constants/activity.constants.mjs";
|
|
34
|
+
import "../../constants/tasks.constants.mjs";
|
|
35
|
+
import "../../constants/events.constants.mjs";
|
|
36
|
+
import "../utils/userAgent.mjs";
|
|
37
|
+
import "multiformats";
|
|
38
|
+
import "../../API/tenderly.api.mjs";
|
|
39
|
+
const Q = async (r, m) => {
|
|
40
|
+
const o = await r.account.merkle.fetch(m, "confirmed"), i = Number(t(o.rootIndex)), p = o.roots.at(i - 1);
|
|
41
|
+
return e.BigNumber.from(t(p).toString());
|
|
42
|
+
};
|
|
43
|
+
export {
|
|
44
|
+
Q as fetchSolanaMerkleTreeRootHash
|
|
45
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../../../types/circom-data.types.cjs");const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../../../types/circom-data.types.cjs");const r=require("../../../types/ethereum-network.types.cjs");require("../../../types/transactions.types.cjs");require("../../../types/activities.types.cjs");const a=require("../../../constants/chains.constants.cjs"),l=require("../../pre-transaction/solana.cjs"),g=require("@solana/web3.js"),i=async e=>(await e.getContractWithFetcher(r.ContractType.AccessTokenContract).functions.hasToken(e.userKeys.getAccessKey()))[0],k=async e=>{const{hinkalIdl:c,originalDeployer:n}=a.networkRegistry[e.getCurrentChainId()].contractData;if(!c||!n)throw new Error("missing hinkal data");const o=new g.PublicKey(n),t=e.getSolanaProgram(c),s=l.getAccessTokenAccountPublicKey(BigInt(e.userKeys.getAccessKey()),t.programId,o);if(!await t.provider.connection.getAccountInfo(s))return!1;const{isAdded:u}=await t.account.accesskeyAccount.fetch(s);return u},y=async e=>a.isSolanaLike(e.getCurrentChainId())?k(e):i(e),T=async(e,c,n)=>{const o=e.getContractWithSigner(r.ContractType.AccessTokenContract),t={value:0n,...n&&{type:0}};return await o.addToken(c,t)};exports.checkHinkalAccessToken=y;exports.checkHinkalAccessTokenEVM=i;exports.checkHinkalAccessTokenSolana=k;exports.mintAccessToken=T;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { ethers } from 'ethers';
|
|
2
2
|
import { IHinkal } from '../../../data-structures/Hinkal/IHinkal';
|
|
3
3
|
import { SignatureData } from '../../../types';
|
|
4
|
+
export declare const checkHinkalAccessTokenEVM: (hinkal: IHinkal) => Promise<any>;
|
|
5
|
+
export declare const checkHinkalAccessTokenSolana: (hinkal: IHinkal) => Promise<any>;
|
|
4
6
|
export declare const checkHinkalAccessToken: (hinkal: IHinkal) => Promise<any>;
|
|
5
7
|
export declare const mintAccessToken: (hinkal: IHinkal, signatureData: SignatureData, fromWallet?: boolean) => Promise<ethers.ContractTransaction>;
|
|
@@ -1,15 +1,33 @@
|
|
|
1
1
|
import "../../../types/circom-data.types.mjs";
|
|
2
|
-
import { ContractType as
|
|
2
|
+
import { ContractType as r } from "../../../types/ethereum-network.types.mjs";
|
|
3
3
|
import "../../../types/transactions.types.mjs";
|
|
4
4
|
import "../../../types/activities.types.mjs";
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
import { networkRegistry as i, isSolanaLike as g } from "../../../constants/chains.constants.mjs";
|
|
6
|
+
import { getAccessTokenAccountPublicKey as k } from "../../pre-transaction/solana.mjs";
|
|
7
|
+
import { PublicKey as u } from "@solana/web3.js";
|
|
8
|
+
const y = async (c) => (await c.getContractWithFetcher(r.AccessTokenContract).functions.hasToken(c.userKeys.getAccessKey()))[0], m = async (c) => {
|
|
9
|
+
const { hinkalIdl: t, originalDeployer: e } = i[c.getCurrentChainId()].contractData;
|
|
10
|
+
if (!t || !e)
|
|
11
|
+
throw new Error("missing hinkal data");
|
|
12
|
+
const o = new u(e), n = c.getSolanaProgram(t), s = k(
|
|
13
|
+
BigInt(c.userKeys.getAccessKey()),
|
|
14
|
+
n.programId,
|
|
15
|
+
o
|
|
16
|
+
);
|
|
17
|
+
if (!await n.provider.connection.getAccountInfo(s))
|
|
18
|
+
return !1;
|
|
19
|
+
const { isAdded: a } = await n.account.accesskeyAccount.fetch(s);
|
|
20
|
+
return a;
|
|
21
|
+
}, w = async (c) => g(c.getCurrentChainId()) ? m(c) : y(c), I = async (c, t, e) => {
|
|
22
|
+
const o = c.getContractWithSigner(r.AccessTokenContract), n = {
|
|
7
23
|
value: 0n,
|
|
8
|
-
...
|
|
24
|
+
...e && { type: 0 }
|
|
9
25
|
};
|
|
10
|
-
return await
|
|
26
|
+
return await o.addToken(t, n);
|
|
11
27
|
};
|
|
12
28
|
export {
|
|
13
|
-
|
|
14
|
-
|
|
29
|
+
w as checkHinkalAccessToken,
|
|
30
|
+
y as checkHinkalAccessTokenEVM,
|
|
31
|
+
m as checkHinkalAccessTokenSolana,
|
|
32
|
+
I as mintAccessToken
|
|
15
33
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../../../error-handling/error-codes.constants.cjs");require("ethers");const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../../../error-handling/error-codes.constants.cjs");require("ethers");const y=require("../../../error-handling/customErrors/ErrorWithTx.cjs");require("../../../types/circom-data.types.cjs");require("../../../types/transactions.types.cjs");require("../../../types/activities.types.cjs");const R=require("../../../constants/server.constants.cjs");require("../../../API/getServerURL.cjs");const C=require("../../../data-structures/http/HttpClient.cjs");require("axios");require("../../../constants/chains.constants.cjs");require("circomlibjs-hinkal-fork");require("libsodium-wrappers");require("process");require("buffer");require("../../../constants/vite.constants.cjs");require("../../../constants/save-depths.cjs");require("../../../constants/reorg-depths.constants.cjs");require("../../utils/mutexes.utils.cjs");require("@coral-xyz/anchor");require("@solana/web3.js");require("../../../data-structures/crypto-keys/keys.cjs");const n=require("../../../API/callRelayer.cjs"),u=require("../../snarkjs/common.snarkjs.cjs");require("node-forge");require("../../../constants/token-data/index.cjs");require("idb-keyval");require("../../utils/convertIntegrationProviderToExternalActionId.cjs");const w=require("../../../API/getRelayerURL.cjs");require("@solana/spl-token");require("../../../constants/contracts.constants.cjs");require("../../../constants/kyc.constants.cjs");require("../../../constants/coingecko.constants.cjs");require("../../../constants/addresses.constants.cjs");require("../../../constants/token.limits.constants.cjs");require("../../../constants/presale.constants.cjs");require("../../../constants/activity.constants.cjs");require("../../../constants/tasks.constants.cjs");require("../../../constants/events.constants.cjs");require("../../utils/userAgent.cjs");require("multiformats");require("../../../API/tenderly.api.cjs");require("ethers-v6h");const l=r=>{if(r.status==="success")return r.message;throw r.message&&r.error?new y.ErrorWithRelayerTransaction(r.error,r.message):new Error(r.error)},T=async(r,a,t,i,c,s,e,o)=>{const h=u.serializeCircomData(i),m=await n.callRelayerTransactAPI(r,{a:a[0],b:a[1],c:a[2],dimData:t,circomData:h,withPrivateMempool:c,withUniswapWorkAround:s,authorizationData:e,adminData:o});return l(m)},D=async(r,a)=>{const t=await C.httpClient.post(`${w.getRelayerURL(r)}${R.RELAYER_CONFIG.SOLANA_TRANSACT}`,a);return l(t)},q=r=>{if(r.status==="success")return r.message.scheduleId;throw new Error(r.error||"Batch transaction failed")},d=async(r,a,t)=>{const i=a.map(e=>u.serializeCircomData(e.circomData)),c={transactions:a.map((e,o)=>({a:e.zkCallData[0],b:e.zkCallData[1],c:e.zkCallData[2],dimData:e.dimData,circomData:i[o],withPrivateMempool:e.withPrivateMempool,withUniswapWorkAround:e.withUniswapWorkAround,authorizationData:e.authorizationData})),txCompletionTime:t},s=await n.callRelayerTransactBatchAPI(r,c);return q(s)},A=async(r,a,t)=>{const i={transactions:a,txCompletionTime:t},c=await n.callRelayerSolanaTransactBatchAPI(r,i);return q(c)};exports.solanaTransactCallRelayer=D;exports.solanaTransactCallRelayerBatch=A;exports.transactCallRelayer=T;exports.transactCallRelayerBatch=d;
|
|
@@ -1,7 +1,27 @@
|
|
|
1
1
|
import { AdminDataType, AuthorizationData, CircomDataBaseType, DimDataType, NewZkCallDataType, RelayerTransaction } from '../../../types';
|
|
2
|
+
import { SolanaTransactionBody } from '../../../types/solana.types';
|
|
2
3
|
export interface RelayerResponseInterface {
|
|
3
4
|
status: string;
|
|
4
5
|
message: RelayerTransaction;
|
|
5
6
|
error?: string;
|
|
6
7
|
}
|
|
7
8
|
export declare const transactCallRelayer: (chainId: number, newZkCallData: NewZkCallDataType, dimData: DimDataType, circomData: CircomDataBaseType, withPrivateMempool?: boolean, withUniswapWorkAround?: boolean, authorizationData?: AuthorizationData, adminData?: AdminDataType) => Promise<RelayerTransaction>;
|
|
9
|
+
export declare const solanaTransactCallRelayer: (chainId: number, body: SolanaTransactionBody) => Promise<RelayerTransaction>;
|
|
10
|
+
export interface RelayerBatchResponseInterface {
|
|
11
|
+
status: string;
|
|
12
|
+
message: {
|
|
13
|
+
scheduleId: string;
|
|
14
|
+
};
|
|
15
|
+
error?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface BatchTransactionParams {
|
|
18
|
+
zkCallData: NewZkCallDataType;
|
|
19
|
+
dimData: DimDataType;
|
|
20
|
+
circomData: CircomDataBaseType;
|
|
21
|
+
withPrivateMempool?: boolean;
|
|
22
|
+
withUniswapWorkAround?: boolean;
|
|
23
|
+
authorizationData?: AuthorizationData;
|
|
24
|
+
adminData?: AdminDataType;
|
|
25
|
+
}
|
|
26
|
+
export declare const transactCallRelayerBatch: (chainId: number, transactions: BatchTransactionParams[], txCompletionTime?: number) => Promise<string>;
|
|
27
|
+
export declare const solanaTransactCallRelayerBatch: (chainId: number, transactions: SolanaTransactionBody[], txCompletionTime?: number) => Promise<string>;
|
|
@@ -1,35 +1,39 @@
|
|
|
1
1
|
import "../../../error-handling/error-codes.constants.mjs";
|
|
2
2
|
import "ethers";
|
|
3
|
-
import { ErrorWithRelayerTransaction as
|
|
3
|
+
import { ErrorWithRelayerTransaction as u } from "../../../error-handling/customErrors/ErrorWithTx.mjs";
|
|
4
4
|
import "../../../types/circom-data.types.mjs";
|
|
5
5
|
import "../../../types/transactions.types.mjs";
|
|
6
6
|
import "../../../types/activities.types.mjs";
|
|
7
|
-
import "../../../constants/server.constants.mjs";
|
|
7
|
+
import { RELAYER_CONFIG as w } from "../../../constants/server.constants.mjs";
|
|
8
8
|
import "../../../API/getServerURL.mjs";
|
|
9
|
+
import { httpClient as y } from "../../../data-structures/http/HttpClient.mjs";
|
|
9
10
|
import "axios";
|
|
10
11
|
import "../../../constants/chains.constants.mjs";
|
|
11
|
-
import "../../../constants/reorg-depths.constants.mjs";
|
|
12
|
-
import "../../utils/mutexes.utils.mjs";
|
|
13
12
|
import "circomlibjs-hinkal-fork";
|
|
14
13
|
import "libsodium-wrappers";
|
|
15
14
|
import "process";
|
|
16
15
|
import "buffer";
|
|
17
16
|
import "../../../constants/vite.constants.mjs";
|
|
18
17
|
import "../../../constants/save-depths.mjs";
|
|
19
|
-
import
|
|
18
|
+
import "../../../constants/reorg-depths.constants.mjs";
|
|
19
|
+
import "../../utils/mutexes.utils.mjs";
|
|
20
|
+
import "@coral-xyz/anchor";
|
|
21
|
+
import "@solana/web3.js";
|
|
20
22
|
import "../../../data-structures/crypto-keys/keys.mjs";
|
|
21
|
-
import {
|
|
23
|
+
import { callRelayerTransactAPI as A, callRelayerTransactBatchAPI as D, callRelayerSolanaTransactBatchAPI as d } from "../../../API/callRelayer.mjs";
|
|
24
|
+
import { serializeCircomData as p } from "../../snarkjs/common.snarkjs.mjs";
|
|
22
25
|
import "node-forge";
|
|
23
26
|
import "../../../constants/token-data/index.mjs";
|
|
24
27
|
import "idb-keyval";
|
|
25
28
|
import "../../utils/convertIntegrationProviderToExternalActionId.mjs";
|
|
29
|
+
import { getRelayerURL as f } from "../../../API/getRelayerURL.mjs";
|
|
30
|
+
import "@solana/spl-token";
|
|
26
31
|
import "../../../constants/contracts.constants.mjs";
|
|
27
32
|
import "../../../constants/kyc.constants.mjs";
|
|
28
33
|
import "../../../constants/coingecko.constants.mjs";
|
|
29
34
|
import "../../../constants/addresses.constants.mjs";
|
|
30
35
|
import "../../../constants/token.limits.constants.mjs";
|
|
31
36
|
import "../../../constants/presale.constants.mjs";
|
|
32
|
-
import "../../../constants/mystery-boxes.constants.mjs";
|
|
33
37
|
import "../../../constants/activity.constants.mjs";
|
|
34
38
|
import "../../../constants/tasks.constants.mjs";
|
|
35
39
|
import "../../../constants/events.constants.mjs";
|
|
@@ -37,22 +41,60 @@ import "../../utils/userAgent.mjs";
|
|
|
37
41
|
import "multiformats";
|
|
38
42
|
import "../../../API/tenderly.api.mjs";
|
|
39
43
|
import "ethers-v6h";
|
|
40
|
-
const
|
|
41
|
-
|
|
44
|
+
const n = (t) => {
|
|
45
|
+
if (t.status === "success")
|
|
46
|
+
return t.message;
|
|
47
|
+
throw t.message && t.error ? new u(t.error, t.message) : new Error(t.error);
|
|
48
|
+
}, nt = async (t, o, a, m, i, c, r, s) => {
|
|
49
|
+
const l = p(m), h = await A(t, {
|
|
42
50
|
a: o[0],
|
|
43
51
|
b: o[1],
|
|
44
52
|
c: o[2],
|
|
45
|
-
dimData:
|
|
46
|
-
circomData:
|
|
47
|
-
withPrivateMempool:
|
|
48
|
-
withUniswapWorkAround:
|
|
49
|
-
authorizationData:
|
|
50
|
-
adminData:
|
|
53
|
+
dimData: a,
|
|
54
|
+
circomData: l,
|
|
55
|
+
withPrivateMempool: i,
|
|
56
|
+
withUniswapWorkAround: c,
|
|
57
|
+
authorizationData: r,
|
|
58
|
+
adminData: s
|
|
59
|
+
});
|
|
60
|
+
return n(h);
|
|
61
|
+
}, et = async (t, o) => {
|
|
62
|
+
const a = await y.post(
|
|
63
|
+
`${f(t)}${w.SOLANA_TRANSACT}`,
|
|
64
|
+
o
|
|
65
|
+
);
|
|
66
|
+
return n(a);
|
|
67
|
+
}, e = (t) => {
|
|
68
|
+
if (t.status === "success")
|
|
69
|
+
return t.message.scheduleId;
|
|
70
|
+
throw new Error(t.error || "Batch transaction failed");
|
|
71
|
+
}, lt = async (t, o, a) => {
|
|
72
|
+
const m = o.map(
|
|
73
|
+
(r) => p(r.circomData)
|
|
74
|
+
), i = {
|
|
75
|
+
transactions: o.map((r, s) => ({
|
|
76
|
+
a: r.zkCallData[0],
|
|
77
|
+
b: r.zkCallData[1],
|
|
78
|
+
c: r.zkCallData[2],
|
|
79
|
+
dimData: r.dimData,
|
|
80
|
+
circomData: m[s],
|
|
81
|
+
withPrivateMempool: r.withPrivateMempool,
|
|
82
|
+
withUniswapWorkAround: r.withUniswapWorkAround,
|
|
83
|
+
authorizationData: r.authorizationData
|
|
84
|
+
})),
|
|
85
|
+
txCompletionTime: a
|
|
86
|
+
}, c = await D(t, i);
|
|
87
|
+
return e(c);
|
|
88
|
+
}, ht = async (t, o, a) => {
|
|
89
|
+
const i = await d(t, {
|
|
90
|
+
transactions: o,
|
|
91
|
+
txCompletionTime: a
|
|
51
92
|
});
|
|
52
|
-
|
|
53
|
-
return r.message;
|
|
54
|
-
throw r.message && r.error ? new n(r.error, r.message) : new Error(r.error);
|
|
93
|
+
return e(i);
|
|
55
94
|
};
|
|
56
95
|
export {
|
|
57
|
-
|
|
96
|
+
et as solanaTransactCallRelayer,
|
|
97
|
+
ht as solanaTransactCallRelayerBatch,
|
|
98
|
+
nt as transactCallRelayer,
|
|
99
|
+
lt as transactCallRelayerBatch
|
|
58
100
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../../constants/contracts.constants.cjs"),c=require("../../constants/chains.constants.cjs"),d=require("../../error-handling/error-codes.constants.cjs"),u=require("ethers"),h=require("../utils/create-provider.cjs"),a=(t,o)=>{const e=c.networkRegistry[o];if(!e)throw new Error(d.transactionErrorCodes.UNSUPPORTED_NETWORK);const r=i.contractMetadataMapping[t];if(!r)throw new Error(`Unsupported contractType: ${t}`);return r(e.contractData)},s=(t,o,e)=>{const r=a(t,o);if(!r.abi)throw new Error(`No ABI configured for contractType: ${t}`);if(r.address&&e)throw new Error(`Overriding address is not supported for contractType: ${t}`);const n=r.address??e;if(!n)throw new Error(`No contractAddress configured for contractType: ${t}`);return new u.ethers.Contract(n,r.abi)},f=(t,o,e=void 0)=>{const{fetchRpcUrl:r}=c.networkRegistry[t];if(!r)throw new Error("RPC URL not found for the specified chain ID");return s(o,t,e).connect(h.createCustomRpcProvider(r))};exports.getContract=s;exports.getContractMetadata=a;exports.getContractWithFetcherByChainId=f;
|
|
@@ -1,64 +1,34 @@
|
|
|
1
|
-
import { contractMetadataMapping as
|
|
2
|
-
import { networkRegistry as
|
|
3
|
-
import { transactionErrorCodes as
|
|
4
|
-
import { ethers as
|
|
5
|
-
import "
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import "../utils/convertIntegrationProviderToExternalActionId.mjs";
|
|
9
|
-
import "../../types/circom-data.types.mjs";
|
|
10
|
-
import "../../types/transactions.types.mjs";
|
|
11
|
-
import "../../types/activities.types.mjs";
|
|
12
|
-
import "circomlibjs-hinkal-fork";
|
|
13
|
-
import "../../data-structures/crypto-keys/keys.mjs";
|
|
14
|
-
import "../../constants/server.constants.mjs";
|
|
15
|
-
import "../../constants/vite.constants.mjs";
|
|
16
|
-
import "axios";
|
|
17
|
-
import "../../API/getServerURL.mjs";
|
|
18
|
-
import "../../constants/reorg-depths.constants.mjs";
|
|
19
|
-
import "../utils/mutexes.utils.mjs";
|
|
20
|
-
import "libsodium-wrappers";
|
|
21
|
-
import "process";
|
|
22
|
-
import "buffer";
|
|
23
|
-
import "../../constants/save-depths.mjs";
|
|
24
|
-
import "../../constants/kyc.constants.mjs";
|
|
25
|
-
import "../../constants/coingecko.constants.mjs";
|
|
26
|
-
import "../../constants/addresses.constants.mjs";
|
|
27
|
-
import "../../constants/token.limits.constants.mjs";
|
|
28
|
-
import "../../constants/presale.constants.mjs";
|
|
29
|
-
import "../../constants/mystery-boxes.constants.mjs";
|
|
30
|
-
import "../../constants/activity.constants.mjs";
|
|
31
|
-
import "../../constants/tasks.constants.mjs";
|
|
32
|
-
import "../../constants/events.constants.mjs";
|
|
33
|
-
import "../utils/userAgent.mjs";
|
|
34
|
-
import "multiformats";
|
|
35
|
-
import "../../API/tenderly.api.mjs";
|
|
36
|
-
const s = (r, i) => {
|
|
37
|
-
const o = p[i];
|
|
1
|
+
import { contractMetadataMapping as c } from "../../constants/contracts.constants.mjs";
|
|
2
|
+
import { networkRegistry as a } from "../../constants/chains.constants.mjs";
|
|
3
|
+
import { transactionErrorCodes as i } from "../../error-handling/error-codes.constants.mjs";
|
|
4
|
+
import { ethers as s } from "ethers";
|
|
5
|
+
import { createCustomRpcProvider as d } from "../utils/create-provider.mjs";
|
|
6
|
+
const f = (r, e) => {
|
|
7
|
+
const o = a[e];
|
|
38
8
|
if (!o)
|
|
39
|
-
throw new Error(
|
|
40
|
-
const t =
|
|
9
|
+
throw new Error(i.UNSUPPORTED_NETWORK);
|
|
10
|
+
const t = c[r];
|
|
41
11
|
if (!t)
|
|
42
12
|
throw new Error(`Unsupported contractType: ${r}`);
|
|
43
13
|
return t(o.contractData);
|
|
44
|
-
},
|
|
45
|
-
const t =
|
|
14
|
+
}, p = (r, e, o) => {
|
|
15
|
+
const t = f(r, e);
|
|
46
16
|
if (!t.abi)
|
|
47
17
|
throw new Error(`No ABI configured for contractType: ${r}`);
|
|
48
18
|
if (t.address && o)
|
|
49
19
|
throw new Error(`Overriding address is not supported for contractType: ${r}`);
|
|
50
|
-
const
|
|
51
|
-
if (!
|
|
20
|
+
const n = t.address ?? o;
|
|
21
|
+
if (!n)
|
|
52
22
|
throw new Error(`No contractAddress configured for contractType: ${r}`);
|
|
53
|
-
return new
|
|
54
|
-
},
|
|
55
|
-
const { fetchRpcUrl: t } =
|
|
23
|
+
return new s.Contract(n, t.abi);
|
|
24
|
+
}, g = (r, e, o = void 0) => {
|
|
25
|
+
const { fetchRpcUrl: t } = a[r];
|
|
56
26
|
if (!t)
|
|
57
27
|
throw new Error("RPC URL not found for the specified chain ID");
|
|
58
|
-
return
|
|
28
|
+
return p(e, r, o).connect(d(t));
|
|
59
29
|
};
|
|
60
30
|
export {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
31
|
+
p as getContract,
|
|
32
|
+
f as getContractMetadata,
|
|
33
|
+
g as getContractWithFetcherByChainId
|
|
64
34
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("ethers"),o=require("../../constants/chains.constants.cjs"),h=require("../../externalABIs/index.cjs"),c=require("../../data-structures/http/HttpClient.cjs");require("axios");require("idb-keyval");const p=require("../utils/create-provider.cjs");require("../../constants/token-data/index.cjs");require("../../error-handling/error-codes.constants.cjs");require("../utils/convertIntegrationProviderToExternalActionId.cjs");require("../../types/circom-data.types.cjs");require("../../types/transactions.types.cjs");require("../../types/activities.types.cjs");require("circomlibjs-hinkal-fork");require("../../data-structures/crypto-keys/keys.cjs");require("../../constants/server.constants.cjs");require("../../constants/vite.constants.cjs");require("../../API/getServerURL.cjs");require("libsodium-wrappers");require("process");require("buffer");require("../../constants/save-depths.cjs");require("../../constants/reorg-depths.constants.cjs");require("../utils/mutexes.utils.cjs");require("@coral-xyz/anchor");require("@solana/web3.js");require("@solana/spl-token");require("../../constants/contracts.constants.cjs");require("../../constants/kyc.constants.cjs");require("../../constants/coingecko.constants.cjs");require("../../constants/addresses.constants.cjs");require("../../constants/token.limits.constants.cjs");require("../../constants/presale.constants.cjs");require("../../constants/activity.constants.cjs");require("../../constants/tasks.constants.cjs");require("../../constants/events.constants.cjs");require("../utils/userAgent.cjs");require("multiformats");require("../../API/tenderly.api.cjs");const a={[o.chainIds.base]:"base",[o.chainIds.optimism]:"optimism",[o.chainIds.arbMainnet]:"arbitrum",[o.chainIds.polygon]:"polygon",[o.chainIds.ethMainnet]:"eth"},k=async(e,r)=>{const i=`https://${a[e]}.blockscout.com/api?module=token&action=getTokenHolders&contractaddress=${r}&page=0&offset=10`,{result:q}=await c.httpClient.get(i),{fetchRpcUrl:n}=o.networkRegistry[e];if(!n)throw new Error("RPC URL not found for the specified chain ID");const l=p.createCustomRpcProvider(n),d=new u.ethers.Contract(r,h.ERC20ABI,l);for(const{address:s}of q)if((await d.balanceOf(s)).toBigInt()!==0n)return s},m=async(e,r)=>{const t=`https://api.routescan.io/v2/network/mainnet/evm/${e}/etherscan/api?module=token&action=tokenholderlist&contractaddress=${r}&page=1&offset=10&apikey=YourApiKeyToken`,{result:i}=await c.httpClient.get(t);return i.at(0)?.TokenHolderAddress},f=async(e,r)=>{try{if(!(e in a))throw new Error("Chain is not supported by blockscout");const t=await k(e,r);if(!t||!u.ethers.utils.isAddress(t))throw new Error("Token holder not found in blockscout");return t}catch{return await m(e,r)}};exports.getTokenHolder=f;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { ethers as
|
|
2
|
-
import { chainIds as
|
|
1
|
+
import { ethers as m } from "ethers";
|
|
2
|
+
import { chainIds as i, networkRegistry as d } from "../../constants/chains.constants.mjs";
|
|
3
3
|
import { ERC20ABI as f } from "../../externalABIs/index.mjs";
|
|
4
|
+
import { httpClient as a } from "../../data-structures/http/HttpClient.mjs";
|
|
5
|
+
import "axios";
|
|
4
6
|
import "idb-keyval";
|
|
5
|
-
import {
|
|
7
|
+
import { createCustomRpcProvider as h } from "../utils/create-provider.mjs";
|
|
6
8
|
import "../../constants/token-data/index.mjs";
|
|
7
9
|
import "../../error-handling/error-codes.constants.mjs";
|
|
8
10
|
import "../utils/convertIntegrationProviderToExternalActionId.mjs";
|
|
@@ -13,21 +15,22 @@ import "circomlibjs-hinkal-fork";
|
|
|
13
15
|
import "../../data-structures/crypto-keys/keys.mjs";
|
|
14
16
|
import "../../constants/server.constants.mjs";
|
|
15
17
|
import "../../constants/vite.constants.mjs";
|
|
16
|
-
import m from "axios";
|
|
17
18
|
import "../../API/getServerURL.mjs";
|
|
18
|
-
import "../../constants/reorg-depths.constants.mjs";
|
|
19
|
-
import "../utils/mutexes.utils.mjs";
|
|
20
19
|
import "libsodium-wrappers";
|
|
21
20
|
import "process";
|
|
22
21
|
import "buffer";
|
|
23
22
|
import "../../constants/save-depths.mjs";
|
|
23
|
+
import "../../constants/reorg-depths.constants.mjs";
|
|
24
|
+
import "../utils/mutexes.utils.mjs";
|
|
25
|
+
import "@coral-xyz/anchor";
|
|
26
|
+
import "@solana/web3.js";
|
|
27
|
+
import "@solana/spl-token";
|
|
24
28
|
import "../../constants/contracts.constants.mjs";
|
|
25
29
|
import "../../constants/kyc.constants.mjs";
|
|
26
30
|
import "../../constants/coingecko.constants.mjs";
|
|
27
31
|
import "../../constants/addresses.constants.mjs";
|
|
28
32
|
import "../../constants/token.limits.constants.mjs";
|
|
29
33
|
import "../../constants/presale.constants.mjs";
|
|
30
|
-
import "../../constants/mystery-boxes.constants.mjs";
|
|
31
34
|
import "../../constants/activity.constants.mjs";
|
|
32
35
|
import "../../constants/tasks.constants.mjs";
|
|
33
36
|
import "../../constants/events.constants.mjs";
|
|
@@ -35,28 +38,30 @@ import "../utils/userAgent.mjs";
|
|
|
35
38
|
import "multiformats";
|
|
36
39
|
import "../../API/tenderly.api.mjs";
|
|
37
40
|
const c = {
|
|
38
|
-
[
|
|
39
|
-
[
|
|
40
|
-
[
|
|
41
|
-
[
|
|
42
|
-
[
|
|
43
|
-
},
|
|
44
|
-
const
|
|
41
|
+
[i.base]: "base",
|
|
42
|
+
[i.optimism]: "optimism",
|
|
43
|
+
[i.arbMainnet]: "arbitrum",
|
|
44
|
+
[i.polygon]: "polygon",
|
|
45
|
+
[i.ethMainnet]: "eth"
|
|
46
|
+
}, k = async (o, t) => {
|
|
47
|
+
const e = `https://${c[o]}.blockscout.com/api?module=token&action=getTokenHolders&contractaddress=${t}&page=0&offset=10`, { result: s } = await a.get(e), { fetchRpcUrl: n } = d[o];
|
|
45
48
|
if (!n)
|
|
46
49
|
throw new Error("RPC URL not found for the specified chain ID");
|
|
47
|
-
const l =
|
|
48
|
-
for (const { address:
|
|
49
|
-
if ((await u.balanceOf(
|
|
50
|
-
return
|
|
50
|
+
const l = h(n), u = new m.Contract(t, f, l);
|
|
51
|
+
for (const { address: p } of s)
|
|
52
|
+
if ((await u.balanceOf(p)).toBigInt() !== 0n)
|
|
53
|
+
return p;
|
|
51
54
|
}, w = async (o, t) => {
|
|
52
|
-
const r = `https://api.routescan.io/v2/network/mainnet/evm/${o}/etherscan/api?module=token&action=tokenholderlist&contractaddress=${t}&page=1&offset=10&apikey=YourApiKeyToken`, {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
+
const r = `https://api.routescan.io/v2/network/mainnet/evm/${o}/etherscan/api?module=token&action=tokenholderlist&contractaddress=${t}&page=1&offset=10&apikey=YourApiKeyToken`, { result: e } = await a.get(
|
|
56
|
+
r
|
|
57
|
+
);
|
|
58
|
+
return e.at(0)?.TokenHolderAddress;
|
|
59
|
+
}, eo = async (o, t) => {
|
|
55
60
|
try {
|
|
56
61
|
if (!(o in c))
|
|
57
62
|
throw new Error("Chain is not supported by blockscout");
|
|
58
|
-
const r = await
|
|
59
|
-
if (!r || !
|
|
63
|
+
const r = await k(o, t);
|
|
64
|
+
if (!r || !m.utils.isAddress(r))
|
|
60
65
|
throw new Error("Token holder not found in blockscout");
|
|
61
66
|
return r;
|
|
62
67
|
} catch {
|
|
@@ -64,5 +69,5 @@ const c = {
|
|
|
64
69
|
}
|
|
65
70
|
};
|
|
66
71
|
export {
|
|
67
|
-
|
|
72
|
+
eo as getTokenHolder
|
|
68
73
|
};
|
|
@@ -4,6 +4,8 @@ export * from './uniswapAPI';
|
|
|
4
4
|
export * from './odosAPI';
|
|
5
5
|
export * from './oneInchAPI';
|
|
6
6
|
export * from './lifiAPI';
|
|
7
|
+
export * from './okxAPI';
|
|
7
8
|
export * from './runContractFunction';
|
|
8
9
|
export * from './getTokenHolder';
|
|
9
10
|
export * from './EIP-712';
|
|
11
|
+
export * from './signAndSendSerializedTransaction';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("../../API/callOdosAPI.cjs");require("../../constants/token-data/index.cjs");const u=require("../../constants/chains.constants.cjs"),a=require("../../constants/protocol.constants.cjs");require("../../constants/contracts.constants.cjs");require("../../constants/kyc.constants.cjs");require("../../constants/server.constants.cjs");require("../../constants/vite.constants.cjs");require("../../constants/coingecko.constants.cjs");require("../../constants/reorg-depths.constants.cjs");require("../../constants/addresses.constants.cjs");require("../../constants/token.limits.constants.cjs");require("../../constants/presale.constants.cjs");require("../../constants/activity.constants.cjs");require("../../constants/tasks.constants.cjs");require("../../constants/events.constants.cjs");const d=require("../../error-handling/error-codes.constants.cjs"),l=require("./etherFunctions.cjs");require("../../types/circom-data.types.cjs");require("../../types/transactions.types.cjs");require("../../types/activities.types.cjs");require("../../API/getServerURL.cjs");require("../../data-structures/http/HttpClient.cjs");require("axios");require("ethers");require("circomlibjs-hinkal-fork");require("libsodium-wrappers");require("process");require("buffer");require("../../constants/save-depths.cjs");require("../utils/mutexes.utils.cjs");require("@coral-xyz/anchor");require("@solana/web3.js");require("../../data-structures/crypto-keys/keys.cjs");const A=async(r,e,t,i,n=.7)=>{try{const o={chainId:r!==31337?r:u.localhostNetwork,inputTokens:[{tokenAddress:e?.wrappedErc20TokenAddress??e.erc20TokenAddress,amount:l.getAmountInWei(e,i).toString()}],outputTokens:[{tokenAddress:t?.wrappedErc20TokenAddress??t.erc20TokenAddress,proportion:1}],userAddr:u.networkRegistry[r].contractData.odosExternalActionInstanceAddress||a.zeroAddress,slippageLimitPercent:n,disableRFQs:!0},{odosResponse:s,status:c}=await q.callOdosAPI(r,o);if(c!=="success")throw Error("Odos API Fetch Error");return{outSwapAmountValue:BigInt(s.outputTokens[0].amount),odosDataValue:s.transaction.data}}catch(o){throw console.log({error:o}),Error(d.transactionErrorCodes.NO_ODOS_PRICE)}};exports.getOdosPrice=A;
|
|
@@ -11,7 +11,6 @@ import "../../constants/reorg-depths.constants.mjs";
|
|
|
11
11
|
import "../../constants/addresses.constants.mjs";
|
|
12
12
|
import "../../constants/token.limits.constants.mjs";
|
|
13
13
|
import "../../constants/presale.constants.mjs";
|
|
14
|
-
import "../../constants/mystery-boxes.constants.mjs";
|
|
15
14
|
import "../../constants/activity.constants.mjs";
|
|
16
15
|
import "../../constants/tasks.constants.mjs";
|
|
17
16
|
import "../../constants/events.constants.mjs";
|
|
@@ -21,22 +20,26 @@ import "../../types/circom-data.types.mjs";
|
|
|
21
20
|
import "../../types/transactions.types.mjs";
|
|
22
21
|
import "../../types/activities.types.mjs";
|
|
23
22
|
import "../../API/getServerURL.mjs";
|
|
23
|
+
import "../../data-structures/http/HttpClient.mjs";
|
|
24
24
|
import "axios";
|
|
25
|
-
import "../utils/mutexes.utils.mjs";
|
|
26
25
|
import "ethers";
|
|
27
26
|
import "circomlibjs-hinkal-fork";
|
|
28
27
|
import "libsodium-wrappers";
|
|
29
28
|
import "process";
|
|
30
29
|
import "buffer";
|
|
31
30
|
import "../../constants/save-depths.mjs";
|
|
32
|
-
|
|
31
|
+
import "../utils/mutexes.utils.mjs";
|
|
32
|
+
import "@coral-xyz/anchor";
|
|
33
|
+
import "@solana/web3.js";
|
|
34
|
+
import "../../data-structures/crypto-keys/keys.mjs";
|
|
35
|
+
const S = async (r, o, s, e, p = 0.7) => {
|
|
33
36
|
try {
|
|
34
37
|
const t = {
|
|
35
38
|
chainId: r !== 31337 ? r : d,
|
|
36
39
|
inputTokens: [
|
|
37
40
|
{
|
|
38
41
|
tokenAddress: o?.wrappedErc20TokenAddress ?? o.erc20TokenAddress,
|
|
39
|
-
amount: A(o,
|
|
42
|
+
amount: A(o, e).toString()
|
|
40
43
|
}
|
|
41
44
|
],
|
|
42
45
|
outputTokens: [
|
|
@@ -49,20 +52,20 @@ const J = async (r, o, s, i, p = 0.7) => {
|
|
|
49
52
|
slippageLimitPercent: p,
|
|
50
53
|
disableRFQs: !0
|
|
51
54
|
// sometimes swap fails because of RFQs
|
|
52
|
-
}, { odosResponse:
|
|
55
|
+
}, { odosResponse: i, status: m } = await n(
|
|
53
56
|
r,
|
|
54
57
|
t
|
|
55
58
|
);
|
|
56
59
|
if (m !== "success")
|
|
57
60
|
throw Error("Odos API Fetch Error");
|
|
58
61
|
return {
|
|
59
|
-
outSwapAmountValue: BigInt(
|
|
60
|
-
odosDataValue:
|
|
62
|
+
outSwapAmountValue: BigInt(i.outputTokens[0].amount),
|
|
63
|
+
odosDataValue: i.transaction.data
|
|
61
64
|
};
|
|
62
65
|
} catch (t) {
|
|
63
66
|
throw console.log({ error: t }), Error(u.NO_ODOS_PRICE);
|
|
64
67
|
}
|
|
65
68
|
};
|
|
66
69
|
export {
|
|
67
|
-
|
|
70
|
+
S as getOdosPrice
|
|
68
71
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("@solana/web3.js"),m=require("./etherFunctions.cjs"),l=require("../../constants/chains.constants.cjs"),b=require("../pre-transaction/solana.cjs"),h=require("../../API/callOkxAPI.cjs"),d=(e,o,n,s,c=.7)=>({amount:`${n}`,chainIndex:"501",fromTokenAddress:e.toString(),toTokenAddress:o.toString(),userWalletAddress:s,slippagePercent:`${c}`,directRoute:!0}),q=async(e,o,n,s,c=.5,i,a)=>{if(!l.isSolanaLike(e))throw new Error("OKX is only supported on Solana");const g=m.getAmountInWei(o,s),{hinkalAddress:w,originalDeployer:u}=l.networkRegistry[e].contractData;if(!u)throw new Error("No original deployer configured for Solana program");if(a&&!i)throw new Error("Proxy wallet address is required");const A=new r.PublicKey(w),P=new r.PublicKey(u),k=a&&i?new r.PublicKey(i):b.getSwapperAccountPublicKey(A,P),p=new r.PublicKey(o.erc20TokenAddress),y=new r.PublicKey(n.erc20TokenAddress),K=d(p,y,g,k.toString(),c),{okxResponse:t,status:S}=await h.callOkxAPI(e,{quote:K});if(S!=="success")throw Error("OKX API Fetch Error");if(t.code!=="0")throw new Error(`OKX API error: ${t.msg}`);const f=BigInt(t.data.routerResult.toTokenAmount),O=JSON.stringify(t);return{outSwapAmountValue:f,okxDataValue:O}};exports.createOKXQuote=d;exports.getOKXPrice=q;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PublicKey } from '@solana/web3.js';
|
|
2
|
+
import { ERC20Token } from '../../types';
|
|
3
|
+
import { OKXQuote } from '../../types/okx.types';
|
|
4
|
+
export declare const createOKXQuote: (fromTokenAddress: PublicKey, toTokenAddress: PublicKey, amount: bigint, userWalletAddress: string, slippagePercent?: number) => OKXQuote;
|
|
5
|
+
export declare const getOKXPrice: (chainId: number, inSwapToken: ERC20Token, outSwapToken: ERC20Token, inSwapAmount: string, slippagePercentage?: number, proxyWalletAddress?: string, isProxyEnvironment?: boolean) => Promise<{
|
|
6
|
+
outSwapAmountValue: bigint;
|
|
7
|
+
okxDataValue: string;
|
|
8
|
+
}>;
|