@hinkal/common 0.2.21 → 0.2.23
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 +14 -14
- package/API/API.mjs +88 -87
- package/API/admin-calls.cjs +1 -1
- package/API/admin-calls.d.ts +1 -1
- package/API/admin-calls.mjs +4 -4
- package/API/ai-calls.cjs +1 -0
- package/API/ai-calls.d.ts +17 -0
- package/API/ai-calls.mjs +21 -0
- package/API/callLifiAPI.cjs +1 -1
- package/API/callLifiAPI.d.ts +1 -1
- package/API/callLifiAPI.mjs +5 -5
- package/API/callMonitor.cjs +1 -1
- package/API/callMonitor.d.ts +1 -1
- package/API/callMonitor.mjs +7 -7
- package/API/callOdosAPI.cjs +1 -1
- package/API/callOdosAPI.mjs +11 -11
- package/API/callOkxAPI.cjs +1 -1
- package/API/callOkxAPI.d.ts +1 -1
- package/API/callOkxAPI.mjs +5 -5
- package/API/callOneInchAPI.cjs +1 -1
- package/API/callOneInchAPI.mjs +11 -10
- package/API/callRelayer.cjs +1 -1
- package/API/callRelayer.d.ts +5 -6
- package/API/callRelayer.mjs +11 -11
- package/API/checkRisk.cjs +1 -1
- package/API/checkRisk.d.ts +1 -1
- package/API/checkRisk.mjs +4 -4
- package/API/deposit-and-withdraw-status-calls.cjs +1 -0
- package/API/deposit-and-withdraw-status-calls.d.ts +20 -0
- package/API/deposit-and-withdraw-status-calls.mjs +18 -0
- package/API/duneAPI.cjs +1 -0
- package/API/duneAPI.d.ts +11 -0
- package/API/duneAPI.mjs +25 -0
- package/API/enclaveCalls.cjs +1 -1
- package/API/enclaveCalls.mjs +4 -5
- package/API/fetchCommitmentsCache.cjs +1 -1
- package/API/fetchCommitmentsCache.mjs +9 -9
- package/API/get-token-data.cjs +1 -1
- package/API/get-token-data.d.ts +1 -1
- package/API/get-token-data.mjs +5 -5
- 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.mjs +9 -9
- package/API/getLifiStatus.cjs +1 -0
- package/API/getLifiStatus.d.ts +24 -0
- package/API/getLifiStatus.mjs +15 -0
- package/API/getRelayerURL.cjs +1 -0
- package/API/getRelayerURL.d.ts +1 -0
- package/API/getRelayerURL.mjs +10 -0
- package/API/getServerURL.cjs +1 -1
- package/API/getServerURL.d.ts +3 -3
- package/API/getServerURL.mjs +67 -51
- package/API/getTokenPrice.cjs +1 -1
- package/API/getTokenPrice.d.ts +0 -5
- package/API/getTokenPrice.mjs +7 -14
- package/API/index.d.ts +3 -1
- package/API/is-tx-stateless.cjs +1 -1
- package/API/is-tx-stateless.d.ts +1 -1
- package/API/is-tx-stateless.mjs +12 -10
- package/API/kycCalls.cjs +1 -1
- package/API/kycCalls.d.ts +8 -4
- package/API/kycCalls.mjs +26 -23
- package/API/passwordCalls.cjs +1 -0
- package/API/passwordCalls.d.ts +9 -0
- package/API/passwordCalls.mjs +13 -0
- package/API/proxyAccountsCalls.cjs +1 -1
- package/API/proxyAccountsCalls.d.ts +2 -7
- package/API/proxyAccountsCalls.mjs +21 -27
- package/API/relayCalls.cjs +1 -1
- package/API/relayCalls.mjs +4 -4
- package/API/restoreSnapshots.cjs +1 -0
- package/API/restoreSnapshots.d.ts +1 -0
- package/API/restoreSnapshots.mjs +10 -0
- package/API/scheduled-transactions-calls.cjs +1 -1
- package/API/scheduled-transactions-calls.d.ts +9 -1
- package/API/scheduled-transactions-calls.mjs +9 -5
- package/API/simulate-batch-tx.cjs +1 -1
- package/API/simulate-batch-tx.d.ts +2 -2
- package/API/simulate-batch-tx.mjs +6 -7
- package/API/solana-calls.cjs +1 -1
- package/API/solana-calls.d.ts +3 -6
- package/API/solana-calls.mjs +15 -15
- package/API/temporaryWalletCalls.cjs +1 -1
- package/API/temporaryWalletCalls.mjs +19 -13
- package/API/token-calls.cjs +1 -1
- package/API/token-calls.mjs +5 -6
- package/README.md +64 -256
- package/constants/activity.constants.cjs +1 -1
- package/constants/activity.constants.mjs +0 -1
- package/constants/addresses.constants.cjs +1 -1
- package/constants/addresses.constants.mjs +9 -10
- package/constants/chains.constants.cjs +1 -1
- package/constants/chains.constants.d.ts +6 -0
- package/constants/chains.constants.mjs +52 -58
- package/constants/coingecko.constants.cjs +1 -1
- package/constants/coingecko.constants.d.ts +0 -1
- package/constants/coingecko.constants.mjs +10 -11
- package/constants/contracts.constants.cjs +1 -1
- package/constants/contracts.constants.d.ts +3 -3
- package/constants/contracts.constants.mjs +29 -29
- package/constants/deploy-data/deploy-data-solana.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-solana.json.mjs +2 -28
- package/constants/function-signatures.constants.cjs +1 -1
- package/constants/function-signatures.constants.d.ts +1 -0
- package/constants/function-signatures.constants.mjs +4 -3
- package/constants/kyc.constants.cjs +1 -1
- package/constants/kyc.constants.mjs +40 -39
- package/constants/mediaUrls.constants.cjs +1 -1
- package/constants/mediaUrls.constants.d.ts +0 -1
- package/constants/mediaUrls.constants.mjs +1 -2
- package/constants/permit2.constants.cjs +1 -1
- package/constants/permit2.constants.d.ts +1 -0
- package/constants/permit2.constants.mjs +11 -10
- package/constants/server.constants.cjs +1 -1
- package/constants/server.constants.d.ts +123 -19
- package/constants/server.constants.mjs +138 -35
- package/constants/tasks.constants.cjs +1 -1
- package/constants/tasks.constants.mjs +4 -5
- package/constants/vite.constants.cjs +1 -1
- package/constants/vite.constants.mjs +13 -36
- package/crypto/poseidon.cjs +1 -1
- package/crypto/poseidon.mjs +10 -10
- package/data-structures/ApprovalDBs/EventsPublicApprovalsDB.cjs +1 -1
- package/data-structures/ApprovalDBs/EventsPublicApprovalsDB.mjs +86 -83
- package/data-structures/Hinkal/Hinkal.cjs +1 -1
- package/data-structures/Hinkal/Hinkal.d.ts +56 -45
- package/data-structures/Hinkal/Hinkal.mjs +348 -315
- package/data-structures/Hinkal/IHinkal.d.ts +56 -42
- package/data-structures/Hinkal/handleAutoDepositBack.cjs +1 -1
- package/data-structures/Hinkal/handleAutoDepositBack.d.ts +1 -1
- package/data-structures/Hinkal/handleAutoDepositBack.mjs +49 -48
- package/data-structures/Hinkal/hinkalActionFundApproveAndTransact.cjs +1 -0
- package/data-structures/Hinkal/hinkalActionFundApproveAndTransact.d.ts +7 -0
- package/data-structures/Hinkal/hinkalActionFundApproveAndTransact.mjs +42 -0
- package/data-structures/Hinkal/hinkalActionReceive.cjs +1 -1
- package/data-structures/Hinkal/hinkalActionReceive.mjs +24 -29
- package/data-structures/Hinkal/hinkalApprove.cjs +1 -0
- package/data-structures/Hinkal/hinkalApprove.d.ts +3 -0
- package/data-structures/Hinkal/hinkalApprove.mjs +114 -0
- package/data-structures/Hinkal/hinkalCheckTokenRegistry.cjs +1 -1
- package/data-structures/Hinkal/hinkalCheckTokenRegistry.mjs +19 -20
- package/data-structures/Hinkal/hinkalDeposit.cjs +1 -1
- package/data-structures/Hinkal/hinkalDeposit.mjs +84 -89
- package/data-structures/Hinkal/hinkalDepositAndWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalDepositAndWithdraw.d.ts +1 -1
- package/data-structures/Hinkal/hinkalDepositAndWithdraw.mjs +96 -78
- package/data-structures/Hinkal/hinkalDepositOnChainUtxos.cjs +1 -1
- package/data-structures/Hinkal/hinkalDepositOnChainUtxos.d.ts +4 -1
- package/data-structures/Hinkal/hinkalDepositOnChainUtxos.mjs +79 -75
- package/data-structures/Hinkal/hinkalDepostAndBridge.cjs +1 -1
- package/data-structures/Hinkal/hinkalDepostAndBridge.d.ts +1 -1
- package/data-structures/Hinkal/hinkalDepostAndBridge.mjs +151 -140
- package/data-structures/Hinkal/hinkalGetZkMeProvider.cjs +1 -1
- package/data-structures/Hinkal/hinkalGetZkMeProvider.mjs +5 -4
- package/data-structures/Hinkal/hinkalInsideTransact.cjs +1 -0
- package/data-structures/Hinkal/hinkalInsideTransact.d.ts +4 -0
- package/data-structures/Hinkal/hinkalInsideTransact.mjs +120 -0
- package/data-structures/Hinkal/hinkalPrivateWallet.cjs +1 -1
- package/data-structures/Hinkal/hinkalPrivateWallet.d.ts +2 -2
- package/data-structures/Hinkal/hinkalPrivateWallet.mjs +118 -115
- package/data-structures/Hinkal/hinkalProoflessDeposit.cjs +1 -1
- package/data-structures/Hinkal/hinkalProoflessDeposit.mjs +29 -30
- package/data-structures/Hinkal/hinkalProxySwap.cjs +1 -1
- package/data-structures/Hinkal/hinkalProxySwap.mjs +36 -40
- package/data-structures/Hinkal/hinkalProxyToPrivate.cjs +1 -1
- package/data-structures/Hinkal/hinkalProxyToPrivate.mjs +32 -37
- package/data-structures/Hinkal/hinkalSignSubAccount.cjs +1 -1
- package/data-structures/Hinkal/hinkalSignSubAccount.d.ts +2 -1
- package/data-structures/Hinkal/hinkalSignSubAccount.mjs +15 -17
- package/data-structures/Hinkal/hinkalSolanaDeposit.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaDeposit.d.ts +3 -4
- package/data-structures/Hinkal/hinkalSolanaDeposit.mjs +95 -84
- package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.d.ts +1 -2
- package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.mjs +180 -154
- package/data-structures/Hinkal/hinkalSolanaProxySend.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaProxySend.d.ts +3 -2
- package/data-structures/Hinkal/hinkalSolanaProxySend.mjs +40 -43
- package/data-structures/Hinkal/hinkalSolanaProxyShield.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaProxyShield.mjs +67 -71
- package/data-structures/Hinkal/hinkalSolanaProxySwap.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaProxySwap.d.ts +1 -1
- package/data-structures/Hinkal/hinkalSolanaProxySwap.mjs +59 -63
- package/data-structures/Hinkal/hinkalSolanaSwap.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaSwap.mjs +46 -50
- package/data-structures/Hinkal/hinkalSolanaTransfer.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaTransfer.mjs +50 -52
- package/data-structures/Hinkal/hinkalSolanaWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaWithdraw.d.ts +1 -2
- package/data-structures/Hinkal/hinkalSolanaWithdraw.mjs +65 -69
- package/data-structures/Hinkal/hinkalSwap.cjs +1 -1
- package/data-structures/Hinkal/hinkalSwap.mjs +77 -71
- package/data-structures/Hinkal/hinkalTransfer.cjs +1 -1
- package/data-structures/Hinkal/hinkalTransfer.mjs +70 -72
- package/data-structures/Hinkal/hinkalWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalWithdraw.mjs +78 -81
- package/data-structures/Hinkal/hinkalWithdrawStuckUtxos.cjs +1 -1
- package/data-structures/Hinkal/hinkalWithdrawStuckUtxos.mjs +103 -106
- package/data-structures/Hinkal/resetMerkleTrees.cjs +1 -1
- package/data-structures/Hinkal/resetMerkleTrees.d.ts +1 -1
- package/data-structures/Hinkal/resetMerkleTrees.mjs +54 -108
- 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 +79 -97
- package/data-structures/IndexedDB/balances-db.cjs +1 -1
- package/data-structures/IndexedDB/balances-db.mjs +39 -43
- package/data-structures/IndexedDB/contact-db.cjs +1 -1
- package/data-structures/IndexedDB/contact-db.mjs +31 -36
- package/data-structures/IndexedDB/signatures-db.cjs +1 -1
- package/data-structures/IndexedDB/signatures-db.mjs +40 -26
- package/data-structures/TokenDBs/EventsPublicTokensDB.cjs +1 -1
- package/data-structures/TokenDBs/EventsPublicTokensDB.mjs +82 -82
- package/data-structures/TokenDBs/token-visibility-db.cjs +1 -1
- package/data-structures/TokenDBs/token-visibility-db.mjs +36 -22
- package/data-structures/crypto-keys/decodeUTXO.cjs +1 -1
- package/data-structures/crypto-keys/decodeUTXO.mjs +45 -45
- package/data-structures/crypto-keys/encryptDecryptUtxo.cjs +1 -1
- package/data-structures/crypto-keys/encryptDecryptUtxo.mjs +28 -27
- package/data-structures/crypto-keys/keys.cjs +1 -1
- package/data-structures/crypto-keys/keys.d.ts +10 -0
- package/data-structures/crypto-keys/keys.mjs +106 -47
- package/data-structures/event-service/evm/AbstractAccessTokenSnapshotService.cjs +1 -1
- package/data-structures/event-service/evm/AbstractAccessTokenSnapshotService.d.ts +2 -3
- package/data-structures/event-service/evm/AbstractAccessTokenSnapshotService.mjs +9 -9
- package/data-structures/event-service/evm/AbstractApprovalsSnapshotService.cjs +1 -1
- package/data-structures/event-service/evm/AbstractApprovalsSnapshotService.d.ts +2 -3
- package/data-structures/event-service/evm/AbstractApprovalsSnapshotService.mjs +5 -5
- package/data-structures/event-service/evm/AbstractCommitmentsSnapshotService.cjs +1 -1
- package/data-structures/event-service/evm/AbstractCommitmentsSnapshotService.d.ts +2 -3
- package/data-structures/event-service/evm/AbstractCommitmentsSnapshotService.mjs +6 -6
- package/data-structures/event-service/evm/AbstractEventService.cjs +1 -1
- package/data-structures/event-service/evm/AbstractEventService.d.ts +2 -4
- package/data-structures/event-service/evm/AbstractEventService.mjs +13 -13
- package/data-structures/event-service/evm/AbstractNullifierSnapshotService.cjs +1 -1
- package/data-structures/event-service/evm/AbstractNullifierSnapshotService.d.ts +2 -3
- package/data-structures/event-service/evm/AbstractNullifierSnapshotService.mjs +3 -3
- package/data-structures/event-service/evm/AbstractSnapshotService.cjs +1 -1
- package/data-structures/event-service/evm/AbstractSnapshotService.d.ts +2 -1
- package/data-structures/event-service/evm/AbstractSnapshotService.mjs +6 -2
- package/data-structures/event-service/evm/BlockchainEventEmitter.cjs +1 -1
- package/data-structures/event-service/evm/BlockchainEventEmitter.d.ts +5 -10
- package/data-structures/event-service/evm/BlockchainEventEmitter.mjs +40 -40
- package/data-structures/event-service/index.d.ts +0 -4
- package/data-structures/event-service/solana/AbstractSolanaAccessTokenSnapshotService.cjs +1 -1
- package/data-structures/event-service/solana/AbstractSolanaAccessTokenSnapshotService.d.ts +2 -3
- package/data-structures/event-service/solana/AbstractSolanaAccessTokenSnapshotService.mjs +6 -6
- package/data-structures/event-service/solana/AbstractSolanaCommitmentsSnapshotService.cjs +1 -1
- package/data-structures/event-service/solana/AbstractSolanaCommitmentsSnapshotService.d.ts +3 -4
- package/data-structures/event-service/solana/AbstractSolanaCommitmentsSnapshotService.mjs +8 -8
- package/data-structures/event-service/solana/AbstractSolanaEventService.cjs +1 -1
- package/data-structures/event-service/solana/AbstractSolanaEventService.d.ts +10 -4
- package/data-structures/event-service/solana/AbstractSolanaEventService.mjs +7 -10
- package/data-structures/event-service/solana/AbstractSolanaNullifierSnapshotService.cjs +1 -1
- package/data-structures/event-service/solana/AbstractSolanaNullifierSnapshotService.d.ts +2 -3
- package/data-structures/event-service/solana/AbstractSolanaNullifierSnapshotService.mjs +2 -2
- package/data-structures/event-service/solana/AbstractSolanaSnapshotService.cjs +1 -1
- package/data-structures/event-service/solana/AbstractSolanaSnapshotService.d.ts +2 -1
- package/data-structures/event-service/solana/AbstractSolanaSnapshotService.mjs +2 -1
- package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.cjs +1 -1
- package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.d.ts +16 -11
- package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.mjs +66 -64
- package/data-structures/index.d.ts +0 -3
- package/data-structures/presale/PresaleContractWrapper.cjs +1 -1
- package/data-structures/presale/PresaleContractWrapper.d.ts +3 -3
- package/data-structures/presale/PresaleContractWrapper.mjs +10 -10
- package/data-structures/provider-adapter/IProviderAdapter.d.ts +16 -11
- package/data-structures/snapshot/evm-snapshots/ClientAccessTokenSnapshotService.cjs +1 -1
- package/data-structures/snapshot/evm-snapshots/ClientAccessTokenSnapshotService.mjs +18 -18
- package/data-structures/snapshot/evm-snapshots/ClientApprovalsSnapshotService.cjs +1 -1
- package/data-structures/snapshot/evm-snapshots/ClientApprovalsSnapshotService.mjs +9 -9
- package/data-structures/snapshot/evm-snapshots/ClientCommitmentsSnapshotService.cjs +1 -1
- package/data-structures/snapshot/evm-snapshots/ClientCommitmentsSnapshotService.mjs +4 -6
- package/data-structures/snapshot/evm-snapshots/ClientNullifierSnapshotService.cjs +1 -1
- package/data-structures/snapshot/evm-snapshots/ClientNullifierSnapshotService.mjs +4 -6
- package/data-structures/snapshot/solana-snapshots/ClientSolanaAccessTokenSnapshotService.cjs +1 -1
- package/data-structures/snapshot/solana-snapshots/ClientSolanaAccessTokenSnapshotService.mjs +4 -6
- package/data-structures/snapshot/solana-snapshots/ClientSolanaCommitmentsSnapshotService.cjs +1 -1
- package/data-structures/snapshot/solana-snapshots/ClientSolanaCommitmentsSnapshotService.mjs +4 -5
- package/data-structures/snapshot/solana-snapshots/ClientSolanaNullifierSnapshotService.cjs +1 -1
- package/data-structures/snapshot/solana-snapshots/ClientSolanaNullifierSnapshotService.mjs +4 -6
- package/error-handling/error-codes.constants.cjs +1 -1
- package/error-handling/error-codes.constants.d.ts +0 -1
- package/error-handling/error-codes.constants.mjs +3 -4
- package/error-handling/get-error.message.cjs +1 -1
- package/error-handling/get-error.message.mjs +27 -22
- package/error-handling/handleErrorRestore.cjs +1 -0
- package/error-handling/handleErrorRestore.d.ts +2 -0
- package/error-handling/handleErrorRestore.mjs +11 -0
- package/error-handling/index.d.ts +1 -0
- package/functions/kyc/authentoHelper.cjs +1 -0
- package/functions/kyc/authentoHelper.d.ts +12 -0
- package/functions/kyc/authentoHelper.mjs +30 -0
- package/functions/kyc/zkMeHelper.cjs +1 -1
- package/functions/kyc/zkMeHelper.mjs +16 -17
- package/functions/pre-transaction/constructAdminData.cjs +1 -1
- package/functions/pre-transaction/constructAdminData.d.ts +2 -2
- package/functions/pre-transaction/constructAdminData.mjs +18 -12
- package/functions/pre-transaction/getExternalSwapAddress.cjs +1 -1
- package/functions/pre-transaction/getExternalSwapAddress.d.ts +2 -1
- package/functions/pre-transaction/getExternalSwapAddress.mjs +8 -8
- package/functions/pre-transaction/getFlatFees.cjs +1 -1
- package/functions/pre-transaction/getFlatFees.mjs +2 -3
- package/functions/pre-transaction/getSolanaCalldataHash.cjs +1 -1
- package/functions/pre-transaction/getSolanaCalldataHash.mjs +21 -21
- package/functions/pre-transaction/getVolatileTransferAmount.cjs +1 -1
- package/functions/pre-transaction/getVolatileTransferAmount.mjs +36 -22
- package/functions/pre-transaction/interaction-to-action.cjs +1 -1
- package/functions/pre-transaction/interaction-to-action.mjs +2 -3
- package/functions/pre-transaction/merge-with-fee-structure-emporium.cjs +1 -1
- package/functions/pre-transaction/merge-with-fee-structure-emporium.d.ts +1 -1
- package/functions/pre-transaction/merge-with-fee-structure-emporium.mjs +17 -17
- package/functions/pre-transaction/outputApprovalDataProcessing.cjs +1 -1
- package/functions/pre-transaction/outputApprovalDataProcessing.d.ts +9 -1
- package/functions/pre-transaction/outputApprovalDataProcessing.mjs +34 -19
- package/functions/pre-transaction/sendV0Transaction.cjs +1 -1
- package/functions/pre-transaction/sendV0Transaction.mjs +50 -53
- package/functions/pre-transaction/shouldPatchAccessTokenMerkleTree.cjs +1 -1
- package/functions/pre-transaction/shouldPatchAccessTokenMerkleTree.d.ts +1 -1
- package/functions/pre-transaction/shouldPatchAccessTokenMerkleTree.mjs +4 -4
- package/functions/private-wallet/emporium.helpers.cjs +1 -1
- package/functions/private-wallet/emporium.helpers.d.ts +12 -10
- package/functions/private-wallet/emporium.helpers.mjs +139 -102
- package/functions/private-wallet/emporium.swap.helpers.cjs +1 -1
- package/functions/private-wallet/emporium.swap.helpers.d.ts +4 -1
- package/functions/private-wallet/emporium.swap.helpers.mjs +106 -103
- package/functions/private-wallet/opProducer.cjs +1 -1
- package/functions/private-wallet/opProducer.mjs +1 -1
- package/functions/snarkjs/common.snarkjs.cjs +1 -1
- package/functions/snarkjs/common.snarkjs.mjs +21 -18
- package/functions/snarkjs/constructEmporiumProof.cjs +1 -1
- package/functions/snarkjs/constructEmporiumProof.mjs +49 -49
- package/functions/snarkjs/constructSolanaZkProof.cjs +1 -1
- package/functions/snarkjs/constructSolanaZkProof.mjs +11 -10
- package/functions/snarkjs/fetchMerkleTreeSiblings.cjs +1 -1
- package/functions/snarkjs/fetchMerkleTreeSiblings.mjs +10 -11
- package/functions/utils/addresses.cjs +1 -1
- package/functions/utils/addresses.d.ts +0 -1
- package/functions/utils/addresses.mjs +11 -12
- package/functions/utils/cacheFunctions.cjs +1 -1
- package/functions/utils/cacheFunctions.d.ts +1 -1
- package/functions/utils/cacheFunctions.mjs +55 -54
- package/functions/utils/convertEmporiumOpToCallInfo.cjs +1 -1
- package/functions/utils/convertEmporiumOpToCallInfo.mjs +5 -5
- package/functions/utils/create-provider.cjs +1 -1
- package/functions/utils/create-provider.d.ts +2 -2
- package/functions/utils/create-provider.mjs +7 -11
- package/functions/utils/encryptInputForEnclave.cjs +1 -1
- package/functions/utils/encryptInputForEnclave.mjs +9 -9
- package/functions/utils/ethers-formatter.utils.d.ts +1 -1
- package/functions/utils/external-action.utils.cjs +1 -1
- package/functions/utils/external-action.utils.mjs +2 -2
- 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/getContractAddress.cjs +1 -0
- package/functions/utils/getContractAddress.d.ts +2 -0
- package/functions/utils/getContractAddress.mjs +9 -0
- package/functions/utils/getDataFromTransaction.cjs +1 -1
- package/functions/utils/getDataFromTransaction.d.ts +0 -11
- package/functions/utils/getDataFromTransaction.mjs +26 -50
- package/functions/utils/getRecipientInfoFromUserKeys.cjs +1 -1
- package/functions/utils/getRecipientInfoFromUserKeys.mjs +1 -1
- package/functions/utils/getSignerFromContract.cjs +1 -0
- package/functions/utils/getSignerFromContract.d.ts +3 -0
- package/functions/utils/getSignerFromContract.mjs +16 -0
- package/functions/utils/getUtxosFromReceipt.utils.cjs +1 -1
- package/functions/utils/getUtxosFromReceipt.utils.d.ts +1 -1
- package/functions/utils/getUtxosFromReceipt.utils.mjs +14 -15
- package/functions/utils/inLogicMetadata.cjs +1 -1
- package/functions/utils/inLogicMetadata.mjs +2 -2
- package/functions/utils/index.d.ts +1 -0
- package/functions/utils/involves-permit2-op.cjs +1 -1
- package/functions/utils/involves-permit2-op.d.ts +1 -0
- package/functions/utils/involves-permit2-op.mjs +6 -4
- package/functions/utils/mutexes.utils.cjs +1 -1
- package/functions/utils/mutexes.utils.d.ts +1 -1
- package/functions/utils/mutexes.utils.mjs +3 -3
- package/functions/utils/nftTokenFunctions.cjs +1 -1
- package/functions/utils/nftTokenFunctions.mjs +23 -9
- package/functions/utils/prepareHinkal.cjs +1 -1
- package/functions/utils/prepareHinkal.d.ts +13 -6
- package/functions/utils/prepareHinkal.mjs +72 -45
- package/functions/utils/publicBalance.utils.cjs +1 -1
- package/functions/utils/publicBalance.utils.d.ts +1 -1
- package/functions/utils/publicBalance.utils.mjs +62 -57
- package/functions/utils/replaceAddressInCalldata.cjs +1 -0
- package/functions/utils/replaceAddressInCalldata.d.ts +1 -0
- package/functions/utils/replaceAddressInCalldata.mjs +7 -0
- package/functions/utils/rpc-int-encode.cjs +1 -1
- package/functions/utils/rpc-int-encode.d.ts +1 -2
- package/functions/utils/rpc-int-encode.mjs +3 -6
- package/functions/utils/solanaMint.utils.cjs +1 -1
- package/functions/utils/solanaMint.utils.mjs +6 -6
- package/functions/utils/string.utils.cjs +1 -1
- package/functions/utils/string.utils.d.ts +0 -1
- package/functions/utils/string.utils.mjs +14 -18
- package/functions/utils/token-check.utils.cjs +1 -1
- package/functions/utils/token-check.utils.d.ts +0 -3
- package/functions/utils/token-check.utils.mjs +7 -18
- package/functions/utils/upToDateState.cjs +1 -1
- package/functions/utils/upToDateState.d.ts +1 -1
- package/functions/utils/upToDateState.mjs +4 -4
- package/functions/utils/walletBalances.utils.cjs +1 -1
- package/functions/utils/walletBalances.utils.d.ts +17 -2
- package/functions/utils/walletBalances.utils.mjs +36 -5
- package/functions/web3/EIP-712.cjs +1 -1
- package/functions/web3/EIP-712.d.ts +4 -4
- package/functions/web3/EIP-712.mjs +1 -1
- package/functions/web3/etherFunctions.cjs +1 -1
- package/functions/web3/etherFunctions.mjs +32 -29
- package/functions/web3/events/balanceChangedCustomHandler.cjs +1 -1
- package/functions/web3/events/balanceChangedCustomHandler.mjs +4 -5
- package/functions/web3/events/balanceChangedHandler.cjs +1 -1
- package/functions/web3/events/balanceChangedHandler.mjs +2 -3
- package/functions/web3/events/getApprovedBalance.cjs +1 -1
- package/functions/web3/events/getApprovedBalance.d.ts +4 -3
- package/functions/web3/events/getApprovedBalance.mjs +44 -39
- package/functions/web3/events/getInputUtxoAndBalance.cjs +1 -1
- package/functions/web3/events/getInputUtxoAndBalance.d.ts +3 -3
- package/functions/web3/events/getInputUtxoAndBalance.mjs +150 -129
- package/functions/web3/events/getInputUtxosEnclave.cjs +1 -1
- package/functions/web3/events/getInputUtxosEnclave.mjs +20 -20
- package/functions/web3/events/getShieldedBalance.cjs +2 -2
- package/functions/web3/events/getShieldedBalance.d.ts +1 -1
- package/functions/web3/events/getShieldedBalance.mjs +75 -73
- package/functions/web3/events/getTransactionLogEvents.cjs +1 -1
- package/functions/web3/events/getTransactionLogEvents.d.ts +3 -3
- package/functions/web3/events/getTransactionLogEvents.mjs +41 -40
- package/functions/web3/events/index.d.ts +0 -1
- package/functions/web3/fetchSolanaMerkleTreeRootHash.cjs +1 -1
- package/functions/web3/fetchSolanaMerkleTreeRootHash.d.ts +1 -2
- package/functions/web3/fetchSolanaMerkleTreeRootHash.mjs +12 -16
- package/functions/web3/functionCalls/accessTokenCalls.cjs +1 -1
- package/functions/web3/functionCalls/accessTokenCalls.d.ts +6 -1
- package/functions/web3/functionCalls/accessTokenCalls.mjs +20 -12
- package/functions/web3/functionCalls/approveToken.cjs +1 -1
- package/functions/web3/functionCalls/approveToken.d.ts +1 -1
- package/functions/web3/functionCalls/approveToken.mjs +68 -69
- package/functions/web3/functionCalls/approveTokensToHinkal.cjs +1 -1
- package/functions/web3/functionCalls/approveTokensToHinkal.d.ts +1 -1
- package/functions/web3/functionCalls/approveTokensToHinkal.mjs +6 -6
- package/functions/web3/functionCalls/constructBatchCall.cjs +1 -1
- package/functions/web3/functionCalls/constructBatchCall.d.ts +2 -2
- package/functions/web3/functionCalls/constructBatchCall.mjs +10 -9
- package/functions/web3/functionCalls/estimateGasRelayer.cjs +1 -1
- package/functions/web3/functionCalls/estimateGasRelayer.d.ts +2 -1
- package/functions/web3/functionCalls/estimateGasRelayer.mjs +10 -10
- package/functions/web3/functionCalls/inHinkalApprovalCalls.cjs +1 -0
- package/functions/web3/functionCalls/inHinkalApprovalCalls.d.ts +5 -0
- package/functions/web3/functionCalls/inHinkalApprovalCalls.mjs +29 -0
- package/functions/web3/functionCalls/recoverTransactionFromError.d.ts +1 -1
- package/functions/web3/functionCalls/transactCallDirect.cjs +1 -1
- package/functions/web3/functionCalls/transactCallDirect.d.ts +1 -1
- package/functions/web3/functionCalls/transactCallDirect.mjs +47 -39
- package/functions/web3/functionCalls/transactCallRelayer.cjs +1 -1
- package/functions/web3/functionCalls/transactCallRelayer.d.ts +3 -3
- package/functions/web3/functionCalls/transactCallRelayer.mjs +54 -56
- package/functions/web3/getContractMetadata.cjs +1 -1
- package/functions/web3/getContractMetadata.d.ts +1 -1
- package/functions/web3/getContractMetadata.mjs +21 -16
- package/functions/web3/getPublicAddressBalance.cjs +1 -1
- package/functions/web3/getPublicAddressBalance.d.ts +1 -1
- package/functions/web3/getPublicAddressBalance.mjs +7 -6
- package/functions/web3/getTokenHolder.cjs +1 -1
- package/functions/web3/getTokenHolder.mjs +32 -31
- package/functions/web3/index.d.ts +0 -1
- package/functions/web3/lifiAPI.cjs +1 -1
- package/functions/web3/lifiAPI.d.ts +1 -1
- package/functions/web3/lifiAPI.mjs +12 -12
- package/functions/web3/odosAPI.cjs +1 -1
- package/functions/web3/odosAPI.mjs +15 -3
- package/functions/web3/okxAPI.cjs +1 -1
- package/functions/web3/okxAPI.mjs +13 -13
- package/functions/web3/oneInchAPI.cjs +1 -1
- package/functions/web3/oneInchAPI.mjs +20 -8
- package/functions/web3/runContractFunction.cjs +1 -1
- package/functions/web3/runContractFunction.d.ts +6 -5
- package/functions/web3/runContractFunction.mjs +60 -46
- package/functions/web3/uniswapAPI.cjs +1 -1
- package/functions/web3/uniswapAPI.d.ts +2 -2
- package/functions/web3/uniswapAPI.mjs +49 -38
- package/index.cjs +1 -1
- package/index.mjs +912 -914
- package/package.json +4 -6
- package/providers/CustomEthersProvider.d.ts +1 -1
- package/providers/EthersProviderAdapter.cjs +1 -1
- package/providers/EthersProviderAdapter.d.ts +21 -14
- package/providers/EthersProviderAdapter.mjs +86 -53
- package/providers/SolanaProviderAdapter.cjs +1 -1
- package/providers/SolanaProviderAdapter.d.ts +12 -8
- package/providers/SolanaProviderAdapter.mjs +31 -16
- package/providers/WagmiProviderAdapter.cjs +1 -1
- package/providers/WagmiProviderAdapter.d.ts +20 -14
- package/providers/WagmiProviderAdapter.mjs +126 -91
- package/providers/prepareEthersHinkal.cjs +1 -1
- package/providers/prepareEthersHinkal.d.ts +2 -2
- package/providers/prepareEthersHinkal.mjs +9 -16
- package/providers/prepareWagmiHinkal.cjs +1 -1
- package/providers/prepareWagmiHinkal.mjs +9 -17
- package/types/TransactionSimulator.types.d.ts +9 -2
- package/types/activities.types.d.ts +2 -5
- package/types/admin.types.cjs +1 -1
- package/types/admin.types.d.ts +6 -0
- package/types/admin.types.mjs +2 -2
- package/types/balances.types.d.ts +1 -0
- package/types/big-intable.types.d.ts +3 -2
- package/types/bridging.types.d.ts +29 -0
- package/types/cache.types.cjs +1 -1
- package/types/cache.types.d.ts +3 -6
- package/types/cache.types.mjs +1 -1
- package/types/coingecko.types.d.ts +0 -5
- package/types/duneAPI.types.d.ts +9 -0
- package/types/ethereum-network.types.d.ts +10 -11
- package/types/hinkal.types.cjs +1 -1
- package/types/hinkal.types.d.ts +1 -1
- package/types/hinkal.types.mjs +18 -18
- package/types/index.d.ts +2 -2
- package/types/proxy.types.d.ts +3 -6
- package/types/sandbox.types.cjs +1 -1
- package/types/sandbox.types.d.ts +39 -10
- package/types/sandbox.types.mjs +2 -2
- package/types/scheduled-transactions.types.cjs +1 -1
- package/types/scheduled-transactions.types.d.ts +6 -0
- package/types/scheduled-transactions.types.mjs +3 -2
- package/types/session.types.d.ts +0 -2
- package/types/solana.types.d.ts +0 -9
- package/types/token-prices.types.cjs +1 -1
- package/types/token-prices.types.d.ts +0 -7
- package/types/token-prices.types.mjs +2 -4
- package/types/transactions.types.cjs +1 -1
- package/types/transactions.types.d.ts +2 -3
- package/types/transactions.types.mjs +6 -7
- package/webworker/snarkjsWorker/snarkjsWorkerLauncher.cjs +1 -1
- package/webworker/snarkjsWorker/snarkjsWorkerLauncher.mjs +1 -1
- 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 +1 -1
- 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/get-token-price-chart-data.cjs +0 -1
- package/API/get-token-price-chart-data.d.ts +0 -16
- package/API/get-token-price-chart-data.mjs +0 -13
- package/API/onrampCalls.cjs +0 -1
- package/API/onrampCalls.d.ts +0 -20
- package/API/onrampCalls.mjs +0 -15
- package/API/unspent-utxos-calls.cjs +0 -1
- package/API/unspent-utxos-calls.d.ts +0 -26
- package/API/unspent-utxos-calls.mjs +0 -26
- package/data-structures/AccountActions/AccountActions.cjs +0 -1
- package/data-structures/AccountActions/AccountActions.d.ts +0 -18
- package/data-structures/AccountActions/AccountActions.mjs +0 -78
- package/data-structures/AccountActions/index.d.ts +0 -1
- package/data-structures/BlockchainEvent/BlockchainEvent.cjs +0 -1
- package/data-structures/BlockchainEvent/BlockchainEvent.d.ts +0 -14
- package/data-structures/BlockchainEvent/BlockchainEvent.mjs +0 -41
- package/data-structures/PublicBalance/PublicBalanceWatcher.cjs +0 -1
- package/data-structures/PublicBalance/PublicBalanceWatcher.d.ts +0 -20
- package/data-structures/PublicBalance/PublicBalanceWatcher.mjs +0 -124
- package/data-structures/PublicBalance/SolanaPublicBalancerWatcher.cjs +0 -1
- package/data-structures/PublicBalance/SolanaPublicBalancerWatcher.d.ts +0 -15
- package/data-structures/PublicBalance/SolanaPublicBalancerWatcher.mjs +0 -64
- package/data-structures/PublicBalance/index.d.ts +0 -2
- package/data-structures/event-service/evm/ClientBlockchainEventEmitter.cjs +0 -1
- package/data-structures/event-service/evm/ClientBlockchainEventEmitter.d.ts +0 -11
- package/data-structures/event-service/evm/ClientBlockchainEventEmitter.mjs +0 -21
- package/data-structures/event-service/evm/PollingBlockchainEventEmitter.cjs +0 -1
- package/data-structures/event-service/evm/PollingBlockchainEventEmitter.d.ts +0 -6
- package/data-structures/event-service/evm/PollingBlockchainEventEmitter.mjs +0 -16
- package/data-structures/event-service/helpers/ClientEventHelper.cjs +0 -1
- package/data-structures/event-service/helpers/ClientEventHelper.d.ts +0 -11
- package/data-structures/event-service/helpers/ClientEventHelper.mjs +0 -26
- package/data-structures/event-service/helpers/PollingEventHelper.cjs +0 -1
- package/data-structures/event-service/helpers/PollingEventHelper.d.ts +0 -5
- package/data-structures/event-service/helpers/PollingEventHelper.mjs +0 -14
- package/data-structures/event-service/solana/ClientSolanaBlockchainEventEmitter.cjs +0 -1
- package/data-structures/event-service/solana/ClientSolanaBlockchainEventEmitter.d.ts +0 -11
- package/data-structures/event-service/solana/ClientSolanaBlockchainEventEmitter.mjs +0 -22
- package/data-structures/event-service/solana/PollingSolanaBlockchainEventEmitter.cjs +0 -1
- package/data-structures/event-service/solana/PollingSolanaBlockchainEventEmitter.d.ts +0 -6
- package/data-structures/event-service/solana/PollingSolanaBlockchainEventEmitter.mjs +0 -16
- package/functions/utils/enum.utils.cjs +0 -1
- package/functions/utils/enum.utils.mjs +0 -14
- package/functions/utils/socket.utils.cjs +0 -1
- package/functions/utils/socket.utils.d.ts +0 -1
- package/functions/utils/socket.utils.mjs +0 -12
- package/functions/web3/crypto.cjs +0 -1
- package/functions/web3/crypto.d.ts +0 -1
- package/functions/web3/crypto.mjs +0 -7
- package/functions/web3/events/web3RetrieveEvents.cjs +0 -1
- package/functions/web3/events/web3RetrieveEvents.d.ts +0 -14
- package/functions/web3/events/web3RetrieveEvents.mjs +0 -9
- package/types/events.types.cjs +0 -1
- package/types/events.types.d.ts +0 -9
- package/types/events.types.mjs +0 -5
- package/types/onramp.types.cjs +0 -1
- package/types/onramp.types.d.ts +0 -58
- package/types/onramp.types.mjs +0 -4
|
@@ -1 +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"),
|
|
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;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { getAssociatedTokenAddress as
|
|
1
|
+
import { getAssociatedTokenAddress as V, TOKEN_PROGRAM_ID as I, ASSOCIATED_TOKEN_PROGRAM_ID as p, createAssociatedTokenAccountInstruction as y } from "@solana/spl-token";
|
|
2
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
|
|
4
|
-
import { convertSolanaTransactionToRelayer as
|
|
5
|
-
import {
|
|
6
|
-
const
|
|
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
7
|
try {
|
|
8
|
-
const { blockhash:
|
|
8
|
+
const { blockhash: s } = await t.getLatestBlockhash(), o = [
|
|
9
9
|
d.setComputeUnitLimit({ units: l }),
|
|
10
10
|
...n
|
|
11
11
|
], i = new h({
|
|
12
|
-
payerKey:
|
|
13
|
-
recentBlockhash:
|
|
12
|
+
payerKey: a,
|
|
13
|
+
recentBlockhash: s,
|
|
14
14
|
instructions: o
|
|
15
15
|
}).compileToV0Message(e), r = new g(i), c = await t.simulateTransaction(r, {
|
|
16
16
|
sigVerify: !1,
|
|
@@ -18,107 +18,104 @@ const R = async (t, s, n, e) => {
|
|
|
18
18
|
}), { unitsConsumed: m } = c.value;
|
|
19
19
|
if (!m)
|
|
20
20
|
return l;
|
|
21
|
-
const u = Math.ceil(m * (1 +
|
|
22
|
-
return Math.max(
|
|
21
|
+
const u = Math.ceil(m * (1 + B));
|
|
22
|
+
return Math.max(C, Math.min(u, l));
|
|
23
23
|
} catch {
|
|
24
24
|
return l;
|
|
25
25
|
}
|
|
26
|
-
},
|
|
27
|
-
const
|
|
26
|
+
}, f = async (t, a, n, e) => {
|
|
27
|
+
const s = n.filter(
|
|
28
28
|
(c) => !c.programId.equals(d.programId)
|
|
29
|
-
), o = await
|
|
29
|
+
), o = await P(
|
|
30
30
|
t,
|
|
31
|
-
s,
|
|
32
31
|
a,
|
|
32
|
+
s,
|
|
33
33
|
e
|
|
34
34
|
), i = d.setComputeUnitLimit({ units: o }), r = d.setComputeUnitPrice({
|
|
35
|
-
microLamports:
|
|
35
|
+
microLamports: L
|
|
36
36
|
});
|
|
37
|
-
return [i, r, ...
|
|
38
|
-
},
|
|
39
|
-
if (
|
|
37
|
+
return [i, r, ...s];
|
|
38
|
+
}, R = async (t, a, n, e, s) => {
|
|
39
|
+
if (a.length === 0)
|
|
40
40
|
return "";
|
|
41
|
-
const { blockhash: o, lastValidBlockHeight: i } = await t.getLatestBlockhash("confirmed"), r = await
|
|
41
|
+
const { blockhash: o, lastValidBlockHeight: i } = await t.getLatestBlockhash("confirmed"), r = await f(
|
|
42
42
|
t,
|
|
43
43
|
n.publicKey,
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
a,
|
|
45
|
+
s
|
|
46
46
|
), c = new h({
|
|
47
47
|
payerKey: n.publicKey,
|
|
48
48
|
instructions: r,
|
|
49
49
|
recentBlockhash: o
|
|
50
|
-
}).compileToV0Message(
|
|
50
|
+
}).compileToV0Message(s), m = new g(c);
|
|
51
51
|
m.sign(e);
|
|
52
52
|
const u = await t.sendTransaction(m);
|
|
53
53
|
return await t.confirmTransaction({ signature: u, blockhash: o, lastValidBlockHeight: i }, "confirmed"), u;
|
|
54
|
-
}, D = async (t,
|
|
54
|
+
}, D = async (t, a, n, e) => {
|
|
55
55
|
if (!n)
|
|
56
56
|
return null;
|
|
57
|
-
const
|
|
58
|
-
if (!await t.getAccountInfo(
|
|
59
|
-
const i =
|
|
60
|
-
|
|
61
|
-
|
|
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
62
|
e,
|
|
63
63
|
n,
|
|
64
64
|
I,
|
|
65
|
-
|
|
65
|
+
p
|
|
66
66
|
);
|
|
67
|
-
await
|
|
67
|
+
await R(t, [i], a, [a]);
|
|
68
68
|
}
|
|
69
|
-
return
|
|
70
|
-
},
|
|
69
|
+
return s;
|
|
70
|
+
}, v = async ({
|
|
71
71
|
connection: t,
|
|
72
|
-
chainId:
|
|
72
|
+
chainId: a,
|
|
73
73
|
subAccount: n,
|
|
74
74
|
payerPublicKey: e,
|
|
75
|
-
instructions:
|
|
75
|
+
instructions: s,
|
|
76
76
|
lookupTableAccounts: o,
|
|
77
77
|
convertParams: i
|
|
78
78
|
}) => {
|
|
79
|
-
const { blockhash: r, lastValidBlockHeight: c } = await t.getLatestBlockhash(), m = await
|
|
79
|
+
const { blockhash: r, lastValidBlockHeight: c } = await t.getLatestBlockhash(), m = await f(
|
|
80
80
|
t,
|
|
81
81
|
e,
|
|
82
|
-
|
|
82
|
+
s,
|
|
83
83
|
o
|
|
84
84
|
), u = new h({
|
|
85
85
|
payerKey: e,
|
|
86
86
|
recentBlockhash: r,
|
|
87
87
|
instructions: m
|
|
88
|
-
}).compileToV0Message(o),
|
|
89
|
-
if (!p)
|
|
90
|
-
throw Error("Private key is not available");
|
|
91
|
-
const f = await A.sendAndSignTransactionFromPrivateKey(s, p, M);
|
|
88
|
+
}).compileToV0Message(o), w = new g(u), T = await E.sendAndSignTransactionFromPrivateKey(a, n.privateKey, w);
|
|
92
89
|
await t.confirmTransaction(
|
|
93
90
|
{
|
|
94
|
-
signature:
|
|
91
|
+
signature: T,
|
|
95
92
|
blockhash: r,
|
|
96
93
|
lastValidBlockHeight: c
|
|
97
94
|
},
|
|
98
95
|
"confirmed"
|
|
99
96
|
);
|
|
100
|
-
const
|
|
97
|
+
const M = await t.getTransaction(T, {
|
|
101
98
|
commitment: "confirmed",
|
|
102
99
|
maxSupportedTransactionVersion: 0
|
|
103
|
-
}), { fromAddress:
|
|
104
|
-
return
|
|
105
|
-
},
|
|
106
|
-
const { blockhash:
|
|
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(
|
|
107
104
|
t,
|
|
108
|
-
|
|
105
|
+
a,
|
|
109
106
|
n,
|
|
110
107
|
e
|
|
111
108
|
), i = new h({
|
|
112
|
-
payerKey:
|
|
113
|
-
recentBlockhash:
|
|
109
|
+
payerKey: a,
|
|
110
|
+
recentBlockhash: s,
|
|
114
111
|
instructions: o
|
|
115
112
|
}).compileToV0Message(e), r = new g(i);
|
|
116
113
|
return Buffer.from(r.serialize()).toString("base64");
|
|
117
114
|
};
|
|
118
115
|
export {
|
|
119
116
|
D as ensureAtaExists,
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
117
|
+
P as estimateComputeUnitLimit,
|
|
118
|
+
v as sendProxyV0Transaction,
|
|
119
|
+
R as sendV0Transaction,
|
|
120
|
+
G as serializeProxyV0Transaction
|
|
124
121
|
};
|
|
@@ -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=async(e,t,o)=>{const c=await e.checkTokenRegistry(t,o),s=await e.checkAccessToken();return{patchAccessTokenMerkleTree:c&&!s,hasAccessToken:s,kycRequired:c}};exports.shouldPatchAccessTokenMerkleTree=r;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IHinkal } from '../../data-structures/Hinkal/IHinkal';
|
|
2
|
-
export declare const shouldPatchAccessTokenMerkleTree: (hinkal: IHinkal,
|
|
2
|
+
export declare const shouldPatchAccessTokenMerkleTree: (hinkal: IHinkal, erc20Addresses: string[], amountChanges: bigint[]) => Promise<{
|
|
3
3
|
patchAccessTokenMerkleTree: boolean;
|
|
4
4
|
hasAccessToken: boolean;
|
|
5
5
|
kycRequired: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const
|
|
2
|
-
const
|
|
3
|
-
return { patchAccessTokenMerkleTree:
|
|
1
|
+
const k = async (e, o, t) => {
|
|
2
|
+
const c = await e.checkTokenRegistry(o, t), s = await e.checkAccessToken();
|
|
3
|
+
return { patchAccessTokenMerkleTree: c && !s, hasAccessToken: s, kycRequired: c };
|
|
4
4
|
};
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
k as shouldPatchAccessTokenMerkleTree
|
|
7
7
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("../../constants/protocol.constants.cjs"),y=require("../../types/ethereum-network.types.cjs");require("idb-keyval");const v=require("../../constants/chains.constants.cjs"),q=require("../utils/getContractAddress.cjs"),k=require("../utils/create-provider.cjs"),u=require("ethers");require("../../constants/token-data/index.cjs");require("../../error-handling/error-codes.constants.cjs");require("../utils/convertIntegrationProviderToExternalActionId.cjs");require("../../types/circom-data.types.cjs");require("../../types/activities.types.cjs");require("circomlibjs-hinkal-fork");const f=require("../../data-structures/crypto-keys/keys.cjs");require("../../constants/server.constants.cjs");require("../../constants/vite.constants.cjs");require("../../data-structures/http/HttpClient.cjs");require("axios");const h=require("../utils/caseInsensitive.utils.cjs");require("../../API/getServerURL.cjs");require("libsodium-wrappers");require("process");require("buffer");require("../../constants/save-depths.cjs");require("../../constants/reorg-depths.constants.cjs");require("../utils/mutexes.utils.cjs");require("@coral-xyz/anchor");const w=require("../../error-handling/logger.cjs");require("@solana/web3.js");require("@solana/spl-token");require("../../constants/contracts.constants.cjs");require("../../constants/kyc.constants.cjs");require("../../constants/coingecko.constants.cjs");require("../../constants/addresses.constants.cjs");require("../../constants/token.limits.constants.cjs");require("../../constants/presale.constants.cjs");require("../../constants/activity.constants.cjs");require("../../constants/tasks.constants.cjs");require("../../constants/events.constants.cjs");require("../utils/userAgent.cjs");const D=require("../utils/string.utils.cjs");require("multiformats");require("../../API/tenderly.api.cjs");const W=require("../utils/replaceAddressInCalldata.cjs"),g=({contract:e,func:t,args:n,callDataString:r,invokeWallet:s,value:i})=>{let o=new Uint8Array,c=r?u.ethers.getBytesCopy(r):new Uint8Array;if(typeof e=="object"){if(o=u.ethers.getBytesCopy(q.getContractAddress(e)),r?.length&&r?.length>0)throw Error("If function and args are providedm no calldata is needed");t&&n&&!r&&(c=u.ethers.getBytesCopy(e.interface.encodeFunctionData(t,n)))}else o=u.ethers.getBytesCopy(e);const a=u.ethers.getBytesCopy(new Uint8Array([s?1:0])),d=u.ethers.zeroPadValue(u.ethers.toBeHex(i??0n),16),p=u.ethers.concat([o,a,d,c]);return u.ethers.hexlify(p)},P=async(e,t,n,r,s,i)=>{const o=n?await f.UserKeys.signTypedDataFromPrivateKey(e,n,{name:"Emporium",version:"1.0.0",chainId:e,verifyingContract:t},{EmporiumSignature:[{name:"message",type:"uint256"}]},{message:s}):void 0,{v:c,r:a,s:d}=o?u.ethers.Signature.from(o):{v:0,r:u.ethers.ZeroHash,s:u.ethers.ZeroHash};return u.ethers.AbiCoder.defaultAbiCoder().encode(["tuple(uint8 v,bytes32 r, bytes32 s, uint256 message, address signerAddress, bytes[] ops)"],[{v:c,r:a,s:d,message:s??0n,signerAddress:i??l.zeroAddress,ops:r}])},A=(e,t,n,r)=>g(e?{contract:e,func:"transfer",args:[t,n],invokeWallet:r}:{contract:t,value:n,invokeWallet:r}),B=(e,t,n,r)=>{const s=e.getContractWithFetcher(y.ContractType.HinkalContract),i=q.getContractAddress(s);return t.map((o,c)=>{const a=h.caseInsensitiveEqual(o,l.zeroAddress)?void 0:e.getContractWithFetcher(y.ContractType.ERC20Contract,o);return A(a,r??i,n[c],!0)})},F=(e,t,n,r)=>g({contract:e,func:"approve",args:[t,n],invokeWallet:r}),O=(e,t,n)=>{const r=e.getSelectedNetwork()?.contractData.hinkalAddress;if(!r)throw Error("No Hinkal Address Provided to modifyDataForProxy");return D.replaceAllInstances(n,r.slice(2),t.slice(2))},T=(e,t,n)=>{if(!t)throw Error("No private key provided to modifyDataForProxy");const r=f.UserKeys.getSignerAddressFromPrivateKey(e.getCurrentChainId(),t);return O(e,r,n)},C=(e,t,n,r,s,i,o)=>{const c=[];for(let a=0;a<t.length;a+=1){const d=t[a],p=h.caseInsensitiveEqual(d,l.zeroAddress)?void 0:e.getContractWithFetcher(y.ContractType.ERC20Contract,d);c.push(A(p,i,n[a],!1))}if(o)for(let a=0;a<r.length;a+=1){const d=r[a];if(!h.caseInsensitiveEqual(d,l.zeroAddress)){const p=e.getContractWithFetcher(y.ContractType.ERC20Contract,d);c.push(F(p,o,s[a],!0))}}return c},z=(e,t,n,r,s,i,o,c,a,d)=>{const p=C(e,t,n,r,s,i,o);if(!!c&&!!a){const m=e.getContractWithFetcher(y.ContractType.HinkalContract);p.push(g({contract:c,callDataString:W.replaceAddressesInCalldata(a,q.getContractAddress(m),i),value:d,invokeWallet:!0}))}return p},x=(e,t,n,r,s,i,o)=>{const c=[],a=[r],d=[s];o.nativeFee>0n&&!h.caseInsensitiveEqual(r,l.zeroAddress)&&(a.push(l.zeroAddress),d.push(o.nativeFee));const E=C(e,a,d,[r],[i],t,n);c.push(...E);let m=o.nativeFee;return h.caseInsensitiveEqual(r,l.zeroAddress)&&(m+=i),c.push(g({contract:n,callDataString:o.calldata,value:m>0n?m:void 0,invokeWallet:!0})),c},U="0xef0100",I=async(e,t)=>{try{const{fetchRpcUrl:n}=v.networkRegistry[e];if(!n)throw new Error("RPC URL not found for the specified chain ID");const r=k.createCustomRpcProvider(n),s=await r.getCode(t);if(s==="0x"||!s)return{delegated:!1,implementation:void 0,nonce:void 0};if(s.toLowerCase().startsWith(U)&&s.length===48){const i=`0x${s.slice(8)}`,o=await r.getTransactionCount(t);return{delegated:!0,implementation:u.ethers.getAddress(i),nonce:o}}else throw Error("checkEOAWithDelegation: It is a contract")}catch(n){throw w.Logger.error("checkEOAWithDelegation error",{error:n}),n}},H=e=>{const{hinkalWalletAddress:t}=v.networkRegistry[e].contractData;if(!t||h.caseInsensitiveEqual(t,l.zeroAddress))throw Error("Hinkal Wallet Address is not set");return t},N=async(e,t)=>{if(e===v.chainIds.localhost||!t)return;const n=f.UserKeys.getSignerAddressFromPrivateKey(e,t),{delegated:r,implementation:s}=await I(e,n),i=H(e);if(!r||!h.caseInsensitiveEqual(s,i)){const o=await f.UserKeys.authorizeDelegation(e,t,i);return{v:o.signature.v.toString(),r:o.signature.r,s:o.signature.s,nonce:o.nonce.toString(),address:i,chainId:String(e)}}},R=e=>{if(!e)return;const{v:t,r:n,s:r,nonce:s,chainId:i,address:o}=e;return{signature:u.ethers.Signature.from({v:t,r:n,s:r}),nonce:BigInt(s),chainId:BigInt(i),address:o}};exports.checkEOAWithDelegation=I;exports.createApproveEmporiumOp=F;exports.createLifiBridgeOps=x;exports.createTransaferEmporiumOpsBatch=B;exports.createTransferToEmporiumOp=A;exports.emporiumOp=g;exports.encodeEmporiumMetadata=P;exports.generateFundAndApproveOps=C;exports.generateFundApproveAndTransactOps=z;exports.getAuthorizationDataIfNeeded=N;exports.modifyDataForProxy=O;exports.modifyDataForProxyWithPrivateKey=T;exports.recoverAuthorizationData=R;
|
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
import { Contract, ContractTransaction, ethers } from 'ethers';
|
|
2
1
|
import { IHinkal } from '../../data-structures/Hinkal/IHinkal';
|
|
3
2
|
import { type AuthorizationData } from '../../types/hinkal.types';
|
|
4
|
-
import { ethers
|
|
3
|
+
import { ethers } from 'ethers';
|
|
5
4
|
import { BridgeQuote } from '../../types/bridging-tx.types';
|
|
6
|
-
export declare const emporiumOp:
|
|
7
|
-
contract:
|
|
8
|
-
func?:
|
|
9
|
-
args?:
|
|
5
|
+
export declare const emporiumOp: ({ contract, func, args, callDataString, invokeWallet, value, }: {
|
|
6
|
+
contract: ethers.BaseContract | string;
|
|
7
|
+
func?: string | undefined;
|
|
8
|
+
args?: unknown[] | undefined;
|
|
10
9
|
callDataString?: string | undefined;
|
|
11
10
|
invokeWallet?: boolean | undefined;
|
|
12
11
|
value?: bigint | undefined;
|
|
13
12
|
}) => string;
|
|
14
13
|
export declare const encodeEmporiumMetadata: (chainId: number, emporiumAddress: string, privateKey: string | undefined, ops: string[], message?: bigint, signerAddress?: string) => Promise<string>;
|
|
15
14
|
export declare const createTransferToEmporiumOp: (tokenContract: ethers.Contract | undefined, to: string, amount: bigint, invokeWallet: boolean) => string;
|
|
16
|
-
export declare const createTransaferEmporiumOpsBatch: (hinkal: IHinkal,
|
|
15
|
+
export declare const createTransaferEmporiumOpsBatch: (hinkal: IHinkal, erc20TokenAddresses: string[], amounts: bigint[], to?: string) => string[];
|
|
17
16
|
export declare const createApproveEmporiumOp: (tokenContract: ethers.Contract, to: string, amount: bigint, invokeWallet: boolean) => string;
|
|
18
|
-
export declare const
|
|
19
|
-
export declare const
|
|
17
|
+
export declare const modifyDataForProxy: (hinkal: IHinkal, userAddress: string, data: string) => string;
|
|
18
|
+
export declare const modifyDataForProxyWithPrivateKey: (hinkal: IHinkal, privateKey: string | undefined, data: string) => string;
|
|
19
|
+
export declare const generateFundAndApproveOps: (hinkal: IHinkal, erc20AddressesToFund: string[], fundAmounts: bigint[], approveTokenAddresses: string[], approveAmounts: bigint[], walletAddress: string, spenderAddress: string | undefined) => string[];
|
|
20
|
+
export declare const generateFundApproveAndTransactOps: (hinkal: IHinkal, erc20AddressesToFund: string[], fundAmounts: bigint[], approveTokenAddresses: string[], approveAmounts: bigint[], walletAddress: string, spenderAddress: string | undefined, to?: string, callDataString?: string, value?: bigint) => string[];
|
|
21
|
+
export declare const createLifiBridgeOps: (hinkal: IHinkal, fromAddress: string, lifiRouterAddress: string, tokenAddress: string, fundAmount: bigint, bridgeAmount: bigint, quote: BridgeQuote) => string[];
|
|
20
22
|
export declare const checkEOAWithDelegation: (chainId: number, eoaAddress: string) => Promise<{
|
|
21
23
|
delegated: boolean;
|
|
22
24
|
implementation: undefined;
|
|
@@ -27,4 +29,4 @@ export declare const checkEOAWithDelegation: (chainId: number, eoaAddress: strin
|
|
|
27
29
|
nonce: number;
|
|
28
30
|
}>;
|
|
29
31
|
export declare const getAuthorizationDataIfNeeded: (chainId: number, privateKey: string | undefined) => Promise<AuthorizationData | undefined>;
|
|
30
|
-
export declare const recoverAuthorizationData: (authorizationData: AuthorizationData | undefined) =>
|
|
32
|
+
export declare const recoverAuthorizationData: (authorizationData: AuthorizationData | undefined) => ethers.Authorization | undefined;
|
|
@@ -1,33 +1,36 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { zeroAddress as d } from "../../constants/protocol.constants.mjs";
|
|
1
|
+
import { zeroAddress as u } from "../../constants/protocol.constants.mjs";
|
|
3
2
|
import { ContractType as g } from "../../types/ethereum-network.types.mjs";
|
|
4
3
|
import "idb-keyval";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { networkRegistry as A, chainIds as w } from "../../constants/chains.constants.mjs";
|
|
5
|
+
import { getContractAddress as v } from "../utils/getContractAddress.mjs";
|
|
6
|
+
import { createCustomRpcProvider as W } from "../utils/create-provider.mjs";
|
|
7
|
+
import { ethers as p } from "ethers";
|
|
7
8
|
import "../../constants/token-data/index.mjs";
|
|
8
9
|
import "../../error-handling/error-codes.constants.mjs";
|
|
9
10
|
import "../utils/convertIntegrationProviderToExternalActionId.mjs";
|
|
10
11
|
import "../../types/circom-data.types.mjs";
|
|
11
|
-
import "../../types/transactions.types.mjs";
|
|
12
12
|
import "../../types/activities.types.mjs";
|
|
13
13
|
import "circomlibjs-hinkal-fork";
|
|
14
|
-
import "../../data-structures/crypto-keys/keys.mjs";
|
|
14
|
+
import { UserKeys as y } from "../../data-structures/crypto-keys/keys.mjs";
|
|
15
15
|
import "../../constants/server.constants.mjs";
|
|
16
|
-
import "../../
|
|
16
|
+
import "../../constants/vite.constants.mjs";
|
|
17
17
|
import "../../data-structures/http/HttpClient.mjs";
|
|
18
18
|
import "axios";
|
|
19
|
-
import "../../constants/vite.constants.mjs";
|
|
20
19
|
import { caseInsensitiveEqual as l } from "../utils/caseInsensitive.utils.mjs";
|
|
21
|
-
import
|
|
22
|
-
import "
|
|
20
|
+
import "../../API/getServerURL.mjs";
|
|
21
|
+
import "libsodium-wrappers";
|
|
22
|
+
import "process";
|
|
23
|
+
import "buffer";
|
|
24
|
+
import "../../constants/save-depths.mjs";
|
|
25
|
+
import "../../constants/reorg-depths.constants.mjs";
|
|
26
|
+
import "../utils/mutexes.utils.mjs";
|
|
23
27
|
import "@coral-xyz/anchor";
|
|
28
|
+
import { Logger as k } from "../../error-handling/logger.mjs";
|
|
29
|
+
import "@solana/web3.js";
|
|
24
30
|
import "@solana/spl-token";
|
|
25
|
-
import { AccountActions as y } from "../../data-structures/AccountActions/AccountActions.mjs";
|
|
26
|
-
import "buffer";
|
|
27
31
|
import "../../constants/contracts.constants.mjs";
|
|
28
32
|
import "../../constants/kyc.constants.mjs";
|
|
29
33
|
import "../../constants/coingecko.constants.mjs";
|
|
30
|
-
import "../../constants/reorg-depths.constants.mjs";
|
|
31
34
|
import "../../constants/addresses.constants.mjs";
|
|
32
35
|
import "../../constants/token.limits.constants.mjs";
|
|
33
36
|
import "../../constants/presale.constants.mjs";
|
|
@@ -35,129 +38,160 @@ import "../../constants/activity.constants.mjs";
|
|
|
35
38
|
import "../../constants/tasks.constants.mjs";
|
|
36
39
|
import "../../constants/events.constants.mjs";
|
|
37
40
|
import "../utils/userAgent.mjs";
|
|
38
|
-
import "
|
|
41
|
+
import { replaceAllInstances as B } from "../utils/string.utils.mjs";
|
|
39
42
|
import "multiformats";
|
|
40
|
-
import "../../API/
|
|
41
|
-
import "
|
|
42
|
-
import "process";
|
|
43
|
-
import "../../providers/EthersProviderAdapter.mjs";
|
|
44
|
-
import { ethers as k } from "ethers-v6h";
|
|
43
|
+
import "../../API/tenderly.api.mjs";
|
|
44
|
+
import { replaceAddressesInCalldata as D } from "../utils/replaceAddressInCalldata.mjs";
|
|
45
45
|
const h = ({
|
|
46
46
|
contract: t,
|
|
47
|
-
func:
|
|
47
|
+
func: e,
|
|
48
48
|
args: o,
|
|
49
|
-
callDataString:
|
|
49
|
+
callDataString: r,
|
|
50
50
|
invokeWallet: i,
|
|
51
51
|
value: a
|
|
52
52
|
}) => {
|
|
53
|
-
let n = new Uint8Array(),
|
|
54
|
-
if (typeof t == "object"
|
|
55
|
-
if (n = p.
|
|
53
|
+
let n = new Uint8Array(), c = r ? p.getBytesCopy(r) : new Uint8Array();
|
|
54
|
+
if (typeof t == "object") {
|
|
55
|
+
if (n = p.getBytesCopy(v(t)), r?.length && r?.length > 0)
|
|
56
56
|
throw Error("If function and args are providedm no calldata is needed");
|
|
57
|
-
|
|
57
|
+
e && o && !r && (c = p.getBytesCopy(t.interface.encodeFunctionData(e, o)));
|
|
58
58
|
} else
|
|
59
|
-
n = p.
|
|
60
|
-
const
|
|
61
|
-
return p.hexlify(
|
|
62
|
-
},
|
|
59
|
+
n = p.getBytesCopy(t);
|
|
60
|
+
const s = p.getBytesCopy(new Uint8Array([i ? 1 : 0])), m = p.zeroPadValue(p.toBeHex(a ?? 0n), 16), d = p.concat([n, s, m, c]);
|
|
61
|
+
return p.hexlify(d);
|
|
62
|
+
}, wt = async (t, e, o, r, i, a) => {
|
|
63
63
|
const n = o ? await y.signTypedDataFromPrivateKey(
|
|
64
64
|
t,
|
|
65
65
|
o,
|
|
66
|
-
{ name: "Emporium", version: "1.0.0", chainId: t, verifyingContract:
|
|
66
|
+
{ name: "Emporium", version: "1.0.0", chainId: t, verifyingContract: e },
|
|
67
67
|
{ EmporiumSignature: [{ name: "message", type: "uint256" }] },
|
|
68
68
|
{ message: i }
|
|
69
|
-
) : void 0, { v:
|
|
70
|
-
return p.defaultAbiCoder.encode(
|
|
69
|
+
) : void 0, { v: c, r: s, s: m } = n ? p.Signature.from(n) : { v: 0, r: p.ZeroHash, s: p.ZeroHash };
|
|
70
|
+
return p.AbiCoder.defaultAbiCoder().encode(
|
|
71
71
|
["tuple(uint8 v,bytes32 r, bytes32 s, uint256 message, address signerAddress, bytes[] ops)"],
|
|
72
72
|
[
|
|
73
73
|
{
|
|
74
|
-
v:
|
|
75
|
-
r:
|
|
76
|
-
s:
|
|
74
|
+
v: c,
|
|
75
|
+
r: s,
|
|
76
|
+
s: m,
|
|
77
77
|
message: i ?? 0n,
|
|
78
|
-
signerAddress: a ??
|
|
79
|
-
ops:
|
|
78
|
+
signerAddress: a ?? u,
|
|
79
|
+
ops: r
|
|
80
80
|
}
|
|
81
81
|
]
|
|
82
82
|
);
|
|
83
|
-
},
|
|
83
|
+
}, E = (t, e, o, r) => h(t ? {
|
|
84
84
|
contract: t,
|
|
85
85
|
func: "transfer",
|
|
86
|
-
args: [
|
|
87
|
-
invokeWallet:
|
|
88
|
-
} : { contract:
|
|
89
|
-
const
|
|
90
|
-
return
|
|
91
|
-
const
|
|
92
|
-
return
|
|
86
|
+
args: [e, o],
|
|
87
|
+
invokeWallet: r
|
|
88
|
+
} : { contract: e, value: o, invokeWallet: r }), Wt = (t, e, o, r) => {
|
|
89
|
+
const i = t.getContractWithFetcher(g.HinkalContract), a = v(i);
|
|
90
|
+
return e.map((n, c) => {
|
|
91
|
+
const s = l(n, u) ? void 0 : t.getContractWithFetcher(g.ERC20Contract, n);
|
|
92
|
+
return E(s, r ?? a, o[c], !0);
|
|
93
93
|
});
|
|
94
|
-
},
|
|
94
|
+
}, O = (t, e, o, r) => h({
|
|
95
95
|
contract: t,
|
|
96
96
|
func: "approve",
|
|
97
|
-
args: [
|
|
98
|
-
invokeWallet:
|
|
99
|
-
}),
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
97
|
+
args: [e, o],
|
|
98
|
+
invokeWallet: r
|
|
99
|
+
}), P = (t, e, o) => {
|
|
100
|
+
const r = t.getSelectedNetwork()?.contractData.hinkalAddress;
|
|
101
|
+
if (!r)
|
|
102
|
+
throw Error("No Hinkal Address Provided to modifyDataForProxy");
|
|
103
|
+
return B(o, r.slice(2), e.slice(2));
|
|
104
|
+
}, kt = (t, e, o) => {
|
|
105
|
+
if (!e)
|
|
106
|
+
throw Error("No private key provided to modifyDataForProxy");
|
|
107
|
+
const r = y.getSignerAddressFromPrivateKey(t.getCurrentChainId(), e);
|
|
108
|
+
return P(t, r, o);
|
|
109
|
+
}, F = (t, e, o, r, i, a, n) => {
|
|
110
|
+
const c = [];
|
|
111
|
+
for (let s = 0; s < e.length; s += 1) {
|
|
112
|
+
const m = e[s], d = l(m, u) ? void 0 : t.getContractWithFetcher(g.ERC20Contract, m);
|
|
113
|
+
c.push(E(d, a, o[s], !1));
|
|
104
114
|
}
|
|
105
|
-
if (
|
|
106
|
-
for (let
|
|
107
|
-
const
|
|
108
|
-
if (!l(
|
|
109
|
-
const
|
|
110
|
-
|
|
115
|
+
if (n)
|
|
116
|
+
for (let s = 0; s < r.length; s += 1) {
|
|
117
|
+
const m = r[s];
|
|
118
|
+
if (!l(m, u)) {
|
|
119
|
+
const d = t.getContractWithFetcher(g.ERC20Contract, m);
|
|
120
|
+
c.push(O(d, n, i[s], !0));
|
|
111
121
|
}
|
|
112
122
|
}
|
|
113
|
-
return
|
|
114
|
-
},
|
|
115
|
-
const
|
|
116
|
-
s.nativeFee > 0n && !l(i, d) && (c.push(d), u.push(s.nativeFee));
|
|
117
|
-
const E = I(
|
|
123
|
+
return c;
|
|
124
|
+
}, Bt = (t, e, o, r, i, a, n, c, s, m) => {
|
|
125
|
+
const d = F(
|
|
118
126
|
t,
|
|
119
|
-
|
|
120
|
-
c,
|
|
121
|
-
u,
|
|
122
|
-
[i],
|
|
123
|
-
[n],
|
|
127
|
+
e,
|
|
124
128
|
o,
|
|
125
|
-
|
|
129
|
+
r,
|
|
130
|
+
i,
|
|
131
|
+
a,
|
|
132
|
+
n
|
|
133
|
+
);
|
|
134
|
+
if (!!c && !!s) {
|
|
135
|
+
const f = t.getContractWithFetcher(g.HinkalContract);
|
|
136
|
+
d.push(
|
|
137
|
+
h({
|
|
138
|
+
contract: c,
|
|
139
|
+
callDataString: D(s, v(f), a),
|
|
140
|
+
value: m,
|
|
141
|
+
invokeWallet: !0
|
|
142
|
+
})
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
return d;
|
|
146
|
+
}, Dt = (t, e, o, r, i, a, n) => {
|
|
147
|
+
const c = [], s = [r], m = [i];
|
|
148
|
+
n.nativeFee > 0n && !l(r, u) && (s.push(u), m.push(n.nativeFee));
|
|
149
|
+
const C = F(
|
|
150
|
+
t,
|
|
151
|
+
s,
|
|
152
|
+
m,
|
|
153
|
+
[r],
|
|
154
|
+
[a],
|
|
155
|
+
e,
|
|
156
|
+
o
|
|
126
157
|
);
|
|
127
|
-
|
|
128
|
-
let
|
|
129
|
-
return l(
|
|
158
|
+
c.push(...C);
|
|
159
|
+
let f = n.nativeFee;
|
|
160
|
+
return l(r, u) && (f += a), c.push(
|
|
130
161
|
h({
|
|
131
|
-
contract:
|
|
132
|
-
callDataString:
|
|
133
|
-
value:
|
|
162
|
+
contract: o,
|
|
163
|
+
callDataString: n.calldata,
|
|
164
|
+
value: f > 0n ? f : void 0,
|
|
134
165
|
invokeWallet: !0
|
|
135
166
|
})
|
|
136
|
-
),
|
|
137
|
-
},
|
|
167
|
+
), c;
|
|
168
|
+
}, I = "0xef0100", x = async (t, e) => {
|
|
138
169
|
try {
|
|
139
|
-
const
|
|
140
|
-
if (
|
|
170
|
+
const { fetchRpcUrl: o } = A[t];
|
|
171
|
+
if (!o)
|
|
172
|
+
throw new Error("RPC URL not found for the specified chain ID");
|
|
173
|
+
const r = W(o), i = await r.getCode(e);
|
|
174
|
+
if (i === "0x" || !i)
|
|
141
175
|
return { delegated: !1, implementation: void 0, nonce: void 0 };
|
|
142
|
-
if (
|
|
143
|
-
const
|
|
144
|
-
return { delegated: !0, implementation: p.getAddress(
|
|
176
|
+
if (i.toLowerCase().startsWith(I) && i.length === 48) {
|
|
177
|
+
const a = `0x${i.slice(8)}`, n = await r.getTransactionCount(e);
|
|
178
|
+
return { delegated: !0, implementation: p.getAddress(a), nonce: n };
|
|
145
179
|
} else
|
|
146
180
|
throw Error("checkEOAWithDelegation: It is a contract");
|
|
147
181
|
} catch (o) {
|
|
148
|
-
throw
|
|
182
|
+
throw k.error("checkEOAWithDelegation error", { error: o }), o;
|
|
149
183
|
}
|
|
150
184
|
}, H = (t) => {
|
|
151
|
-
const { hinkalWalletAddress:
|
|
152
|
-
if (!
|
|
185
|
+
const { hinkalWalletAddress: e } = A[t].contractData;
|
|
186
|
+
if (!e || l(e, u))
|
|
153
187
|
throw Error("Hinkal Wallet Address is not set");
|
|
154
|
-
return
|
|
155
|
-
},
|
|
156
|
-
if (t ===
|
|
188
|
+
return e;
|
|
189
|
+
}, Ot = async (t, e) => {
|
|
190
|
+
if (t === w.localhost || !e)
|
|
157
191
|
return;
|
|
158
|
-
const o = y.getSignerAddressFromPrivateKey(t,
|
|
159
|
-
if (!
|
|
160
|
-
const n = await y.authorizeDelegation(t,
|
|
192
|
+
const o = y.getSignerAddressFromPrivateKey(t, e), { delegated: r, implementation: i } = await x(t, o), a = H(t);
|
|
193
|
+
if (!r || !l(i, a)) {
|
|
194
|
+
const n = await y.authorizeDelegation(t, e, a);
|
|
161
195
|
return {
|
|
162
196
|
v: n.signature.v.toString(),
|
|
163
197
|
r: n.signature.r,
|
|
@@ -167,21 +201,24 @@ const h = ({
|
|
|
167
201
|
chainId: String(t)
|
|
168
202
|
};
|
|
169
203
|
}
|
|
170
|
-
},
|
|
204
|
+
}, Pt = (t) => {
|
|
171
205
|
if (!t)
|
|
172
206
|
return;
|
|
173
|
-
const { v:
|
|
174
|
-
return { signature:
|
|
207
|
+
const { v: e, r: o, s: r, nonce: i, chainId: a, address: n } = t;
|
|
208
|
+
return { signature: p.Signature.from({ v: e, r: o, s: r }), nonce: BigInt(i), chainId: BigInt(a), address: n };
|
|
175
209
|
};
|
|
176
210
|
export {
|
|
177
211
|
x as checkEOAWithDelegation,
|
|
178
|
-
|
|
179
|
-
|
|
212
|
+
O as createApproveEmporiumOp,
|
|
213
|
+
Dt as createLifiBridgeOps,
|
|
180
214
|
Wt as createTransaferEmporiumOpsBatch,
|
|
181
|
-
|
|
215
|
+
E as createTransferToEmporiumOp,
|
|
182
216
|
h as emporiumOp,
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
Bt as
|
|
186
|
-
|
|
217
|
+
wt as encodeEmporiumMetadata,
|
|
218
|
+
F as generateFundAndApproveOps,
|
|
219
|
+
Bt as generateFundApproveAndTransactOps,
|
|
220
|
+
Ot as getAuthorizationDataIfNeeded,
|
|
221
|
+
P as modifyDataForProxy,
|
|
222
|
+
kt as modifyDataForProxyWithPrivateKey,
|
|
223
|
+
Pt as recoverAuthorizationData
|
|
187
224
|
};
|