@hinkal/common 0.2.15 → 0.2.16
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 +73 -34
- package/API/API.mjs +112 -59
- 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 -0
- package/API/admin-calls.d.ts +2 -0
- package/API/admin-calls.mjs +8 -0
- package/API/ai-calls.cjs +1 -1
- package/API/ai-calls.d.ts +8 -0
- package/API/ai-calls.mjs +16 -8
- package/API/brotherhoodCalls.cjs +1 -0
- package/API/brotherhoodCalls.d.ts +82 -0
- package/API/brotherhoodCalls.mjs +59 -0
- package/API/callLifiAPI.cjs +1 -0
- package/API/callLifiAPI.d.ts +33 -0
- package/API/callLifiAPI.mjs +11 -0
- package/API/callMonitor.cjs +1 -1
- package/API/callMonitor.mjs +5 -2
- package/API/callOdosAPI.cjs +1 -1
- package/API/callOdosAPI.mjs +12 -13
- 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 +9 -8
- package/API/callRelayer.cjs +1 -1
- package/API/callRelayer.d.ts +17 -0
- package/API/callRelayer.mjs +15 -6
- package/API/checkRisk.cjs +1 -1
- package/API/checkRisk.mjs +5 -4
- package/API/duneAPI.cjs +1 -1
- package/API/duneAPI.mjs +7 -5
- package/API/enclaveCalls.cjs +1 -0
- package/API/enclaveCalls.d.ts +9 -0
- package/API/enclaveCalls.mjs +11 -0
- package/API/fetchCommitmentsCache.cjs +1 -1
- package/API/fetchCommitmentsCache.d.ts +12 -4
- package/API/fetchCommitmentsCache.mjs +21 -7
- package/API/generate-trading-points.cjs +1 -0
- package/API/generate-trading-points.d.ts +27 -0
- package/API/generate-trading-points.mjs +45 -0
- package/API/get-token-data.cjs +1 -0
- package/API/get-token-data.d.ts +6 -0
- package/API/get-token-data.mjs +8 -0
- package/API/getBridgeProtocols.cjs +1 -0
- package/API/getBridgeProtocols.d.ts +7 -0
- package/API/getBridgeProtocols.mjs +8 -0
- package/API/getGasEstimates.cjs +1 -1
- package/API/getGasEstimates.d.ts +2 -2
- package/API/getGasEstimates.mjs +10 -10
- package/API/getLifiStatus.cjs +1 -0
- package/API/getLifiStatus.d.ts +24 -0
- package/API/getLifiStatus.mjs +15 -0
- package/API/getRelayerURL.cjs +1 -1
- package/API/getRelayerURL.mjs +6 -6
- package/API/getServerURL.cjs +1 -1
- package/API/getServerURL.d.ts +3 -1
- package/API/getServerURL.mjs +60 -29
- package/API/getTokenPrice.cjs +1 -1
- package/API/getTokenPrice.d.ts +0 -11
- package/API/getTokenPrice.mjs +8 -16
- package/API/getWebsiteURL.cjs +1 -0
- package/API/getWebsiteURL.d.ts +3 -0
- package/API/getWebsiteURL.mjs +56 -0
- package/API/index.d.ts +9 -3
- package/API/is-tx-stateless.cjs +1 -1
- package/API/is-tx-stateless.d.ts +4 -2
- package/API/is-tx-stateless.mjs +18 -7
- package/API/kycCalls.cjs +1 -1
- package/API/kycCalls.d.ts +4 -7
- package/API/kycCalls.mjs +34 -32
- package/API/leaderboardCalls.cjs +1 -0
- package/API/leaderboardCalls.d.ts +14 -0
- package/API/leaderboardCalls.mjs +16 -0
- package/API/proxyAccountsCalls.cjs +1 -0
- package/API/proxyAccountsCalls.d.ts +4 -0
- package/API/proxyAccountsCalls.mjs +26 -0
- package/API/referralsCalls.cjs +1 -0
- package/API/referralsCalls.d.ts +22 -0
- package/API/referralsCalls.mjs +22 -0
- package/API/relayCalls.cjs +1 -1
- package/API/relayCalls.d.ts +1 -1
- package/API/relayCalls.mjs +8 -5
- 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 +4 -3
- package/API/rewardsUserCalls.cjs +1 -0
- package/API/rewardsUserCalls.d.ts +51 -0
- package/API/rewardsUserCalls.mjs +44 -0
- package/API/scheduled-transactions-calls.cjs +1 -0
- package/API/scheduled-transactions-calls.d.ts +6 -0
- package/API/scheduled-transactions-calls.mjs +9 -0
- 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 -0
- package/API/send-telegram-callback.d.ts +7 -0
- package/API/send-telegram-callback.mjs +11 -0
- package/API/simulate-batch-tx.cjs +1 -0
- package/API/simulate-batch-tx.d.ts +3 -0
- package/API/simulate-batch-tx.mjs +13 -0
- 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 +24 -22
- package/API/token-calls.cjs +1 -1
- package/API/token-calls.d.ts +1 -1
- package/API/token-calls.mjs +12 -7
- package/API/unspent-utxos-calls.cjs +1 -0
- package/API/unspent-utxos-calls.d.ts +26 -0
- package/API/unspent-utxos-calls.mjs +27 -0
- package/API/weeklyAnalyticCalls.cjs +1 -0
- package/API/weeklyAnalyticCalls.d.ts +22 -0
- package/API/weeklyAnalyticCalls.mjs +16 -0
- package/README.md +61 -0
- package/constants/activity.constants.cjs +1 -0
- package/constants/activity.constants.d.ts +2 -0
- package/constants/activity.constants.mjs +14 -0
- package/constants/addresses.constants.cjs +1 -1
- package/constants/addresses.constants.d.ts +9 -0
- package/constants/addresses.constants.mjs +71 -41
- package/constants/backend.constants.cjs +1 -1
- package/constants/backend.constants.d.ts +3 -1
- package/constants/backend.constants.mjs +6 -7
- package/constants/bridging.constants.cjs +1 -0
- package/constants/bridging.constants.d.ts +5 -0
- package/constants/bridging.constants.mjs +8 -0
- package/constants/chains.constants.cjs +1 -1
- package/constants/chains.constants.d.ts +8 -3
- package/constants/chains.constants.mjs +88 -79
- package/constants/coingecko.constants.cjs +1 -1
- package/constants/coingecko.constants.d.ts +4 -1
- package/constants/coingecko.constants.mjs +25 -15
- package/constants/contracts.constants.cjs +1 -1
- package/constants/contracts.constants.mjs +74 -252
- package/constants/deploy-data/deploy-data-arbMainnet.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-arbMainnet.json.mjs +1487 -8687
- package/constants/deploy-data/deploy-data-arcTestnet.json.cjs +1 -0
- package/constants/deploy-data/deploy-data-arcTestnet.json.mjs +7381 -0
- package/constants/deploy-data/deploy-data-avalanche.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-avalanche.json.mjs +258 -8430
- package/constants/deploy-data/deploy-data-base.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-base.json.mjs +1491 -8681
- package/constants/deploy-data/deploy-data-bnbMainnet.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-bnbMainnet.json.mjs +258 -7898
- package/constants/deploy-data/deploy-data-ethMainnet.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-ethMainnet.json.mjs +1835 -8845
- package/constants/deploy-data/deploy-data-localhost.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-localhost.json.mjs +1209 -10210
- package/constants/deploy-data/deploy-data-optimism.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-optimism.json.mjs +1491 -8681
- package/constants/deploy-data/deploy-data-polygon.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-polygon.json.mjs +1491 -8681
- 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 +3 -3
- package/constants/events.constants.cjs +1 -0
- package/constants/events.constants.d.ts +1 -0
- package/constants/events.constants.mjs +12 -0
- package/constants/fees.constants.cjs +1 -1
- package/constants/fees.constants.d.ts +1 -12
- package/constants/fees.constants.mjs +4 -35
- package/constants/function-signatures.constants.cjs +1 -0
- package/constants/function-signatures.constants.d.ts +5 -0
- package/constants/function-signatures.constants.mjs +8 -0
- package/constants/index.d.ts +11 -6
- package/constants/kyc.constants.cjs +1 -1
- package/constants/kyc.constants.mjs +23 -35
- package/constants/lifi.constants.cjs +1 -0
- package/constants/lifi.constants.d.ts +1 -0
- package/constants/lifi.constants.mjs +4 -0
- package/constants/link.constant.cjs +1 -0
- package/constants/link.constant.d.ts +1 -0
- package/constants/link.constant.mjs +4 -0
- package/constants/mediaUrls.constants.cjs +1 -1
- package/constants/mediaUrls.constants.d.ts +10 -0
- package/constants/mediaUrls.constants.mjs +14 -4
- package/constants/oauthUrls.constants.cjs +1 -0
- package/constants/oauthUrls.constants.d.ts +7 -0
- package/constants/oauthUrls.constants.mjs +10 -0
- package/constants/okx.constants.cjs +1 -0
- package/constants/okx.constants.d.ts +2 -0
- package/constants/okx.constants.mjs +5 -0
- package/constants/permit2.constants.cjs +1 -1
- package/constants/permit2.constants.d.ts +6 -0
- package/constants/permit2.constants.mjs +14 -2
- package/constants/presale.constants.cjs +1 -0
- package/constants/presale.constants.d.ts +78 -0
- package/{externalABIs/LidoWstEthAbi.json.mjs → constants/presale.constants.mjs} +242 -218
- package/constants/protocol.constants.cjs +1 -1
- package/constants/protocol.constants.d.ts +32 -11
- package/constants/protocol.constants.mjs +44 -36
- package/constants/reorg-depths.constants.cjs +1 -1
- package/constants/reorg-depths.constants.mjs +14 -11
- package/constants/rewards.constants.cjs +1 -1
- package/constants/rewards.constants.d.ts +3 -4
- package/constants/rewards.constants.mjs +14 -21
- package/constants/save-depths.cjs +1 -0
- package/constants/save-depths.d.ts +3 -0
- package/constants/save-depths.mjs +19 -0
- package/constants/server.constants.cjs +1 -1
- package/constants/server.constants.d.ts +103 -79
- package/constants/server.constants.mjs +195 -148
- package/constants/tasks.constants.cjs +1 -0
- package/constants/tasks.constants.d.ts +9 -0
- package/constants/tasks.constants.mjs +230 -0
- package/constants/token-data/ERC20Registry.cjs +1 -1
- package/constants/token-data/ERC20Registry.mjs +50 -33
- package/constants/token-data/arbMainnetRegistry.json.cjs +1 -1
- package/constants/token-data/arbMainnetRegistry.json.mjs +1185 -526
- package/constants/token-data/arbMainnetRegistryFixed.json.cjs +1 -1
- package/constants/token-data/arbMainnetRegistryFixed.json.mjs +1218 -463
- package/constants/token-data/arcTestnetRegistry.json.cjs +1 -0
- package/constants/token-data/arcTestnetRegistry.json.mjs +439 -0
- package/constants/token-data/avalancheRegistry.json.cjs +1 -1
- package/constants/token-data/avalancheRegistry.json.mjs +296 -322
- package/constants/token-data/avalancheRegistryFixed.json.cjs +1 -1
- package/constants/token-data/avalancheRegistryFixed.json.mjs +297 -323
- package/constants/token-data/baseRegistry.json.cjs +1 -1
- package/constants/token-data/baseRegistry.json.mjs +715 -232
- package/constants/token-data/baseRegistryFixed.json.cjs +1 -1
- package/constants/token-data/baseRegistryFixed.json.mjs +736 -217
- package/constants/token-data/bnbMainnetRegistry.json.cjs +1 -1
- package/constants/token-data/bnbMainnetRegistry.json.mjs +444 -516
- package/constants/token-data/bnbMainnetRegistryFixed.json.cjs +1 -1
- package/constants/token-data/bnbMainnetRegistryFixed.json.mjs +444 -516
- package/constants/token-data/ethMainnetRegistry.json.cjs +1 -1
- package/constants/token-data/ethMainnetRegistry.json.mjs +2710 -1798
- package/constants/token-data/ethMainnetRegistryFixed.json.cjs +1 -1
- package/constants/token-data/ethMainnetRegistryFixed.json.mjs +2894 -1494
- package/constants/token-data/index.cjs +1 -1
- package/constants/token-data/index.d.ts +228 -291
- package/constants/token-data/index.mjs +34 -28
- package/constants/token-data/localhostRegistry.json.cjs +1 -1
- package/constants/token-data/localhostRegistry.json.mjs +3 -3
- package/constants/token-data/optimismRegistry.json.cjs +1 -1
- package/constants/token-data/optimismRegistry.json.mjs +129 -1402
- package/constants/token-data/optimismRegistryFixed.json.cjs +1 -1
- package/constants/token-data/optimismRegistryFixed.json.mjs +129 -1322
- package/constants/token-data/polygonRegistry.json.cjs +1 -1
- package/constants/token-data/polygonRegistry.json.mjs +1395 -784
- package/constants/token-data/polygonRegistryFixed.json.cjs +1 -1
- package/constants/token-data/polygonRegistryFixed.json.mjs +1447 -746
- 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/constants/token-data/tokenPricing.consts.d.ts +0 -3
- package/constants/vite.constants.cjs +1 -1
- package/constants/vite.constants.d.ts +7 -11
- package/constants/vite.constants.mjs +13 -38
- package/constants/wallet.constants.cjs +1 -0
- package/constants/wallet.constants.d.ts +7 -0
- package/constants/wallet.constants.mjs +10 -0
- package/crypto/preProcessing.cjs +1 -1
- package/crypto/preProcessing.mjs +3 -3
- package/data-structures/ApprovalDBs/EventsPublicApprovalsDB.cjs +1 -0
- package/data-structures/ApprovalDBs/EventsPublicApprovalsDB.d.ts +18 -0
- package/data-structures/ApprovalDBs/EventsPublicApprovalsDB.mjs +175 -0
- package/data-structures/ApprovalDBs/index.d.ts +1 -0
- package/data-structures/Hinkal/Hinkal.cjs +1 -1
- package/data-structures/Hinkal/Hinkal.d.ts +40 -46
- package/data-structures/Hinkal/Hinkal.mjs +344 -191
- package/data-structures/Hinkal/IHinkal.d.ts +39 -45
- package/data-structures/Hinkal/handleAutoDepositBack.cjs +1 -0
- package/data-structures/Hinkal/handleAutoDepositBack.d.ts +5 -0
- package/data-structures/Hinkal/handleAutoDepositBack.mjs +108 -0
- package/data-structures/Hinkal/hinkalActionFundApproveAndTransact.cjs +1 -1
- package/data-structures/Hinkal/hinkalActionFundApproveAndTransact.d.ts +5 -1
- package/data-structures/Hinkal/hinkalActionFundApproveAndTransact.mjs +31 -50
- package/data-structures/Hinkal/hinkalActionReceive.cjs +1 -1
- package/data-structures/Hinkal/hinkalActionReceive.d.ts +4 -1
- package/data-structures/Hinkal/hinkalActionReceive.mjs +33 -31
- package/data-structures/Hinkal/hinkalApprove.cjs +1 -1
- package/data-structures/Hinkal/hinkalApprove.d.ts +2 -1
- package/data-structures/Hinkal/hinkalApprove.mjs +73 -78
- 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 +46 -7
- package/data-structures/Hinkal/hinkalDeposit.cjs +1 -1
- package/data-structures/Hinkal/hinkalDeposit.mjs +76 -62
- package/data-structures/Hinkal/hinkalDepositAndWithdraw.cjs +1 -0
- package/data-structures/Hinkal/hinkalDepositAndWithdraw.d.ts +4 -0
- package/data-structures/Hinkal/hinkalDepositAndWithdraw.mjs +188 -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/hinkalGetZkMeProvider.d.ts +27 -2
- package/data-structures/Hinkal/hinkalInsideTransact.cjs +1 -1
- package/data-structures/Hinkal/hinkalInsideTransact.d.ts +3 -1
- package/data-structures/Hinkal/hinkalInsideTransact.mjs +84 -74
- 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 +4 -1
- package/data-structures/Hinkal/hinkalPrivateWallet.mjs +127 -73
- package/data-structures/Hinkal/hinkalProxySwap.cjs +1 -1
- package/data-structures/Hinkal/hinkalProxySwap.d.ts +4 -1
- package/data-structures/Hinkal/hinkalProxySwap.mjs +48 -24
- 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.d.ts +3 -2
- package/data-structures/Hinkal/hinkalSignSubAccount.mjs +19 -17
- 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 +236 -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 +119 -0
- package/data-structures/Hinkal/hinkalSolanaTransfer.cjs +1 -0
- package/data-structures/Hinkal/hinkalSolanaTransfer.d.ts +3 -0
- package/data-structures/Hinkal/hinkalSolanaTransfer.mjs +89 -0
- package/data-structures/Hinkal/hinkalSolanaWithdraw.cjs +1 -0
- package/data-structures/Hinkal/hinkalSolanaWithdraw.d.ts +3 -0
- package/data-structures/Hinkal/hinkalSolanaWithdraw.mjs +105 -0
- package/data-structures/Hinkal/hinkalSwap.cjs +1 -1
- package/data-structures/Hinkal/hinkalSwap.d.ts +3 -1
- package/data-structures/Hinkal/hinkalSwap.mjs +103 -58
- package/data-structures/Hinkal/hinkalTransfer.cjs +1 -1
- package/data-structures/Hinkal/hinkalTransfer.d.ts +4 -1
- package/data-structures/Hinkal/hinkalTransfer.mjs +127 -2
- package/data-structures/Hinkal/hinkalWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalWithdraw.d.ts +2 -2
- package/data-structures/Hinkal/hinkalWithdraw.mjs +95 -60
- package/data-structures/Hinkal/hinkalWithdrawStuckUtxos.cjs +1 -0
- package/data-structures/Hinkal/hinkalWithdrawStuckUtxos.d.ts +4 -0
- package/data-structures/Hinkal/hinkalWithdrawStuckUtxos.mjs +147 -0
- package/data-structures/Hinkal/index.d.ts +5 -4
- package/data-structures/Hinkal/resetMerkleTrees.cjs +1 -1
- package/data-structures/Hinkal/resetMerkleTrees.mjs +59 -27
- package/data-structures/IndexedDB/activity-db.cjs +1 -1
- package/data-structures/IndexedDB/activity-db.d.ts +2 -3
- package/data-structures/IndexedDB/activity-db.mjs +146 -83
- package/data-structures/IndexedDB/balances-db.cjs +1 -1
- package/data-structures/IndexedDB/balances-db.d.ts +1 -1
- package/data-structures/IndexedDB/balances-db.mjs +59 -41
- package/data-structures/IndexedDB/contact-db.cjs +1 -1
- package/data-structures/IndexedDB/contact-db.mjs +83 -29
- package/data-structures/IndexedDB/index.d.ts +1 -0
- package/data-structures/IndexedDB/signatures-db.cjs +1 -0
- package/data-structures/IndexedDB/signatures-db.d.ts +10 -0
- package/data-structures/IndexedDB/signatures-db.mjs +63 -0
- 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 -0
- package/data-structures/TokenDBs/AlchemyPublicTokensDB.d.ts +19 -0
- package/data-structures/TokenDBs/AlchemyPublicTokensDB.mjs +204 -0
- package/data-structures/TokenDBs/ArcPublicTokensDB.cjs +1 -0
- package/data-structures/TokenDBs/ArcPublicTokensDB.d.ts +11 -0
- package/data-structures/TokenDBs/ArcPublicTokensDB.mjs +112 -0
- package/data-structures/TokenDBs/EventsPublicTokensDB.cjs +1 -0
- package/data-structures/TokenDBs/EventsPublicTokensDB.d.ts +17 -0
- package/data-structures/TokenDBs/EventsPublicTokensDB.mjs +173 -0
- package/data-structures/TokenDBs/IPublicTokensDB.d.ts +6 -0
- package/data-structures/TokenDBs/PrivateTokensDB.cjs +1 -1
- package/data-structures/TokenDBs/PrivateTokensDB.mjs +48 -36
- package/data-structures/TokenDBs/PublicTokensDB.cjs +1 -1
- package/data-structures/TokenDBs/PublicTokensDB.d.ts +4 -8
- package/data-structures/TokenDBs/PublicTokensDB.mjs +21 -75
- package/data-structures/TokenDBs/index.d.ts +2 -0
- package/data-structures/TokenDBs/token-visibility-db.cjs +1 -0
- package/data-structures/TokenDBs/token-visibility-db.d.ts +17 -0
- package/data-structures/TokenDBs/token-visibility-db.mjs +96 -0
- 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 +21 -0
- package/data-structures/crypto-keys/keys.mjs +118 -38
- package/data-structures/event-service/evm/AbstractAccessTokenSnapshotService.cjs +1 -0
- package/data-structures/event-service/{AbstractAccessTokenSnapshotService.d.ts → evm/AbstractAccessTokenSnapshotService.d.ts} +4 -5
- package/data-structures/event-service/{AbstractAccessTokenSnapshotService.mjs → evm/AbstractAccessTokenSnapshotService.mjs} +12 -23
- package/data-structures/event-service/evm/AbstractApprovalsSnapshotService.cjs +1 -0
- package/data-structures/event-service/{AbstractApprovalsSnapshotService.d.ts → evm/AbstractApprovalsSnapshotService.d.ts} +4 -5
- package/data-structures/event-service/evm/AbstractApprovalsSnapshotService.mjs +92 -0
- package/data-structures/event-service/evm/AbstractCommitmentsSnapshotService.cjs +1 -0
- package/data-structures/event-service/{AbstractCommitmentsSnapshotService.d.ts → evm/AbstractCommitmentsSnapshotService.d.ts} +5 -6
- package/data-structures/event-service/evm/AbstractCommitmentsSnapshotService.mjs +86 -0
- package/data-structures/event-service/evm/AbstractEventService.cjs +1 -0
- package/data-structures/event-service/evm/AbstractEventService.d.ts +12 -0
- package/data-structures/event-service/evm/AbstractEventService.mjs +37 -0
- package/data-structures/event-service/evm/AbstractNullifierSnapshotService.cjs +1 -0
- package/data-structures/event-service/{AbstractNullifierSnapshotService.d.ts → evm/AbstractNullifierSnapshotService.d.ts} +4 -4
- package/data-structures/event-service/evm/AbstractNullifierSnapshotService.mjs +48 -0
- package/data-structures/event-service/evm/AbstractSnapshotService.cjs +1 -0
- package/data-structures/event-service/{AbstractSnapshotService.d.ts → evm/AbstractSnapshotService.d.ts} +6 -7
- package/data-structures/event-service/evm/AbstractSnapshotService.mjs +33 -0
- package/data-structures/event-service/evm/BlockchainEventEmitter.cjs +1 -0
- package/data-structures/event-service/evm/BlockchainEventEmitter.d.ts +26 -0
- package/data-structures/event-service/evm/BlockchainEventEmitter.mjs +90 -0
- package/data-structures/event-service/index.d.ts +13 -6
- 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 +41 -0
- package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.mjs +154 -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 +4 -1
- package/data-structures/presale/PresaleContractWrapper.cjs +1 -0
- package/data-structures/presale/PresaleContractWrapper.d.ts +23 -0
- package/data-structures/presale/PresaleContractWrapper.mjs +54 -0
- package/data-structures/presale/index.d.ts +1 -0
- package/data-structures/provider-adapter/IProviderAdapter.d.ts +4 -3
- package/data-structures/snapshot/SnapshotFetcherService.cjs +1 -0
- package/data-structures/snapshot/SnapshotFetcherService.d.ts +16 -0
- package/data-structures/snapshot/SnapshotFetcherService.mjs +42 -0
- package/data-structures/snapshot/evm-snapshots/ClientAccessTokenSnapshotService.cjs +1 -0
- package/data-structures/snapshot/{ClientAccessTokenSnapshotService.d.ts → evm-snapshots/ClientAccessTokenSnapshotService.d.ts} +4 -3
- package/data-structures/snapshot/evm-snapshots/ClientAccessTokenSnapshotService.mjs +41 -0
- package/data-structures/snapshot/evm-snapshots/ClientApprovalsSnapshotService.cjs +1 -0
- package/data-structures/snapshot/{ClientApprovalsSnapshotService.d.ts → evm-snapshots/ClientApprovalsSnapshotService.d.ts} +4 -4
- package/data-structures/snapshot/evm-snapshots/ClientApprovalsSnapshotService.mjs +43 -0
- package/data-structures/snapshot/evm-snapshots/ClientCommitmentsSnapshotService.cjs +1 -0
- package/data-structures/snapshot/evm-snapshots/ClientCommitmentsSnapshotService.d.ts +8 -0
- package/data-structures/snapshot/evm-snapshots/ClientCommitmentsSnapshotService.mjs +35 -0
- package/data-structures/snapshot/evm-snapshots/ClientNullifierSnapshotService.cjs +1 -0
- package/data-structures/snapshot/evm-snapshots/ClientNullifierSnapshotService.d.ts +8 -0
- package/data-structures/snapshot/evm-snapshots/ClientNullifierSnapshotService.mjs +34 -0
- package/data-structures/snapshot/index.d.ts +8 -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.d.ts +1 -13
- package/data-structures/token-price-fetcher/TokenChecker.mjs +13 -26
- package/data-structures/transactions-manager/history/history.types.cjs +1 -1
- package/data-structures/transactions-manager/history/history.types.d.ts +2 -81
- package/data-structures/transactions-manager/history/history.types.mjs +2 -42
- package/data-structures/transactions-manager/index.d.ts +0 -1
- 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/customErrors/ErrorWithTx.cjs +1 -0
- package/error-handling/customErrors/ErrorWithTx.d.ts +5 -0
- package/error-handling/customErrors/ErrorWithTx.mjs +9 -0
- package/error-handling/customErrors/SimulationFailureError.cjs +1 -0
- package/error-handling/customErrors/SimulationFailureError.d.ts +10 -0
- package/error-handling/customErrors/SimulationFailureError.mjs +9 -0
- package/error-handling/customErrors/index.d.ts +2 -0
- package/error-handling/error-codes.constants.cjs +2 -2
- package/error-handling/error-codes.constants.d.ts +19 -20
- package/error-handling/error-codes.constants.mjs +178 -179
- package/error-handling/get-error.message.cjs +1 -1
- package/error-handling/get-error.message.d.ts +2 -0
- package/error-handling/get-error.message.mjs +81 -36
- package/error-handling/index.d.ts +1 -2
- package/error-handling/types.cjs +1 -1
- package/error-handling/types.d.ts +4 -1
- package/error-handling/types.mjs +2 -2
- package/externalABIs/ERC1155.json.cjs +1 -0
- package/externalABIs/ERC1155.json.mjs +320 -0
- package/externalABIs/ERC721.json.cjs +1 -0
- package/externalABIs/{BeefyZapOneInchAbi.json.mjs → ERC721.json.mjs} +162 -167
- package/externalABIs/NodeInterfaceABI.json.cjs +1 -0
- package/externalABIs/NodeInterfaceABI.json.mjs +280 -0
- package/externalABIs/index.cjs +1 -1
- package/externalABIs/index.d.ts +25 -79
- package/externalABIs/index.mjs +18 -20
- package/externalABIs/swapAbi.cjs +1 -0
- package/externalABIs/{BeefyZapAbi.json.mjs → swapAbi.mjs} +161 -81
- package/functions/connectors.types.d.ts +14 -0
- package/functions/index.d.ts +1 -1
- 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 -0
- package/functions/pre-transaction/constructAdminData.d.ts +3 -0
- package/functions/pre-transaction/constructAdminData.mjs +33 -0
- 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/getExternalSwapAddress.cjs +1 -1
- package/functions/pre-transaction/getExternalSwapAddress.mjs +9 -6
- package/functions/pre-transaction/getFeeStructure.cjs +1 -1
- package/functions/pre-transaction/getFeeStructure.d.ts +2 -2
- package/functions/pre-transaction/getFeeStructure.mjs +8 -9
- package/functions/pre-transaction/getFlatFees.cjs +1 -1
- package/functions/pre-transaction/getFlatFees.d.ts +2 -2
- package/functions/pre-transaction/getFlatFees.mjs +43 -166
- 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 -0
- package/functions/pre-transaction/getVolatileTransferAmount.d.ts +9 -0
- package/functions/pre-transaction/getVolatileTransferAmount.mjs +53 -0
- package/functions/pre-transaction/index.d.ts +12 -1
- 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/interaction-to-action.cjs +1 -1
- package/functions/pre-transaction/interaction-to-action.d.ts +2 -2
- package/functions/pre-transaction/interaction-to-action.mjs +6 -53
- package/functions/pre-transaction/merge-with-fee-structure-emporium.cjs +1 -0
- package/functions/pre-transaction/merge-with-fee-structure-emporium.d.ts +3 -0
- package/functions/pre-transaction/merge-with-fee-structure-emporium.mjs +24 -0
- package/functions/pre-transaction/merge-with-fee-structure.cjs +1 -1
- package/functions/pre-transaction/merge-with-fee-structure.mjs +15 -17
- package/functions/pre-transaction/outputApprovalDataProcessing.cjs +1 -1
- package/functions/pre-transaction/outputApprovalDataProcessing.d.ts +1 -0
- package/functions/pre-transaction/outputApprovalDataProcessing.mjs +32 -35
- package/functions/pre-transaction/outputUtxoProcessing.cjs +1 -1
- package/functions/pre-transaction/outputUtxoProcessing.d.ts +1 -1
- package/functions/pre-transaction/outputUtxoProcessing.mjs +31 -18
- 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 +9 -9
- 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.d.ts +20 -7
- package/functions/private-wallet/emporium.helpers.mjs +171 -95
- package/functions/private-wallet/emporium.swap.helpers.cjs +1 -1
- package/functions/private-wallet/emporium.swap.helpers.d.ts +3 -1
- package/functions/private-wallet/emporium.swap.helpers.mjs +134 -69
- package/functions/private-wallet/index.d.ts +0 -1
- package/functions/snarkjs/common.snarkjs.cjs +1 -1
- package/functions/snarkjs/common.snarkjs.d.ts +5 -1
- package/functions/snarkjs/common.snarkjs.mjs +70 -69
- package/functions/snarkjs/constant.cjs +1 -1
- package/functions/snarkjs/constant.d.ts +64 -6
- package/functions/snarkjs/constant.mjs +93 -29
- package/functions/snarkjs/constructEmporiumProof.cjs +1 -1
- package/functions/snarkjs/constructEmporiumProof.d.ts +7 -6
- package/functions/snarkjs/constructEmporiumProof.mjs +146 -149
- package/functions/snarkjs/constructGeneralZkProof.cjs +1 -1
- package/functions/snarkjs/constructGeneralZkProof.d.ts +4 -4
- package/functions/snarkjs/constructGeneralZkProof.mjs +115 -118
- package/functions/snarkjs/constructSolanaZkProof.cjs +1 -0
- package/functions/snarkjs/constructSolanaZkProof.d.ts +13 -0
- package/functions/snarkjs/constructSolanaZkProof.mjs +105 -0
- package/functions/snarkjs/fetchMerkleTreeSiblings.cjs +1 -0
- package/functions/snarkjs/fetchMerkleTreeSiblings.d.ts +11 -0
- package/functions/snarkjs/fetchMerkleTreeSiblings.mjs +22 -0
- package/functions/snarkjs/generateCircomData.cjs +1 -1
- package/functions/snarkjs/generateCircomData.d.ts +1 -1
- package/functions/snarkjs/generateCircomData.mjs +23 -23
- package/functions/snarkjs/generateZkProof.cjs +1 -1
- package/functions/snarkjs/generateZkProof.mjs +13 -4
- package/functions/snarkjs/generateZkProofEnclave.cjs +1 -1
- package/functions/snarkjs/generateZkProofEnclave.mjs +13 -12
- package/functions/snarkjs/getMerkleTreeSiblingsAndRootHashes.cjs +1 -0
- package/functions/snarkjs/getMerkleTreeSiblingsAndRootHashes.d.ts +13 -0
- package/functions/snarkjs/getMerkleTreeSiblingsAndRootHashes.mjs +92 -0
- 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 +2 -1
- package/functions/utils/addresses.mjs +21 -15
- package/functions/utils/amounts.utils.cjs +1 -1
- package/functions/utils/amounts.utils.d.ts +3 -0
- package/functions/utils/amounts.utils.mjs +54 -28
- 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 +8 -5
- package/functions/utils/cacheFunctions.cjs +1 -1
- package/functions/utils/cacheFunctions.mjs +53 -52
- package/functions/utils/caseInsensitive.utils.cjs +1 -1
- package/functions/utils/caseInsensitive.utils.d.ts +1 -1
- package/functions/utils/caseInsensitive.utils.mjs +3 -3
- package/functions/utils/convertEmporiumOpToCallInfo.cjs +1 -1
- package/functions/utils/convertEmporiumOpToCallInfo.d.ts +1 -1
- package/functions/utils/convertEmporiumOpToCallInfo.mjs +6 -5
- package/functions/utils/convertIntegrationProviderToExternalActionId.cjs +1 -1
- package/functions/utils/convertIntegrationProviderToExternalActionId.mjs +5 -4
- package/functions/utils/create-provider.cjs +1 -1
- package/functions/utils/create-provider.d.ts +4 -0
- package/functions/utils/create-provider.mjs +9 -2
- 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 +22 -21
- package/functions/utils/erc20tokenFunctions.cjs +1 -1
- package/functions/utils/erc20tokenFunctions.d.ts +7 -2
- package/functions/utils/erc20tokenFunctions.mjs +54 -21
- package/functions/utils/ethers-formatter.utils.cjs +1 -0
- package/functions/utils/ethers-formatter.utils.d.ts +5 -0
- package/functions/utils/ethers-formatter.utils.mjs +59 -0
- package/functions/utils/evmNetworkFunctions.cjs +1 -1
- package/functions/utils/evmNetworkFunctions.mjs +10 -7
- package/functions/utils/external-action.utils.cjs +1 -1
- package/functions/utils/external-action.utils.d.ts +0 -5
- package/functions/utils/external-action.utils.mjs +8 -56
- package/functions/utils/fees.utils.cjs +1 -1
- package/functions/utils/fees.utils.d.ts +3 -0
- package/functions/utils/fees.utils.mjs +29 -8
- package/functions/utils/get-hinkal-approvals.cjs +1 -0
- package/functions/utils/get-hinkal-approvals.d.ts +3 -0
- package/functions/utils/get-hinkal-approvals.mjs +38 -0
- package/functions/utils/get-signature-header.cjs +1 -0
- package/functions/utils/get-signature-header.d.ts +5 -0
- package/functions/utils/get-signature-header.mjs +8 -0
- package/functions/utils/getBlockExplorerUrl.cjs +1 -1
- package/functions/utils/getBlockExplorerUrl.mjs +3 -3
- package/functions/utils/getDataFromTransaction.cjs +1 -1
- package/functions/utils/getDataFromTransaction.d.ts +3 -4
- package/functions/utils/getDataFromTransaction.mjs +25 -44
- 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/inLogicMetadata.cjs +1 -0
- package/functions/utils/inLogicMetadata.d.ts +2 -0
- package/functions/utils/inLogicMetadata.mjs +8 -0
- package/functions/utils/index.d.ts +16 -2
- package/functions/utils/involves-permit2-op.cjs +1 -1
- package/functions/utils/involves-permit2-op.d.ts +8 -1
- package/functions/utils/involves-permit2-op.mjs +7 -3
- package/functions/utils/ipfs.cjs +1 -0
- package/functions/utils/ipfs.d.ts +8 -0
- package/functions/utils/ipfs.mjs +25 -0
- package/functions/utils/is-valid-url.cjs +1 -0
- package/functions/utils/is-valid-url.d.ts +1 -0
- package/functions/utils/is-valid-url.mjs +4 -0
- package/functions/utils/lifi.utils.d.ts +1 -0
- package/functions/utils/mutexes.utils.cjs +1 -0
- package/functions/utils/mutexes.utils.d.ts +2 -0
- package/functions/utils/mutexes.utils.mjs +5 -0
- package/functions/utils/networks.utils.cjs +1 -0
- package/functions/utils/networks.utils.d.ts +1 -0
- package/functions/utils/networks.utils.mjs +21 -0
- package/functions/utils/nftTokenFunctions.cjs +1 -0
- package/functions/utils/nftTokenFunctions.d.ts +2 -0
- package/functions/utils/nftTokenFunctions.mjs +40 -0
- package/functions/utils/postToOffscreen.cjs +1 -0
- package/functions/utils/postToOffscreen.d.ts +2 -0
- package/functions/utils/postToOffscreen.mjs +6 -0
- package/functions/utils/prepareHinkal.cjs +1 -0
- package/functions/utils/prepareHinkal.d.ts +14 -2
- package/functions/utils/prepareHinkal.mjs +88 -0
- package/functions/utils/publicBalance.utils.cjs +1 -1
- package/functions/utils/publicBalance.utils.d.ts +5 -3
- package/functions/utils/publicBalance.utils.mjs +95 -15
- 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/string.utils.cjs +1 -1
- package/functions/utils/string.utils.d.ts +3 -0
- package/functions/utils/string.utils.mjs +10 -4
- package/functions/utils/time.utils.cjs +1 -1
- package/functions/utils/time.utils.d.ts +11 -0
- package/functions/utils/time.utils.mjs +52 -4
- package/functions/utils/trimFieldValues.cjs +1 -0
- package/functions/utils/trimFieldValues.d.ts +4 -0
- package/functions/utils/trimFieldValues.mjs +17 -0
- package/functions/utils/userAgent.cjs +1 -1
- package/functions/utils/userAgent.d.ts +2 -1
- package/functions/utils/userAgent.mjs +23 -11
- package/functions/utils/walletBalances.utils.cjs +1 -0
- package/functions/utils/walletBalances.utils.d.ts +17 -0
- package/functions/utils/walletBalances.utils.mjs +42 -0
- package/functions/web3/EIP-712.cjs +1 -0
- package/functions/web3/EIP-712.d.ts +23 -0
- package/functions/web3/EIP-712.mjs +113 -0
- package/functions/web3/connectors.utils.cjs +1 -0
- package/functions/web3/connectors.utils.d.ts +6 -0
- package/functions/web3/connectors.utils.mjs +23 -0
- package/functions/web3/events/balanceChangedCustomHandler.cjs +1 -1
- package/functions/web3/events/balanceChangedCustomHandler.mjs +2 -3
- package/functions/web3/events/balanceChangedHandler.cjs +1 -1
- package/functions/web3/events/balanceChangedHandler.mjs +4 -5
- package/functions/web3/events/getApprovedBalance.cjs +1 -1
- package/functions/web3/events/getApprovedBalance.mjs +42 -68
- package/functions/web3/events/getInputUtxoAndBalance.cjs +1 -1
- package/functions/web3/events/getInputUtxoAndBalance.d.ts +7 -6
- package/functions/web3/events/getInputUtxoAndBalance.mjs +154 -119
- package/functions/web3/events/getInputUtxosEnclave.cjs +1 -0
- package/functions/web3/events/getInputUtxosEnclave.d.ts +8 -0
- package/functions/web3/events/getInputUtxosEnclave.mjs +47 -0
- package/functions/web3/events/getShieldedBalance.cjs +2 -2
- package/functions/web3/events/getShieldedBalance.d.ts +2 -2
- package/functions/web3/events/getShieldedBalance.mjs +78 -68
- package/functions/web3/events/getTransactionLogEvents.cjs +1 -0
- package/functions/web3/events/getTransactionLogEvents.d.ts +13 -0
- package/functions/web3/events/getTransactionLogEvents.mjs +75 -0
- package/functions/web3/events/index.d.ts +1 -0
- 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 +3 -2
- package/functions/web3/functionCalls/accessTokenCalls.mjs +24 -21
- package/functions/web3/functionCalls/approveToken.cjs +1 -1
- package/functions/web3/functionCalls/approveToken.mjs +21 -19
- package/functions/web3/functionCalls/constructBatchCall.cjs +1 -0
- package/functions/web3/functionCalls/constructBatchCall.d.ts +5 -0
- package/functions/web3/functionCalls/constructBatchCall.mjs +21 -0
- package/functions/web3/functionCalls/estimateGasRelayer.cjs +1 -1
- package/functions/web3/functionCalls/estimateGasRelayer.d.ts +2 -1
- package/functions/web3/functionCalls/estimateGasRelayer.mjs +15 -14
- package/functions/web3/functionCalls/transactCallDirect.cjs +1 -1
- package/functions/web3/functionCalls/transactCallDirect.mjs +38 -24
- package/functions/web3/functionCalls/transactCallRelayer.cjs +1 -1
- package/functions/web3/functionCalls/transactCallRelayer.d.ts +22 -2
- package/functions/web3/functionCalls/transactCallRelayer.mjs +86 -32
- package/functions/web3/getContractMetadata.cjs +1 -1
- package/functions/web3/getContractMetadata.mjs +24 -20
- package/functions/web3/getPublicAddressBalance.cjs +1 -0
- package/functions/web3/getPublicAddressBalance.d.ts +2 -0
- package/functions/web3/getPublicAddressBalance.mjs +9 -0
- package/functions/web3/getTokenHolder.cjs +1 -1
- package/functions/web3/getTokenHolder.mjs +71 -10
- package/functions/web3/index.d.ts +6 -0
- package/functions/web3/lifiAPI.cjs +1 -0
- package/functions/web3/lifiAPI.d.ts +6 -0
- package/functions/web3/lifiAPI.mjs +30 -0
- package/functions/web3/odosAPI.cjs +1 -1
- package/functions/web3/odosAPI.d.ts +1 -1
- package/functions/web3/odosAPI.mjs +30 -21
- 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.d.ts +1 -1
- package/functions/web3/oneInchAPI.mjs +30 -20
- package/functions/web3/runContractFunction.cjs +1 -1
- package/functions/web3/runContractFunction.mjs +33 -26
- 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/solana-wagmi-adapter.cjs +1 -0
- package/functions/web3/solana-wagmi-adapter.d.ts +3 -0
- package/functions/web3/solana-wagmi-adapter.mjs +29 -0
- package/functions/web3/uniswapAPI.cjs +1 -1
- package/functions/web3/uniswapAPI.mjs +36 -27
- package/index.cjs +1 -1
- package/index.d.ts +1 -0
- package/index.mjs +978 -787
- package/mutexes/index.d.ts +1 -0
- package/mutexes/mutex.cjs +1 -0
- package/mutexes/mutex.d.ts +2 -0
- package/mutexes/mutex.mjs +5 -0
- package/package.json +10 -3
- package/providers/CustomEthersProvider.cjs +1 -0
- package/providers/CustomEthersProvider.d.ts +10 -0
- 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 +19 -21
- 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 +5 -2
- package/providers/WagmiProviderAdapter.mjs +110 -56
- package/providers/prepareEthersHinkal.cjs +1 -1
- package/providers/prepareEthersHinkal.mjs +27 -15
- package/providers/prepareWagmiHinkal.cjs +1 -1
- package/providers/prepareWagmiHinkal.mjs +27 -15
- package/types/API.types.d.ts +0 -19
- package/types/IMultiThreadedUtxoUtils.d.ts +2 -2
- package/types/RewardUserEnums.cjs +1 -0
- package/types/RewardUserEnums.d.ts +11 -0
- package/types/RewardUserEnums.mjs +5 -0
- package/types/TransactionSimulator.types.d.ts +17 -3
- package/types/WeeklyAnalytics.types.d.ts +37 -0
- package/types/activities.types.cjs +1 -1
- package/types/activities.types.d.ts +34 -7
- package/types/activities.types.mjs +22 -10
- package/types/admin.types.cjs +1 -1
- package/types/admin.types.d.ts +42 -20
- package/types/admin.types.mjs +2 -3
- package/types/all-points.types.d.ts +7 -0
- package/types/approvals.types.cjs +1 -0
- package/types/approvals.types.d.ts +41 -0
- package/types/approvals.types.mjs +4 -0
- package/types/bridging.types.d.ts +29 -0
- package/types/brotherhood-user.types.d.ts +11 -0
- package/types/cache.types.cjs +1 -1
- package/types/cache.types.d.ts +26 -4
- package/types/cache.types.mjs +2 -2
- package/types/circom-data.types.d.ts +12 -0
- package/types/coingecko.types.d.ts +207 -0
- package/types/commitments.types.d.ts +12 -0
- package/types/confirmation-request.types.cjs +1 -0
- package/types/confirmation-request.types.d.ts +10 -0
- package/types/confirmation-request.types.mjs +4 -0
- package/types/connector.types.d.ts +4 -0
- package/types/contacts.types.d.ts +1 -0
- package/types/eip5792.types.cjs +1 -0
- package/types/eip5792.types.d.ts +33 -0
- package/types/eip5792.types.mjs +5 -0
- package/types/ethereum-network.types.cjs +1 -1
- package/types/ethereum-network.types.d.ts +21 -95
- package/types/ethereum-network.types.mjs +2 -2
- package/types/external-action.types.cjs +1 -1
- package/types/external-action.types.d.ts +4 -16
- package/types/external-action.types.mjs +2 -2
- package/types/generatePoints.cjs +1 -0
- package/types/generatePoints.d.ts +14 -0
- package/types/generatePoints.mjs +5 -0
- package/types/hinkal.types.cjs +1 -1
- package/types/hinkal.types.d.ts +24 -96
- package/types/hinkal.types.mjs +26 -33
- package/types/http.types.d.ts +8 -0
- package/types/index.d.ts +25 -8
- package/types/kyc.types.cjs +1 -1
- package/types/kyc.types.d.ts +5 -3
- package/types/kyc.types.mjs +3 -3
- package/types/message.types.d.ts +5 -0
- package/types/new-rewards.type.cjs +1 -0
- package/types/new-rewards.type.d.ts +156 -0
- package/types/new-rewards.type.mjs +7 -0
- package/types/offscreen.types.cjs +1 -0
- package/types/offscreen.types.d.ts +9 -0
- package/types/offscreen.types.mjs +4 -0
- package/types/okx.types.d.ts +57 -0
- package/types/presaleReferral.types.d.ts +4 -0
- package/types/proxy.types.d.ts +10 -0
- package/types/referral.types.d.ts +12 -0
- package/types/rewards.types.cjs +1 -1
- package/types/rewards.types.d.ts +15 -210
- package/types/rewards.types.mjs +3 -25
- package/types/routing.types.cjs +1 -0
- package/types/routing.types.d.ts +7 -0
- package/types/routing.types.mjs +4 -0
- package/types/sandbox.types.cjs +1 -1
- package/types/sandbox.types.d.ts +86 -21
- package/types/sandbox.types.mjs +2 -2
- package/types/scheduled-transactions.types.cjs +1 -0
- package/types/scheduled-transactions.types.d.ts +22 -0
- package/types/scheduled-transactions.types.mjs +4 -0
- package/types/session.types.d.ts +11 -0
- package/types/signature.types.d.ts +10 -0
- package/types/slippage.types.cjs +1 -1
- package/types/slippage.types.d.ts +1 -13
- package/types/slippage.types.mjs +2 -13
- package/types/solana.types.d.ts +75 -0
- package/types/tenderly.api.types.d.ts +37 -21
- package/types/token-prices.types.cjs +1 -0
- package/types/token-prices.types.d.ts +7 -0
- package/types/token-prices.types.mjs +9 -0
- package/types/token.types.d.ts +32 -8
- package/types/transactions.types.cjs +1 -1
- package/types/transactions.types.d.ts +12 -20
- package/types/transactions.types.mjs +5 -5
- package/types/wc.types.d.ts +4 -15
- 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.mjs +28 -21
- 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 +3 -3
- package/webworker/viteWorkerURL.constant.mjs +3 -3
- package/webworker/zkProofWorker/zkProofWorkerLauncher.cjs +1 -1
- package/webworker/zkProofWorker/zkProofWorkerLauncher.mjs +1 -1
- package/API/HinkalPointsCalls.cjs +0 -1
- package/API/HinkalPointsCalls.d.ts +0 -20
- package/API/HinkalPointsCalls.mjs +0 -15
- package/API/callBeefyGraphAPI.cjs +0 -1
- package/API/callBeefyGraphAPI.d.ts +0 -2
- package/API/callBeefyGraphAPI.mjs +0 -14
- package/API/callCurveAPI.cjs +0 -1
- package/API/callCurveAPI.d.ts +0 -9
- package/API/callCurveAPI.mjs +0 -160
- package/API/dataServerCalls.cjs +0 -1
- package/API/dataServerCalls.d.ts +0 -6
- package/API/dataServerCalls.mjs +0 -13
- package/API/fetchNullifiers.cjs +0 -1
- package/API/fetchNullifiers.d.ts +0 -5
- package/API/fetchNullifiers.mjs +0 -7
- package/API/getAxelarGasEstimate.cjs +0 -1
- package/API/getAxelarGasEstimate.d.ts +0 -5
- package/API/getAxelarGasEstimate.mjs +0 -14
- package/API/getConnextReceiveFee.cjs +0 -1
- package/API/getConnextReceiveFee.d.ts +0 -2
- package/API/getConnextReceiveFee.mjs +0 -7
- package/API/referralProgramCalls.cjs +0 -1
- package/API/referralProgramCalls.d.ts +0 -36
- package/API/referralProgramCalls.mjs +0 -35
- package/API/rewardsPointsCalls.cjs +0 -1
- package/API/rewardsPointsCalls.d.ts +0 -10
- package/API/rewardsPointsCalls.mjs +0 -15
- package/API/userVerifyTransactions.cjs +0 -1
- package/API/userVerifyTransactions.d.ts +0 -19
- package/API/userVerifyTransactions.mjs +0 -21
- package/constants/axelar.constants.cjs +0 -1
- package/constants/axelar.constants.d.ts +0 -5
- package/constants/axelar.constants.mjs +0 -48
- package/constants/beefy.registry.cjs +0 -1
- package/constants/beefy.registry.d.ts +0 -8
- package/constants/beefy.registry.mjs +0 -24
- package/constants/crvCvx.registry.cjs +0 -1
- package/constants/crvCvx.registry.d.ts +0 -20
- package/constants/crvCvx.registry.mjs +0 -638
- package/constants/crvDynamic.registry.cjs +0 -1
- package/constants/crvDynamic.registry.d.ts +0 -1
- package/constants/crvDynamic.registry.mjs +0 -24
- package/constants/deploy-data/deploy-data-axelar1.json.cjs +0 -1
- package/constants/deploy-data/deploy-data-axelar1.json.mjs +0 -4329
- package/constants/deploy-data/deploy-data-axelar2.json.cjs +0 -1
- package/constants/deploy-data/deploy-data-axelar2.json.mjs +0 -4329
- package/constants/lido.constants.cjs +0 -1
- package/constants/lido.constants.d.ts +0 -10
- package/constants/lido.constants.mjs +0 -13
- package/constants/pendle.registry.cjs +0 -1
- package/constants/pendle.registry.d.ts +0 -21
- package/constants/pendle.registry.mjs +0 -253
- package/constants/token-data/tokenPricing.consts.cjs +0 -1
- package/constants/token-data/tokenPricing.consts.mjs +0 -6
- package/data-structures/Hinkal/hinkalActionBeefy.cjs +0 -1
- package/data-structures/Hinkal/hinkalActionBeefy.d.ts +0 -3
- package/data-structures/Hinkal/hinkalActionBeefy.mjs +0 -80
- package/data-structures/Hinkal/hinkalActionConvex.cjs +0 -1
- package/data-structures/Hinkal/hinkalActionConvex.d.ts +0 -12
- package/data-structures/Hinkal/hinkalActionConvex.mjs +0 -61
- package/data-structures/Hinkal/hinkalActionCurve.cjs +0 -1
- package/data-structures/Hinkal/hinkalActionCurve.d.ts +0 -12
- package/data-structures/Hinkal/hinkalActionCurve.mjs +0 -93
- package/data-structures/Hinkal/hinkalActionLidoEth.cjs +0 -1
- package/data-structures/Hinkal/hinkalActionLidoEth.d.ts +0 -4
- package/data-structures/Hinkal/hinkalActionLidoEth.mjs +0 -72
- package/data-structures/Hinkal/hinkalActionPendle.cjs +0 -1
- package/data-structures/Hinkal/hinkalActionPendle.d.ts +0 -3
- package/data-structures/Hinkal/hinkalActionPendle.mjs +0 -119
- package/data-structures/Hinkal/hinkalActionPendleLP.cjs +0 -1
- package/data-structures/Hinkal/hinkalActionPendleLP.d.ts +0 -7
- package/data-structures/Hinkal/hinkalActionPendleLP.mjs +0 -81
- package/data-structures/Hinkal/hinkalActionStake.cjs +0 -1
- package/data-structures/Hinkal/hinkalActionStake.mjs +0 -122
- package/data-structures/Hinkal/hinkalActionVolatile.cjs +0 -1
- package/data-structures/Hinkal/hinkalActionVolatile.d.ts +0 -3
- package/data-structures/Hinkal/hinkalActionVolatile.mjs +0 -89
- package/data-structures/Hinkal/hinkalDeploySubAccount.cjs +0 -1
- package/data-structures/Hinkal/hinkalDeploySubAccount.d.ts +0 -3
- package/data-structures/Hinkal/hinkalDeploySubAccount.mjs +0 -15
- package/data-structures/event-service/AbstractAccessTokenSnapshotService.cjs +0 -1
- package/data-structures/event-service/AbstractApprovalsSnapshotService.cjs +0 -1
- package/data-structures/event-service/AbstractApprovalsSnapshotService.mjs +0 -104
- package/data-structures/event-service/AbstractCommitmentsSnapshotService.cjs +0 -1
- package/data-structures/event-service/AbstractCommitmentsSnapshotService.mjs +0 -94
- package/data-structures/event-service/AbstractEventService.cjs +0 -1
- package/data-structures/event-service/AbstractEventService.d.ts +0 -31
- package/data-structures/event-service/AbstractEventService.mjs +0 -95
- package/data-structures/event-service/AbstractNullifierSnapshotService.cjs +0 -1
- package/data-structures/event-service/AbstractNullifierSnapshotService.mjs +0 -59
- package/data-structures/event-service/AbstractSnapshotService.cjs +0 -1
- package/data-structures/event-service/AbstractSnapshotService.mjs +0 -35
- package/data-structures/snapshot/ClientAccessTokenSnapshotService.cjs +0 -1
- package/data-structures/snapshot/ClientAccessTokenSnapshotService.mjs +0 -32
- 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.d.ts +0 -7
- package/data-structures/snapshot/ClientCommitmentsSnapshotService.mjs +0 -31
- package/data-structures/snapshot/ClientNullifierSnapshotService.cjs +0 -1
- package/data-structures/snapshot/ClientNullifierSnapshotService.d.ts +0 -7
- package/data-structures/snapshot/ClientNullifierSnapshotService.mjs +0 -28
- package/data-structures/transactions-manager/TransactionsManager.cjs +0 -1
- package/data-structures/transactions-manager/TransactionsManager.d.ts +0 -28
- package/data-structures/transactions-manager/TransactionsManager.mjs +0 -180
- package/data-structures/transactions-manager/history/getBeefyData.cjs +0 -1
- package/data-structures/transactions-manager/history/getBeefyData.d.ts +0 -3
- package/data-structures/transactions-manager/history/getBeefyData.mjs +0 -49
- package/data-structures/transactions-manager/history/getConvexData.cjs +0 -1
- package/data-structures/transactions-manager/history/getConvexData.d.ts +0 -6
- package/data-structures/transactions-manager/history/getConvexData.mjs +0 -38
- package/data-structures/transactions-manager/history/getCurveData.cjs +0 -1
- package/data-structures/transactions-manager/history/getCurveData.d.ts +0 -6
- package/data-structures/transactions-manager/history/getCurveData.mjs +0 -78
- package/data-structures/transactions-manager/history/getDepositData.cjs +0 -1
- package/data-structures/transactions-manager/history/getDepositData.d.ts +0 -2
- package/data-structures/transactions-manager/history/getDepositData.mjs +0 -12
- package/data-structures/transactions-manager/history/getLidoData.cjs +0 -1
- package/data-structures/transactions-manager/history/getLidoData.d.ts +0 -10
- package/data-structures/transactions-manager/history/getLidoData.mjs +0 -26
- package/data-structures/transactions-manager/history/getPendleData.cjs +0 -1
- package/data-structures/transactions-manager/history/getPendleData.d.ts +0 -3
- package/data-structures/transactions-manager/history/getPendleData.mjs +0 -40
- package/data-structures/transactions-manager/history/getSwapData.cjs +0 -1
- package/data-structures/transactions-manager/history/getSwapData.d.ts +0 -3
- package/data-structures/transactions-manager/history/getSwapData.mjs +0 -19
- package/data-structures/transactions-manager/history/getTxDetails.cjs +0 -1
- package/data-structures/transactions-manager/history/getTxDetails.d.ts +0 -3
- package/data-structures/transactions-manager/history/getTxDetails.mjs +0 -57
- package/data-structures/transactions-manager/history/getVolatileData.cjs +0 -1
- package/data-structures/transactions-manager/history/getVolatileData.d.ts +0 -32
- package/data-structures/transactions-manager/history/getVolatileData.mjs +0 -56
- package/data-structures/transactions-manager/history/history.utils.cjs +0 -1
- package/data-structures/transactions-manager/history/history.utils.d.ts +0 -8
- package/data-structures/transactions-manager/history/history.utils.mjs +0 -8
- package/data-structures/volatile-helper/VolatileHelper.cjs +0 -1
- package/data-structures/volatile-helper/VolatileHelper.d.ts +0 -57
- package/data-structures/volatile-helper/VolatileHelper.mjs +0 -161
- package/data-structures/volatile-helper/index.d.ts +0 -1
- package/externalABIs/BeefyRouterAbi.json.cjs +0 -1
- package/externalABIs/BeefyRouterAbi.json.mjs +0 -1025
- package/externalABIs/BeefyStrategyAbi.json.cjs +0 -1
- package/externalABIs/BeefyStrategyAbi.json.mjs +0 -1426
- package/externalABIs/BeefyVaultAbi.json.cjs +0 -1
- package/externalABIs/BeefyVaultAbi.json.mjs +0 -573
- package/externalABIs/BeefyZapAbi.json.cjs +0 -1
- package/externalABIs/BeefyZapOneInchAbi.json.cjs +0 -1
- package/externalABIs/ConvexBoosterAbi.json.cjs +0 -1
- package/externalABIs/ConvexBoosterAbi.json.mjs +0 -677
- package/externalABIs/ConvexBoosterAbiMainnet.json.cjs +0 -1
- package/externalABIs/ConvexBoosterAbiMainnet.json.mjs +0 -1005
- package/externalABIs/ConvexRewardPoolAbi.json.cjs +0 -1
- package/externalABIs/ConvexRewardPoolAbi.json.mjs +0 -886
- package/externalABIs/CurveReadingWrapperAbi.json.cjs +0 -1
- package/externalABIs/CurveReadingWrapperAbi.json.mjs +0 -1425
- package/externalABIs/CurveWrappedMainPool.json.cjs +0 -1
- package/externalABIs/CurveWrappedMainPool.json.mjs +0 -1139
- package/externalABIs/CurveZap.json.cjs +0 -1
- package/externalABIs/CurveZap.json.mjs +0 -265
- package/externalABIs/CvxCrvUtilities.json.cjs +0 -1
- package/externalABIs/CvxCrvUtilities.json.mjs +0 -267
- package/externalABIs/ERC20.d.ts +0 -1
- package/externalABIs/LidoStEthAbi.json.cjs +0 -1
- package/externalABIs/LidoStEthAbi.json.mjs +0 -1603
- package/externalABIs/LidoStMaticAbi.json.cjs +0 -1
- package/externalABIs/LidoStMaticAbi.json.mjs +0 -1764
- package/externalABIs/LidoStakeManagerAbi.json.cjs +0 -1
- package/externalABIs/LidoStakeManagerAbi.json.mjs +0 -2082
- package/externalABIs/LidoWithdrawalQueueERC721Abi.json.cjs +0 -1
- package/externalABIs/LidoWithdrawalQueueERC721Abi.json.mjs +0 -2030
- package/externalABIs/LidoWstEthAbi.json.cjs +0 -1
- package/externalABIs/PendleRouterAbi.json.cjs +0 -1
- package/externalABIs/PendleRouterAbi.json.mjs +0 -176
- package/externalABIs/PoLidoNftAbi.json.cjs +0 -1
- package/externalABIs/PoLidoNftAbi.json.mjs +0 -701
- package/externalABIs/crvFRAX.d.ts +0 -38
- package/functions/pre-transaction/processAmountChanges.cjs +0 -1
- package/functions/pre-transaction/processAmountChanges.d.ts +0 -12
- package/functions/pre-transaction/processAmountChanges.mjs +0 -228
- package/functions/private-wallet/smartContractWalletCalculator.cjs +0 -1
- package/functions/private-wallet/smartContractWalletCalculator.d.ts +0 -5
- package/functions/private-wallet/smartContractWalletCalculator.mjs +0 -25
- package/functions/protocols/convex.protocols.cjs +0 -1
- package/functions/protocols/convex.protocols.d.ts +0 -1
- package/functions/protocols/convex.protocols.mjs +0 -28
- package/functions/protocols/curve.protocols.cjs +0 -1
- package/functions/protocols/curve.protocols.d.ts +0 -1
- package/functions/protocols/curve.protocols.mjs +0 -22
- package/functions/protocols/index.d.ts +0 -3
- package/functions/protocols/pendle.helpers.cjs +0 -1
- package/functions/protocols/pendle.helpers.d.ts +0 -8
- package/functions/protocols/pendle.helpers.mjs +0 -112
- package/functions/utils/axelar.utils.cjs +0 -1
- package/functions/utils/axelar.utils.d.ts +0 -3
- package/functions/utils/axelar.utils.mjs +0 -45
- package/functions/utils/enum.utils.cjs +0 -1
- package/functions/utils/enum.utils.mjs +0 -14
- package/functions/utils/volatile-patcher.utils.cjs +0 -1
- package/functions/utils/volatile-patcher.utils.d.ts +0 -1
- package/functions/utils/volatile-patcher.utils.mjs +0 -18
- package/types/axelar.types.d.ts +0 -14
- package/types/beefy.types.cjs +0 -1
- package/types/beefy.types.d.ts +0 -11
- package/types/beefy.types.mjs +0 -21
- package/types/connext.types.d.ts +0 -13
- package/types/curve.types.cjs +0 -1
- package/types/curve.types.d.ts +0 -133
- package/types/curve.types.mjs +0 -24
- package/types/earlyAccessCode.types.d.ts +0 -4
- package/types/hinkalTvl.types.d.ts +0 -4
- package/types/pendle.api.types.d.ts +0 -233
- package/types/pendle.types.cjs +0 -1
- package/types/pendle.types.d.ts +0 -222
- package/types/pendle.types.mjs +0 -15
- package/types/time.types.cjs +0 -1
- package/types/time.types.d.ts +0 -31
- package/types/time.types.mjs +0 -58
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { get as c, update as o } from "idb-keyval";
|
|
2
|
+
import { Logger as a } from "../../error-handling/logger.mjs";
|
|
3
|
+
import { caseInsensitiveEqual as d } from "../../functions/utils/caseInsensitive.utils.mjs";
|
|
4
|
+
class T {
|
|
5
|
+
STORAGE_KEY = "hiddenTokenAddresses";
|
|
6
|
+
UNHIDDEN_SPAM_KEY = "unhiddenSpamTokens";
|
|
7
|
+
async getHiddenTokens(e) {
|
|
8
|
+
try {
|
|
9
|
+
return (await c(this.STORAGE_KEY))?.[e] || [];
|
|
10
|
+
} catch (r) {
|
|
11
|
+
return a.error("Error retrieving hidden tokens", r), [];
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
async getHiddenTokenAddresses(e) {
|
|
15
|
+
try {
|
|
16
|
+
return (await this.getHiddenTokens(e)).map(({ erc20TokenAddress: s }) => s.toLowerCase());
|
|
17
|
+
} catch (r) {
|
|
18
|
+
return a.error("Error retrieving hidden tokens", r), [];
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
async filterOutHiddenTokens(e, r) {
|
|
22
|
+
const s = await this.getHiddenTokens(e);
|
|
23
|
+
return r.filter(
|
|
24
|
+
(n) => !s.some(
|
|
25
|
+
(t) => d(t.erc20TokenAddress, n.erc20TokenAddress)
|
|
26
|
+
)
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
async hideToken(e) {
|
|
30
|
+
try {
|
|
31
|
+
await o(this.STORAGE_KEY, (r) => {
|
|
32
|
+
const s = r ?? {}, { chainId: n } = e;
|
|
33
|
+
return s[n] || (s[n] = []), s[n].some(
|
|
34
|
+
({ erc20TokenAddress: i }) => d(i, e.erc20TokenAddress)
|
|
35
|
+
) || s[n].push(e), s;
|
|
36
|
+
}), e.isSpam && await this.deleteUnhiddenSpamToken(e);
|
|
37
|
+
} catch (r) {
|
|
38
|
+
a.error("Error hiding token", r);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
async showToken(e) {
|
|
42
|
+
try {
|
|
43
|
+
await o(this.STORAGE_KEY, (r) => {
|
|
44
|
+
const { chainId: s } = e, n = r ?? {};
|
|
45
|
+
return n[s] || (n[s] = []), n[s] = n[s].filter(
|
|
46
|
+
({ erc20TokenAddress: t }) => !d(t, e.erc20TokenAddress)
|
|
47
|
+
), n;
|
|
48
|
+
}), e.isSpam && await this.storeUnhiddenSpamToken(e);
|
|
49
|
+
} catch (r) {
|
|
50
|
+
a.error("Error showing token", r);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
async storeUnhiddenSpamToken(e) {
|
|
54
|
+
const { chainId: r } = e;
|
|
55
|
+
try {
|
|
56
|
+
await o(this.UNHIDDEN_SPAM_KEY, (s) => {
|
|
57
|
+
const n = s ?? {};
|
|
58
|
+
return n[r] || (n[r] = []), n[r].some(
|
|
59
|
+
({ erc20TokenAddress: i }) => d(i, e.erc20TokenAddress)
|
|
60
|
+
) || n[r].push(e), n;
|
|
61
|
+
});
|
|
62
|
+
} catch (s) {
|
|
63
|
+
a.error("Error storing unhidden spam token", s);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
async deleteUnhiddenSpamToken(e) {
|
|
67
|
+
await o(this.UNHIDDEN_SPAM_KEY, (r) => {
|
|
68
|
+
const { chainId: s } = e, n = r ?? {};
|
|
69
|
+
return n[s] = n[s]?.filter(
|
|
70
|
+
({ erc20TokenAddress: t }) => !d(t, e.erc20TokenAddress)
|
|
71
|
+
), n;
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
async getUnhiddenSpamTokens(e) {
|
|
75
|
+
try {
|
|
76
|
+
return (await c(this.UNHIDDEN_SPAM_KEY))?.[e] || [];
|
|
77
|
+
} catch (r) {
|
|
78
|
+
return a.error("Error retrieving unhidden spam tokens", r), [];
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
// From the list of tokens, hide the spam tokens that are not in the unhidden spam tokens list
|
|
82
|
+
async hideUnnecessarySpamTokens(e, r) {
|
|
83
|
+
const s = await this.getUnhiddenSpamTokens(e), n = r.filter(({ erc20TokenAddress: t, isSpam: i }) => i ? !s.some(
|
|
84
|
+
({ erc20TokenAddress: h }) => d(t, h)
|
|
85
|
+
) : !1);
|
|
86
|
+
await Promise.all(n.map((t) => this.hideToken(t)));
|
|
87
|
+
}
|
|
88
|
+
// First hide spam tokens from the list, then fetch the all hidden tokens addresses
|
|
89
|
+
async hideSpamsAndFetchHiddenTokensAddresses(e, r) {
|
|
90
|
+
return await this.hideUnnecessarySpamTokens(e, r), this.getHiddenTokenAddresses(e);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
const y = new T();
|
|
94
|
+
export {
|
|
95
|
+
y as tokenVisibilityStorage
|
|
96
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("ethers"),O=require("@solana/web3.js"),E=require("../../crypto/poseidon.cjs"),f=require("../../constants/chains.constants.cjs"),z=require("../utxo/Utxo.cjs"),_=require("./keys.cjs"),y="solana-on-chain-utxo:",x=8,N=e=>{if(e.length!==x)throw new Error(`Expected ${x} on-chain fields, received ${e.length}`);const t=e.map((o,r)=>{const n=o instanceof Uint8Array?o:Uint8Array.from(o);if(n.length!==32)throw new Error(`Expected bytes32 length 32 at position ${r}, got ${n.length}`);return`0x${Buffer.from(n).toString("hex")}`});return`${y}${a.ethers.utils.defaultAbiCoder.encode(["bytes32[8]"],[t])}`},H=e=>e.startsWith(y),S=e=>{if(!H(e))throw new Error("Invalid encoded Solana UTXO payload");const[t]=a.ethers.utils.defaultAbiCoder.decode(["bytes32[8]"],e.slice(y.length)),o=t;if(!Array.isArray(o)||o.length!==x)throw new Error("Malformed encoded Solana UTXO payload");const[r,n,s,i,d,c,l,m]=o,u=BigInt(r),h=BigInt(i),A=a.ethers.BigNumber.from(d).toHexString(),g=BigInt(c),b=BigInt(l),B=BigInt(m).toString(),k=Array.from(a.ethers.utils.arrayify(n)),w=Array.from(a.ethers.utils.arrayify(s)),p=Uint8Array.from([...k.slice(16),...w.slice(16)]),T=new O.PublicKey(p).toBase58(),C=E.poseidonHash(BigInt(n),BigInt(s));return{amount:u,erc20TokenAddress:C,mintAddress:T,randomization:h,stealthAddress:A,H0:g,H1:b,timeStamp:B}},U=e=>{const t=a.ethers.utils.defaultAbiCoder.decode(["uint256","address","tuple(uint256, uint256, uint256, uint256)","uint256","uint256"],e),o=t[0].toBigInt(),r=t[1],n=t[2][0].toBigInt(),s=t[2][1].toHexString(),i=t[2][2].toBigInt(),d=t[2][3].toBigInt(),c=t[3].toString(),l=t[4].toNumber();return{amount:o,erc20TokenAddress:r,randomization:n,stealthAddress:s,H0:i,H1:d,timeStamp:c,tokenId:l}},I=(e,t,o)=>{if(f.isSolanaLike(o)){const{amount:l,erc20TokenAddress:m,mintAddress:u,randomization:h,stealthAddress:A,timeStamp:g}=S(e);return{amount:l,erc20TokenAddress:m,mintAddress:u,timeStamp:g,tokenId:0,randomization:h,shieldedPrivateKey:t,stealthAddress:A}}const{amount:r,erc20TokenAddress:n,timeStamp:s,tokenId:i,randomization:d,stealthAddress:c}=U(e);return{amount:r,erc20TokenAddress:n,timeStamp:s,tokenId:i,randomization:d,shieldedPrivateKey:t,stealthAddress:c}},P=(e,t,o)=>new z.Utxo(I(e,t,o)),$=(e,t,o)=>{const{randomization:r,H0:n,H1:s}=f.isSolanaLike(o)?S(e):U(e),i=_.UserKeys.checkSignature(r,n,s,t);if(!i)throw new Error("UTXO doesn't belong to user");return i};exports.abiDecodeUtxo=U;exports.checkUtxoSignature=$;exports.decodeSolanaOnChainUtxo=S;exports.decodeUtxo=P;exports.decodeUtxoConstructorArgs=I;exports.encodeSolanaOnChainUtxo=N;exports.isSolanaOnChainUtxo=H;
|
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
import { IUtxoConstructor, Utxo } from '../utxo/Utxo';
|
|
2
|
+
export declare const encodeSolanaOnChainUtxo: (onChainData: number[][]) => string;
|
|
3
|
+
export declare const isSolanaOnChainUtxo: (encodedOutput: string) => boolean;
|
|
4
|
+
export declare const decodeSolanaOnChainUtxo: (encodedOutput: string) => {
|
|
5
|
+
amount: bigint;
|
|
6
|
+
erc20TokenAddress: string;
|
|
7
|
+
mintAddress: string;
|
|
8
|
+
randomization: bigint;
|
|
9
|
+
stealthAddress: string;
|
|
10
|
+
H0: bigint;
|
|
11
|
+
H1: bigint;
|
|
12
|
+
timeStamp: string;
|
|
13
|
+
};
|
|
2
14
|
export declare const abiDecodeUtxo: (encryptedOutput: string) => {
|
|
3
15
|
amount: bigint;
|
|
4
16
|
erc20TokenAddress: string;
|
|
@@ -9,6 +21,6 @@ export declare const abiDecodeUtxo: (encryptedOutput: string) => {
|
|
|
9
21
|
timeStamp: string;
|
|
10
22
|
tokenId: number;
|
|
11
23
|
};
|
|
12
|
-
export declare const decodeUtxoConstructorArgs: (encryptedOutput: string, privateKey: string) => IUtxoConstructor;
|
|
13
|
-
export declare const decodeUtxo: (encryptedOutput: string, privateKey: string) => Utxo;
|
|
14
|
-
export declare const checkUtxoSignature: (encryptedOutput: string, privateKey: string) => boolean;
|
|
24
|
+
export declare const decodeUtxoConstructorArgs: (encryptedOutput: string, privateKey: string, chainId: number) => IUtxoConstructor;
|
|
25
|
+
export declare const decodeUtxo: (encryptedOutput: string, privateKey: string, chainId: number) => Utxo;
|
|
26
|
+
export declare const checkUtxoSignature: (encryptedOutput: string, privateKey: string, chainId: number) => boolean;
|
|
@@ -1,41 +1,99 @@
|
|
|
1
|
-
import { ethers as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { ethers as a } from "ethers";
|
|
2
|
+
import { PublicKey as T } from "@solana/web3.js";
|
|
3
|
+
import { poseidonHash as E } from "../../crypto/poseidon.mjs";
|
|
4
|
+
import { isSolanaLike as y } from "../../constants/chains.constants.mjs";
|
|
5
|
+
import { Utxo as z } from "../utxo/Utxo.mjs";
|
|
6
|
+
import { UserKeys as C } from "./keys.mjs";
|
|
7
|
+
const x = "solana-on-chain-utxo:", f = 8, F = (o) => {
|
|
8
|
+
if (o.length !== f)
|
|
9
|
+
throw new Error(`Expected ${f} on-chain fields, received ${o.length}`);
|
|
10
|
+
const t = o.map((e, r) => {
|
|
11
|
+
const n = e instanceof Uint8Array ? e : Uint8Array.from(e);
|
|
12
|
+
if (n.length !== 32)
|
|
13
|
+
throw new Error(`Expected bytes32 length 32 at position ${r}, got ${n.length}`);
|
|
14
|
+
return `0x${Buffer.from(n).toString("hex")}`;
|
|
15
|
+
});
|
|
16
|
+
return `${x}${a.utils.defaultAbiCoder.encode(["bytes32[8]"], [t])}`;
|
|
17
|
+
}, N = (o) => o.startsWith(x), S = (o) => {
|
|
18
|
+
if (!N(o))
|
|
19
|
+
throw new Error("Invalid encoded Solana UTXO payload");
|
|
20
|
+
const [t] = a.utils.defaultAbiCoder.decode(
|
|
21
|
+
["bytes32[8]"],
|
|
22
|
+
o.slice(x.length)
|
|
23
|
+
), e = t;
|
|
24
|
+
if (!Array.isArray(e) || e.length !== f)
|
|
25
|
+
throw new Error("Malformed encoded Solana UTXO payload");
|
|
26
|
+
const [
|
|
27
|
+
r,
|
|
28
|
+
n,
|
|
29
|
+
s,
|
|
30
|
+
i,
|
|
31
|
+
d,
|
|
32
|
+
c,
|
|
33
|
+
m,
|
|
34
|
+
l
|
|
35
|
+
] = e, A = BigInt(r), u = BigInt(i), h = a.BigNumber.from(d).toHexString(), g = BigInt(c), I = BigInt(m), p = BigInt(l).toString(), B = Array.from(a.utils.arrayify(n)), U = Array.from(a.utils.arrayify(s)), b = Uint8Array.from([...B.slice(16), ...U.slice(16)]), w = new T(b).toBase58(), k = E(BigInt(n), BigInt(s));
|
|
36
|
+
return {
|
|
37
|
+
amount: A,
|
|
38
|
+
erc20TokenAddress: k,
|
|
39
|
+
mintAddress: w,
|
|
40
|
+
randomization: u,
|
|
41
|
+
stealthAddress: h,
|
|
42
|
+
H0: g,
|
|
43
|
+
H1: I,
|
|
44
|
+
timeStamp: p
|
|
45
|
+
};
|
|
46
|
+
}, H = (o) => {
|
|
47
|
+
const t = a.utils.defaultAbiCoder.decode(
|
|
6
48
|
["uint256", "address", "tuple(uint256, uint256, uint256, uint256)", "uint256", "uint256"],
|
|
7
49
|
o
|
|
8
|
-
),
|
|
50
|
+
), e = t[0].toBigInt(), r = t[1], n = t[2][0].toBigInt(), s = t[2][1].toHexString(), i = t[2][2].toBigInt(), d = t[2][3].toBigInt(), c = t[3].toString(), m = t[4].toNumber();
|
|
9
51
|
return {
|
|
10
|
-
amount:
|
|
52
|
+
amount: e,
|
|
11
53
|
erc20TokenAddress: r,
|
|
12
|
-
randomization:
|
|
13
|
-
stealthAddress:
|
|
54
|
+
randomization: n,
|
|
55
|
+
stealthAddress: s,
|
|
14
56
|
H0: i,
|
|
15
57
|
H1: d,
|
|
16
|
-
timeStamp:
|
|
17
|
-
tokenId:
|
|
58
|
+
timeStamp: c,
|
|
59
|
+
tokenId: m
|
|
18
60
|
};
|
|
19
|
-
},
|
|
20
|
-
|
|
61
|
+
}, O = (o, t, e) => {
|
|
62
|
+
if (y(e)) {
|
|
63
|
+
const { amount: m, erc20TokenAddress: l, mintAddress: A, randomization: u, stealthAddress: h, timeStamp: g } = S(o);
|
|
64
|
+
return {
|
|
65
|
+
amount: m,
|
|
66
|
+
erc20TokenAddress: l,
|
|
67
|
+
mintAddress: A,
|
|
68
|
+
timeStamp: g,
|
|
69
|
+
tokenId: 0,
|
|
70
|
+
randomization: u,
|
|
71
|
+
shieldedPrivateKey: t,
|
|
72
|
+
stealthAddress: h
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
const { amount: r, erc20TokenAddress: n, timeStamp: s, tokenId: i, randomization: d, stealthAddress: c } = H(o);
|
|
21
76
|
return {
|
|
22
|
-
amount:
|
|
23
|
-
erc20TokenAddress:
|
|
77
|
+
amount: r,
|
|
78
|
+
erc20TokenAddress: n,
|
|
24
79
|
timeStamp: s,
|
|
25
|
-
tokenId:
|
|
26
|
-
randomization:
|
|
80
|
+
tokenId: i,
|
|
81
|
+
randomization: d,
|
|
27
82
|
shieldedPrivateKey: t,
|
|
28
|
-
stealthAddress:
|
|
83
|
+
stealthAddress: c
|
|
29
84
|
};
|
|
30
|
-
},
|
|
31
|
-
const { randomization:
|
|
32
|
-
if (!
|
|
85
|
+
}, v = (o, t, e) => new z(O(o, t, e)), M = (o, t, e) => {
|
|
86
|
+
const { randomization: r, H0: n, H1: s } = y(e) ? S(o) : H(o), i = C.checkSignature(r, n, s, t);
|
|
87
|
+
if (!i)
|
|
33
88
|
throw new Error("UTXO doesn't belong to user");
|
|
34
|
-
return
|
|
89
|
+
return i;
|
|
35
90
|
};
|
|
36
91
|
export {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
92
|
+
H as abiDecodeUtxo,
|
|
93
|
+
M as checkUtxoSignature,
|
|
94
|
+
S as decodeSolanaOnChainUtxo,
|
|
95
|
+
v as decodeUtxo,
|
|
96
|
+
O as decodeUtxoConstructorArgs,
|
|
97
|
+
F as encodeSolanaOnChainUtxo,
|
|
98
|
+
N as isSolanaOnChainUtxo
|
|
41
99
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("ethers"),a=require("libsodium-wrappers"),p=require("../utxo/Utxo.cjs"),l=require("@solana/web3.js"),h=require("./keys.cjs"),g=(e,s)=>{const i=[Buffer.from(r.ethers.utils.hexlify(s?0n:e.amount)),Buffer.from(r.ethers.utils.hexlify(e.erc20TokenAddress)),Buffer.from(r.ethers.utils.hexlify(e.randomization)),Buffer.from(e.getStealthAddress()),Buffer.from(r.ethers.utils.hexlify(BigInt(e.timeStamp))),Buffer.from(r.ethers.utils.hexlify(e.tokenId??0))];if(e.mintAddress){const t=new l.PublicKey(e.mintAddress),n=r.ethers.utils.hexlify(t.toBytes());i.push(Buffer.from(n))}const f=Buffer.concat(i);return a.crypto_box_seal(f,r.ethers.utils.arrayify(e.getEncryptionKey()))},u=(e,s)=>{const{publicKey:i,privateKey:f}=h.UserKeys.getEncryptionKeyPair(s.getShieldedPrivateKey()),y=a.crypto_box_seal_open(e,r.ethers.utils.arrayify(i),r.ethers.utils.arrayify(f)),t=Buffer.from(y).toString("utf-8").split("0x").filter(o=>o.length!==0).map((o,d)=>{let c;return[0,2,4,5].includes(d)?c=BigInt(`0x${o}`):[1,3,6].includes(d)&&(c=`0x${o}`),c}),n=typeof t[6]=="string"?t[6]:void 0,m=n?new l.PublicKey(Buffer.from(n.slice(2),"hex")).toString():void 0;return{amount:t[0],erc20TokenAddress:t[1],randomization:t[2],stealthAddress:t[3],shieldedPrivateKey:s.getShieldedPrivateKey(),timeStamp:t[4].toString(),tokenId:t[5]?Number(t[5]):0,mintAddress:m}},x=(e,s)=>new p.Utxo(u(e,s));exports.decryptUtxo=x;exports.decryptUtxoConstructorArgs=u;exports.encryptUtxo=g;
|
|
@@ -1,40 +1,46 @@
|
|
|
1
|
-
import { ethers as
|
|
2
|
-
import
|
|
3
|
-
import { Utxo as
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import { ethers as r } from "ethers";
|
|
2
|
+
import m from "libsodium-wrappers";
|
|
3
|
+
import { Utxo as p } from "../utxo/Utxo.mjs";
|
|
4
|
+
import { PublicKey as c } from "@solana/web3.js";
|
|
5
|
+
import { UserKeys as u } from "./keys.mjs";
|
|
6
|
+
const K = (e, i) => {
|
|
6
7
|
const o = [
|
|
7
|
-
Buffer.from(
|
|
8
|
-
Buffer.from(
|
|
9
|
-
Buffer.from(
|
|
8
|
+
Buffer.from(r.utils.hexlify(i ? 0n : e.amount)),
|
|
9
|
+
Buffer.from(r.utils.hexlify(e.erc20TokenAddress)),
|
|
10
|
+
Buffer.from(r.utils.hexlify(e.randomization)),
|
|
10
11
|
Buffer.from(e.getStealthAddress()),
|
|
11
|
-
Buffer.from(
|
|
12
|
+
Buffer.from(r.utils.hexlify(BigInt(e.timeStamp))),
|
|
13
|
+
Buffer.from(r.utils.hexlify(e.tokenId ?? 0))
|
|
12
14
|
];
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
const
|
|
15
|
+
if (e.mintAddress) {
|
|
16
|
+
const t = new c(e.mintAddress), n = r.utils.hexlify(t.toBytes());
|
|
17
|
+
o.push(Buffer.from(n));
|
|
18
|
+
}
|
|
19
|
+
const f = Buffer.concat(o);
|
|
20
|
+
return m.crypto_box_seal(f, r.utils.arrayify(e.getEncryptionKey()));
|
|
21
|
+
}, h = (e, i) => {
|
|
22
|
+
const { publicKey: o, privateKey: f } = u.getEncryptionKeyPair(i.getShieldedPrivateKey()), y = m.crypto_box_seal_open(
|
|
18
23
|
e,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
),
|
|
22
|
-
let
|
|
23
|
-
return [0, 2, 4, 5].includes(
|
|
24
|
-
});
|
|
24
|
+
r.utils.arrayify(o),
|
|
25
|
+
r.utils.arrayify(f)
|
|
26
|
+
), t = Buffer.from(y).toString("utf-8").split("0x").filter((s) => s.length !== 0).map((s, d) => {
|
|
27
|
+
let a;
|
|
28
|
+
return [0, 2, 4, 5].includes(d) ? a = BigInt(`0x${s}`) : [1, 3, 6].includes(d) && (a = `0x${s}`), a;
|
|
29
|
+
}), n = typeof t[6] == "string" ? t[6] : void 0, l = n ? new c(Buffer.from(n.slice(2), "hex")).toString() : void 0;
|
|
25
30
|
return {
|
|
26
|
-
amount:
|
|
27
|
-
erc20TokenAddress:
|
|
28
|
-
randomization:
|
|
29
|
-
stealthAddress:
|
|
31
|
+
amount: t[0],
|
|
32
|
+
erc20TokenAddress: t[1],
|
|
33
|
+
randomization: t[2],
|
|
34
|
+
stealthAddress: t[3],
|
|
30
35
|
shieldedPrivateKey: i.getShieldedPrivateKey(),
|
|
31
|
-
timeStamp:
|
|
32
|
-
tokenId:
|
|
36
|
+
timeStamp: t[4].toString(),
|
|
37
|
+
tokenId: t[5] ? Number(t[5]) : 0,
|
|
33
38
|
// tokenId
|
|
39
|
+
mintAddress: l
|
|
34
40
|
};
|
|
35
|
-
},
|
|
41
|
+
}, S = (e, i) => new p(h(e, i));
|
|
36
42
|
export {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
43
|
+
S as decryptUtxo,
|
|
44
|
+
h as decryptUtxoConstructorArgs,
|
|
45
|
+
K as encryptUtxo
|
|
40
46
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("ethers"),w=require("libsodium-wrappers"),p=require("../../constants/protocol.constants.cjs"),m=require("../../crypto/babyJub.cjs"),u=require("../../crypto/poseidon.cjs"),h=require("./keyUtils.cjs"),v=require("../cacheDevices/AttachableMemoryCacheDevice.cjs"),d=require("ethers-v6h"),g=require("../../constants/chains.constants.cjs"),c=require("@solana/web3.js"),b=require("tweetnacl"),K=require("bs58"),q=require("../../functions/utils/create-provider.cjs"),P=new v.AttachableMemoryCacheDevice,f=new v.AttachableMemoryCacheDevice,k={privateKey:"",publicKey:""};class l{signature;constructor(e){this.signature=e}getSignature(){return this.requireSignature(),this.signature}setSignature(e){this.signature=e}requireSignature(){if(!this.signature)throw Error("No signature provided")}verifyMessage(e){return this.requireSignature(),a.utils.verifyMessage(e,this.signature)}getShieldedPrivateKey=()=>(this.requireSignature(),a.ethers.utils.keccak256(this.signature));getShieldedPublicKey=()=>(this.requireSignature(),u.poseidonHash(this.getShieldedPrivateKey()));getDerivedEthereumAddress=()=>(this.requireSignature(),new d.ethers.Wallet(this.getShieldedPrivateKey()).address);getDerivedSolanaPublicKey=()=>(this.requireSignature(),c.Keypair.fromSeed(a.utils.arrayify(this.getShieldedPrivateKey())).publicKey.toBase58());getAccessKey=()=>(this.requireSignature(),u.poseidonHash(this.getShieldedPrivateKey(),this.getShieldedPublicKey()));getSignerPrivateKeyFromNonce=e=>{this.requireSignature();const r=u.poseidonHash(e,this.getShieldedPrivateKey(),this.getShieldedPublicKey());return a.utils.keccak256(a.utils.toUtf8Bytes(r))};getSignerSolanaPrivateKeyFromNonce=e=>{const r=this.getSignerPrivateKeyFromNonce(e),t=a.utils.arrayify(r),i=c.Keypair.fromSeed(t);return K.encode(i.secretKey)};getEvmPrivateKeyFromSolanaPrivateKey=e=>{const t=K.decode(e).slice(0,32);return d.hexlify(t)};static getSignerFromPrivateKey=(e,r)=>{if(g.isSolanaLike(e)){const i=a.utils.arrayify(r);return c.Keypair.fromSeed(i)}return new d.ethers.Wallet(r)};static getSignerAddressFromPrivateKey(e,r){const t=l.getSignerFromPrivateKey(e,r);return t instanceof c.Keypair?t.publicKey.toString():t.address}static signMessageFromPrivateKey=async(e,r,t)=>{const i=l.getSignerFromPrivateKey(e,r);if(i instanceof c.Keypair){const s=a.utils.isHexString(t)?a.utils.arrayify(t):new TextEncoder().encode(t),o=b.sign.detached(s,i.secretKey);return`0x${Buffer.from(o).toString("hex")}`}const n=a.utils.isHexString(t)?a.utils.arrayify(t):t;return i.signMessage(n)};static signSolanaTransactionFromPrivateKey=(e,r,t)=>{if(!g.isSolanaLike(e))throw new Error("Solana transaction signing is only available for Solana chains");const i=l.getSignerFromPrivateKey(e,r);if(!(i instanceof c.Keypair))throw new Error("Unable to derive Solana keypair for signing");t.sign([i])};static sendAndSignTransactionFromPrivateKey=async(e,r,t)=>{const i=l.getSignerFromPrivateKey(e,r),{fetchRpcUrl:n}=g.networkRegistry[e];if(!n)throw new Error("No RPC URL found for chainId");if(i instanceof c.Keypair){if(!(t instanceof c.VersionedTransaction))throw new Error("Invalid transaction type for Solana");return t.sign([i]),await q.createCustomSolanaConnection(n).sendRawTransaction(t.serialize())}if(t instanceof c.VersionedTransaction)throw new Error("Invalid transaction type for EVM");const s=new d.ethers.JsonRpcProvider(n);return(await i.connect(s).sendTransaction(t)).hash};static signTypedDataFromPrivateKey=async(e,r,t,i,n)=>{if(g.isSolanaLike(e))throw new Error("Solana does not support typed data");return await l.getSignerFromPrivateKey(e,r).signTypedData(t,i,n)};static authorizeDelegation=async(e,r,t,i)=>{if(g.isSolanaLike(e))throw new Error("Solana does not support delegation");const n=new d.ethers.JsonRpcProvider(g.networkRegistry[e].fetchRpcUrl);return await l.getSignerFromPrivateKey(e,r).connect(n).authorize({address:t,...i!==void 0&&{nonce:i}})};getWalletSalt=e=>(this.requireSignature(),u.poseidonHash(this.getShieldedPublicKey(),this.getShieldedPrivateKey(),e));getInHinkalAddress=e=>{this.requireSignature();const r=u.poseidonHash(this.getShieldedPrivateKey(),e);return BigInt(r)};getBackendToken=()=>(this.requireSignature(),u.poseidonHash(this.getAccessKey(),this.getShieldedPublicKey()));static getRandomizedStealthPair=P.attach((e,r)=>{const t=m.babyJubInstance(),i=BigInt(r)%p.CIRCOM_P,n=e*i%p.CIRCOM_P,s=t.mulPointEscalar(t.Base8,e),o=t.mulPointEscalar(t.Base8,n),y=[BigInt(t.F.toString(s[0])),BigInt(t.F.toString(s[1]))],S=[BigInt(t.F.toString(o[0])),BigInt(t.F.toString(o[1]))];return{H0:y,H1:S}});static getStealthAddressCompressedPoints=(e,r)=>{const{H0:t,H1:i}=this.getRandomizedStealthPair(e,r),[n,s]=[t,i].map(o=>BigInt(o[1])+2n**255n*h.getCircomSign(o[0]));return{h0:n,h1:s}};static getStealthAddress=f.attach((e,r)=>{const{H0:t,H1:i}=this.getRandomizedStealthPair(e,r),s=[2n*h.getCircomSign(t[0])+h.getCircomSign(i[0]),t[1],i[1]];return u.poseidonHash(...s)});static getStealthAddressWithEKey=(e,r)=>({stealthAddress:this.getStealthAddress(e,r),encryptionKey:this.getEncryptionKeyPair(r).publicKey});static checkSignature=(e,r,t,i)=>{const{h0:n,h1:s}=this.getStealthAddressCompressedPoints(e,i);return r===n&&t===s};static getEncryptionKeyPair=e=>{const r=w.crypto_box_seed_keypair(a.ethers.utils.arrayify(e));return{privateKey:a.ethers.utils.hexlify(r.privateKey),publicKey:a.ethers.utils.hexlify(r.publicKey)}}}exports.EncryptionKeyPairDefaultValue=k;exports.UserKeys=l;exports.stealthAddressCacheDevice=f;exports.stealthPairCacheDevice=P;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import { ethers } from 'ethers';
|
|
1
2
|
import { AttachableMemoryCacheDevice } from '../cacheDevices/AttachableMemoryCacheDevice';
|
|
3
|
+
import { ethers as ethersV6 } from 'ethers-v6h';
|
|
4
|
+
import { VersionedTransaction } from '@solana/web3.js';
|
|
2
5
|
export declare const stealthPairCacheDevice: AttachableMemoryCacheDevice<{
|
|
3
6
|
H0: [bigint, bigint];
|
|
4
7
|
H1: [bigint, bigint];
|
|
@@ -29,11 +32,29 @@ export declare class UserKeys {
|
|
|
29
32
|
* @retuns shielded public key in hexstring with 0x prefixed
|
|
30
33
|
*/
|
|
31
34
|
getShieldedPublicKey: () => string;
|
|
35
|
+
/**
|
|
36
|
+
* deterministically derive an EVM address from the shielded private key
|
|
37
|
+
*/
|
|
38
|
+
getDerivedEthereumAddress: () => string;
|
|
39
|
+
/**
|
|
40
|
+
* deterministically derive a Solana public key from the shielded private key
|
|
41
|
+
*/
|
|
42
|
+
getDerivedSolanaPublicKey: () => string;
|
|
32
43
|
/**
|
|
33
44
|
* generate access token, this accessKey is what should be sent to the server for signing
|
|
34
45
|
* @returns accessKey in hexstring with 0x prefixed
|
|
35
46
|
*/
|
|
36
47
|
getAccessKey: () => string;
|
|
48
|
+
getSignerPrivateKeyFromNonce: (walletNonce: bigint) => string;
|
|
49
|
+
getSignerSolanaPrivateKeyFromNonce: (walletNonce: bigint) => string;
|
|
50
|
+
getEvmPrivateKeyFromSolanaPrivateKey: (solanaPrivateKey: string) => string;
|
|
51
|
+
private static getSignerFromPrivateKey;
|
|
52
|
+
static getSignerAddressFromPrivateKey(chainId: number, privateKey: string): string;
|
|
53
|
+
static signMessageFromPrivateKey: (chainId: number, privateKey: string, message: string) => Promise<string>;
|
|
54
|
+
static signSolanaTransactionFromPrivateKey: (chainId: number, privateKey: string, transaction: VersionedTransaction) => void;
|
|
55
|
+
static sendAndSignTransactionFromPrivateKey: (chainId: number, privateKey: string, transaction: ethersV6.TransactionRequest | VersionedTransaction) => Promise<string>;
|
|
56
|
+
static signTypedDataFromPrivateKey: (chainId: number, privateKey: string, domain: ethers.TypedDataDomain, types: Record<string, Array<ethers.TypedDataField>>, value: Record<string, any>) => Promise<string>;
|
|
57
|
+
static authorizeDelegation: (chainId: number, privateKey: string, implementation: string, nonce?: number) => Promise<ethersV6.Authorization>;
|
|
37
58
|
getWalletSalt: (walletNonce: bigint) => string;
|
|
38
59
|
/**
|
|
39
60
|
* generate inHinkalAddress - a user unique address linking him with a specific app
|
|
@@ -1,15 +1,21 @@
|
|
|
1
|
-
import { utils as
|
|
2
|
-
import
|
|
3
|
-
import { CIRCOM_P as
|
|
4
|
-
import { babyJubInstance as
|
|
5
|
-
import { poseidonHash as
|
|
6
|
-
import { getCircomSign as
|
|
7
|
-
import { AttachableMemoryCacheDevice as
|
|
8
|
-
|
|
1
|
+
import { utils as o, ethers as d } from "ethers";
|
|
2
|
+
import w from "libsodium-wrappers";
|
|
3
|
+
import { CIRCOM_P as m } from "../../constants/protocol.constants.mjs";
|
|
4
|
+
import { babyJubInstance as b } from "../../crypto/babyJub.mjs";
|
|
5
|
+
import { poseidonHash as c } from "../../crypto/poseidon.mjs";
|
|
6
|
+
import { getCircomSign as y } from "./keyUtils.mjs";
|
|
7
|
+
import { AttachableMemoryCacheDevice as v } from "../cacheDevices/AttachableMemoryCacheDevice.mjs";
|
|
8
|
+
import { ethers as u, hexlify as F } from "ethers-v6h";
|
|
9
|
+
import { isSolanaLike as h, networkRegistry as p } from "../../constants/chains.constants.mjs";
|
|
10
|
+
import { Keypair as g, VersionedTransaction as K } from "@solana/web3.js";
|
|
11
|
+
import k from "tweetnacl";
|
|
12
|
+
import P from "bs58";
|
|
13
|
+
import { createCustomSolanaConnection as A } from "../../functions/utils/create-provider.mjs";
|
|
14
|
+
const E = new v(), R = new v(), L = {
|
|
9
15
|
privateKey: "",
|
|
10
16
|
publicKey: ""
|
|
11
17
|
};
|
|
12
|
-
class
|
|
18
|
+
class l {
|
|
13
19
|
signature;
|
|
14
20
|
constructor(e) {
|
|
15
21
|
this.signature = e;
|
|
@@ -25,59 +31,133 @@ class k {
|
|
|
25
31
|
throw Error("No signature provided");
|
|
26
32
|
}
|
|
27
33
|
verifyMessage(e) {
|
|
28
|
-
return this.requireSignature(),
|
|
34
|
+
return this.requireSignature(), o.verifyMessage(e, this.signature);
|
|
29
35
|
}
|
|
30
36
|
/**
|
|
31
37
|
* get shielded private key from message signature used to login to the application,
|
|
32
38
|
* this private key is used to generate encryption keypairs as well as public key
|
|
33
39
|
* @retuns 0x-prefixed shielded private key
|
|
34
40
|
*/
|
|
35
|
-
getShieldedPrivateKey = () => (this.requireSignature(),
|
|
41
|
+
getShieldedPrivateKey = () => (this.requireSignature(), d.utils.keccak256(this.signature));
|
|
36
42
|
/**
|
|
37
43
|
* generate shielded public key from private key
|
|
38
44
|
* @param privateKey the key used to generate the shielded public key, this should be the signature
|
|
39
45
|
* that the user provided
|
|
40
46
|
* @retuns shielded public key in hexstring with 0x prefixed
|
|
41
47
|
*/
|
|
42
|
-
getShieldedPublicKey = () => (this.requireSignature(),
|
|
48
|
+
getShieldedPublicKey = () => (this.requireSignature(), c(this.getShieldedPrivateKey()));
|
|
49
|
+
/**
|
|
50
|
+
* deterministically derive an EVM address from the shielded private key
|
|
51
|
+
*/
|
|
52
|
+
getDerivedEthereumAddress = () => (this.requireSignature(), new u.Wallet(this.getShieldedPrivateKey()).address);
|
|
53
|
+
/**
|
|
54
|
+
* deterministically derive a Solana public key from the shielded private key
|
|
55
|
+
*/
|
|
56
|
+
getDerivedSolanaPublicKey = () => (this.requireSignature(), g.fromSeed(o.arrayify(this.getShieldedPrivateKey())).publicKey.toBase58());
|
|
43
57
|
/**
|
|
44
58
|
* generate access token, this accessKey is what should be sent to the server for signing
|
|
45
59
|
* @returns accessKey in hexstring with 0x prefixed
|
|
46
60
|
*/
|
|
47
|
-
getAccessKey = () => (this.requireSignature(),
|
|
48
|
-
|
|
61
|
+
getAccessKey = () => (this.requireSignature(), c(this.getShieldedPrivateKey(), this.getShieldedPublicKey()));
|
|
62
|
+
getSignerPrivateKeyFromNonce = (e) => {
|
|
63
|
+
this.requireSignature();
|
|
64
|
+
const r = c(e, this.getShieldedPrivateKey(), this.getShieldedPublicKey());
|
|
65
|
+
return o.keccak256(o.toUtf8Bytes(r));
|
|
66
|
+
};
|
|
67
|
+
getSignerSolanaPrivateKeyFromNonce = (e) => {
|
|
68
|
+
const r = this.getSignerPrivateKeyFromNonce(e), t = o.arrayify(r), i = g.fromSeed(t);
|
|
69
|
+
return P.encode(i.secretKey);
|
|
70
|
+
};
|
|
71
|
+
getEvmPrivateKeyFromSolanaPrivateKey = (e) => {
|
|
72
|
+
const t = P.decode(e).slice(0, 32);
|
|
73
|
+
return F(t);
|
|
74
|
+
};
|
|
75
|
+
static getSignerFromPrivateKey = (e, r) => {
|
|
76
|
+
if (h(e)) {
|
|
77
|
+
const i = o.arrayify(r);
|
|
78
|
+
return g.fromSeed(i);
|
|
79
|
+
}
|
|
80
|
+
return new u.Wallet(r);
|
|
81
|
+
};
|
|
82
|
+
static getSignerAddressFromPrivateKey(e, r) {
|
|
83
|
+
const t = l.getSignerFromPrivateKey(e, r);
|
|
84
|
+
return t instanceof g ? t.publicKey.toString() : t.address;
|
|
85
|
+
}
|
|
86
|
+
static signMessageFromPrivateKey = async (e, r, t) => {
|
|
87
|
+
const i = l.getSignerFromPrivateKey(e, r);
|
|
88
|
+
if (i instanceof g) {
|
|
89
|
+
const a = o.isHexString(t) ? o.arrayify(t) : new TextEncoder().encode(t), s = k.sign.detached(a, i.secretKey);
|
|
90
|
+
return `0x${Buffer.from(s).toString("hex")}`;
|
|
91
|
+
}
|
|
92
|
+
const n = o.isHexString(t) ? o.arrayify(t) : t;
|
|
93
|
+
return i.signMessage(n);
|
|
94
|
+
};
|
|
95
|
+
static signSolanaTransactionFromPrivateKey = (e, r, t) => {
|
|
96
|
+
if (!h(e))
|
|
97
|
+
throw new Error("Solana transaction signing is only available for Solana chains");
|
|
98
|
+
const i = l.getSignerFromPrivateKey(e, r);
|
|
99
|
+
if (!(i instanceof g))
|
|
100
|
+
throw new Error("Unable to derive Solana keypair for signing");
|
|
101
|
+
t.sign([i]);
|
|
102
|
+
};
|
|
103
|
+
static sendAndSignTransactionFromPrivateKey = async (e, r, t) => {
|
|
104
|
+
const i = l.getSignerFromPrivateKey(e, r), { fetchRpcUrl: n } = p[e];
|
|
105
|
+
if (!n)
|
|
106
|
+
throw new Error("No RPC URL found for chainId");
|
|
107
|
+
if (i instanceof g) {
|
|
108
|
+
if (!(t instanceof K))
|
|
109
|
+
throw new Error("Invalid transaction type for Solana");
|
|
110
|
+
return t.sign([i]), await A(n).sendRawTransaction(t.serialize());
|
|
111
|
+
}
|
|
112
|
+
if (t instanceof K)
|
|
113
|
+
throw new Error("Invalid transaction type for EVM");
|
|
114
|
+
const a = new u.JsonRpcProvider(n);
|
|
115
|
+
return (await i.connect(a).sendTransaction(t)).hash;
|
|
116
|
+
};
|
|
117
|
+
static signTypedDataFromPrivateKey = async (e, r, t, i, n) => {
|
|
118
|
+
if (h(e))
|
|
119
|
+
throw new Error("Solana does not support typed data");
|
|
120
|
+
return await l.getSignerFromPrivateKey(e, r).signTypedData(t, i, n);
|
|
121
|
+
};
|
|
122
|
+
static authorizeDelegation = async (e, r, t, i) => {
|
|
123
|
+
if (h(e))
|
|
124
|
+
throw new Error("Solana does not support delegation");
|
|
125
|
+
const n = new u.JsonRpcProvider(p[e].fetchRpcUrl);
|
|
126
|
+
return await l.getSignerFromPrivateKey(e, r).connect(n).authorize({ address: t, ...i !== void 0 && { nonce: i } });
|
|
127
|
+
};
|
|
128
|
+
getWalletSalt = (e) => (this.requireSignature(), c(this.getShieldedPublicKey(), this.getShieldedPrivateKey(), e));
|
|
49
129
|
/**
|
|
50
130
|
* generate inHinkalAddress - a user unique address linking him with a specific app
|
|
51
131
|
* @returns inHinkalAddress in bigint
|
|
52
132
|
*/
|
|
53
133
|
getInHinkalAddress = (e) => {
|
|
54
134
|
this.requireSignature();
|
|
55
|
-
const
|
|
56
|
-
return BigInt(
|
|
135
|
+
const r = c(this.getShieldedPrivateKey(), e);
|
|
136
|
+
return BigInt(r);
|
|
57
137
|
};
|
|
58
138
|
/**
|
|
59
139
|
* generate backend token, which is used for access control on backend
|
|
60
140
|
* @returns accessKey in hexstring with 0x prefixed
|
|
61
141
|
*/
|
|
62
|
-
getBackendToken = () => (this.requireSignature(),
|
|
63
|
-
static getRandomizedStealthPair =
|
|
64
|
-
(e,
|
|
65
|
-
const
|
|
66
|
-
return { H0:
|
|
142
|
+
getBackendToken = () => (this.requireSignature(), c(this.getAccessKey(), this.getShieldedPublicKey()));
|
|
143
|
+
static getRandomizedStealthPair = E.attach(
|
|
144
|
+
(e, r) => {
|
|
145
|
+
const t = b(), i = BigInt(r) % m, n = e * i % m, a = t.mulPointEscalar(t.Base8, e), s = t.mulPointEscalar(t.Base8, n), S = [BigInt(t.F.toString(a[0])), BigInt(t.F.toString(a[1]))], f = [BigInt(t.F.toString(s[0])), BigInt(t.F.toString(s[1]))];
|
|
146
|
+
return { H0: S, H1: f };
|
|
67
147
|
}
|
|
68
148
|
);
|
|
69
|
-
static getStealthAddressCompressedPoints = (e,
|
|
70
|
-
const { H0:
|
|
71
|
-
return { h0: n, h1:
|
|
149
|
+
static getStealthAddressCompressedPoints = (e, r) => {
|
|
150
|
+
const { H0: t, H1: i } = this.getRandomizedStealthPair(e, r), [n, a] = [t, i].map((s) => BigInt(s[1]) + 2n ** 255n * y(s[0]));
|
|
151
|
+
return { h0: n, h1: a };
|
|
72
152
|
};
|
|
73
|
-
static getStealthAddress =
|
|
74
|
-
const { H0:
|
|
75
|
-
return
|
|
153
|
+
static getStealthAddress = R.attach((e, r) => {
|
|
154
|
+
const { H0: t, H1: i } = this.getRandomizedStealthPair(e, r), a = [2n * y(t[0]) + y(i[0]), t[1], i[1]];
|
|
155
|
+
return c(...a);
|
|
76
156
|
});
|
|
77
|
-
static getStealthAddressWithEKey = (e,
|
|
78
|
-
static checkSignature = (e, t, i
|
|
79
|
-
const { h0: n, h1:
|
|
80
|
-
return
|
|
157
|
+
static getStealthAddressWithEKey = (e, r) => ({ stealthAddress: this.getStealthAddress(e, r), encryptionKey: this.getEncryptionKeyPair(r).publicKey });
|
|
158
|
+
static checkSignature = (e, r, t, i) => {
|
|
159
|
+
const { h0: n, h1: a } = this.getStealthAddressCompressedPoints(e, i);
|
|
160
|
+
return r === n && t === a;
|
|
81
161
|
};
|
|
82
162
|
/**
|
|
83
163
|
* generate private and public keypair
|
|
@@ -85,16 +165,16 @@ class k {
|
|
|
85
165
|
* and must correspond to 32 bytes
|
|
86
166
|
*/
|
|
87
167
|
static getEncryptionKeyPair = (e) => {
|
|
88
|
-
const
|
|
168
|
+
const r = w.crypto_box_seed_keypair(d.utils.arrayify(e));
|
|
89
169
|
return {
|
|
90
|
-
privateKey:
|
|
91
|
-
publicKey:
|
|
170
|
+
privateKey: d.utils.hexlify(r.privateKey),
|
|
171
|
+
publicKey: d.utils.hexlify(r.publicKey)
|
|
92
172
|
};
|
|
93
173
|
};
|
|
94
174
|
}
|
|
95
175
|
export {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
176
|
+
L as EncryptionKeyPairDefaultValue,
|
|
177
|
+
l as UserKeys,
|
|
178
|
+
R as stealthAddressCacheDevice,
|
|
179
|
+
E as stealthPairCacheDevice
|
|
100
180
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../../../constants/protocol.constants.cjs"),a=require("../../../crypto/poseidon.cjs");require("circomlibjs-hinkal-fork");require("libsodium-wrappers");require("process");require("buffer");const t=require("../../../functions/utils/amounts.utils.cjs"),o=require("../../merkle-tree/MerkleTree.cjs");require("ethers");require("../../../error-handling/error-codes.constants.cjs");const l=require("./AbstractSnapshotService.cjs"),i=require("../../../functions/utils/merkleTree.utils.cjs");class u extends l.AbstractSnapshotService{constructor(e){super(e,"NewAccessKeyAdded")}_merkleTree;_senderAddresses;_senderAddressIndexMap;get merkleTree(){return this._merkleTree}get senderAddresses(){return this._senderAddresses}get senderAddressIndexMap(){return this._senderAddressIndexMap}serializeSnapshot(e){return{merkleTree:e.payload.merkleTree.toJSON(),senderAddresses:Array.from(e.payload.senderAddresses),latestBlockNumber:e.latestBlockNumber,senderAddressIndexMap:Array.from(e.payload.senderAddressIndexMap).map(([s,r])=>({address:s,index:r}))}}deserializeSnapshot(e){let s,r;return e.latestBlockNumber&&e.merkleTree?s=i.contructMerkleTreeFromSerialized(e.merkleTree):s=o.MerkleTree.create(a.poseidonFunction,0n),e.latestBlockNumber&&e.senderAddressIndexMap?r=new Map(e.senderAddressIndexMap.map(({address:d,index:n})=>[d,n])):r=new Map,{latestBlockNumber:e.latestBlockNumber??0,payload:{merkleTree:s,senderAddresses:e.senderAddresses??[],senderAddressIndexMap:r}}}acceptEvent(e,s){try{return this._merkleTree.insert(e.accessKey,e.index),this._senderAddressIndexMap.set(e.senderAddress,Math.max(Number(e.index),this._senderAddressIndexMap.get(e.senderAddress)??0)),this._senderAddresses.includes(e.senderAddress)||this._senderAddresses.push(e.senderAddress),e.accessKey===0n&&e.senderAddress===c.zeroAddress&&this._merkleTree.remove(e.index),!0}catch(r){return console.error(r),!1}}mapEvent(e){const{accessKey:s,index:r,senderAddress:d}=e;return{accessKey:t.toBigInt(s),index:t.toBigInt(r),senderAddress:d}}getSnapshotPayload(){return{merkleTree:this._merkleTree,senderAddresses:this._senderAddresses,senderAddressIndexMap:this._senderAddressIndexMap}}populateSnapshot({payload:{merkleTree:e,senderAddresses:s,senderAddressIndexMap:r}}){this._merkleTree=e,this._senderAddresses=s,this._senderAddressIndexMap=r}}exports.AbstractAccessTokenSnapshotService=u;
|