@sabaaa1/common 0.1.6 → 0.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/API/API.cjs +1 -1
- package/API/API.d.ts +16 -12
- package/API/API.mjs +73 -69
- package/API/accessCodeCalls.cjs +1 -0
- package/API/accessCodeCalls.d.ts +23 -0
- package/API/accessCodeCalls.mjs +23 -0
- package/API/admin-calls.cjs +1 -1
- package/API/admin-calls.mjs +5 -7
- package/API/ai-calls.cjs +1 -1
- package/API/ai-calls.mjs +11 -10
- package/API/brotherhoodCalls.cjs +1 -1
- package/API/brotherhoodCalls.mjs +43 -69
- package/API/callLifiAPI.cjs +1 -1
- package/API/callLifiAPI.mjs +8 -7
- package/API/callOdosAPI.cjs +1 -1
- package/API/callOdosAPI.mjs +16 -16
- package/API/callOkxAPI.cjs +1 -0
- package/API/callOkxAPI.d.ts +10 -0
- package/API/callOkxAPI.mjs +13 -0
- package/API/callOneInchAPI.cjs +1 -1
- package/API/callOneInchAPI.mjs +8 -7
- package/API/callRelayer.cjs +1 -1
- package/API/callRelayer.d.ts +11 -0
- package/API/callRelayer.mjs +15 -7
- package/API/checkRisk.cjs +1 -1
- package/API/checkRisk.mjs +5 -4
- package/API/duneAPI.cjs +1 -1
- package/API/duneAPI.mjs +2 -3
- package/API/enclaveCalls.cjs +1 -1
- package/API/enclaveCalls.mjs +9 -11
- package/API/fetchCommitmentsCache.cjs +1 -1
- package/API/fetchCommitmentsCache.d.ts +2 -2
- package/API/fetchCommitmentsCache.mjs +13 -10
- package/API/generate-trading-points.cjs +1 -1
- package/API/generate-trading-points.mjs +34 -39
- package/API/get-token-data.cjs +1 -1
- package/API/get-token-data.mjs +5 -4
- package/API/getBridgeProtocols.cjs +1 -1
- package/API/getBridgeProtocols.mjs +4 -3
- package/API/getGasEstimates.cjs +1 -1
- package/API/getGasEstimates.d.ts +2 -1
- package/API/getGasEstimates.mjs +14 -16
- package/API/getLifiStatus.cjs +1 -1
- package/API/getLifiStatus.mjs +11 -10
- package/API/getRelayerURL.cjs +1 -1
- package/API/getRelayerURL.mjs +4 -4
- package/API/getServerURL.cjs +1 -1
- package/API/getServerURL.mjs +42 -36
- package/API/getTokenPrice.cjs +1 -1
- package/API/getTokenPrice.d.ts +0 -11
- package/API/getTokenPrice.mjs +8 -23
- package/API/getWebsiteURL.cjs +1 -1
- package/API/getWebsiteURL.d.ts +1 -1
- package/API/getWebsiteURL.mjs +6 -7
- package/API/index.d.ts +2 -1
- package/API/is-tx-stateless.cjs +1 -1
- package/API/is-tx-stateless.mjs +17 -22
- package/API/kycCalls.cjs +1 -1
- package/API/kycCalls.d.ts +2 -2
- package/API/kycCalls.mjs +31 -30
- package/API/leaderboardCalls.cjs +1 -1
- package/API/leaderboardCalls.mjs +11 -16
- package/API/proxyAccountsCalls.cjs +1 -1
- package/API/proxyAccountsCalls.mjs +19 -18
- package/API/referralsCalls.cjs +1 -1
- package/API/referralsCalls.mjs +16 -24
- package/API/relayCalls.cjs +1 -1
- package/API/relayCalls.mjs +6 -8
- package/API/resolve-sns.cjs +1 -0
- package/API/resolve-sns.d.ts +1 -0
- package/API/resolve-sns.mjs +12 -0
- package/API/restoreSnapshots.cjs +1 -1
- package/API/restoreSnapshots.mjs +5 -5
- package/API/rewardsUserCalls.cjs +1 -1
- package/API/rewardsUserCalls.mjs +37 -54
- package/API/seedless-calls.cjs +1 -0
- package/API/seedless-calls.d.ts +53 -0
- package/API/seedless-calls.mjs +12 -0
- package/API/send-telegram-callback.cjs +1 -1
- package/API/send-telegram-callback.mjs +9 -11
- package/API/simulate-batch-tx.cjs +1 -1
- package/API/simulate-batch-tx.mjs +11 -13
- package/API/solana-calls.cjs +1 -0
- package/API/solana-calls.d.ts +34 -0
- package/API/solana-calls.mjs +19 -0
- package/API/tenderly.api.cjs +1 -1
- package/API/tenderly.api.mjs +48 -59
- package/API/token-calls.cjs +1 -1
- package/API/token-calls.mjs +11 -13
- package/API/weeklyAnalyticCalls.cjs +1 -1
- package/API/weeklyAnalyticCalls.mjs +9 -14
- package/README.md +164 -0
- package/_virtual/_commonjsHelpers.cjs +1 -0
- package/_virtual/_commonjsHelpers.mjs +30 -0
- package/_virtual/bn.cjs +1 -0
- package/_virtual/bn.mjs +4 -0
- package/_virtual/bn2.cjs +1 -0
- package/_virtual/bn2.mjs +4 -0
- package/_virtual/common.cjs +1 -0
- package/_virtual/common.mjs +4 -0
- package/_virtual/common2.cjs +1 -0
- package/_virtual/common2.mjs +4 -0
- package/_virtual/hash.cjs +1 -0
- package/_virtual/hash.mjs +4 -0
- package/_virtual/index.cjs +1 -0
- package/_virtual/index.mjs +6 -0
- package/_virtual/index10.cjs +1 -0
- package/_virtual/index10.mjs +6 -0
- package/_virtual/index11.cjs +1 -0
- package/_virtual/index11.mjs +6 -0
- package/_virtual/index12.cjs +1 -0
- package/_virtual/index12.mjs +6 -0
- package/_virtual/index13.cjs +1 -0
- package/_virtual/index13.mjs +6 -0
- package/_virtual/index14.cjs +1 -0
- package/_virtual/index14.mjs +6 -0
- package/_virtual/index15.cjs +1 -0
- package/_virtual/index15.mjs +6 -0
- package/_virtual/index16.cjs +1 -0
- package/_virtual/index16.mjs +6 -0
- package/_virtual/index17.cjs +1 -0
- package/_virtual/index17.mjs +6 -0
- package/_virtual/index18.cjs +1 -0
- package/_virtual/index18.mjs +6 -0
- package/_virtual/index19.cjs +1 -0
- package/_virtual/index19.mjs +6 -0
- package/_virtual/index2.cjs +1 -0
- package/_virtual/index2.mjs +6 -0
- package/_virtual/index20.cjs +1 -0
- package/_virtual/index20.mjs +6 -0
- package/_virtual/index21.cjs +1 -0
- package/_virtual/index21.mjs +6 -0
- package/_virtual/index22.cjs +1 -0
- package/_virtual/index22.mjs +4 -0
- package/_virtual/index3.cjs +1 -0
- package/_virtual/index3.mjs +6 -0
- package/_virtual/index4.cjs +1 -0
- package/_virtual/index4.mjs +6 -0
- package/_virtual/index5.cjs +1 -0
- package/_virtual/index5.mjs +6 -0
- package/_virtual/index6.cjs +1 -0
- package/_virtual/index6.mjs +6 -0
- package/_virtual/index7.cjs +1 -0
- package/_virtual/index7.mjs +6 -0
- package/_virtual/index8.cjs +1 -0
- package/_virtual/index8.mjs +6 -0
- package/_virtual/index9.cjs +1 -0
- package/_virtual/index9.mjs +6 -0
- package/_virtual/inherits_browser.cjs +1 -0
- package/_virtual/inherits_browser.mjs +4 -0
- package/_virtual/ripemd.cjs +1 -0
- package/_virtual/ripemd.mjs +4 -0
- package/_virtual/scrypt.cjs +1 -0
- package/_virtual/scrypt.mjs +4 -0
- package/_virtual/sha.cjs +1 -0
- package/_virtual/sha.mjs +4 -0
- package/_virtual/sha3.cjs +1 -0
- package/_virtual/sha3.mjs +4 -0
- package/_virtual/utils.cjs +1 -0
- package/_virtual/utils.mjs +4 -0
- package/_virtual/utils2.cjs +1 -0
- package/_virtual/utils2.mjs +4 -0
- package/constants/backend.constants.cjs +1 -1
- package/constants/backend.constants.d.ts +2 -1
- package/constants/backend.constants.mjs +5 -7
- package/constants/chains.constants.cjs +1 -1
- package/constants/chains.constants.d.ts +5 -0
- package/constants/chains.constants.mjs +63 -35
- package/constants/coingecko.constants.cjs +1 -1
- package/constants/coingecko.constants.d.ts +1 -1
- package/constants/coingecko.constants.mjs +18 -11
- package/constants/contracts.constants.cjs +1 -1
- package/constants/contracts.constants.mjs +19 -15
- package/constants/deploy-data/deploy-data-arbMainnet.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-arbMainnet.json.mjs +1218 -8
- package/constants/deploy-data/deploy-data-arcTestnet.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-arcTestnet.json.mjs +1214 -4
- package/constants/deploy-data/deploy-data-base.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-base.json.mjs +1218 -8
- package/constants/deploy-data/deploy-data-ethMainnet.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-ethMainnet.json.mjs +1213 -3
- package/constants/deploy-data/deploy-data-optimism.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-optimism.json.mjs +1218 -8
- package/constants/deploy-data/deploy-data-polygon.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-polygon.json.mjs +1218 -8
- package/constants/deploy-data/deploy-data-solana.json.cjs +1 -0
- package/constants/deploy-data/deploy-data-solana.json.mjs +6111 -0
- package/constants/deploy-data/index.d.ts +2 -1
- package/constants/index.d.ts +1 -1
- package/constants/mediaUrls.constants.cjs +1 -1
- package/constants/mediaUrls.constants.d.ts +9 -0
- package/constants/mediaUrls.constants.mjs +13 -4
- package/constants/okx.constants.cjs +1 -0
- package/constants/okx.constants.d.ts +2 -0
- package/constants/okx.constants.mjs +5 -0
- package/constants/protocol.constants.cjs +1 -1
- package/constants/protocol.constants.d.ts +12 -1
- package/constants/protocol.constants.mjs +37 -29
- package/constants/save-depths.cjs +1 -1
- package/constants/save-depths.mjs +4 -1
- package/constants/server.constants.cjs +1 -1
- package/constants/server.constants.d.ts +23 -10
- package/constants/server.constants.mjs +102 -89
- package/constants/token-data/ERC20Registry.cjs +1 -1
- package/constants/token-data/ERC20Registry.mjs +49 -35
- package/constants/token-data/index.cjs +1 -1
- package/constants/token-data/index.d.ts +17 -1
- package/constants/token-data/index.mjs +29 -25
- package/constants/token-data/solanaLocalnetRegistry.json.cjs +1 -0
- package/constants/token-data/solanaLocalnetRegistry.json.mjs +24 -0
- package/constants/token-data/solanaMainnetRegistry.json.cjs +1 -0
- package/constants/token-data/solanaMainnetRegistry.json.mjs +560 -0
- package/data-structures/ApprovalDBs/EventsPublicApprovalsDB.cjs +1 -1
- package/data-structures/ApprovalDBs/EventsPublicApprovalsDB.mjs +41 -41
- package/data-structures/Hinkal/Hinkal.cjs +1 -1
- package/data-structures/Hinkal/Hinkal.d.ts +19 -10
- package/data-structures/Hinkal/Hinkal.mjs +290 -125
- package/data-structures/Hinkal/IHinkal.d.ts +18 -11
- package/data-structures/Hinkal/handleAutoDepositBack.cjs +1 -1
- package/data-structures/Hinkal/handleAutoDepositBack.mjs +36 -32
- package/data-structures/Hinkal/hinkalActionFundApproveAndTransact.cjs +1 -1
- package/data-structures/Hinkal/hinkalActionFundApproveAndTransact.mjs +24 -23
- package/data-structures/Hinkal/hinkalActionReceive.cjs +1 -1
- package/data-structures/Hinkal/hinkalActionReceive.mjs +13 -12
- package/data-structures/Hinkal/hinkalCheckSolanaTokenRegistry.cjs +1 -0
- package/data-structures/Hinkal/hinkalCheckSolanaTokenRegistry.d.ts +3 -0
- package/data-structures/Hinkal/hinkalCheckSolanaTokenRegistry.mjs +28 -0
- package/data-structures/Hinkal/hinkalCheckTokenRegistry.cjs +1 -1
- package/data-structures/Hinkal/hinkalCheckTokenRegistry.mjs +11 -8
- package/data-structures/Hinkal/hinkalDepositAndWithdraw.cjs +1 -0
- package/data-structures/Hinkal/hinkalDepositAndWithdraw.d.ts +4 -0
- package/data-structures/Hinkal/hinkalDepositAndWithdraw.mjs +167 -0
- package/data-structures/Hinkal/hinkalGetRecipientInfo.cjs +1 -1
- package/data-structures/Hinkal/hinkalGetRecipientInfo.d.ts +1 -1
- package/data-structures/Hinkal/hinkalGetRecipientInfo.mjs +4 -4
- package/data-structures/Hinkal/hinkalMultiSend.cjs +1 -1
- package/data-structures/Hinkal/hinkalMultiSend.mjs +6 -6
- package/data-structures/Hinkal/hinkalPrivateWallet.cjs +1 -1
- package/data-structures/Hinkal/hinkalPrivateWallet.d.ts +2 -2
- package/data-structures/Hinkal/hinkalPrivateWallet.mjs +109 -93
- package/data-structures/Hinkal/hinkalProxySwap.cjs +1 -1
- package/data-structures/Hinkal/hinkalProxySwap.mjs +23 -22
- package/data-structures/Hinkal/hinkalProxyToPrivate.cjs +1 -0
- package/data-structures/Hinkal/hinkalProxyToPrivate.d.ts +6 -0
- package/data-structures/Hinkal/hinkalProxyToPrivate.mjs +45 -0
- package/data-structures/Hinkal/hinkalSignSubAccount.cjs +1 -1
- package/data-structures/Hinkal/hinkalSignSubAccount.mjs +11 -9
- package/data-structures/Hinkal/hinkalSolanaDeposit.cjs +1 -0
- package/data-structures/Hinkal/hinkalSolanaDeposit.d.ts +4 -0
- package/data-structures/Hinkal/hinkalSolanaDeposit.mjs +133 -0
- package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.cjs +1 -0
- package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.d.ts +3 -0
- package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.mjs +216 -0
- package/data-structures/Hinkal/hinkalSolanaProxySend.cjs +1 -0
- package/data-structures/Hinkal/hinkalSolanaProxySend.d.ts +6 -0
- package/data-structures/Hinkal/hinkalSolanaProxySend.mjs +55 -0
- package/data-structures/Hinkal/hinkalSolanaProxyShield.cjs +1 -0
- package/data-structures/Hinkal/hinkalSolanaProxyShield.d.ts +6 -0
- package/data-structures/Hinkal/hinkalSolanaProxyShield.mjs +99 -0
- package/data-structures/Hinkal/hinkalSolanaProxySwap.cjs +1 -0
- package/data-structures/Hinkal/hinkalSolanaProxySwap.d.ts +5 -0
- package/data-structures/Hinkal/hinkalSolanaProxySwap.mjs +96 -0
- package/data-structures/Hinkal/hinkalSolanaSwap.cjs +1 -0
- package/data-structures/Hinkal/hinkalSolanaSwap.d.ts +4 -0
- package/data-structures/Hinkal/hinkalSolanaSwap.mjs +120 -0
- package/data-structures/Hinkal/hinkalSolanaTransfer.cjs +1 -0
- package/data-structures/Hinkal/hinkalSolanaTransfer.d.ts +3 -0
- package/data-structures/Hinkal/hinkalSolanaTransfer.mjs +90 -0
- package/data-structures/Hinkal/hinkalSolanaWithdraw.cjs +1 -0
- package/data-structures/Hinkal/hinkalSolanaWithdraw.d.ts +3 -0
- package/data-structures/Hinkal/hinkalSolanaWithdraw.mjs +106 -0
- package/data-structures/Hinkal/hinkalSwap.cjs +1 -1
- package/data-structures/Hinkal/hinkalSwap.mjs +33 -27
- package/data-structures/Hinkal/hinkalTransfer.cjs +1 -1
- package/data-structures/Hinkal/hinkalTransfer.mjs +20 -14
- package/data-structures/Hinkal/hinkalWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalWithdraw.mjs +15 -9
- package/data-structures/Hinkal/index.d.ts +4 -0
- package/data-structures/Hinkal/resetMerkleTrees.cjs +1 -1
- package/data-structures/Hinkal/resetMerkleTrees.mjs +56 -23
- package/data-structures/IndexedDB/activity-db.cjs +1 -1
- package/data-structures/IndexedDB/activity-db.d.ts +0 -1
- package/data-structures/IndexedDB/activity-db.mjs +86 -86
- package/data-structures/IndexedDB/balances-db.cjs +1 -1
- package/data-structures/IndexedDB/balances-db.mjs +15 -12
- package/data-structures/IndexedDB/contact-db.cjs +1 -1
- package/data-structures/IndexedDB/contact-db.mjs +29 -26
- package/data-structures/IndexedDB/signatures-db.cjs +1 -1
- package/data-structures/IndexedDB/signatures-db.mjs +14 -10
- package/data-structures/MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.cjs +1 -1
- package/data-structures/MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.d.ts +2 -2
- package/data-structures/MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.mjs +32 -31
- package/data-structures/TokenDBs/AlchemyPublicTokensDB.cjs +1 -1
- package/data-structures/TokenDBs/AlchemyPublicTokensDB.d.ts +6 -1
- package/data-structures/TokenDBs/AlchemyPublicTokensDB.mjs +154 -79
- package/data-structures/TokenDBs/EventsPublicTokensDB.cjs +1 -1
- package/data-structures/TokenDBs/EventsPublicTokensDB.mjs +24 -21
- package/data-structures/TokenDBs/PrivateTokensDB.cjs +1 -1
- package/data-structures/TokenDBs/PrivateTokensDB.mjs +39 -34
- package/data-structures/crypto-keys/decodeUTXO.cjs +1 -1
- package/data-structures/crypto-keys/decodeUTXO.d.ts +15 -3
- package/data-structures/crypto-keys/decodeUTXO.mjs +84 -26
- package/data-structures/crypto-keys/encryptDecryptUtxo.cjs +1 -1
- package/data-structures/crypto-keys/encryptDecryptUtxo.mjs +36 -30
- package/data-structures/crypto-keys/keys.cjs +1 -1
- package/data-structures/crypto-keys/keys.d.ts +19 -5
- package/data-structures/crypto-keys/keys.mjs +117 -60
- package/data-structures/event-service/evm/AbstractAccessTokenSnapshotService.cjs +1 -0
- package/data-structures/event-service/{AbstractAccessTokenSnapshotService.d.ts → evm/AbstractAccessTokenSnapshotService.d.ts} +2 -2
- package/data-structures/event-service/{AbstractAccessTokenSnapshotService.mjs → evm/AbstractAccessTokenSnapshotService.mjs} +6 -6
- package/data-structures/event-service/evm/AbstractApprovalsSnapshotService.cjs +1 -0
- package/data-structures/event-service/{AbstractApprovalsSnapshotService.d.ts → evm/AbstractApprovalsSnapshotService.d.ts} +2 -2
- package/data-structures/event-service/{AbstractApprovalsSnapshotService.mjs → evm/AbstractApprovalsSnapshotService.mjs} +2 -2
- package/data-structures/event-service/evm/AbstractCommitmentsSnapshotService.cjs +1 -0
- package/data-structures/event-service/{AbstractCommitmentsSnapshotService.d.ts → evm/AbstractCommitmentsSnapshotService.d.ts} +3 -3
- package/data-structures/event-service/{AbstractCommitmentsSnapshotService.mjs → evm/AbstractCommitmentsSnapshotService.mjs} +24 -21
- package/data-structures/event-service/evm/AbstractEventService.cjs +1 -0
- package/data-structures/event-service/{AbstractEventService.d.ts → evm/AbstractEventService.d.ts} +1 -1
- package/data-structures/event-service/evm/AbstractEventService.mjs +37 -0
- package/data-structures/event-service/{AbstractNullifierSnapshotService.d.ts → evm/AbstractNullifierSnapshotService.d.ts} +1 -1
- package/data-structures/event-service/evm/AbstractSnapshotService.cjs +1 -0
- package/data-structures/event-service/{AbstractSnapshotService.mjs → evm/AbstractSnapshotService.mjs} +1 -1
- package/data-structures/event-service/evm/BlockchainEventEmitter.cjs +1 -0
- package/data-structures/event-service/{BlockchainEventEmitter.d.ts → evm/BlockchainEventEmitter.d.ts} +2 -1
- package/data-structures/event-service/evm/BlockchainEventEmitter.mjs +89 -0
- package/data-structures/event-service/index.d.ts +13 -7
- package/data-structures/event-service/solana/AbstractSolanaAccessTokenSnapshotService.cjs +1 -0
- package/data-structures/event-service/solana/AbstractSolanaAccessTokenSnapshotService.d.ts +34 -0
- package/data-structures/event-service/solana/AbstractSolanaAccessTokenSnapshotService.mjs +87 -0
- package/data-structures/event-service/solana/AbstractSolanaCommitmentsSnapshotService.cjs +1 -0
- package/data-structures/event-service/solana/AbstractSolanaCommitmentsSnapshotService.d.ts +29 -0
- package/data-structures/event-service/solana/AbstractSolanaCommitmentsSnapshotService.mjs +96 -0
- package/data-structures/event-service/solana/AbstractSolanaEventService.cjs +1 -0
- package/data-structures/event-service/solana/AbstractSolanaEventService.d.ts +22 -0
- package/data-structures/event-service/solana/AbstractSolanaEventService.mjs +33 -0
- package/data-structures/event-service/solana/AbstractSolanaNullifierSnapshotService.cjs +1 -0
- package/data-structures/event-service/solana/AbstractSolanaNullifierSnapshotService.d.ts +21 -0
- package/data-structures/event-service/solana/AbstractSolanaNullifierSnapshotService.mjs +49 -0
- package/data-structures/event-service/solana/AbstractSolanaSnapshotService.cjs +1 -0
- package/data-structures/event-service/solana/AbstractSolanaSnapshotService.d.ts +22 -0
- package/data-structures/event-service/solana/AbstractSolanaSnapshotService.mjs +33 -0
- package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.cjs +1 -0
- package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.d.ts +39 -0
- package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.mjs +153 -0
- package/data-structures/http/BasicHttpClient.cjs +1 -0
- package/data-structures/http/BasicHttpClient.d.ts +11 -0
- package/data-structures/http/BasicHttpClient.mjs +25 -0
- package/data-structures/http/HttpClient.cjs +1 -0
- package/data-structures/http/HttpClient.d.ts +10 -0
- package/data-structures/http/HttpClient.mjs +15 -0
- package/data-structures/http/index.d.ts +2 -0
- package/data-structures/index.d.ts +1 -0
- package/data-structures/provider-adapter/IProviderAdapter.d.ts +1 -3
- package/data-structures/snapshot/SnapshotFetcherService.d.ts +1 -1
- package/data-structures/snapshot/evm-snapshots/ClientAccessTokenSnapshotService.cjs +1 -0
- package/data-structures/snapshot/{ClientAccessTokenSnapshotService.d.ts → evm-snapshots/ClientAccessTokenSnapshotService.d.ts} +2 -2
- package/data-structures/snapshot/{ClientAccessTokenSnapshotService.mjs → evm-snapshots/ClientAccessTokenSnapshotService.mjs} +13 -9
- package/data-structures/snapshot/evm-snapshots/ClientApprovalsSnapshotService.cjs +1 -0
- package/data-structures/snapshot/{ClientApprovalsSnapshotService.d.ts → evm-snapshots/ClientApprovalsSnapshotService.d.ts} +2 -3
- package/data-structures/snapshot/evm-snapshots/ClientApprovalsSnapshotService.mjs +43 -0
- package/data-structures/snapshot/evm-snapshots/ClientCommitmentsSnapshotService.cjs +1 -0
- package/data-structures/snapshot/{ClientCommitmentsSnapshotService.d.ts → evm-snapshots/ClientCommitmentsSnapshotService.d.ts} +2 -2
- package/data-structures/snapshot/evm-snapshots/ClientCommitmentsSnapshotService.mjs +35 -0
- package/data-structures/snapshot/evm-snapshots/ClientNullifierSnapshotService.cjs +1 -0
- package/data-structures/snapshot/{ClientNullifierSnapshotService.d.ts → evm-snapshots/ClientNullifierSnapshotService.d.ts} +2 -2
- package/data-structures/snapshot/evm-snapshots/ClientNullifierSnapshotService.mjs +34 -0
- package/data-structures/snapshot/index.d.ts +7 -0
- package/data-structures/snapshot/solana-snapshots/ClientSolanaAccessTokenSnapshotService.cjs +1 -0
- package/data-structures/snapshot/solana-snapshots/ClientSolanaAccessTokenSnapshotService.d.ts +8 -0
- package/data-structures/snapshot/solana-snapshots/ClientSolanaAccessTokenSnapshotService.mjs +42 -0
- package/data-structures/snapshot/solana-snapshots/ClientSolanaCommitmentsSnapshotService.cjs +1 -0
- package/data-structures/snapshot/solana-snapshots/ClientSolanaCommitmentsSnapshotService.d.ts +8 -0
- package/data-structures/snapshot/solana-snapshots/ClientSolanaCommitmentsSnapshotService.mjs +34 -0
- package/data-structures/snapshot/solana-snapshots/ClientSolanaNullifierSnapshotService.cjs +1 -0
- package/data-structures/snapshot/solana-snapshots/ClientSolanaNullifierSnapshotService.d.ts +8 -0
- package/data-structures/snapshot/solana-snapshots/ClientSolanaNullifierSnapshotService.mjs +34 -0
- package/data-structures/token-price-fetcher/TokenChecker.cjs +1 -1
- package/data-structures/token-price-fetcher/TokenChecker.mjs +5 -4
- package/data-structures/utxo/Utxo.cjs +1 -1
- package/data-structures/utxo/Utxo.d.ts +6 -1
- package/data-structures/utxo/Utxo.mjs +37 -24
- package/error-handling/error-codes.constants.cjs +1 -1
- package/error-handling/error-codes.constants.d.ts +2 -0
- package/error-handling/error-codes.constants.mjs +4 -2
- package/functions/connectors.types.d.ts +14 -0
- package/functions/index.d.ts +1 -0
- package/functions/pre-transaction/addressTableLookup.cjs +1 -0
- package/functions/pre-transaction/addressTableLookup.d.ts +4 -0
- package/functions/pre-transaction/addressTableLookup.mjs +44 -0
- package/functions/pre-transaction/constructAdminData.cjs +1 -1
- package/functions/pre-transaction/constructAdminData.d.ts +2 -1
- package/functions/pre-transaction/constructAdminData.mjs +30 -12
- package/functions/pre-transaction/convert-okx-instructions.cjs +1 -0
- package/functions/pre-transaction/convert-okx-instructions.d.ts +12 -0
- package/functions/pre-transaction/convert-okx-instructions.mjs +30 -0
- package/functions/pre-transaction/getSolanaCalldataHash.cjs +1 -0
- package/functions/pre-transaction/getSolanaCalldataHash.d.ts +4 -0
- package/functions/pre-transaction/getSolanaCalldataHash.mjs +36 -0
- package/functions/pre-transaction/getVolatileTransferAmount.cjs +1 -1
- package/functions/pre-transaction/getVolatileTransferAmount.mjs +11 -7
- package/functions/pre-transaction/index.d.ts +10 -0
- package/functions/pre-transaction/initTokenLimitIfNeeded.cjs +1 -0
- package/functions/pre-transaction/initTokenLimitIfNeeded.d.ts +3 -0
- package/functions/pre-transaction/initTokenLimitIfNeeded.mjs +20 -0
- package/functions/pre-transaction/outputUtxoProcessing.cjs +1 -1
- package/functions/pre-transaction/outputUtxoProcessing.mjs +14 -13
- package/functions/pre-transaction/process-gas-estimates.cjs +1 -1
- package/functions/pre-transaction/process-gas-estimates.d.ts +2 -2
- package/functions/pre-transaction/process-gas-estimates.mjs +13 -12
- package/functions/pre-transaction/recipientUtxoProcessing.cjs +1 -0
- package/functions/pre-transaction/recipientUtxoProcessing.d.ts +3 -0
- package/functions/pre-transaction/recipientUtxoProcessing.mjs +36 -0
- package/functions/pre-transaction/sendInitNullifiersTransaction.cjs +1 -0
- package/functions/pre-transaction/sendInitNullifiersTransaction.d.ts +11 -0
- package/functions/pre-transaction/sendInitNullifiersTransaction.mjs +41 -0
- package/functions/pre-transaction/sendV0Transaction.cjs +1 -0
- package/functions/pre-transaction/sendV0Transaction.d.ts +22 -0
- package/functions/pre-transaction/sendV0Transaction.mjs +121 -0
- package/functions/pre-transaction/solana-public-signals.cjs +1 -0
- package/functions/pre-transaction/solana-public-signals.d.ts +19 -0
- package/functions/pre-transaction/solana-public-signals.mjs +60 -0
- package/functions/pre-transaction/solana.cjs +1 -0
- package/functions/pre-transaction/solana.d.ts +17 -0
- package/functions/pre-transaction/solana.mjs +96 -0
- package/functions/pre-transaction/solanaTransfer.utils.cjs +1 -0
- package/functions/pre-transaction/solanaTransfer.utils.d.ts +6 -0
- package/functions/pre-transaction/solanaTransfer.utils.mjs +38 -0
- package/functions/pre-transaction/store-instructions.cjs +1 -0
- package/functions/pre-transaction/store-instructions.d.ts +4 -0
- package/functions/pre-transaction/store-instructions.mjs +9 -0
- package/functions/pre-transaction/store-proof.cjs +1 -0
- package/functions/pre-transaction/store-proof.d.ts +7 -0
- package/functions/pre-transaction/store-proof.mjs +55 -0
- package/functions/private-wallet/emporium.helpers.cjs +1 -1
- package/functions/private-wallet/emporium.helpers.mjs +33 -29
- package/functions/private-wallet/emporium.swap.helpers.cjs +1 -1
- package/functions/private-wallet/emporium.swap.helpers.d.ts +1 -1
- package/functions/private-wallet/emporium.swap.helpers.mjs +79 -69
- package/functions/snarkjs/constant.cjs +1 -1
- package/functions/snarkjs/constant.d.ts +40 -0
- package/functions/snarkjs/constant.mjs +66 -23
- package/functions/snarkjs/constructEmporiumProof.cjs +1 -1
- package/functions/snarkjs/constructEmporiumProof.mjs +32 -32
- package/functions/snarkjs/constructGeneralZkProof.cjs +1 -1
- package/functions/snarkjs/constructGeneralZkProof.d.ts +1 -1
- package/functions/snarkjs/constructGeneralZkProof.mjs +63 -61
- package/functions/snarkjs/constructSolanaZkProof.cjs +1 -0
- package/functions/snarkjs/constructSolanaZkProof.d.ts +13 -0
- package/functions/snarkjs/constructSolanaZkProof.mjs +109 -0
- package/functions/snarkjs/generateCircomData.cjs +1 -1
- package/functions/snarkjs/generateCircomData.d.ts +1 -1
- package/functions/snarkjs/generateCircomData.mjs +9 -9
- package/functions/snarkjs/generateZkProofEnclave.cjs +1 -1
- package/functions/snarkjs/generateZkProofEnclave.mjs +10 -9
- package/functions/snarkjs/getZKFiles.cjs +1 -1
- package/functions/snarkjs/getZKFiles.mjs +13 -13
- package/functions/snarkjs/index.d.ts +1 -0
- package/functions/utils/addresses.cjs +1 -1
- package/functions/utils/addresses.d.ts +1 -1
- package/functions/utils/addresses.mjs +21 -17
- package/functions/utils/amounts.utils.cjs +1 -1
- package/functions/utils/amounts.utils.d.ts +1 -0
- package/functions/utils/amounts.utils.mjs +53 -40
- package/functions/utils/bytes32.utils.cjs +1 -0
- package/functions/utils/bytes32.utils.d.ts +2 -0
- package/functions/utils/bytes32.utils.mjs +10 -0
- package/functions/utils/cacheDevice.utils.cjs +1 -1
- package/functions/utils/cacheDevice.utils.mjs +2 -3
- package/functions/utils/cacheFunctions.cjs +1 -1
- package/functions/utils/cacheFunctions.mjs +53 -52
- package/functions/utils/convertIntegrationProviderToExternalActionId.cjs +1 -1
- package/functions/utils/convertIntegrationProviderToExternalActionId.mjs +1 -0
- package/functions/utils/create-provider.cjs +1 -1
- package/functions/utils/create-provider.d.ts +4 -1
- package/functions/utils/create-provider.mjs +8 -6
- package/functions/utils/encodeTokenWithId.cjs +1 -1
- package/functions/utils/encodeTokenWithId.d.ts +1 -1
- package/functions/utils/encodeTokenWithId.mjs +6 -2
- package/functions/utils/encryptInputForEnclave.cjs +1 -1
- package/functions/utils/encryptInputForEnclave.mjs +29 -28
- package/functions/utils/erc20tokenFunctions.cjs +1 -1
- package/functions/utils/erc20tokenFunctions.mjs +29 -29
- package/functions/utils/ethers-formatter.utils.cjs +1 -1
- package/functions/utils/ethers-formatter.utils.d.ts +2 -0
- package/functions/utils/ethers-formatter.utils.mjs +45 -15
- package/functions/utils/evmNetworkFunctions.cjs +1 -1
- package/functions/utils/evmNetworkFunctions.mjs +3 -4
- package/functions/utils/fees.utils.cjs +1 -1
- package/functions/utils/fees.utils.d.ts +1 -0
- package/functions/utils/fees.utils.mjs +19 -9
- package/functions/utils/get-hinkal-approvals.cjs +1 -1
- package/functions/utils/get-hinkal-approvals.mjs +1 -1
- package/functions/utils/getBlockExplorerUrl.cjs +1 -1
- package/functions/utils/getBlockExplorerUrl.mjs +2 -2
- package/functions/utils/getRecipientInfoFromUserKeys.cjs +1 -1
- package/functions/utils/getRecipientInfoFromUserKeys.d.ts +0 -1
- package/functions/utils/getRecipientInfoFromUserKeys.mjs +10 -13
- package/functions/utils/getUtxosFromReceipt.utils.cjs +1 -0
- package/functions/utils/getUtxosFromReceipt.utils.d.ts +4 -0
- package/functions/utils/getUtxosFromReceipt.utils.mjs +29 -0
- package/functions/utils/getUtxosFromReceiptSolana.cjs +1 -0
- package/functions/utils/getUtxosFromReceiptSolana.d.ts +5 -0
- package/functions/utils/getUtxosFromReceiptSolana.mjs +19 -0
- package/functions/utils/index.d.ts +5 -1
- package/functions/utils/networks.utils.cjs +1 -1
- package/functions/utils/networks.utils.mjs +2 -3
- package/functions/utils/nftTokenFunctions.cjs +1 -1
- package/functions/utils/nftTokenFunctions.mjs +8 -4
- package/functions/utils/prepareHinkal.cjs +1 -0
- package/functions/utils/prepareHinkal.d.ts +7 -1
- package/functions/utils/prepareHinkal.mjs +88 -0
- package/functions/utils/publicBalance.utils.cjs +1 -1
- package/functions/utils/publicBalance.utils.d.ts +1 -0
- package/functions/utils/publicBalance.utils.mjs +75 -45
- package/functions/utils/solanaMint.utils.cjs +1 -0
- package/functions/utils/solanaMint.utils.d.ts +10 -0
- package/functions/utils/solanaMint.utils.mjs +14 -0
- package/functions/utils/time.utils.cjs +1 -1
- package/functions/utils/time.utils.d.ts +1 -1
- package/functions/utils/time.utils.mjs +11 -11
- package/functions/utils/userAgent.cjs +1 -1
- package/functions/utils/userAgent.mjs +6 -7
- package/functions/utils/walletBalances.utils.cjs +1 -1
- package/functions/utils/walletBalances.utils.d.ts +2 -1
- package/functions/utils/walletBalances.utils.mjs +18 -17
- package/functions/web3/events/getInputUtxoAndBalance.cjs +1 -1
- package/functions/web3/events/getInputUtxoAndBalance.mjs +98 -91
- package/functions/web3/events/getInputUtxosEnclave.cjs +1 -1
- package/functions/web3/events/getInputUtxosEnclave.mjs +38 -16
- package/functions/web3/events/getShieldedBalance.cjs +2 -2
- package/functions/web3/events/getShieldedBalance.mjs +70 -62
- package/functions/web3/events/getTransactionLogEvents.cjs +1 -1
- package/functions/web3/events/getTransactionLogEvents.d.ts +3 -2
- package/functions/web3/events/getTransactionLogEvents.mjs +12 -9
- package/functions/web3/fetchSolanaMerkleTreeRootHash.cjs +1 -0
- package/functions/web3/fetchSolanaMerkleTreeRootHash.d.ts +4 -0
- package/functions/web3/fetchSolanaMerkleTreeRootHash.mjs +45 -0
- package/functions/web3/functionCalls/accessTokenCalls.cjs +1 -1
- package/functions/web3/functionCalls/accessTokenCalls.d.ts +2 -0
- package/functions/web3/functionCalls/accessTokenCalls.mjs +25 -7
- package/functions/web3/functionCalls/transactCallRelayer.cjs +1 -1
- package/functions/web3/functionCalls/transactCallRelayer.d.ts +20 -0
- package/functions/web3/functionCalls/transactCallRelayer.mjs +61 -19
- package/functions/web3/getContractMetadata.cjs +1 -1
- package/functions/web3/getContractMetadata.mjs +20 -50
- package/functions/web3/getTokenHolder.cjs +1 -1
- package/functions/web3/getTokenHolder.mjs +29 -24
- package/functions/web3/index.d.ts +2 -0
- package/functions/web3/odosAPI.cjs +1 -1
- package/functions/web3/odosAPI.mjs +11 -8
- package/functions/web3/okxAPI.cjs +1 -0
- package/functions/web3/okxAPI.d.ts +8 -0
- package/functions/web3/okxAPI.mjs +43 -0
- package/functions/web3/oneInchAPI.cjs +1 -1
- package/functions/web3/oneInchAPI.mjs +7 -4
- package/functions/web3/runContractFunction.cjs +1 -1
- package/functions/web3/runContractFunction.mjs +22 -18
- package/functions/web3/signAndSendSerializedTransaction.cjs +1 -0
- package/functions/web3/signAndSendSerializedTransaction.d.ts +2 -0
- package/functions/web3/signAndSendSerializedTransaction.mjs +11 -0
- package/functions/web3/uniswapAPI.cjs +1 -1
- package/functions/web3/uniswapAPI.mjs +7 -4
- package/index.cjs +1 -1
- package/index.mjs +922 -810
- package/package.json +12 -16
- package/providers/CustomEthersProvider.cjs +1 -0
- package/providers/{TorExternalProvider.d.ts → CustomEthersProvider.d.ts} +2 -2
- package/providers/CustomEthersProvider.mjs +29 -0
- package/providers/CustomSolanaConnection.cjs +1 -0
- package/providers/CustomSolanaConnection.d.ts +4 -0
- package/providers/CustomSolanaConnection.mjs +33 -0
- package/providers/EthersProviderAdapter.cjs +1 -1
- package/providers/EthersProviderAdapter.d.ts +1 -2
- package/providers/EthersProviderAdapter.mjs +8 -48
- package/providers/SolanaProviderAdapter.cjs +1 -0
- package/providers/SolanaProviderAdapter.d.ts +44 -0
- package/providers/SolanaProviderAdapter.mjs +125 -0
- package/providers/WagmiProviderAdapter.cjs +1 -1
- package/providers/WagmiProviderAdapter.d.ts +1 -2
- package/providers/WagmiProviderAdapter.mjs +26 -24
- package/providers/prepareEthersHinkal.cjs +1 -1
- package/providers/prepareEthersHinkal.mjs +10 -7
- package/providers/prepareWagmiHinkal.cjs +1 -1
- package/providers/prepareWagmiHinkal.mjs +9 -6
- package/types/IMultiThreadedUtxoUtils.d.ts +2 -2
- package/types/TransactionSimulator.types.d.ts +1 -0
- package/types/activities.types.cjs +1 -1
- package/types/activities.types.d.ts +1 -0
- package/types/activities.types.mjs +6 -4
- package/types/admin.types.cjs +1 -1
- package/types/admin.types.d.ts +16 -0
- package/types/admin.types.mjs +1 -1
- package/types/all-points.types.d.ts +0 -1
- package/types/cache.types.cjs +1 -1
- package/types/cache.types.d.ts +8 -1
- package/types/cache.types.mjs +1 -1
- package/types/circom-data.types.d.ts +6 -0
- package/types/commitments.types.d.ts +12 -0
- package/types/ethereum-network.types.cjs +1 -1
- package/types/ethereum-network.types.d.ts +9 -3
- package/types/ethereum-network.types.mjs +1 -1
- package/types/external-action.types.cjs +1 -1
- package/types/external-action.types.d.ts +3 -1
- package/types/external-action.types.mjs +2 -2
- package/types/hinkal.types.cjs +1 -1
- package/types/hinkal.types.d.ts +3 -2
- package/types/hinkal.types.mjs +8 -8
- package/types/http.types.d.ts +8 -0
- package/types/index.d.ts +3 -2
- package/types/new-rewards.type.d.ts +2 -9
- package/types/offscreen.types.cjs +1 -1
- package/types/offscreen.types.d.ts +2 -1
- package/types/offscreen.types.mjs +2 -2
- package/types/okx.types.d.ts +57 -0
- package/types/rewards.types.d.ts +0 -11
- package/types/sandbox.types.cjs +1 -1
- package/types/sandbox.types.d.ts +19 -2
- package/types/sandbox.types.mjs +2 -2
- package/types/solana.types.d.ts +75 -0
- package/types/token.types.d.ts +6 -0
- package/webworker/snarkjsWorker/snarkjsWorkerLauncher.cjs +1 -1
- package/webworker/snarkjsWorker/snarkjsWorkerLauncher.mjs +1 -1
- package/webworker/snarkjsWorker/snarkjsWorkerLogic.cjs +1 -1
- package/webworker/snarkjsWorker/snarkjsWorkerLogic.d.ts +0 -1
- package/webworker/snarkjsWorker/snarkjsWorkerLogic.mjs +28 -30
- package/webworker/utxoWorker/utxoWorker.types.d.ts +2 -0
- package/webworker/utxoWorker/utxoWorkerLauncher.cjs +1 -1
- package/webworker/utxoWorker/utxoWorkerLauncher.mjs +1 -1
- package/webworker/utxoWorker/utxoWorkerLogic.cjs +1 -1
- package/webworker/utxoWorker/utxoWorkerLogic.mjs +33 -31
- package/webworker/viteWorkerURL.constant.cjs +21 -1
- package/webworker/viteWorkerURL.constant.mjs +21 -12
- package/webworker/zkProofWorker/zkProofWorkerLauncher.cjs +1 -1
- package/webworker/zkProofWorker/zkProofWorkerLauncher.mjs +1 -1
- package/API/mysteryBoxesCalls.cjs +0 -1
- package/API/mysteryBoxesCalls.d.ts +0 -60
- package/API/mysteryBoxesCalls.mjs +0 -66
- package/assets/snarkjsWorkerLauncher-CWaDqRaL.js +0 -14803
- package/assets/utxoWorkerLauncher-BUhBaUSg.js +0 -115868
- package/assets/zkProofWorkerLauncher-DlWQP3l9.js +0 -115360
- package/constants/mystery-boxes.constants.cjs +0 -1
- package/constants/mystery-boxes.constants.d.ts +0 -63
- package/constants/mystery-boxes.constants.mjs +0 -355
- package/data-structures/event-service/AbstractAccessTokenSnapshotService.cjs +0 -1
- package/data-structures/event-service/AbstractApprovalsSnapshotService.cjs +0 -1
- package/data-structures/event-service/AbstractCommitmentsSnapshotService.cjs +0 -1
- package/data-structures/event-service/AbstractEventService.cjs +0 -1
- package/data-structures/event-service/AbstractEventService.mjs +0 -33
- package/data-structures/event-service/AbstractSnapshotService.cjs +0 -1
- package/data-structures/event-service/BlockchainEventEmitter.cjs +0 -1
- package/data-structures/event-service/BlockchainEventEmitter.mjs +0 -80
- package/data-structures/snapshot/ClientAccessTokenSnapshotService.cjs +0 -1
- package/data-structures/snapshot/ClientApprovalsSnapshotService.cjs +0 -1
- package/data-structures/snapshot/ClientApprovalsSnapshotService.mjs +0 -23
- package/data-structures/snapshot/ClientCommitmentsSnapshotService.cjs +0 -1
- package/data-structures/snapshot/ClientCommitmentsSnapshotService.mjs +0 -31
- package/data-structures/snapshot/ClientNullifierSnapshotService.cjs +0 -1
- package/data-structures/snapshot/ClientNullifierSnapshotService.mjs +0 -30
- package/functions/utils/mystery-box-auction.utils.cjs +0 -1
- package/functions/utils/mystery-box-auction.utils.d.ts +0 -8
- package/functions/utils/mystery-box-auction.utils.mjs +0 -51
- package/providers/TorExternalProvider.cjs +0 -1
- package/providers/TorExternalProvider.mjs +0 -29
- package/types/merch-order.types.cjs +0 -1
- package/types/merch-order.types.d.ts +0 -16
- package/types/merch-order.types.mjs +0 -4
- package/types/mystery-boxes.types.cjs +0 -1
- package/types/mystery-boxes.types.d.ts +0 -43
- package/types/mystery-boxes.types.mjs +0 -6
- /package/data-structures/event-service/{AbstractNullifierSnapshotService.cjs → evm/AbstractNullifierSnapshotService.cjs} +0 -0
- /package/data-structures/event-service/{AbstractNullifierSnapshotService.mjs → evm/AbstractNullifierSnapshotService.mjs} +0 -0
- /package/data-structures/event-service/{AbstractSnapshotService.d.ts → evm/AbstractSnapshotService.d.ts} +0 -0
|
@@ -5,20 +5,24 @@ import "../../types/transactions.types.mjs";
|
|
|
5
5
|
import "../../types/activities.types.mjs";
|
|
6
6
|
import "../../constants/server.constants.mjs";
|
|
7
7
|
import "../../API/getServerURL.mjs";
|
|
8
|
+
import "../../data-structures/http/HttpClient.mjs";
|
|
8
9
|
import "axios";
|
|
9
10
|
import "../../constants/chains.constants.mjs";
|
|
10
|
-
import "../../constants/reorg-depths.constants.mjs";
|
|
11
|
-
import "../utils/mutexes.utils.mjs";
|
|
12
11
|
import "circomlibjs-hinkal-fork";
|
|
13
12
|
import "libsodium-wrappers";
|
|
14
13
|
import "process";
|
|
15
14
|
import "buffer";
|
|
16
15
|
import "../../constants/vite.constants.mjs";
|
|
17
16
|
import "../../constants/save-depths.mjs";
|
|
17
|
+
import "../../constants/reorg-depths.constants.mjs";
|
|
18
|
+
import "../utils/mutexes.utils.mjs";
|
|
19
|
+
import "@coral-xyz/anchor";
|
|
18
20
|
import { Logger as a } from "../../error-handling/logger.mjs";
|
|
21
|
+
import "@solana/web3.js";
|
|
22
|
+
import "../../data-structures/crypto-keys/keys.mjs";
|
|
19
23
|
import { simulateVolatileTokenTransfer as c } from "../../API/is-tx-stateless.mjs";
|
|
20
24
|
import { TokenChecker as u } from "../../data-structures/token-price-fetcher/TokenChecker.mjs";
|
|
21
|
-
const
|
|
25
|
+
const E = async (l, s, i, m) => {
|
|
22
26
|
try {
|
|
23
27
|
const t = s.map((r, e) => {
|
|
24
28
|
const o = i[e];
|
|
@@ -31,11 +35,11 @@ const R = async (p, s, i, m) => {
|
|
|
31
35
|
}).filter((r) => r !== null);
|
|
32
36
|
if (t.length === 0)
|
|
33
37
|
return i;
|
|
34
|
-
const
|
|
38
|
+
const p = await c(l, t);
|
|
35
39
|
return i.map((r, e) => {
|
|
36
40
|
const o = t.findIndex((n) => n.originalIndex === e);
|
|
37
|
-
if (o !== -1 &&
|
|
38
|
-
const n =
|
|
41
|
+
if (o !== -1 && p[o].success) {
|
|
42
|
+
const n = p[o].balanceDifference;
|
|
39
43
|
return n ? BigInt(n) : r;
|
|
40
44
|
}
|
|
41
45
|
return r;
|
|
@@ -45,5 +49,5 @@ const R = async (p, s, i, m) => {
|
|
|
45
49
|
}
|
|
46
50
|
};
|
|
47
51
|
export {
|
|
48
|
-
|
|
52
|
+
E as modifyVolatileTokenAmountChanges
|
|
49
53
|
};
|
|
@@ -5,3 +5,13 @@ export * from './getFlatFees';
|
|
|
5
5
|
export * from './outputApprovalDataProcessing';
|
|
6
6
|
export * from './getVolatileTransferAmount';
|
|
7
7
|
export * from './constructAdminData';
|
|
8
|
+
export * from './solana';
|
|
9
|
+
export * from './addressTableLookup';
|
|
10
|
+
export * from './solana-public-signals';
|
|
11
|
+
export * from './convert-okx-instructions';
|
|
12
|
+
export * from './sendV0Transaction';
|
|
13
|
+
export * from './store-proof';
|
|
14
|
+
export * from './sendInitNullifiersTransaction';
|
|
15
|
+
export * from './initTokenLimitIfNeeded';
|
|
16
|
+
export * from './recipientUtxoProcessing';
|
|
17
|
+
export * from './store-instructions';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./solana.cjs"),a=require("../../constants/protocol.constants.cjs"),s=require("./sendV0Transaction.cjs"),d=async(t,n,i,e)=>{const o=await t.methods.initTokenLimit().accounts({mint:i.toBase58()===a.solanaNativeAddress?null:i,originalDeployer:n,tokenLimitStorage:c.getTokenLimitStorageAccountPublicKey(t.programId,n,i)}).instruction();await s.sendV0Transaction(t.provider.connection,[o],e,[e])},r=async(t,n,i,e)=>{const o=c.getTokenLimitStorageAccountPublicKey(t.programId,n,i);await t.provider.connection.getAccountInfo(o,"confirmed")||await d(t,n,i,e)};exports.initTokenLimitIfNeeded=r;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { getTokenLimitStorageAccountPublicKey as c } from "./solana.mjs";
|
|
2
|
+
import { solanaNativeAddress as a } from "../../constants/protocol.constants.mjs";
|
|
3
|
+
import { sendV0Transaction as s } from "./sendV0Transaction.mjs";
|
|
4
|
+
const d = async (t, o, i, n) => {
|
|
5
|
+
const e = await t.methods.initTokenLimit().accounts({
|
|
6
|
+
mint: i.toBase58() === a ? null : i,
|
|
7
|
+
originalDeployer: o,
|
|
8
|
+
tokenLimitStorage: c(t.programId, o, i)
|
|
9
|
+
}).instruction();
|
|
10
|
+
await s(t.provider.connection, [e], n, [n]);
|
|
11
|
+
}, f = async (t, o, i, n) => {
|
|
12
|
+
const e = c(t.programId, o, i);
|
|
13
|
+
await t.provider.connection.getAccountInfo(
|
|
14
|
+
e,
|
|
15
|
+
"confirmed"
|
|
16
|
+
) || await d(t, o, i, n);
|
|
17
|
+
};
|
|
18
|
+
export {
|
|
19
|
+
f as initTokenLimitIfNeeded
|
|
20
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("../../data-structures/utxo/Utxo.cjs"),c=require("../utils/amounts.utils.cjs"),A=require("../../error-handling/error-codes.constants.cjs"),I=(a,o,t,r,l,U=!0,e,n)=>{const s=c.countTotalAmountInUtxos(o),{erc20TokenAddress:i,mintAddress:x}=o[0];if(U&&t<0n&&s+t<0n)throw Error(A.transactionErrorCodes.INSUFFICIENT_FUNDS_TO_TRANSACT);const u=[new d.Utxo({amount:c.bigintMax(s+t,0n),erc20TokenAddress:i,mintAddress:x,shieldedPrivateKey:a.getShieldedPrivateKey(),timeStamp:r,tokenId:l})];if(e!==void 0&&n!==void 0){const[T,y,v]=e.split(",");u.push(new d.Utxo({amount:n,erc20TokenAddress:i,randomization:BigInt(T),stealthAddress:y,encryptionKey:v,timeStamp:r}))}return{outputUtxos:u}};exports.outputUtxoProcessing=I;
|
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
import { Utxo as a } from "../../data-structures/utxo/Utxo.mjs";
|
|
2
|
-
import { countTotalAmountInUtxos as
|
|
2
|
+
import { countTotalAmountInUtxos as x, bigintMax as A } from "../utils/amounts.utils.mjs";
|
|
3
3
|
import { transactionErrorCodes as I } from "../../error-handling/error-codes.constants.mjs";
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
if (
|
|
4
|
+
const N = (c, t, o, r, m, u = !0, n, s) => {
|
|
5
|
+
const i = x(t), { erc20TokenAddress: e, mintAddress: l } = t[0];
|
|
6
|
+
if (u && o < 0n && i + o < 0n)
|
|
7
7
|
throw Error(I.INSUFFICIENT_FUNDS_TO_TRANSACT);
|
|
8
8
|
const d = [
|
|
9
9
|
new a({
|
|
10
|
-
amount:
|
|
10
|
+
amount: A(i + o, 0n),
|
|
11
11
|
erc20TokenAddress: e,
|
|
12
|
+
mintAddress: l,
|
|
12
13
|
shieldedPrivateKey: c.getShieldedPrivateKey(),
|
|
13
14
|
timeStamp: r,
|
|
14
|
-
tokenId:
|
|
15
|
+
tokenId: m
|
|
15
16
|
})
|
|
16
17
|
];
|
|
17
|
-
if (n !== void 0 &&
|
|
18
|
-
const [
|
|
18
|
+
if (n !== void 0 && s !== void 0) {
|
|
19
|
+
const [T, f, p] = n.split(",");
|
|
19
20
|
d.push(
|
|
20
21
|
new a({
|
|
21
|
-
amount:
|
|
22
|
+
amount: s,
|
|
22
23
|
erc20TokenAddress: e,
|
|
23
|
-
randomization: BigInt(
|
|
24
|
-
stealthAddress:
|
|
25
|
-
encryptionKey:
|
|
24
|
+
randomization: BigInt(T),
|
|
25
|
+
stealthAddress: f,
|
|
26
|
+
encryptionKey: p,
|
|
26
27
|
timeStamp: r
|
|
27
28
|
})
|
|
28
29
|
);
|
|
@@ -30,5 +31,5 @@ const A = (c, t, o, r, u, m = !0, n, i) => {
|
|
|
30
31
|
return { outputUtxos: d };
|
|
31
32
|
};
|
|
32
33
|
export {
|
|
33
|
-
|
|
34
|
+
N as outputUtxoProcessing
|
|
34
35
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("../../API/getGasEstimates.cjs"),E=require("../../error-handling/logError.cjs"),d=require("../utils/amounts.utils.cjs"),f=require("../web3/etherFunctions.cjs"),I=async(i,e,n,a,o,c=[],u)=>{let s,t;try{({priceOfTransactionInUSD:s,priceOfTransactionInToken:t}=await T.getGasEstimates(i,e.erc20TokenAddress,n,a,c.map(({from:r,to:m,calldata:g,value:p})=>({from:r,to:m,calldata:g,value:`${p}`})),o,u))}catch(r){E.logError("processGasEstimates error:",r)}const l=t?f.getAmountInWei(e,d.getValueFirstNDigit(t,e.decimals)):void 0;return{priceOfTransactionInUSD:s,priceOfTransactionInToken:l}};exports.processGasEstimates=I;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CallInfo, ERC20Token, ExternalActionId } from '../../types';
|
|
2
|
-
export declare const processGasEstimates: (chainId: number, tokenForGasFee: ERC20Token, externalActionId: ExternalActionId, erc20TokenAddressLength: number, gasAmount?: number, calls?: CallInfo<bigint>[]) => Promise<{
|
|
1
|
+
import { CallInfo, ERC20Token, ExternalActionId, SolanaTransactionParams } from '../../types';
|
|
2
|
+
export declare const processGasEstimates: (chainId: number, tokenForGasFee: ERC20Token, externalActionId: ExternalActionId, erc20TokenAddressLength: number, gasAmount?: number, calls?: CallInfo<bigint>[], solanaTransactionParams?: SolanaTransactionParams) => Promise<{
|
|
3
3
|
priceOfTransactionInUSD: number | undefined;
|
|
4
4
|
priceOfTransactionInToken: bigint | undefined;
|
|
5
5
|
}>;
|
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
import { getGasEstimates as
|
|
2
|
-
import { logError as
|
|
3
|
-
import { getValueFirstNDigit as
|
|
4
|
-
import { getAmountInWei as
|
|
5
|
-
const
|
|
1
|
+
import { getGasEstimates as g } from "../../API/getGasEstimates.mjs";
|
|
2
|
+
import { logError as E } from "../../error-handling/logError.mjs";
|
|
3
|
+
import { getValueFirstNDigit as I } from "../utils/amounts.utils.mjs";
|
|
4
|
+
import { getAmountInWei as d } from "../web3/etherFunctions.mjs";
|
|
5
|
+
const y = async (o, r, s, a, n, c = [], m) => {
|
|
6
6
|
let i, t;
|
|
7
7
|
try {
|
|
8
|
-
({ priceOfTransactionInUSD: i, priceOfTransactionInToken: t } = await
|
|
8
|
+
({ priceOfTransactionInUSD: i, priceOfTransactionInToken: t } = await g(
|
|
9
9
|
o,
|
|
10
10
|
r.erc20TokenAddress,
|
|
11
11
|
s,
|
|
12
12
|
a,
|
|
13
|
-
c.map(({ from: e, to:
|
|
14
|
-
n
|
|
13
|
+
c.map(({ from: e, to: f, calldata: T, value: l }) => ({ from: e, to: f, calldata: T, value: `${l}` })),
|
|
14
|
+
n,
|
|
15
|
+
m
|
|
15
16
|
));
|
|
16
17
|
} catch (e) {
|
|
17
|
-
|
|
18
|
+
E("processGasEstimates error:", e);
|
|
18
19
|
}
|
|
19
|
-
const
|
|
20
|
-
return { priceOfTransactionInUSD: i, priceOfTransactionInToken:
|
|
20
|
+
const p = t ? d(r, I(t, r.decimals)) : void 0;
|
|
21
|
+
return { priceOfTransactionInUSD: i, priceOfTransactionInToken: p };
|
|
21
22
|
};
|
|
22
23
|
export {
|
|
23
|
-
|
|
24
|
+
y as processGasEstimates
|
|
24
25
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("../../data-structures/utxo/Utxo.cjs"),u=require("../utils/caseInsensitive.utils.cjs"),v=(o,i,l,r)=>{const{recipientInfo:f,amount:s,token:p}=o,[t,c,d]=f.split(","),a=i.findIndex(e=>e.find(n=>u.caseInsensitiveEqual(n.erc20TokenAddress,o?.token.erc20TokenAddress))!==void 0),T=new k.Utxo({amount:s,erc20TokenAddress:p.erc20TokenAddress,timeStamp:r,randomization:BigInt(t),stealthAddress:c,encryptionKey:d});if(a===-1)throw Error("Private recipient index not found");i.forEach((e,n)=>{if(n===a)e.push(T),l[n]+=s;else{const g=new k.Utxo({amount:0n,erc20TokenAddress:e[0].erc20TokenAddress,timeStamp:r,randomization:BigInt(t),stealthAddress:c,encryptionKey:d});e.push(g)}})};exports.recipientUtxoProcessing=v;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { Utxo } from '../../data-structures/utxo/Utxo';
|
|
2
|
+
import { PrivateRecipientInfo } from '../../types/token.types';
|
|
3
|
+
export declare const recipientUtxoProcessing: (privateRecipientInfo: PrivateRecipientInfo, outputUtxosArray: Utxo[][], deltaChanges: bigint[], timeStamp: string) => void;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Utxo as f } from "../../data-structures/utxo/Utxo.mjs";
|
|
2
|
+
import { caseInsensitiveEqual as h } from "../utils/caseInsensitive.utils.mjs";
|
|
3
|
+
const v = (o, r, k, i) => {
|
|
4
|
+
const { recipientInfo: p, amount: s, token: m } = o, [t, d, c] = p.split(","), a = r.findIndex(
|
|
5
|
+
(e) => e.find(
|
|
6
|
+
(n) => h(n.erc20TokenAddress, o?.token.erc20TokenAddress)
|
|
7
|
+
) !== void 0
|
|
8
|
+
), A = new f({
|
|
9
|
+
amount: s,
|
|
10
|
+
erc20TokenAddress: m.erc20TokenAddress,
|
|
11
|
+
timeStamp: i,
|
|
12
|
+
randomization: BigInt(t),
|
|
13
|
+
stealthAddress: d,
|
|
14
|
+
encryptionKey: c
|
|
15
|
+
});
|
|
16
|
+
if (a === -1)
|
|
17
|
+
throw Error("Private recipient index not found");
|
|
18
|
+
r.forEach((e, n) => {
|
|
19
|
+
if (n === a)
|
|
20
|
+
e.push(A), k[n] += s;
|
|
21
|
+
else {
|
|
22
|
+
const T = new f({
|
|
23
|
+
amount: 0n,
|
|
24
|
+
erc20TokenAddress: e[0].erc20TokenAddress,
|
|
25
|
+
timeStamp: i,
|
|
26
|
+
randomization: BigInt(t),
|
|
27
|
+
stealthAddress: d,
|
|
28
|
+
encryptionKey: c
|
|
29
|
+
});
|
|
30
|
+
e.push(T);
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
export {
|
|
35
|
+
v as recipientUtxoProcessing
|
|
36
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./sendV0Transaction.cjs"),y=require("./solana.cjs"),w=require("../utils/bytes32.utils.cjs"),I=async(e,s,r,n,t)=>{if(t.every(o=>o===0))return{instruction:void 0,willCreate:!1};const i=y.getNullifierAccount(w.convertBytes32ToBigInt(t),r,s.programId);return await e.getAccountInfo(i)?{instruction:void 0,willCreate:!1}:{instruction:await s.methods.initNullifier(t).accounts({originalDeployer:r,signer:n}).instruction(),willCreate:!0,account:i,nullifier:t}},N=async(e,s,r,n,t)=>{const i=[],c=[];for(const u of t){const{instruction:o,willCreate:f,account:a,nullifier:l}=await I(e,s,r,n,u);o&&i.push(o),f&&a&&l&&c.push({account:a,nullifier:l})}return{instructions:i,createdAccounts:c}},A=async(e,s,r,n,t)=>{const{instructions:i,createdAccounts:c}=await N(e,s,r,n.publicKey,t);return{signature:await d.sendV0Transaction(e,i,n,[n]),createdAccounts:c}};exports.sendInitNullifiersTransaction=A;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Program } from '@coral-xyz/anchor';
|
|
2
|
+
import { Connection, Keypair, PublicKey } from '@solana/web3.js';
|
|
3
|
+
interface CreatedNullifierAccount {
|
|
4
|
+
account: PublicKey;
|
|
5
|
+
nullifier: number[];
|
|
6
|
+
}
|
|
7
|
+
export declare const sendInitNullifiersTransaction: (connection: Connection, program: Program, originalDeployer: PublicKey, signer: Keypair, nullifiers: number[][]) => Promise<{
|
|
8
|
+
signature: string;
|
|
9
|
+
createdAccounts: Array<CreatedNullifierAccount>;
|
|
10
|
+
}>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { sendV0Transaction as d } from "./sendV0Transaction.mjs";
|
|
2
|
+
import { getNullifierAccount as w } from "./solana.mjs";
|
|
3
|
+
import { convertBytes32ToBigInt as I } from "../utils/bytes32.utils.mjs";
|
|
4
|
+
const m = async (r, e, c, i, t) => {
|
|
5
|
+
if (t.every((o) => o === 0))
|
|
6
|
+
return { instruction: void 0, willCreate: !1 };
|
|
7
|
+
const n = w(I(t), c, e.programId);
|
|
8
|
+
return await r.getAccountInfo(n) ? { instruction: void 0, willCreate: !1 } : {
|
|
9
|
+
instruction: await e.methods.initNullifier(t).accounts({
|
|
10
|
+
originalDeployer: c,
|
|
11
|
+
signer: i
|
|
12
|
+
}).instruction(),
|
|
13
|
+
willCreate: !0,
|
|
14
|
+
account: n,
|
|
15
|
+
nullifier: t
|
|
16
|
+
};
|
|
17
|
+
}, y = async (r, e, c, i, t) => {
|
|
18
|
+
const n = [], s = [];
|
|
19
|
+
for (const u of t) {
|
|
20
|
+
const {
|
|
21
|
+
instruction: o,
|
|
22
|
+
willCreate: f,
|
|
23
|
+
account: a,
|
|
24
|
+
nullifier: l
|
|
25
|
+
} = await m(r, e, c, i, u);
|
|
26
|
+
o && n.push(o), f && a && l && s.push({ account: a, nullifier: l });
|
|
27
|
+
}
|
|
28
|
+
return { instructions: n, createdAccounts: s };
|
|
29
|
+
}, C = async (r, e, c, i, t) => {
|
|
30
|
+
const { instructions: n, createdAccounts: s } = await y(
|
|
31
|
+
r,
|
|
32
|
+
e,
|
|
33
|
+
c,
|
|
34
|
+
i.publicKey,
|
|
35
|
+
t
|
|
36
|
+
);
|
|
37
|
+
return { signature: await d(r, n, i, [i]), createdAccounts: s };
|
|
38
|
+
};
|
|
39
|
+
export {
|
|
40
|
+
C as sendInitNullifiersTransaction
|
|
41
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("@solana/spl-token"),r=require("@solana/web3.js"),T=require("../../constants/protocol.constants.cjs"),U=require("../utils/ethers-formatter.utils.cjs"),C=require("../../data-structures/crypto-keys/keys.cjs"),h=async(t,e,a,n)=>{try{const{blockhash:s}=await t.getLatestBlockhash(),o=[r.ComputeBudgetProgram.setComputeUnitLimit({units:T.MAX_COMPUTE_UNIT_LIMIT}),...a],i=new r.TransactionMessage({payerKey:e,recentBlockhash:s,instructions:o}).compileToV0Message(n),c=new r.VersionedTransaction(i),u=await t.simulateTransaction(c,{sigVerify:!1,replaceRecentBlockhash:!0}),{unitsConsumed:m}=u.value;if(!m)return T.MAX_COMPUTE_UNIT_LIMIT;const l=Math.ceil(m*(1+T.COMPUTE_UNIT_PADDING_PERCENTAGE));return Math.max(T.MIN_COMPUTE_UNIT_LIMIT,Math.min(l,T.MAX_COMPUTE_UNIT_LIMIT))}catch{return T.MAX_COMPUTE_UNIT_LIMIT}},I=async(t,e,a,n)=>{const s=a.filter(u=>!u.programId.equals(r.ComputeBudgetProgram.programId)),o=await h(t,e,s,n),i=r.ComputeBudgetProgram.setComputeUnitLimit({units:o}),c=r.ComputeBudgetProgram.setComputeUnitPrice({microLamports:T.MICRO_LAMPORTS_PER_CU});return[i,c,...s]},M=async(t,e,a,n,s)=>{if(e.length===0)return"";const{blockhash:o,lastValidBlockHeight:i}=await t.getLatestBlockhash("confirmed"),c=await I(t,a.publicKey,e,s),u=new r.TransactionMessage({payerKey:a.publicKey,instructions:c,recentBlockhash:o}).compileToV0Message(s),m=new r.VersionedTransaction(u);m.sign(n);const l=await t.sendTransaction(m);return await t.confirmTransaction({signature:l,blockhash:o,lastValidBlockHeight:i},"confirmed"),l},P=async(t,e,a,n)=>{if(!a)return null;const s=await d.getAssociatedTokenAddress(a,n,!0,d.TOKEN_PROGRAM_ID,d.ASSOCIATED_TOKEN_PROGRAM_ID);if(!await t.getAccountInfo(s)){const i=d.createAssociatedTokenAccountInstruction(e.publicKey,s,n,a,d.TOKEN_PROGRAM_ID,d.ASSOCIATED_TOKEN_PROGRAM_ID);await M(t,[i],e,[e])}return s},V=async({connection:t,chainId:e,subAccount:a,payerPublicKey:n,instructions:s,lookupTableAccounts:o,convertParams:i})=>{const{blockhash:c,lastValidBlockHeight:u}=await t.getLatestBlockhash(),m=await I(t,n,s,o),l=new r.TransactionMessage({payerKey:n,recentBlockhash:c,instructions:m}).compileToV0Message(o),_=new r.VersionedTransaction(l),g=await C.UserKeys.sendAndSignTransactionFromPrivateKey(e,a.privateKey,_);await t.confirmTransaction({signature:g,blockhash:c,lastValidBlockHeight:u},"confirmed");const p=await t.getTransaction(g,{commitment:"confirmed",maxSupportedTransactionVersion:0}),{fromAddress:f,toAddress:w,programAddress:A}=i;return U.convertSolanaTransactionToRelayer(g,p,f,w,A)},y=async(t,e,a,n)=>{const{blockhash:s}=await t.getLatestBlockhash(),o=await I(t,e,a,n),i=new r.TransactionMessage({payerKey:e,recentBlockhash:s,instructions:o}).compileToV0Message(n),c=new r.VersionedTransaction(i);return Buffer.from(c.serialize()).toString("base64")};exports.ensureAtaExists=P;exports.estimateComputeUnitLimit=h;exports.sendProxyV0Transaction=V;exports.sendV0Transaction=M;exports.serializeProxyV0Transaction=y;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { AddressLookupTableAccount, Connection, Keypair, PublicKey, TransactionInstruction } from '@solana/web3.js';
|
|
2
|
+
import { RelayerTransaction } from '../../types/relayer.types';
|
|
3
|
+
import { SubAccount } from '../../types/proxy.types';
|
|
4
|
+
export declare const estimateComputeUnitLimit: (connection: Connection, payerKey: PublicKey, instructions: TransactionInstruction[], lookupTableAccounts?: AddressLookupTableAccount[]) => Promise<number>;
|
|
5
|
+
export declare const sendV0Transaction: (connection: Connection, instructions: TransactionInstruction[], payer: Keypair, signers: Keypair[], lookupTableAccounts?: AddressLookupTableAccount[]) => Promise<string>;
|
|
6
|
+
export declare const ensureAtaExists: (connection: Connection, payer: Keypair, mintPubkey: PublicKey | null, owner: PublicKey) => Promise<PublicKey | null>;
|
|
7
|
+
type SendProxyV0TransactionParams = {
|
|
8
|
+
connection: Connection;
|
|
9
|
+
chainId: number;
|
|
10
|
+
subAccount: SubAccount;
|
|
11
|
+
payerPublicKey: PublicKey;
|
|
12
|
+
instructions: TransactionInstruction[];
|
|
13
|
+
lookupTableAccounts?: AddressLookupTableAccount[];
|
|
14
|
+
convertParams: {
|
|
15
|
+
fromAddress: string;
|
|
16
|
+
toAddress: string;
|
|
17
|
+
programAddress: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export declare const sendProxyV0Transaction: ({ connection, chainId, subAccount, payerPublicKey, instructions, lookupTableAccounts, convertParams, }: SendProxyV0TransactionParams) => Promise<RelayerTransaction>;
|
|
21
|
+
export declare const serializeProxyV0Transaction: (connection: Connection, payerPublicKey: PublicKey, instructions: TransactionInstruction[], lookupTableAccounts?: AddressLookupTableAccount[]) => Promise<string>;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { getAssociatedTokenAddress as V, TOKEN_PROGRAM_ID as I, ASSOCIATED_TOKEN_PROGRAM_ID as p, createAssociatedTokenAccountInstruction as y } from "@solana/spl-token";
|
|
2
|
+
import { ComputeBudgetProgram as d, TransactionMessage as h, VersionedTransaction as g } from "@solana/web3.js";
|
|
3
|
+
import { MAX_COMPUTE_UNIT_LIMIT as l, COMPUTE_UNIT_PADDING_PERCENTAGE as B, MIN_COMPUTE_UNIT_LIMIT as C, MICRO_LAMPORTS_PER_CU as L } from "../../constants/protocol.constants.mjs";
|
|
4
|
+
import { convertSolanaTransactionToRelayer as k } from "../utils/ethers-formatter.utils.mjs";
|
|
5
|
+
import { UserKeys as E } from "../../data-structures/crypto-keys/keys.mjs";
|
|
6
|
+
const P = async (t, a, n, e) => {
|
|
7
|
+
try {
|
|
8
|
+
const { blockhash: s } = await t.getLatestBlockhash(), o = [
|
|
9
|
+
d.setComputeUnitLimit({ units: l }),
|
|
10
|
+
...n
|
|
11
|
+
], i = new h({
|
|
12
|
+
payerKey: a,
|
|
13
|
+
recentBlockhash: s,
|
|
14
|
+
instructions: o
|
|
15
|
+
}).compileToV0Message(e), r = new g(i), c = await t.simulateTransaction(r, {
|
|
16
|
+
sigVerify: !1,
|
|
17
|
+
replaceRecentBlockhash: !0
|
|
18
|
+
}), { unitsConsumed: m } = c.value;
|
|
19
|
+
if (!m)
|
|
20
|
+
return l;
|
|
21
|
+
const u = Math.ceil(m * (1 + B));
|
|
22
|
+
return Math.max(C, Math.min(u, l));
|
|
23
|
+
} catch {
|
|
24
|
+
return l;
|
|
25
|
+
}
|
|
26
|
+
}, f = async (t, a, n, e) => {
|
|
27
|
+
const s = n.filter(
|
|
28
|
+
(c) => !c.programId.equals(d.programId)
|
|
29
|
+
), o = await P(
|
|
30
|
+
t,
|
|
31
|
+
a,
|
|
32
|
+
s,
|
|
33
|
+
e
|
|
34
|
+
), i = d.setComputeUnitLimit({ units: o }), r = d.setComputeUnitPrice({
|
|
35
|
+
microLamports: L
|
|
36
|
+
});
|
|
37
|
+
return [i, r, ...s];
|
|
38
|
+
}, R = async (t, a, n, e, s) => {
|
|
39
|
+
if (a.length === 0)
|
|
40
|
+
return "";
|
|
41
|
+
const { blockhash: o, lastValidBlockHeight: i } = await t.getLatestBlockhash("confirmed"), r = await f(
|
|
42
|
+
t,
|
|
43
|
+
n.publicKey,
|
|
44
|
+
a,
|
|
45
|
+
s
|
|
46
|
+
), c = new h({
|
|
47
|
+
payerKey: n.publicKey,
|
|
48
|
+
instructions: r,
|
|
49
|
+
recentBlockhash: o
|
|
50
|
+
}).compileToV0Message(s), m = new g(c);
|
|
51
|
+
m.sign(e);
|
|
52
|
+
const u = await t.sendTransaction(m);
|
|
53
|
+
return await t.confirmTransaction({ signature: u, blockhash: o, lastValidBlockHeight: i }, "confirmed"), u;
|
|
54
|
+
}, D = async (t, a, n, e) => {
|
|
55
|
+
if (!n)
|
|
56
|
+
return null;
|
|
57
|
+
const s = await V(n, e, !0, I, p);
|
|
58
|
+
if (!await t.getAccountInfo(s)) {
|
|
59
|
+
const i = y(
|
|
60
|
+
a.publicKey,
|
|
61
|
+
s,
|
|
62
|
+
e,
|
|
63
|
+
n,
|
|
64
|
+
I,
|
|
65
|
+
p
|
|
66
|
+
);
|
|
67
|
+
await R(t, [i], a, [a]);
|
|
68
|
+
}
|
|
69
|
+
return s;
|
|
70
|
+
}, v = async ({
|
|
71
|
+
connection: t,
|
|
72
|
+
chainId: a,
|
|
73
|
+
subAccount: n,
|
|
74
|
+
payerPublicKey: e,
|
|
75
|
+
instructions: s,
|
|
76
|
+
lookupTableAccounts: o,
|
|
77
|
+
convertParams: i
|
|
78
|
+
}) => {
|
|
79
|
+
const { blockhash: r, lastValidBlockHeight: c } = await t.getLatestBlockhash(), m = await f(
|
|
80
|
+
t,
|
|
81
|
+
e,
|
|
82
|
+
s,
|
|
83
|
+
o
|
|
84
|
+
), u = new h({
|
|
85
|
+
payerKey: e,
|
|
86
|
+
recentBlockhash: r,
|
|
87
|
+
instructions: m
|
|
88
|
+
}).compileToV0Message(o), w = new g(u), T = await E.sendAndSignTransactionFromPrivateKey(a, n.privateKey, w);
|
|
89
|
+
await t.confirmTransaction(
|
|
90
|
+
{
|
|
91
|
+
signature: T,
|
|
92
|
+
blockhash: r,
|
|
93
|
+
lastValidBlockHeight: c
|
|
94
|
+
},
|
|
95
|
+
"confirmed"
|
|
96
|
+
);
|
|
97
|
+
const M = await t.getTransaction(T, {
|
|
98
|
+
commitment: "confirmed",
|
|
99
|
+
maxSupportedTransactionVersion: 0
|
|
100
|
+
}), { fromAddress: _, toAddress: A, programAddress: U } = i;
|
|
101
|
+
return k(T, M, _, A, U);
|
|
102
|
+
}, G = async (t, a, n, e) => {
|
|
103
|
+
const { blockhash: s } = await t.getLatestBlockhash(), o = await f(
|
|
104
|
+
t,
|
|
105
|
+
a,
|
|
106
|
+
n,
|
|
107
|
+
e
|
|
108
|
+
), i = new h({
|
|
109
|
+
payerKey: a,
|
|
110
|
+
recentBlockhash: s,
|
|
111
|
+
instructions: o
|
|
112
|
+
}).compileToV0Message(e), r = new g(i);
|
|
113
|
+
return Buffer.from(r.serialize()).toString("base64");
|
|
114
|
+
};
|
|
115
|
+
export {
|
|
116
|
+
D as ensureAtaExists,
|
|
117
|
+
P as estimateComputeUnitLimit,
|
|
118
|
+
v as sendProxyV0Transaction,
|
|
119
|
+
R as sendV0Transaction,
|
|
120
|
+
G as serializeProxyV0Transaction
|
|
121
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=(a,m)=>{const e=m.tokenNumber,c=m.nullifierAmount,h=m.outputAmount;let t=0;const y=Uint8Array.from(a[t]);t+=1;const A=Uint8Array.from(a[t]);t+=1;const u=Uint8Array.from(a[t]);t+=1;const S=Uint8Array.from(a[t]);t+=1;const x=Uint8Array.from(a[t]);t+=1;const s=[];for(let o=0;o<e;o+=1)s.push(Uint8Array.from(a[t])),t+=1;const i=[];for(let o=0;o<e;o+=1)i.push(Uint8Array.from(a[t])),t+=1;const d=[];for(let o=0;o<e;o+=1){const n=[];for(let r=0;r<c;r+=1)n.push(Uint8Array.from(a[t])),t+=1;d.push(n)}const U=Uint8Array.from(a[t]);t+=1;const z=Uint8Array.from(a[t]);t+=1;const f=[];for(let o=0;o<e;o+=1)f.push(Uint8Array.from(a[t])),t+=1;const l=[];for(let o=0;o<e;o+=1){const n=[];for(let r=0;r<h;r+=1)n.push(Uint8Array.from(a[t])),t+=1;l.push(n)}const R=Uint8Array.from(a[t]);return t+=1,{extraRandomizedStealthAddress:[...y],extraRandomizedStealthAddressSigns:[...A],extraRandomizedStealthAddressH0Ay:[...u],extraRandomizedStealthAddressH1Ay:[...S],rootHash:[...x],mintAccountPart1:s.map(o=>[...o]),mintAccountPart2:i.map(o=>[...o]),inNullifiers:d.map(o=>o.map(n=>[...n])),outTimestamp:[...U],extraRandomization:[...z],amountChanges:f.map(o=>[...o]),outCommitments:l.map(o=>o.map(n=>[...n])),calldataHash:[...R]}};exports.convertSolanaPublicSignals=g;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const convertSolanaPublicSignals: (publicInputsArr: number[][], dimensions: {
|
|
2
|
+
tokenNumber: number;
|
|
3
|
+
nullifierAmount: number;
|
|
4
|
+
outputAmount: number;
|
|
5
|
+
}) => {
|
|
6
|
+
extraRandomizedStealthAddress: number[];
|
|
7
|
+
extraRandomizedStealthAddressSigns: number[];
|
|
8
|
+
extraRandomizedStealthAddressH0Ay: number[];
|
|
9
|
+
extraRandomizedStealthAddressH1Ay: number[];
|
|
10
|
+
rootHash: number[];
|
|
11
|
+
mintAccountPart1: number[][];
|
|
12
|
+
mintAccountPart2: number[][];
|
|
13
|
+
inNullifiers: number[][][];
|
|
14
|
+
outTimestamp: number[];
|
|
15
|
+
extraRandomization: number[];
|
|
16
|
+
amountChanges: number[][];
|
|
17
|
+
outCommitments: number[][][];
|
|
18
|
+
calldataHash: number[];
|
|
19
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
const C = (a, m) => {
|
|
2
|
+
const e = m.tokenNumber, c = m.nullifierAmount, l = m.outputAmount;
|
|
3
|
+
let t = 0;
|
|
4
|
+
const A = Uint8Array.from(a[t]);
|
|
5
|
+
t += 1;
|
|
6
|
+
const y = Uint8Array.from(a[t]);
|
|
7
|
+
t += 1;
|
|
8
|
+
const x = Uint8Array.from(a[t]);
|
|
9
|
+
t += 1;
|
|
10
|
+
const u = Uint8Array.from(a[t]);
|
|
11
|
+
t += 1;
|
|
12
|
+
const U = Uint8Array.from(a[t]);
|
|
13
|
+
t += 1;
|
|
14
|
+
const s = [];
|
|
15
|
+
for (let o = 0; o < e; o += 1)
|
|
16
|
+
s.push(Uint8Array.from(a[t])), t += 1;
|
|
17
|
+
const d = [];
|
|
18
|
+
for (let o = 0; o < e; o += 1)
|
|
19
|
+
d.push(Uint8Array.from(a[t])), t += 1;
|
|
20
|
+
const i = [];
|
|
21
|
+
for (let o = 0; o < e; o += 1) {
|
|
22
|
+
const n = [];
|
|
23
|
+
for (let r = 0; r < c; r += 1)
|
|
24
|
+
n.push(Uint8Array.from(a[t])), t += 1;
|
|
25
|
+
i.push(n);
|
|
26
|
+
}
|
|
27
|
+
const S = Uint8Array.from(a[t]);
|
|
28
|
+
t += 1;
|
|
29
|
+
const z = Uint8Array.from(a[t]);
|
|
30
|
+
t += 1;
|
|
31
|
+
const f = [];
|
|
32
|
+
for (let o = 0; o < e; o += 1)
|
|
33
|
+
f.push(Uint8Array.from(a[t])), t += 1;
|
|
34
|
+
const h = [];
|
|
35
|
+
for (let o = 0; o < e; o += 1) {
|
|
36
|
+
const n = [];
|
|
37
|
+
for (let r = 0; r < l; r += 1)
|
|
38
|
+
n.push(Uint8Array.from(a[t])), t += 1;
|
|
39
|
+
h.push(n);
|
|
40
|
+
}
|
|
41
|
+
const R = Uint8Array.from(a[t]);
|
|
42
|
+
return t += 1, {
|
|
43
|
+
extraRandomizedStealthAddress: [...A],
|
|
44
|
+
extraRandomizedStealthAddressSigns: [...y],
|
|
45
|
+
extraRandomizedStealthAddressH0Ay: [...x],
|
|
46
|
+
extraRandomizedStealthAddressH1Ay: [...u],
|
|
47
|
+
rootHash: [...U],
|
|
48
|
+
mintAccountPart1: s.map((o) => [...o]),
|
|
49
|
+
mintAccountPart2: d.map((o) => [...o]),
|
|
50
|
+
inNullifiers: i.map((o) => o.map((n) => [...n])),
|
|
51
|
+
outTimestamp: [...S],
|
|
52
|
+
extraRandomization: [...z],
|
|
53
|
+
amountChanges: f.map((o) => [...o]),
|
|
54
|
+
outCommitments: h.map((o) => o.map((n) => [...n])),
|
|
55
|
+
calldataHash: [...R]
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
export {
|
|
59
|
+
C as convertSolanaPublicSignals
|
|
60
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("@coral-xyz/anchor"),n=require("@solana/web3.js"),u=e=>{const t=[];let c=e;for(;c>0n;)t.unshift(Number(c%256n)),c/=256n;for(;t.length<32;)t.unshift(0);return t},i=e=>({extraRandomization:u(e.extraRandomization),stealthAddress:u(e.stealthAddress),h0:u(e.H0),h1:u(e.H1)}),l=(e,t,c)=>{const o=u(e),r=[Buffer.from("hinkal_nullifier"),t.toBuffer(),Buffer.from(o)],[s]=n.PublicKey.findProgramAddressSync(r,c);return s},a=(e,t)=>{const c=[Buffer.from("hinkal"),t.toBuffer()],[o]=n.PublicKey.findProgramAddressSync(c,e);return o},d=(e,t)=>{const c=[Buffer.from("hinkal_merkle"),t.toBuffer()],[o]=n.PublicKey.findProgramAddressSync(c,e);return o},y=(e,t)=>{const c=[Buffer.from("hinkal_merkle_access_token"),t.toBuffer()],[o]=n.PublicKey.findProgramAddressSync(c,e);return o},A=(e,t)=>{const c=[Buffer.from("hinkal_access_token"),t.toBuffer()],[o]=n.PublicKey.findProgramAddressSync(c,e);return o},P=(e,t)=>{const c=[Buffer.from("hinkal_swapper"),t.toBuffer()],[o]=n.PublicKey.findProgramAddressSync(c,e);return o},g=(e,t)=>{const c=[Buffer.from("hinkal_vault"),t.toBuffer()],[o]=n.PublicKey.findProgramAddressSync(c,e);return o},b=(e,t,c)=>{const o=u(e),r=[Buffer.from("hinkal_access_keys"),c.toBuffer(),Buffer.from(o)],[s]=n.PublicKey.findProgramAddressSync(r,t);return s},B=(e,t,c,o)=>{const r=[Buffer.from("hinkal_proof_part1"),t.toBuffer(),c.toBuffer(),new f.BN(o.toString()).toBuffer("be",4)],[s]=n.PublicKey.findProgramAddressSync(r,e);return s},K=(e,t,c,o)=>{const r=[Buffer.from("hinkal_proof_part2"),t.toBuffer(),c.toBuffer(),new f.BN(o.toString()).toBuffer("be",4)],[s]=n.PublicKey.findProgramAddressSync(r,e);return s},m=(e,t,c,o)=>{const r=[Buffer.from("hinkal_encrypted_outputs"),t.toBuffer(),c.toBuffer(),new f.BN(o.toString()).toBuffer("be",4)],[s]=n.PublicKey.findProgramAddressSync(r,e);return s},k=(e,t,c)=>{const o=[Buffer.from("hinkal_token_limit"),t.toBuffer(),c.toBuffer()],[r]=n.PublicKey.findProgramAddressSync(o,e);return r},S=(e,t,c,o)=>{const r=[Buffer.from("hinkal_instructions"),t.toBuffer(),c.toBuffer(),new f.BN(o.toString()).toBuffer("be",4)],[s]=n.PublicKey.findProgramAddressSync(r,e);return s};exports.buildAnchorStealthAddressStructure=i;exports.encodeToByte32Array=u;exports.getAccessTokenAccountPublicKey=b;exports.getAccessTokenMerkleAccountPublicKey=y;exports.getAccessTokenStorageAccountPublicKey=A;exports.getEncryptedOutputsAccountPublicKey=m;exports.getInstructionsAccountPublicKey=S;exports.getMerkleAccountPublicKey=d;exports.getNullifierAccount=l;exports.getProofAccountPart1PublicKey=B;exports.getProofAccountPart2PublicKey=K;exports.getStorageAccountPublicKey=a;exports.getStorageVaultPublicKey=g;exports.getSwapperAccountPublicKey=P;exports.getTokenLimitStorageAccountPublicKey=k;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AnchorStealthAddressStructure, StealthAddressStructure } from '../../types/circom-data.types';
|
|
2
|
+
import { PublicKey } from '@solana/web3.js';
|
|
3
|
+
export declare const encodeToByte32Array: (value: bigint) => number[];
|
|
4
|
+
export declare const buildAnchorStealthAddressStructure: (structure: StealthAddressStructure) => AnchorStealthAddressStructure;
|
|
5
|
+
export declare const getNullifierAccount: (nullifier: bigint, originalDeployer: PublicKey, programId: PublicKey) => PublicKey;
|
|
6
|
+
export declare const getStorageAccountPublicKey: (programId: PublicKey, originalDeployer: PublicKey) => PublicKey;
|
|
7
|
+
export declare const getMerkleAccountPublicKey: (programId: PublicKey, originalDeployer: PublicKey) => PublicKey;
|
|
8
|
+
export declare const getAccessTokenMerkleAccountPublicKey: (programId: PublicKey, originalDeployer: PublicKey) => PublicKey;
|
|
9
|
+
export declare const getAccessTokenStorageAccountPublicKey: (programId: PublicKey, originalDeployer: PublicKey) => PublicKey;
|
|
10
|
+
export declare const getSwapperAccountPublicKey: (programId: PublicKey, originalDeployer: PublicKey) => PublicKey;
|
|
11
|
+
export declare const getStorageVaultPublicKey: (programId: PublicKey, originalDeployer: PublicKey) => PublicKey;
|
|
12
|
+
export declare const getAccessTokenAccountPublicKey: (accessKey: bigint, programId: PublicKey, originalDeployer: PublicKey) => PublicKey;
|
|
13
|
+
export declare const getProofAccountPart1PublicKey: (programId: PublicKey, originalDeployer: PublicKey, signer: PublicKey, id: bigint) => PublicKey;
|
|
14
|
+
export declare const getProofAccountPart2PublicKey: (programId: PublicKey, originalDeployer: PublicKey, signer: PublicKey, id: bigint) => PublicKey;
|
|
15
|
+
export declare const getEncryptedOutputsAccountPublicKey: (programId: PublicKey, originalDeployer: PublicKey, signer: PublicKey, id: bigint) => PublicKey;
|
|
16
|
+
export declare const getTokenLimitStorageAccountPublicKey: (programId: PublicKey, originalDeployer: PublicKey, mint: PublicKey) => PublicKey;
|
|
17
|
+
export declare const getInstructionsAccountPublicKey: (programId: PublicKey, originalDeployer: PublicKey, signer: PublicKey, id: bigint) => PublicKey;
|