@hinkal/common 0.2.21 → 0.2.22
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 +54 -42
- 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/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 +142 -38
- package/constants/vite.constants.cjs +1 -1
- package/constants/vite.constants.mjs +13 -36
- package/data-structures/ApprovalDBs/EventsPublicApprovalsDB.cjs +1 -1
- package/data-structures/ApprovalDBs/EventsPublicApprovalsDB.mjs +71 -68
- package/data-structures/Hinkal/Hinkal.cjs +1 -1
- package/data-structures/Hinkal/Hinkal.d.ts +56 -45
- package/data-structures/Hinkal/Hinkal.mjs +348 -314
- package/data-structures/Hinkal/IHinkal.d.ts +54 -40
- 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 +20 -20
- package/data-structures/Hinkal/hinkalDeposit.cjs +1 -1
- package/data-structures/Hinkal/hinkalDeposit.mjs +84 -88
- package/data-structures/Hinkal/hinkalDepositAndWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalDepositAndWithdraw.d.ts +1 -1
- package/data-structures/Hinkal/hinkalDepositAndWithdraw.mjs +96 -77
- package/data-structures/Hinkal/hinkalDepositOnChainUtxos.cjs +1 -1
- package/data-structures/Hinkal/hinkalDepositOnChainUtxos.d.ts +4 -1
- package/data-structures/Hinkal/hinkalDepositOnChainUtxos.mjs +80 -75
- package/data-structures/Hinkal/hinkalDepostAndBridge.cjs +1 -1
- package/data-structures/Hinkal/hinkalDepostAndBridge.d.ts +1 -1
- package/data-structures/Hinkal/hinkalDepostAndBridge.mjs +150 -138
- 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 +119 -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 -114
- package/data-structures/Hinkal/hinkalProoflessDeposit.cjs +1 -1
- package/data-structures/Hinkal/hinkalProoflessDeposit.mjs +34 -36
- 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 +182 -155
- 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 +45 -48
- package/data-structures/Hinkal/hinkalSolanaTransfer.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaTransfer.mjs +48 -49
- package/data-structures/Hinkal/hinkalSolanaWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaWithdraw.d.ts +1 -2
- package/data-structures/Hinkal/hinkalSolanaWithdraw.mjs +68 -71
- package/data-structures/Hinkal/hinkalSwap.cjs +1 -1
- package/data-structures/Hinkal/hinkalSwap.mjs +78 -71
- package/data-structures/Hinkal/hinkalTransfer.cjs +1 -1
- package/data-structures/Hinkal/hinkalTransfer.mjs +70 -71
- package/data-structures/Hinkal/hinkalWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalWithdraw.mjs +79 -81
- package/data-structures/Hinkal/hinkalWithdrawStuckUtxos.cjs +1 -1
- package/data-structures/Hinkal/hinkalWithdrawStuckUtxos.mjs +103 -105
- package/data-structures/Hinkal/resetMerkleTrees.cjs +1 -1
- package/data-structures/Hinkal/resetMerkleTrees.d.ts +1 -1
- package/data-structures/Hinkal/resetMerkleTrees.mjs +53 -107
- 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 +75 -91
- package/data-structures/IndexedDB/balances-db.cjs +1 -1
- package/data-structures/IndexedDB/balances-db.mjs +37 -40
- package/data-structures/IndexedDB/contact-db.cjs +1 -1
- package/data-structures/IndexedDB/contact-db.mjs +13 -16
- package/data-structures/IndexedDB/signatures-db.cjs +1 -1
- package/data-structures/IndexedDB/signatures-db.mjs +40 -25
- package/data-structures/TokenDBs/EventsPublicTokensDB.cjs +1 -1
- package/data-structures/TokenDBs/EventsPublicTokensDB.mjs +84 -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/keys.cjs +1 -1
- package/data-structures/crypto-keys/keys.d.ts +11 -0
- package/data-structures/crypto-keys/keys.mjs +107 -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 +19 -19
- package/data-structures/event-service/evm/AbstractNullifierSnapshotService.cjs +1 -1
- package/data-structures/event-service/evm/AbstractNullifierSnapshotService.d.ts +3 -3
- package/data-structures/event-service/evm/AbstractNullifierSnapshotService.mjs +5 -6
- 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 +4 -3
- 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 +35 -39
- 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 +1 -1
- 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/provider-adapter/IProviderAdapter.d.ts +13 -8
- package/data-structures/snapshot/evm-snapshots/ClientAccessTokenSnapshotService.cjs +1 -1
- package/data-structures/snapshot/evm-snapshots/ClientAccessTokenSnapshotService.mjs +4 -6
- package/data-structures/snapshot/evm-snapshots/ClientApprovalsSnapshotService.cjs +1 -1
- package/data-structures/snapshot/evm-snapshots/ClientApprovalsSnapshotService.mjs +4 -6
- 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 -21
- 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 +17 -18
- 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/getVolatileTransferAmount.cjs +1 -1
- package/functions/pre-transaction/getVolatileTransferAmount.mjs +36 -21
- 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 +6 -3
- package/functions/private-wallet/emporium.helpers.mjs +127 -89
- 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 +102 -100
- 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 +20 -18
- 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 +12 -13
- package/functions/utils/cacheFunctions.cjs +1 -1
- package/functions/utils/cacheFunctions.mjs +2 -2
- package/functions/utils/create-provider.cjs +1 -1
- package/functions/utils/create-provider.d.ts +1 -1
- package/functions/utils/create-provider.mjs +9 -13
- 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/getUtxosFromReceipt.utils.cjs +1 -1
- package/functions/utils/getUtxosFromReceipt.utils.d.ts +1 -1
- package/functions/utils/getUtxosFromReceipt.utils.mjs +11 -11
- 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 -8
- 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.mjs +54 -49
- 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/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/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/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.mjs +38 -38
- package/functions/web3/fetchSolanaMerkleTreeRootHash.cjs +1 -1
- package/functions/web3/fetchSolanaMerkleTreeRootHash.mjs +10 -13
- package/functions/web3/functionCalls/accessTokenCalls.cjs +1 -1
- package/functions/web3/functionCalls/accessTokenCalls.d.ts +6 -1
- package/functions/web3/functionCalls/accessTokenCalls.mjs +21 -12
- package/functions/web3/functionCalls/approveToken.cjs +1 -1
- package/functions/web3/functionCalls/approveToken.d.ts +1 -1
- package/functions/web3/functionCalls/approveToken.mjs +46 -50
- 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/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 +32 -0
- package/functions/web3/functionCalls/transactCallDirect.cjs +1 -1
- package/functions/web3/functionCalls/transactCallDirect.d.ts +1 -1
- package/functions/web3/functionCalls/transactCallDirect.mjs +40 -36
- package/functions/web3/functionCalls/transactCallRelayer.cjs +1 -1
- package/functions/web3/functionCalls/transactCallRelayer.d.ts +3 -3
- package/functions/web3/functionCalls/transactCallRelayer.mjs +54 -54
- package/functions/web3/getContractMetadata.cjs +1 -1
- package/functions/web3/getContractMetadata.mjs +22 -17
- package/functions/web3/getPublicAddressBalance.cjs +1 -1
- package/functions/web3/getPublicAddressBalance.d.ts +1 -1
- package/functions/web3/getPublicAddressBalance.mjs +6 -6
- package/functions/web3/getTokenHolder.cjs +1 -1
- package/functions/web3/getTokenHolder.mjs +27 -27
- 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 +19 -6
- 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 -7
- package/functions/web3/runContractFunction.cjs +1 -1
- package/functions/web3/runContractFunction.mjs +56 -38
- package/functions/web3/uniswapAPI.cjs +1 -1
- package/functions/web3/uniswapAPI.mjs +34 -22
- package/index.cjs +1 -1
- package/index.mjs +922 -920
- package/package.json +2 -3
- package/providers/EthersProviderAdapter.cjs +1 -1
- package/providers/EthersProviderAdapter.d.ts +17 -10
- package/providers/EthersProviderAdapter.mjs +76 -45
- package/providers/SolanaProviderAdapter.cjs +1 -1
- package/providers/SolanaProviderAdapter.d.ts +11 -7
- package/providers/SolanaProviderAdapter.mjs +31 -16
- package/providers/WagmiProviderAdapter.cjs +1 -1
- package/providers/WagmiProviderAdapter.d.ts +17 -11
- package/providers/WagmiProviderAdapter.mjs +117 -86
- package/providers/prepareEthersHinkal.cjs +1 -1
- package/providers/prepareEthersHinkal.mjs +9 -14
- package/providers/prepareWagmiHinkal.cjs +1 -1
- package/providers/prepareWagmiHinkal.mjs +9 -15
- package/types/TransactionSimulator.types.d.ts +9 -2
- package/types/activities.types.d.ts +0 -2
- 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/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 +0 -1
- 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/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/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/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,4 +1,7 @@
|
|
|
1
1
|
import { IHinkal } from './IHinkal';
|
|
2
2
|
import { ERC20Token, RecipientUtxo } from '../../types';
|
|
3
3
|
import { FeeStructure } from '../../types/hinkal.types';
|
|
4
|
-
export declare const hinkalDepositOnChainUtxos: (hinkal: IHinkal,
|
|
4
|
+
export declare const hinkalDepositOnChainUtxos: (hinkal: IHinkal, erc20Token: ERC20Token, recipientAmounts: bigint[], recipientAddresses: string[], feeStructure: FeeStructure, hashedEthereumAddress: string) => Promise<{
|
|
5
|
+
userDepositedUtxos: RecipientUtxo[];
|
|
6
|
+
statusId?: string | undefined;
|
|
7
|
+
}>;
|
|
@@ -1,103 +1,108 @@
|
|
|
1
|
-
import { ethers as
|
|
2
|
-
import { zeroAddress as
|
|
3
|
-
import { outputUtxoProcessing as
|
|
4
|
-
import { constructZkProof as
|
|
5
|
-
import { addPaddingToUtxos as
|
|
6
|
-
import { transactCallDirect as
|
|
7
|
-
import { ExternalActionId as
|
|
1
|
+
import { ethers as _ } from "ethers";
|
|
2
|
+
import { zeroAddress as q } from "../../constants/protocol.constants.mjs";
|
|
3
|
+
import { outputUtxoProcessing as B } from "../../functions/pre-transaction/outputUtxoProcessing.mjs";
|
|
4
|
+
import { constructZkProof as X } from "../../functions/snarkjs/constructGeneralZkProof.mjs";
|
|
5
|
+
import { addPaddingToUtxos as j } from "../../functions/web3/events/getShieldedBalance.mjs";
|
|
6
|
+
import { transactCallDirect as G } from "../../functions/web3/functionCalls/transactCallDirect.mjs";
|
|
7
|
+
import { ExternalActionId as J } from "../../types/external-action.types.mjs";
|
|
8
8
|
import "../../types/circom-data.types.mjs";
|
|
9
9
|
import { ContractType as p } from "../../types/ethereum-network.types.mjs";
|
|
10
10
|
import "../../types/transactions.types.mjs";
|
|
11
|
-
import { AdminTransactionType as
|
|
11
|
+
import { AdminTransactionType as L } from "../../types/admin.types.mjs";
|
|
12
12
|
import "../../types/activities.types.mjs";
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import { constructAdminData as
|
|
19
|
-
import { emitTxPublicData as
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
import { DepositAndWithdrawPhase as U } from "../../types/scheduled-transactions.types.mjs";
|
|
14
|
+
import { getSignatureDataForTransact as N } from "../../functions/pre-transaction/getSignatureDataForTransact.mjs";
|
|
15
|
+
import { shouldPatchAccessTokenMerkleTree as Q } from "../../functions/pre-transaction/shouldPatchAccessTokenMerkleTree.mjs";
|
|
16
|
+
import { getUtxosFromReceipt as V } from "../../functions/utils/getUtxosFromReceipt.utils.mjs";
|
|
17
|
+
import { calculateTotalFee as Y } from "../../functions/utils/fees.utils.mjs";
|
|
18
|
+
import { constructAdminData as tt } from "../../functions/pre-transaction/constructAdminData.mjs";
|
|
19
|
+
import { emitTxPublicData as ot } from "../../API/admin-calls.mjs";
|
|
20
|
+
import { updateDepositAndWithdrawStatus as et, safeUpdateDepositAndWithdrawStatus as rt } from "../../API/deposit-and-withdraw-status-calls.mjs";
|
|
21
|
+
const Ot = async (t, m, y, O, E, u) => {
|
|
22
|
+
const f = m.erc20TokenAddress, x = await t.getEthereumAddress(), a = y.map((o) => o + Y(o, E)), i = [f], n = [0n], P = [!0], { patchAccessTokenMerkleTree: v, kycRequired: I, hasAccessToken: W } = await Q(
|
|
22
23
|
t,
|
|
23
|
-
|
|
24
|
-
n
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
o,
|
|
24
|
+
i,
|
|
25
|
+
n
|
|
26
|
+
), S = await N(
|
|
27
|
+
t.getCurrentChainId(),
|
|
28
28
|
x,
|
|
29
29
|
t.userKeys,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
),
|
|
33
|
-
for (let
|
|
34
|
-
const { outputUtxos:
|
|
35
|
-
|
|
30
|
+
I,
|
|
31
|
+
W
|
|
32
|
+
), r = [...await j(t, i, n)], C = [];
|
|
33
|
+
for (let o = 0; o < r.length; o += 1) {
|
|
34
|
+
const { outputUtxos: e } = B(t.userKeys, r[o], n[o]);
|
|
35
|
+
C.push(e);
|
|
36
36
|
}
|
|
37
|
-
const
|
|
38
|
-
zkCallData:
|
|
39
|
-
circomData:
|
|
37
|
+
const D = a.reduce((o, e) => o + e, 0n), F = _.utils.defaultAbiCoder.encode(["uint256[]"], [a]), A = t.getContractWithSigner(p.HinkalWrapper), h = t.getContractWithSigner(p.DepositOnChainUtxos), {
|
|
38
|
+
zkCallData: H,
|
|
39
|
+
circomData: R,
|
|
40
40
|
dimData: b
|
|
41
|
-
} = await
|
|
41
|
+
} = await X(
|
|
42
42
|
"v1x1",
|
|
43
|
-
t.
|
|
44
|
-
t.
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
t.merkleTreeHinkal,
|
|
44
|
+
t.merkleTreeAccessToken,
|
|
45
|
+
r,
|
|
46
|
+
C,
|
|
47
47
|
t.userKeys,
|
|
48
|
-
`swapperM1x${
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
48
|
+
`swapperM1x${r[0].length}x1`,
|
|
49
|
+
J.DepositOnChainUtxos,
|
|
50
|
+
h.address,
|
|
51
|
+
F,
|
|
52
52
|
t.generateProofRemotely,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
q,
|
|
54
|
+
t.getCurrentChainId(),
|
|
55
|
+
P,
|
|
56
56
|
void 0,
|
|
57
57
|
void 0,
|
|
58
|
-
|
|
58
|
+
v,
|
|
59
59
|
void 0,
|
|
60
60
|
void 0,
|
|
61
61
|
void 0,
|
|
62
|
-
t.getContractWithFetcher(
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
t.getContractWithFetcher(p.HinkalHelperContract),
|
|
63
|
+
S,
|
|
64
|
+
A.address,
|
|
65
65
|
!1
|
|
66
|
-
),
|
|
66
|
+
), s = t.getCurrentChainId(), T = (await et(s, {
|
|
67
|
+
hashedEthereumAddress: u,
|
|
68
|
+
phase: U.BEFORE_DEPOSIT
|
|
69
|
+
})).id ?? void 0, l = await G(
|
|
67
70
|
t,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
d,
|
|
71
|
-
F,
|
|
71
|
+
D,
|
|
72
|
+
m,
|
|
72
73
|
H,
|
|
74
|
+
R,
|
|
73
75
|
b,
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
)
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
76
|
+
h,
|
|
77
|
+
A
|
|
78
|
+
), K = await l.wait(), M = l.hash;
|
|
79
|
+
await rt(s, {
|
|
80
|
+
id: T,
|
|
81
|
+
hashedEthereumAddress: u,
|
|
82
|
+
phase: U.AFTER_DEPOSIT,
|
|
83
|
+
depositTxHash: M
|
|
84
|
+
});
|
|
85
|
+
const $ = V(K, t, f), g = [], c = [...$];
|
|
86
|
+
O.forEach((o, e) => {
|
|
87
|
+
const w = a[e], d = c.find((Z) => Z.amount === w);
|
|
88
|
+
if (!d)
|
|
89
|
+
throw new Error(`Could not find newly created UTXO with amount ${w} for recipient ${o}.`);
|
|
90
|
+
g.push({
|
|
91
|
+
recipientAddress: o,
|
|
92
|
+
utxo: d
|
|
84
93
|
});
|
|
85
|
-
const
|
|
86
|
-
c.splice(
|
|
87
|
-
}), await V({
|
|
88
|
-
hashedEthereumAddress: v,
|
|
89
|
-
chainId: o,
|
|
90
|
-
utxos: D
|
|
94
|
+
const z = c.indexOf(d);
|
|
95
|
+
c.splice(z, 1);
|
|
91
96
|
});
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
[
|
|
97
|
+
const k = tt(
|
|
98
|
+
L.DepositOnChainUtxos,
|
|
99
|
+
s,
|
|
100
|
+
i,
|
|
101
|
+
[D],
|
|
97
102
|
x
|
|
98
103
|
);
|
|
99
|
-
return
|
|
104
|
+
return ot(s, k), { userDepositedUtxos: g, statusId: T };
|
|
100
105
|
};
|
|
101
106
|
export {
|
|
102
|
-
|
|
107
|
+
Ot as hinkalDepositOnChainUtxos
|
|
103
108
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("../../constants/protocol.constants.cjs"),X=require("../../error-handling/error-codes.constants.cjs"),ee=require("../../functions/snarkjs/constructEmporiumProof.cjs"),te=require("../../functions/web3/functionCalls/transactCallRelayer.cjs"),I=require("../../types/external-action.types.cjs"),O=require("../utxo/Utxo.cjs");require("../../types/circom-data.types.cjs");const re=require("../../types/ethereum-network.types.cjs");require("../../types/transactions.types.cjs");require("../../types/activities.types.cjs");const W=require("../../types/scheduled-transactions.types.cjs"),se=require("../../functions/pre-transaction/getSignatureDataForTransact.cjs"),oe=require("../../functions/pre-transaction/shouldPatchAccessTokenMerkleTree.cjs"),ne=require("../../functions/utils/time.utils.cjs"),ie=require("../../functions/pre-transaction/getFeeStructure.cjs"),ae=require("../../functions/utils/addresses.cjs"),ce=require("../../constants/chains.constants.cjs"),L=require("../../constants/addresses.constants.cjs");require("ethers");require("idb-keyval");require("@solana/web3.js");require("../http/HttpClient.cjs");require("../../constants/vite.constants.cjs");const ue=require("../../functions/utils/erc20tokenFunctions.cjs");require("../../functions/utils/convertIntegrationProviderToExternalActionId.cjs");require("../../constants/server.constants.cjs");require("axios");const N=require("../../functions/utils/caseInsensitive.utils.cjs");require("../../API/getServerURL.cjs");require("circomlibjs-hinkal-fork");require("libsodium-wrappers");require("process");require("buffer");require("../../constants/save-depths.cjs");require("../../constants/reorg-depths.constants.cjs");require("../../functions/utils/mutexes.utils.cjs");require("@coral-xyz/anchor");require("../crypto-keys/keys.cjs");require("@solana/spl-token");require("../../constants/token-data/index.cjs");require("../../constants/contracts.constants.cjs");require("../../constants/kyc.constants.cjs");require("../../constants/coingecko.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("../../functions/utils/userAgent.cjs");const de=require("../../functions/utils/convertEmporiumOpToCallInfo.cjs");require("multiformats");const le=require("../../API/API.cjs");require("../../API/tenderly.api.cjs");const b=require("./hinkalDepositOnChainUtxos.cjs"),K=require("../../functions/private-wallet/emporium.helpers.cjs"),z=require("../../API/deposit-and-withdraw-status-calls.cjs"),qe=async(e,A,s,v,i,f,d,l)=>{if(s.length===0)throw new Error("No recipients to bridge");const n=A.erc20TokenAddress,r=e.getCurrentChainId(),{contractData:a}=ce.networkRegistry[r],{emporiumAddress:T}=a;if(!T)throw Error("No Emporium Address");const D=L.SWAP_ROUTER_ADDRESSES[I.ExternalActionId.Lifi][r];if(!D)throw new Error(`LIFI not configured for chain ${r}`);const m=await e.getRandomRelay();if(!m)throw Error(X.transactionErrorCodes.RELAYER_NOT_AVAILABLE);const C=await e.getEthereumAddress(),h=ne.getCurrentTimeInSeconds().toString(),w=e.generateProofRemotely?5:1,y=[];for(let q=0;q<s.length;q+=w){const t=s.slice(q,q+w),o=await Promise.all(t.map(async({utxo:c,nativeUtxo:u,bridgeAmount:B,quote:x,temporarySubAccount:R})=>{await le.API.addTemporaryWalletNonce(r,i,R.index);const H=x.nativeFee>0n&&!N.caseInsensitiveEqual(n,p.zeroAddress),E=[n],U=[-c.amount],_=[!1],k=new O.Utxo({amount:0n,erc20TokenAddress:n,shieldedPrivateKey:e.userKeys.getShieldedPrivateKey(),timeStamp:h,tokenId:0}),S=[[c,k]],F=[[k]];if(H&&u){const P=new O.Utxo({amount:0n,erc20TokenAddress:p.zeroAddress,shieldedPrivateKey:e.userKeys.getShieldedPrivateKey(),timeStamp:h,tokenId:0});E.push(p.zeroAddress),U.push(-u.amount),_.push(!1),S.push([u,P]),F.push([P])}const M=K.createLifiBridgeOps(e,R.ethAddress,D,n,c.amount,B,x),{patchAccessTokenMerkleTree:j,kycRequired:V,hasAccessToken:Y}=await oe.shouldPatchAccessTokenMerkleTree(e,E,U),Z=await se.getSignatureDataForTransact(r,C,e.userKeys,V,Y),{zkCallData:$,circomData:G,dimData:J,authorizationData:Q}=await ee.constructEmporiumProof("v1x1",e.merkleTreeHinkal,e.merkleTreeAccessToken,E,E.map(()=>0),S,F,e.userKeys,E.length,S[0].length,T,M,e.generateProofRemotely,m??p.zeroAddress,r,_,void 0,R.privateKey,void 0,j,void 0,v,e.getContractWithFetcher(re.ContractType.HinkalHelperContract),Z,void 0,!1);return{zkCallData:$,dimData:J,circomData:G,authorizationData:Q}}));y.push(...o)}await z.safeUpdateDepositAndWithdrawStatus(r,{id:f,hashedEthereumAddress:i,phase:W.DepositAndWithdrawPhase.BEFORE_SCHEDULE_WITHDRAW});const g=await te.transactCallRelayerBatch(r,y,i,d,l);return await z.safeUpdateDepositAndWithdrawStatus(r,{id:f,hashedEthereumAddress:i,phase:W.DepositAndWithdrawPhase.AFTER_SCHEDULE_WITHDRAW,scheduleId:g}),g},pe=async(e,A,s,v,i,f)=>{const d=A.erc20TokenAddress,l=e.getCurrentChainId(),n=ae.hashEthereumAddress(await e.getEthereumAddress()),r=L.SWAP_ROUTER_ADDRESSES[I.ExternalActionId.Lifi][l];if(!r)throw Error("LIFI router not configured");let a;if(i)a=i;else{const t=s[0],c=K.createLifiBridgeOps(e,t.temporarySubAccount.ethAddress,r,d,t.bridgeAmount,t.bridgeAmount,t.quote).map(u=>de.convertEmporiumOpToCallInfo(u,t.temporarySubAccount.ethAddress,l));a=await ie.getFeeStructure(l,d,[d],I.ExternalActionId.Emporium,c)}const T={feeToken:a.feeToken,flatFee:0n,variableRate:0n},m=s.reduce((t,o)=>t+o.quote.nativeFee,0n)>0n&&!N.caseInsensitiveEqual(d,p.zeroAddress),C=s.map(t=>t.bridgeAmount),h=s.map(t=>t.recipientAddress),{userDepositedUtxos:w,statusId:y}=await b.hinkalDepositOnChainUtxos(e,A,C,h,a,n);let g=[];if(m){const t=ue.getERC20Token(p.zeroAddress,l);if(!t)throw Error("No native token");const o=s.map(u=>u.quote.nativeFee),{userDepositedUtxos:c}=await b.hinkalDepositOnChainUtxos(e,t,o,h,T,n);g=c}const q=s.map((t,o)=>({...t,utxo:w[o].utxo,nativeUtxo:m?g[o]?.utxo:void 0}));return qe(e,A,q,a,n,y,v,f)};exports.hinkalDepositAndBridge=pe;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { IHinkal } from './IHinkal';
|
|
2
2
|
import { BridgeRecipient, ERC20Token } from '../../types';
|
|
3
3
|
import { FeeStructure } from '../../types/hinkal.types';
|
|
4
|
-
export declare const hinkalDepositAndBridge: (hinkal: IHinkal, erc20Token: ERC20Token, recipients: BridgeRecipient[], txCompletionTime?: number, feeStructureOverride?: FeeStructure) => Promise<string>;
|
|
4
|
+
export declare const hinkalDepositAndBridge: (hinkal: IHinkal, erc20Token: ERC20Token, recipients: BridgeRecipient[], txCompletionTime?: number, feeStructureOverride?: FeeStructure, ref?: string) => Promise<string>;
|
|
@@ -1,214 +1,226 @@
|
|
|
1
|
-
import { zeroAddress as
|
|
2
|
-
import { transactionErrorCodes as
|
|
3
|
-
import { constructEmporiumProof as
|
|
4
|
-
import { transactCallRelayerBatch as
|
|
5
|
-
import { ExternalActionId as
|
|
1
|
+
import { zeroAddress as f } from "../../constants/protocol.constants.mjs";
|
|
2
|
+
import { transactionErrorCodes as X } from "../../error-handling/error-codes.constants.mjs";
|
|
3
|
+
import { constructEmporiumProof as tt } from "../../functions/snarkjs/constructEmporiumProof.mjs";
|
|
4
|
+
import { transactCallRelayerBatch as et } from "../../functions/web3/functionCalls/transactCallRelayer.mjs";
|
|
5
|
+
import { ExternalActionId as S } from "../../types/external-action.types.mjs";
|
|
6
6
|
import { Utxo as K } from "../utxo/Utxo.mjs";
|
|
7
7
|
import "../../types/circom-data.types.mjs";
|
|
8
|
-
import { ContractType as
|
|
8
|
+
import { ContractType as ot } from "../../types/ethereum-network.types.mjs";
|
|
9
9
|
import "../../types/transactions.types.mjs";
|
|
10
10
|
import "../../types/activities.types.mjs";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
11
|
+
import { DepositAndWithdrawPhase as N } from "../../types/scheduled-transactions.types.mjs";
|
|
12
|
+
import { getSignatureDataForTransact as rt } from "../../functions/pre-transaction/getSignatureDataForTransact.mjs";
|
|
13
|
+
import { shouldPatchAccessTokenMerkleTree as st } from "../../functions/pre-transaction/shouldPatchAccessTokenMerkleTree.mjs";
|
|
14
|
+
import { getCurrentTimeInSeconds as it } from "../../functions/utils/time.utils.mjs";
|
|
15
|
+
import { getFeeStructure as nt } from "../../functions/pre-transaction/getFeeStructure.mjs";
|
|
16
|
+
import { hashEthereumAddress as at } from "../../functions/utils/addresses.mjs";
|
|
17
|
+
import { networkRegistry as mt } from "../../constants/chains.constants.mjs";
|
|
18
|
+
import { SWAP_ROUTER_ADDRESSES as H } from "../../constants/addresses.constants.mjs";
|
|
18
19
|
import "ethers";
|
|
19
20
|
import "idb-keyval";
|
|
20
21
|
import "@solana/web3.js";
|
|
21
22
|
import "../http/HttpClient.mjs";
|
|
22
23
|
import "../../constants/vite.constants.mjs";
|
|
23
|
-
import { getERC20Token as
|
|
24
|
+
import { getERC20Token as pt } from "../../functions/utils/erc20tokenFunctions.mjs";
|
|
24
25
|
import "../../functions/utils/convertIntegrationProviderToExternalActionId.mjs";
|
|
25
26
|
import "../../constants/server.constants.mjs";
|
|
26
|
-
import "../../API/getServerURL.mjs";
|
|
27
27
|
import "axios";
|
|
28
|
-
import { caseInsensitiveEqual as
|
|
29
|
-
import "
|
|
28
|
+
import { caseInsensitiveEqual as O } from "../../functions/utils/caseInsensitive.utils.mjs";
|
|
29
|
+
import "../../API/getServerURL.mjs";
|
|
30
30
|
import "circomlibjs-hinkal-fork";
|
|
31
|
-
import "
|
|
32
|
-
import "
|
|
33
|
-
import "tweetnacl";
|
|
34
|
-
import "bs58";
|
|
31
|
+
import "libsodium-wrappers";
|
|
32
|
+
import "process";
|
|
35
33
|
import "buffer";
|
|
34
|
+
import "../../constants/save-depths.mjs";
|
|
35
|
+
import "../../constants/reorg-depths.constants.mjs";
|
|
36
|
+
import "../../functions/utils/mutexes.utils.mjs";
|
|
37
|
+
import "@coral-xyz/anchor";
|
|
38
|
+
import "../crypto-keys/keys.mjs";
|
|
39
|
+
import "@solana/spl-token";
|
|
36
40
|
import "../../constants/token-data/index.mjs";
|
|
37
41
|
import "../../constants/contracts.constants.mjs";
|
|
38
42
|
import "../../constants/kyc.constants.mjs";
|
|
39
43
|
import "../../constants/coingecko.constants.mjs";
|
|
40
|
-
import "../../constants/reorg-depths.constants.mjs";
|
|
41
44
|
import "../../constants/token.limits.constants.mjs";
|
|
42
45
|
import "../../constants/presale.constants.mjs";
|
|
43
46
|
import "../../constants/activity.constants.mjs";
|
|
44
47
|
import "../../constants/tasks.constants.mjs";
|
|
45
48
|
import "../../constants/events.constants.mjs";
|
|
46
49
|
import "../../functions/utils/userAgent.mjs";
|
|
47
|
-
import { convertEmporiumOpToCallInfo as
|
|
48
|
-
import "../crypto-keys/keys.mjs";
|
|
49
|
-
import "libsodium-wrappers";
|
|
50
|
+
import { convertEmporiumOpToCallInfo as ct } from "../../functions/utils/convertEmporiumOpToCallInfo.mjs";
|
|
50
51
|
import "multiformats";
|
|
51
|
-
import {
|
|
52
|
-
import "
|
|
53
|
-
import "
|
|
54
|
-
import "../../providers/EthersProviderAdapter.mjs";
|
|
55
|
-
import { hinkalDepositOnChainUtxos as N } from "./hinkalDepositOnChainUtxos.mjs";
|
|
52
|
+
import { API as dt } from "../../API/API.mjs";
|
|
53
|
+
import "../../API/tenderly.api.mjs";
|
|
54
|
+
import { hinkalDepositOnChainUtxos as W } from "./hinkalDepositOnChainUtxos.mjs";
|
|
56
55
|
import { createLifiBridgeOps as z } from "../../functions/private-wallet/emporium.helpers.mjs";
|
|
57
|
-
import {
|
|
58
|
-
const
|
|
59
|
-
if (
|
|
56
|
+
import { safeUpdateDepositAndWithdrawStatus as _ } from "../../API/deposit-and-withdraw-status-calls.mjs";
|
|
57
|
+
const ut = async (t, A, r, R, n, T, c, d) => {
|
|
58
|
+
if (r.length === 0)
|
|
60
59
|
throw new Error("No recipients to bridge");
|
|
61
|
-
const
|
|
62
|
-
if (!
|
|
60
|
+
const i = A.erc20TokenAddress, o = t.getCurrentChainId(), { contractData: a } = mt[o], { emporiumAddress: w } = a;
|
|
61
|
+
if (!w)
|
|
63
62
|
throw Error("No Emporium Address");
|
|
64
|
-
const
|
|
65
|
-
if (!
|
|
66
|
-
throw new Error(`LIFI not configured for chain ${
|
|
67
|
-
const
|
|
68
|
-
if (!
|
|
69
|
-
throw Error(
|
|
70
|
-
const
|
|
71
|
-
for (let
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
await
|
|
75
|
-
const
|
|
63
|
+
const C = H[S.Lifi][o];
|
|
64
|
+
if (!C)
|
|
65
|
+
throw new Error(`LIFI not configured for chain ${o}`);
|
|
66
|
+
const l = await t.getRandomRelay();
|
|
67
|
+
if (!l)
|
|
68
|
+
throw Error(X.RELAYER_NOT_AVAILABLE);
|
|
69
|
+
const D = await t.getEthereumAddress(), h = it().toString(), v = t.generateProofRemotely ? 5 : 1, y = [];
|
|
70
|
+
for (let u = 0; u < r.length; u += v) {
|
|
71
|
+
const e = r.slice(u, u + v), s = await Promise.all(
|
|
72
|
+
e.map(async ({ utxo: m, nativeUtxo: p, bridgeAmount: B, quote: x, temporarySubAccount: I }) => {
|
|
73
|
+
await dt.addTemporaryWalletNonce(o, n, I.index);
|
|
74
|
+
const q = x.nativeFee > 0n && !O(i, f), E = [i], U = [-m.amount], k = [!1], P = new K({
|
|
76
75
|
amount: 0n,
|
|
77
|
-
erc20TokenAddress:
|
|
76
|
+
erc20TokenAddress: i,
|
|
78
77
|
shieldedPrivateKey: t.userKeys.getShieldedPrivateKey(),
|
|
79
|
-
timeStamp:
|
|
78
|
+
timeStamp: h,
|
|
80
79
|
tokenId: 0
|
|
81
|
-
}), F = [[
|
|
82
|
-
if (
|
|
83
|
-
const
|
|
80
|
+
}), F = [[m, P]], L = [[P]];
|
|
81
|
+
if (q && p) {
|
|
82
|
+
const b = new K({
|
|
84
83
|
amount: 0n,
|
|
85
|
-
erc20TokenAddress:
|
|
84
|
+
erc20TokenAddress: f,
|
|
86
85
|
shieldedPrivateKey: t.userKeys.getShieldedPrivateKey(),
|
|
87
|
-
timeStamp:
|
|
86
|
+
timeStamp: h,
|
|
88
87
|
tokenId: 0
|
|
89
88
|
});
|
|
90
|
-
|
|
89
|
+
E.push(f), U.push(-p.amount), k.push(!1), F.push([p, b]), L.push([b]);
|
|
91
90
|
}
|
|
92
|
-
const
|
|
91
|
+
const M = z(
|
|
93
92
|
t,
|
|
94
|
-
|
|
95
|
-
R.ethAddress,
|
|
96
|
-
y,
|
|
97
|
-
m,
|
|
98
|
-
s.amount,
|
|
93
|
+
I.ethAddress,
|
|
99
94
|
C,
|
|
95
|
+
i,
|
|
96
|
+
m.amount,
|
|
97
|
+
B,
|
|
100
98
|
x
|
|
101
|
-
), { patchAccessTokenMerkleTree:
|
|
99
|
+
), { patchAccessTokenMerkleTree: V, kycRequired: Y, hasAccessToken: Z } = await st(
|
|
102
100
|
t,
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
h,
|
|
101
|
+
E,
|
|
102
|
+
U
|
|
103
|
+
), $ = await rt(
|
|
104
|
+
o,
|
|
105
|
+
D,
|
|
109
106
|
t.userKeys,
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
), { zkCallData:
|
|
107
|
+
Y,
|
|
108
|
+
Z
|
|
109
|
+
), { zkCallData: j, circomData: G, dimData: J, authorizationData: Q } = await tt(
|
|
113
110
|
"v1x1",
|
|
114
|
-
t.
|
|
115
|
-
t.
|
|
116
|
-
|
|
117
|
-
|
|
111
|
+
t.merkleTreeHinkal,
|
|
112
|
+
t.merkleTreeAccessToken,
|
|
113
|
+
E,
|
|
114
|
+
E.map(() => 0),
|
|
118
115
|
F,
|
|
119
|
-
|
|
116
|
+
L,
|
|
120
117
|
t.userKeys,
|
|
121
|
-
|
|
118
|
+
E.length,
|
|
122
119
|
F[0].length,
|
|
123
|
-
|
|
124
|
-
|
|
120
|
+
w,
|
|
121
|
+
M,
|
|
125
122
|
t.generateProofRemotely,
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
123
|
+
l ?? f,
|
|
124
|
+
o,
|
|
125
|
+
k,
|
|
129
126
|
void 0,
|
|
130
|
-
|
|
127
|
+
I.privateKey,
|
|
131
128
|
void 0,
|
|
132
|
-
|
|
129
|
+
V,
|
|
133
130
|
void 0,
|
|
134
|
-
|
|
135
|
-
t.getContractWithFetcher(
|
|
136
|
-
|
|
131
|
+
R,
|
|
132
|
+
t.getContractWithFetcher(ot.HinkalHelperContract),
|
|
133
|
+
$,
|
|
137
134
|
void 0,
|
|
138
135
|
!1
|
|
139
136
|
);
|
|
140
|
-
return { zkCallData:
|
|
137
|
+
return { zkCallData: j, dimData: J, circomData: G, authorizationData: Q };
|
|
141
138
|
})
|
|
142
139
|
);
|
|
143
|
-
|
|
140
|
+
y.push(...s);
|
|
144
141
|
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
142
|
+
await _(o, {
|
|
143
|
+
id: T,
|
|
144
|
+
hashedEthereumAddress: n,
|
|
145
|
+
phase: N.BEFORE_SCHEDULE_WITHDRAW
|
|
146
|
+
});
|
|
147
|
+
const g = await et(
|
|
148
|
+
o,
|
|
149
|
+
y,
|
|
150
|
+
n,
|
|
151
|
+
c,
|
|
152
|
+
d
|
|
153
|
+
);
|
|
154
|
+
return await _(o, {
|
|
155
|
+
id: T,
|
|
156
|
+
hashedEthereumAddress: n,
|
|
157
|
+
phase: N.AFTER_SCHEDULE_WITHDRAW,
|
|
158
|
+
scheduleId: g
|
|
159
|
+
}), g;
|
|
160
|
+
}, le = async (t, A, r, R, n, T) => {
|
|
161
|
+
const c = A.erc20TokenAddress, d = t.getCurrentChainId(), i = at(await t.getEthereumAddress()), o = H[S.Lifi][d];
|
|
162
|
+
if (!o)
|
|
149
163
|
throw Error("LIFI router not configured");
|
|
150
|
-
let
|
|
151
|
-
if (
|
|
152
|
-
|
|
164
|
+
let a;
|
|
165
|
+
if (n)
|
|
166
|
+
a = n;
|
|
153
167
|
else {
|
|
154
|
-
const
|
|
168
|
+
const e = r[0], m = z(
|
|
155
169
|
t,
|
|
156
|
-
|
|
157
|
-
o
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
o.quote
|
|
170
|
+
e.temporarySubAccount.ethAddress,
|
|
171
|
+
o,
|
|
172
|
+
c,
|
|
173
|
+
e.bridgeAmount,
|
|
174
|
+
e.bridgeAmount,
|
|
175
|
+
e.quote
|
|
163
176
|
).map(
|
|
164
|
-
(
|
|
177
|
+
(p) => ct(p, e.temporarySubAccount.ethAddress, d)
|
|
165
178
|
);
|
|
166
|
-
|
|
179
|
+
a = await nt(d, c, [c], S.Emporium, m);
|
|
167
180
|
}
|
|
168
|
-
const
|
|
169
|
-
feeToken:
|
|
181
|
+
const w = {
|
|
182
|
+
feeToken: a.feeToken,
|
|
170
183
|
flatFee: 0n,
|
|
171
184
|
variableRate: 0n
|
|
172
|
-
},
|
|
185
|
+
}, l = r.reduce((e, s) => e + s.quote.nativeFee, 0n) > 0n && !O(c, f), D = r.map((e) => e.bridgeAmount), h = r.map((e) => e.recipientAddress), { userDepositedUtxos: v, statusId: y } = await W(
|
|
173
186
|
t,
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
m
|
|
187
|
+
A,
|
|
188
|
+
D,
|
|
189
|
+
h,
|
|
190
|
+
a,
|
|
191
|
+
i
|
|
180
192
|
);
|
|
181
|
-
let
|
|
182
|
-
if (
|
|
183
|
-
const
|
|
184
|
-
if (!
|
|
193
|
+
let g = [];
|
|
194
|
+
if (l) {
|
|
195
|
+
const e = pt(f, d);
|
|
196
|
+
if (!e)
|
|
185
197
|
throw Error("No native token");
|
|
186
|
-
const s =
|
|
187
|
-
p = await N(
|
|
198
|
+
const s = r.map((p) => p.quote.nativeFee), { userDepositedUtxos: m } = await W(
|
|
188
199
|
t,
|
|
189
|
-
|
|
190
|
-
o,
|
|
200
|
+
e,
|
|
191
201
|
s,
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
202
|
+
h,
|
|
203
|
+
w,
|
|
204
|
+
i
|
|
195
205
|
);
|
|
206
|
+
g = m;
|
|
196
207
|
}
|
|
197
|
-
const
|
|
198
|
-
...
|
|
199
|
-
utxo:
|
|
200
|
-
nativeUtxo:
|
|
208
|
+
const u = r.map((e, s) => ({
|
|
209
|
+
...e,
|
|
210
|
+
utxo: v[s].utxo,
|
|
211
|
+
nativeUtxo: l ? g[s]?.utxo : void 0
|
|
201
212
|
}));
|
|
202
|
-
return
|
|
213
|
+
return ut(
|
|
203
214
|
t,
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
215
|
+
A,
|
|
216
|
+
u,
|
|
217
|
+
a,
|
|
218
|
+
i,
|
|
219
|
+
y,
|
|
220
|
+
R,
|
|
221
|
+
T
|
|
210
222
|
);
|
|
211
223
|
};
|
|
212
224
|
export {
|
|
213
|
-
|
|
225
|
+
le as hinkalDepositAndBridge
|
|
214
226
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../../API/API.cjs"),n=r=>({async getAccessToken(){return a.API.getZkMeAccessToken()},async getUserAccounts(){return[await r.getEthereumAddress()]},async delegateTransaction(e){const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../../API/API.cjs"),n=r=>({async getAccessToken(){const e=r.getCurrentChainId();return a.API.getZkMeAccessToken(e)},async getUserAccounts(){return[await r.getEthereumAddress()]},async delegateTransaction(e){const t=await r.getProviderAdapter(),s={...e,chainId:Number(e.chainId),type:e.type?e.type:void 0,maxPriorityFeePerGas:e.maxPriorityFeePerGas?e.maxPriorityFeePerGas:void 0,maxFeePerGas:e.maxFeePerGas?e.maxFeePerGas:void 0};return(await t.sendTransaction(s)).hash}});exports.getHinkalZkMeProvider=n;
|