@hinkal/common 0.2.20 → 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 +61 -32
- 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
package/README.md
CHANGED
|
@@ -12,9 +12,9 @@ With Hinkal SDK, developers can:
|
|
|
12
12
|
|
|
13
13
|
## Compatibility
|
|
14
14
|
|
|
15
|
-
| Environment | Supported | Notes
|
|
16
|
-
|
|
17
|
-
| Node.js | ✅ | v18+
|
|
15
|
+
| Environment | Supported | Notes |
|
|
16
|
+
| ----------- | --------- | -------------------------- |
|
|
17
|
+
| Node.js | ✅ | v18+ |
|
|
18
18
|
| Browser | ✅ | React, Next.js, vanilla JS |
|
|
19
19
|
|
|
20
20
|
## Installation
|
|
@@ -38,11 +38,11 @@ yarn add @hinkal/common
|
|
|
38
38
|
To begin using Hinkal in your application, you'll need to initialize the SDK with your preferred Web3 connection library. Hinkal supports multiple popular libraries out of the box, allowing seamless integration with your existing wallet connection setup.
|
|
39
39
|
|
|
40
40
|
Initializing the SDK creates a `Hinkal` object that encapsulates:
|
|
41
|
+
|
|
41
42
|
- The user's shielded balances
|
|
42
43
|
- Actions the user can perform, such as shielding (depositing), transfers, and swapping
|
|
43
44
|
- Cryptographic keys for privacy-preserving operations
|
|
44
45
|
|
|
45
|
-
|
|
46
46
|
**ethers.js:**
|
|
47
47
|
|
|
48
48
|
```typescript
|
|
@@ -59,12 +59,14 @@ import { prepareWagmiHinkal } from '@hinkal/common/providers/prepareWagmiHinkal'
|
|
|
59
59
|
// wagmiConfig: wagmi.Config
|
|
60
60
|
const hinkal = await prepareWagmiHinkal(connector, wagmiConfig, hinkalConfig);
|
|
61
61
|
```
|
|
62
|
+
|
|
62
63
|
The `hinkalConfig` is defined as follows:
|
|
64
|
+
|
|
63
65
|
```typescript
|
|
64
66
|
type HinkalConfig = {
|
|
65
67
|
/** Disables caching in browser localStorage, storing data only in memory. Front-end only. Defaults to false. */
|
|
66
68
|
disableCaching?: boolean;
|
|
67
|
-
|
|
69
|
+
|
|
68
70
|
/** If true, allows caching in a file locally. Node.js only. Defaults to false. */
|
|
69
71
|
useFileCache?: boolean;
|
|
70
72
|
|
|
@@ -86,15 +88,14 @@ type HinkalConfig = {
|
|
|
86
88
|
Shielded balances are encrypted token holdings stored within the Hinkal protocol. Unlike regular blockchain balances that are publicly visible, shielded balances are hidden from external observers, providing privacy for your assets. After initializing the Hinkal object, you can access and calculate your shielded balances:
|
|
87
89
|
|
|
88
90
|
```typescript
|
|
89
|
-
const balances: Promise<Map<string, TokenBalance>>
|
|
91
|
+
const balances: Promise<Map<string, TokenBalance>> = await hinkal.getBalances();
|
|
90
92
|
```
|
|
91
93
|
|
|
92
94
|
This returns a map from token address to balance for all tokens held by the user, including ERC20 and ERC721 tokens.
|
|
93
95
|
|
|
94
|
-
|
|
95
96
|
### Shielding: depositing funds to the shielded balance
|
|
96
97
|
|
|
97
|
-
Shielding is the process of moving your tokens from a public blockchain address into a private, encrypted balance. Once shielded, your tokens are no longer visible on-chain to external observers. This provides privacy for your holdings and subsequent transactions.
|
|
98
|
+
Shielding is the process of moving your tokens from a public blockchain address into a private, encrypted balance. Once shielded, your tokens are no longer visible on-chain to external observers. This provides privacy for your holdings and subsequent transactions.
|
|
98
99
|
|
|
99
100
|
A user can deposit funds to their shielded address using:
|
|
100
101
|
|
|
@@ -103,6 +104,7 @@ function deposit(erc20Tokens: ERC20Token[], amountChanges: bigint[]): Promise<et
|
|
|
103
104
|
```
|
|
104
105
|
|
|
105
106
|
where:
|
|
107
|
+
|
|
106
108
|
- `erc20Tokens` is an array of tokens to deposit
|
|
107
109
|
- `amountChanges` represents the corresponding token amounts for the deposit
|
|
108
110
|
|
|
@@ -130,13 +132,14 @@ function withdraw(
|
|
|
130
132
|
deltaAmounts: bigint[],
|
|
131
133
|
recipientAddress: string,
|
|
132
134
|
isRelayerOff: boolean,
|
|
133
|
-
): Promise<
|
|
135
|
+
): Promise<string>;
|
|
134
136
|
```
|
|
135
137
|
|
|
136
138
|
where:
|
|
139
|
+
|
|
137
140
|
- `recipientAddress` is the public address that will receive the withdrawn funds
|
|
138
141
|
- `isRelayerOff` determines whether to use a relayer for the transaction (when `false`, a relayer handles gas fees; when `true`, the user pays gas directly)
|
|
139
|
-
- `
|
|
142
|
+
- `string` type represents the transaction response from the relayer service.
|
|
140
143
|
|
|
141
144
|
### Private Send to Private Address: transfering funds from shielded balance
|
|
142
145
|
|
|
@@ -145,13 +148,11 @@ Private Send to Private Address enables fully confidential transfers between shi
|
|
|
145
148
|
A user can transfer tokens from their shielded balance to another shielded address using:
|
|
146
149
|
|
|
147
150
|
```typescript
|
|
148
|
-
function transfer(
|
|
149
|
-
erc20Tokens: ERC20Token[],
|
|
150
|
-
deltaAmounts: bigint[],
|
|
151
|
-
privateRecipientAddress: string,
|
|
152
|
-
): Promise<RelayerTransaction>;
|
|
151
|
+
function transfer(erc20Tokens: ERC20Token[], deltaAmounts: bigint[], privateRecipientAddress: string): Promise<string>;
|
|
153
152
|
```
|
|
153
|
+
|
|
154
154
|
where:
|
|
155
|
+
|
|
155
156
|
- `privateRecipientAddress` is the recipient's private address, formatted as a comma-separated string with five components:
|
|
156
157
|
- `randomization` - a random value for privacy
|
|
157
158
|
- `stealthAddress` - the recipient's stealth address (hex format starting with `0x`)
|
|
@@ -171,16 +172,16 @@ function depositAndWithdraw(
|
|
|
171
172
|
recipientAmounts: bigint[],
|
|
172
173
|
recipientAddresses: string[],
|
|
173
174
|
txCompletionTime?: number,
|
|
174
|
-
): Promise<
|
|
175
|
+
): Promise<string>;
|
|
175
176
|
```
|
|
176
177
|
|
|
177
178
|
where:
|
|
179
|
+
|
|
178
180
|
- `erc20Token` is the token to transfer (only single token transfers are supported for this method)
|
|
179
181
|
- `recipientAmounts` is an array of amounts to send to each recipient (in the token's smallest unit)
|
|
180
182
|
- `recipientAddresses` is an array of public addresses that will receive the funds
|
|
181
183
|
- `txCompletionTime` (optional) specifies a delay in milliseconds before the withdrawal completes
|
|
182
184
|
|
|
183
|
-
|
|
184
185
|
### Swapping tokens from the shielded balance
|
|
185
186
|
|
|
186
187
|
Swapping allows you to exchange tokens directly from your shielded balance without revealing your identity. The swap is executed through integrated DEX protocols (Uniswap, 1Inch, Odos) while keeping your transaction private. Your tokens are withdrawn from your shielded balance, swapped through the specified protocol, and the resulting tokens are deposited back into your shielded balance—all in a single private transaction.
|
|
@@ -193,10 +194,11 @@ function swap(
|
|
|
193
194
|
deltaAmounts: bigint[],
|
|
194
195
|
externalActionId: ExternalActionId,
|
|
195
196
|
swapData: string,
|
|
196
|
-
): Promise<
|
|
197
|
+
): Promise<string>;
|
|
197
198
|
```
|
|
198
199
|
|
|
199
200
|
where:
|
|
201
|
+
|
|
200
202
|
- `externalActionId` identifies the external swap protocol to use. Possible values include:
|
|
201
203
|
- `ExternalActionId.Uniswap` - for Uniswap swaps
|
|
202
204
|
- `ExternalActionId.OneInch` - for 1Inch swaps
|
|
@@ -209,8 +211,8 @@ To obtain the swap calldata using the Hinkal SDK, you can use the built-in swap
|
|
|
209
211
|
|
|
210
212
|
To get swap data for 1Inch, you can use the `getOneInchPrice` function. This function fetches a quote from the 1Inch aggregator and returns both the expected output amount and the encoded swap data that can be passed to the `swap` function:
|
|
211
213
|
|
|
212
|
-
|
|
213
214
|
**1Inch:**
|
|
215
|
+
|
|
214
216
|
```typescript
|
|
215
217
|
function getOneInchPrice(
|
|
216
218
|
chainId: number,
|
|
@@ -219,11 +221,13 @@ function getOneInchPrice(
|
|
|
219
221
|
inSwapAmount: string,
|
|
220
222
|
slippagePercentage?: number,
|
|
221
223
|
): Promise<{
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
}
|
|
224
|
+
outSwapAmountValue: bigint;
|
|
225
|
+
oneInchDataValue: string;
|
|
226
|
+
}>;
|
|
225
227
|
```
|
|
228
|
+
|
|
226
229
|
Similar functions are available for other supported swap protocols:
|
|
230
|
+
|
|
227
231
|
- **Uniswap:** `getUniswapPrice`
|
|
228
232
|
- **Odos:** `getOdosPrice`
|
|
229
233
|
- **LiFi:** `getLifiPrice`
|
|
@@ -234,15 +238,16 @@ The SDK lets you interact with any smart contract on the blockchain while keepin
|
|
|
234
238
|
|
|
235
239
|
```typescript
|
|
236
240
|
function actionPrivateWallet(
|
|
237
|
-
chainId:number,
|
|
241
|
+
chainId: number,
|
|
238
242
|
erc20Tokens: ERC20Token[],
|
|
239
243
|
deltaAmounts: bigint[],
|
|
240
244
|
onChainCreation: boolean[],
|
|
241
245
|
ops: string[],
|
|
242
|
-
): Promise<
|
|
246
|
+
): Promise<string>;
|
|
243
247
|
```
|
|
244
248
|
|
|
245
249
|
Parameters:
|
|
250
|
+
|
|
246
251
|
- `chainId` - the blockchain network identifier
|
|
247
252
|
- `onChainCreation` - array of booleans indicating the direction of token changes: `true` for positive changes (tokens received), `false` for negative changes (tokens spent)
|
|
248
253
|
- `ops` - array of encoded user operations to execute (see User operations below)
|
|
@@ -259,10 +264,11 @@ function emporiumOp(
|
|
|
259
264
|
callDataString?: string;
|
|
260
265
|
invokeWallet?: boolean;
|
|
261
266
|
value?: bigint;
|
|
262
|
-
): Promise<
|
|
267
|
+
): Promise<string>;
|
|
263
268
|
```
|
|
264
269
|
|
|
265
270
|
The function accepts the following arguments:
|
|
271
|
+
|
|
266
272
|
1. `contract` _(required)_ - target address or contract instance (with address). The contract instance will be used to properly encode the call function, if any, in the custom operation.
|
|
267
273
|
2. `func` _(optional)_ - the name of the function to be called on the target address.
|
|
268
274
|
3. `args` _(optional)_ - arguments of the function to be called on the target address.
|
|
@@ -270,7 +276,6 @@ The function accepts the following arguments:
|
|
|
270
276
|
5. `invokeWallet` _(optional)_ - boolean flag that determines the type of interaction (see the stateless/stateful interactions below).
|
|
271
277
|
6. `value` _(optional)_ - the value field to the user operation call.
|
|
272
278
|
|
|
273
|
-
|
|
274
279
|
When the Emporium contract executes a user operation, it receives the data in this format:
|
|
275
280
|
|
|
276
281
|
```solidity
|
|
@@ -296,23 +301,31 @@ const operations = [
|
|
|
296
301
|
emporiumOp({ contract: wethContractInstance, func: 'withdraw', args: [amountOut] }),
|
|
297
302
|
];
|
|
298
303
|
```
|
|
304
|
+
|
|
299
305
|
In this example:
|
|
306
|
+
|
|
300
307
|
- First operation approves the swap router to spend USDC tokens
|
|
301
308
|
- Second operation executes the swap from USDC to WETH
|
|
302
309
|
- Third operation unwraps WETH to ETH
|
|
303
310
|
|
|
304
|
-
|
|
305
|
-
**Stateful interactions** are operations where the target protocol needs to track the account's history for future calculations, such as staking rewards, voting power, or checkpoints. In these cases, set `invokeWallet: true` to ensure the operation is executed from a persistent wallet address that the protocol can track.
|
|
311
|
+
**Stateful interactions** are operations where the target protocol needs to track the account's history for future calculations, such as staking rewards, voting power, or checkpoints. In these cases, set `invokeWallet: true` to ensure the operation is executed from a persistent wallet address that the protocol can track.
|
|
306
312
|
|
|
307
313
|
Consider a scenario where you have already staked Curve LP tokens and want to claim your rewards. The gauge contract needs to track your staking history to calculate accumulated rewards, so it must recognize the same wallet address across multiple interactions.
|
|
308
314
|
|
|
309
315
|
```typescript
|
|
310
316
|
const operations = [
|
|
311
|
-
emporiumOp({ contract: lpTokenInstance, func: 'approve', args: [gaugeAddressInstance, amount], invokeWallet: true }),
|
|
312
|
-
emporiumOp({
|
|
317
|
+
emporiumOp({ contract: lpTokenInstance, func: 'approve', args: [gaugeAddressInstance, amount], invokeWallet: true }),
|
|
318
|
+
emporiumOp({
|
|
319
|
+
contract: gaugeAddressInstance,
|
|
320
|
+
func: 'deposit',
|
|
321
|
+
args: [amount, invokeWalletAddress],
|
|
322
|
+
invokeWallet: true,
|
|
323
|
+
}),
|
|
313
324
|
];
|
|
314
325
|
```
|
|
326
|
+
|
|
315
327
|
In this example:
|
|
328
|
+
|
|
316
329
|
- First operation approves the gauge contract to spend LP tokens, executed from the persistent wallet
|
|
317
330
|
- Second operation deposits LP tokens into the gauge, with the wallet address as the recipient for reward tracking
|
|
318
331
|
|
|
@@ -331,16 +344,32 @@ function checkAccessToken(): Promise<boolean>;
|
|
|
331
344
|
If the user does not have an access token, they need to complete a compliance verification through one of Hinkal's supported compliance providers. This is a one-time process that verifies the user meets regulatory requirements before they can use the privacy features.
|
|
332
345
|
|
|
333
346
|
To get a list of all available compliance providers that can be used for verification:
|
|
347
|
+
|
|
334
348
|
```typescript
|
|
335
349
|
function getSupportedPassportLinks(): string[];
|
|
336
350
|
```
|
|
337
351
|
|
|
338
|
-
After passing the compliance check with one of the supported providers, the access token will be automatically minted during the user's first transaction with Hinkal. This token is stored on-chain and grants the user permission to interact with Hinkal's privacy contracts.
|
|
352
|
+
After passing the compliance check with one of the supported providers, the access token will be automatically minted during the user's first transaction with Hinkal. This token is stored on-chain and grants the user permission to interact with Hinkal's privacy contracts.
|
|
353
|
+
|
|
354
|
+
## Supported Chains
|
|
355
|
+
|
|
356
|
+
Hinkal SDK is available on the following blockchain networks:
|
|
357
|
+
|
|
358
|
+
| Chain | Chain ID | Status |
|
|
359
|
+
| -------- | -------- | -------------- |
|
|
360
|
+
| Ethereum | 1 | ✅ Live |
|
|
361
|
+
| Polygon | 137 | ✅ Live |
|
|
362
|
+
| Base | 8453 | ✅ Live |
|
|
363
|
+
| Arbitrum | 42161 | ✅ Live |
|
|
364
|
+
| Optimism | 10 | ✅ Live |
|
|
365
|
+
| Solana | - | 🚧 In Progress |
|
|
366
|
+
|
|
367
|
+
Each chain supports the full suite of Hinkal privacy features including shielding, transfers, and confidential interactions with DeFi protocols.
|
|
339
368
|
|
|
340
369
|
## References
|
|
341
370
|
|
|
342
371
|
Wallet: [Hinkal Wallet](https://chromewebstore.google.com/detail/hinkal-wallet/khfjgapjfcdoffmklchibpepboholpbe)
|
|
343
372
|
|
|
344
|
-
Application: [Private Send](https://send.hinkal.io)
|
|
373
|
+
Application: [Private Send](https://send.hinkal.io)
|
|
345
374
|
|
|
346
375
|
Docs: [Hinkal Documentation](https://hinkal-team.gitbook.io/hinkal)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./deploy-data/deploy-data-bnbMainnet.json.cjs"),d=require("./deploy-data/deploy-data-arbMainnet.json.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./deploy-data/deploy-data-bnbMainnet.json.cjs"),d=require("./deploy-data/deploy-data-arbMainnet.json.cjs"),h=require("./deploy-data/deploy-data-ethMainnet.json.cjs"),u=require("./deploy-data/deploy-data-optimism.json.cjs"),m=require("./deploy-data/deploy-data-polygon.json.cjs"),b=require("./deploy-data/deploy-data-avalanche.json.cjs"),y=require("./deploy-data/deploy-data-base.json.cjs"),A=require("./deploy-data/deploy-data-localhost.json.cjs"),f=require("./deploy-data/deploy-data-arcTestnet.json.cjs"),c=require("./deploy-data/deploy-data-solana.json.cjs"),r=require("./vite.constants.cjs"),t={polygon:137,arbMainnet:42161,ethMainnet:1,avalanche:43114,bnbMainnet:56,optimism:10,base:8453,bnbTestnet:97,polygonMumbai:80001,mainnetSepolia:11155111,optimismSepolia:11155420,localhost:31337,hardhat:31337,arcTestnet:5042002,solanaMainnet:501,solanaLocalnet:102},D="4sGjMW1sUnHzSxGspuhpqLDx6wiyjNtZ",n=t.ethMainnet,s=a=>!![t.localhost].includes(a),E=a=>a?s(a)?n:a:n,i="X4IiEZsSzGOrJq8tzq7Y3",e=r.isNotProduction?i:"XzUgeU8YiIIzkD7j2GWnTsFUck7wGgK9",F="https://mainnet.helius-rpc.com/?api-key=24718f72-c710-45d6-853e-d447cf530579",o={[t.ethMainnet]:{name:"Ethereum",chainId:t.ethMainnet,rpcUrl:"https://rpc.ankr.com/eth",fetchRpcUrl:`https://eth-mainnet.g.alchemy.com/v2/${e}`,supported:!0,contractData:h.default,quoterV2Address:"0x61fFE014bA17989E743c5F6cB21bF9697530B21e",uniswapV3FactoryAddress:"0x1F98431c8aD98523631AE4a59f267346ea31F984",priority:1,privateMempoolRpcUrl:"https://relay.flashbots.net"},[t.arbMainnet]:{name:"Arbitrum",chainId:t.arbMainnet,rpcUrl:"https://endpoints.omniatech.io/v1/arbitrum/one/public",fetchRpcUrl:`https://arb-mainnet.g.alchemy.com/v2/${e}`,supported:!0,contractData:d.default,quoterV2Address:"0x61fFE014bA17989E743c5F6cB21bF9697530B21e",uniswapV3FactoryAddress:"0x1F98431c8aD98523631AE4a59f267346ea31F984",priority:2},[t.optimism]:{name:"Optimism",chainId:t.optimism,rpcUrl:"https://optimism-mainnet.infura.io/v3/c26b99456bb6464bb498926ff5162903",fetchRpcUrl:`https://opt-mainnet.g.alchemy.com/v2/${e}`,supported:!0,contractData:u.default,quoterV2Address:"0x61fFE014bA17989E743c5F6cB21bF9697530B21e",uniswapV3FactoryAddress:"0x1F98431c8aD98523631AE4a59f267346ea31F984",priority:3},[t.polygon]:{name:"Polygon",chainId:t.polygon,rpcUrl:"https://polygon-rpc.com",fetchRpcUrl:`https://polygon-mainnet.g.alchemy.com/v2/${e}`,supported:!0,contractData:m.default,quoterV2Address:"0x61fFE014bA17989E743c5F6cB21bF9697530B21e",uniswapV3FactoryAddress:"0x1F98431c8aD98523631AE4a59f267346ea31F984",priority:4,maxPageSize:1e6},[t.avalanche]:{name:"Avalanche",chainId:t.avalanche,rpcUrl:"https://api.avax.network/ext/bc/C/rpc",fetchRpcUrl:`https://avax-mainnet.g.alchemy.com/v2/${e}`,supported:!0,contractData:b.default,quoterV2Address:"0xbe0F5544EC67e9B3b2D979aaA43f18Fd87E6257F",uniswapV3FactoryAddress:"0x740b1c1de25031C31FF4fC9A62f554A55cdC1baD",priority:5},[t.bnbMainnet]:{name:"BNB Chain",chainId:t.bnbMainnet,rpcUrl:"https://bsc-dataseed.binance.org",fetchRpcUrl:`https://bnb-mainnet.g.alchemy.com/v2/${e}`,supported:!0,contractData:l.default,quoterV2Address:"0x78D78E420Da98ad378D7799bE8f4AF69033EB077",uniswapV3FactoryAddress:"0xdB1d10011AD0Ff90774D0C6Bb92e5C5c8b4461F7",priority:6},[t.base]:{name:"Base",chainId:t.base,rpcUrl:"https://mainnet.base.org/",fetchRpcUrl:`https://base-mainnet.g.alchemy.com/v2/${e}`,supported:!0,contractData:y.default,quoterV2Address:"0x3d4e44Eb1374240CE5F1B871ab261CD16335B76a",uniswapV3FactoryAddress:"0x33128a8fC17869897dcE68Ed026d694621f6FDfD",priority:7},[t.arcTestnet]:{name:"Arc Testnet",chainId:t.arcTestnet,rpcUrl:`https://arc-testnet.g.alchemy.com/v2/${e}`,fetchRpcUrl:`https://arc-testnet.g.alchemy.com/v2/${e}`,supported:!0,contractData:f.default,priority:8,maxPageSize:9999},[t.solanaMainnet]:{name:"Solana",chainId:t.solanaMainnet,rpcUrl:"https://api.mainnet-beta.solana.com",fetchRpcUrl:"https://wider-side-sunset.solana-mainnet.quiknode.pro/61054262c1a2b13dd570243c5fdd017c05cf7fe1",supported:!0,contractData:c.default,priority:8},[t.solanaLocalnet]:{name:"Solana Localnet",chainId:t.solanaLocalnet,rpcUrl:"http://127.0.0.1:8899",fetchRpcUrl:"http://127.0.0.1:8899",supported:!0,contractData:c.default,priority:9},...r.isDevelopment?{}:{}},I={name:"Localhost",chainId:t.localhost,rpcUrl:"http://127.0.0.1:8545",fetchRpcUrl:"http://127.0.0.1:8545",supported:!0,contractData:A.default,quoterV2Address:o[n].quoterV2Address,uniswapV3FactoryAddress:o[n].uniswapV3FactoryAddress,priority:7};r.isDevelopment&&(o[t.localhost]=I);var p=(a=>(a.Mainnet="Mainnet",a.Testnet="Testnet",a.Local="Local",a))(p||{});const L={Mainnet:[t.polygon,t.arbMainnet,t.ethMainnet,t.bnbMainnet,t.optimism,t.avalanche,t.base],Testnet:[t.bnbTestnet,t.polygonMumbai,t.arcTestnet],Local:[t.localhost]},M=a=>[t.optimism,t.base].includes(a),U=a=>[t.solanaMainnet,t.solanaLocalnet].includes(a),g=t.ethMainnet,T=[t.ethMainnet,t.optimism,t.base,t.polygon,t.arbMainnet,t.arcTestnet],C=[t.ethMainnet,t.optimism,t.base,t.polygon,t.arbMainnet];exports.ALCHEMY_API_KEY=e;exports.ALCHEMY_TEST_KEY=i;exports.BRIDGE_SUPPORTED_CHAINS=C;exports.EthereumNetworkType=p;exports.HELIUS_RPC_URL=F;exports.WALLET_INITIAL_CHAIN_ID=g;exports.WALLET_SUPPORTED_CHAINS=T;exports.chainIds=t;exports.chainIdsByType=L;exports.getNonLocalhostChainId=E;exports.isLocalNetwork=s;exports.isOptimismLike=M;exports.isSolanaLike=U;exports.localhostNetwork=n;exports.networkRegistry=o;exports.solanaChainIdStr=D;
|
|
@@ -7,7 +7,12 @@ export declare const chainIds: {
|
|
|
7
7
|
bnbMainnet: number;
|
|
8
8
|
optimism: number;
|
|
9
9
|
base: number;
|
|
10
|
+
bnbTestnet: number;
|
|
11
|
+
polygonMumbai: number;
|
|
12
|
+
mainnetSepolia: number;
|
|
13
|
+
optimismSepolia: number;
|
|
10
14
|
localhost: number;
|
|
15
|
+
hardhat: number;
|
|
11
16
|
arcTestnet: number;
|
|
12
17
|
solanaMainnet: number;
|
|
13
18
|
solanaLocalnet: number;
|
|
@@ -32,5 +37,6 @@ export declare const chainIdsByType: {
|
|
|
32
37
|
};
|
|
33
38
|
export declare const isOptimismLike: (chainId: number) => boolean;
|
|
34
39
|
export declare const isSolanaLike: (chainId: number) => boolean;
|
|
40
|
+
export declare const WALLET_INITIAL_CHAIN_ID: number;
|
|
35
41
|
export declare const WALLET_SUPPORTED_CHAINS: number[];
|
|
36
42
|
export declare const BRIDGE_SUPPORTED_CHAINS: number[];
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import s from "./deploy-data/deploy-data-bnbMainnet.json.mjs";
|
|
2
2
|
import i from "./deploy-data/deploy-data-arbMainnet.json.mjs";
|
|
3
3
|
import p from "./deploy-data/deploy-data-ethMainnet.json.mjs";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
4
|
+
import l from "./deploy-data/deploy-data-optimism.json.mjs";
|
|
5
|
+
import m from "./deploy-data/deploy-data-polygon.json.mjs";
|
|
6
6
|
import h from "./deploy-data/deploy-data-avalanche.json.mjs";
|
|
7
7
|
import d from "./deploy-data/deploy-data-base.json.mjs";
|
|
8
8
|
import b from "./deploy-data/deploy-data-localhost.json.mjs";
|
|
9
9
|
import u from "./deploy-data/deploy-data-arcTestnet.json.mjs";
|
|
10
10
|
import r from "./deploy-data/deploy-data-solana.json.mjs";
|
|
11
|
-
import { isDevelopment as
|
|
11
|
+
import { isDevelopment as c, isNotProduction as f } from "./vite.constants.mjs";
|
|
12
12
|
const t = {
|
|
13
13
|
polygon: 137,
|
|
14
14
|
arbMainnet: 42161,
|
|
@@ -17,73 +17,70 @@ const t = {
|
|
|
17
17
|
bnbMainnet: 56,
|
|
18
18
|
optimism: 10,
|
|
19
19
|
base: 8453,
|
|
20
|
+
bnbTestnet: 97,
|
|
21
|
+
polygonMumbai: 80001,
|
|
22
|
+
mainnetSepolia: 11155111,
|
|
23
|
+
optimismSepolia: 11155420,
|
|
20
24
|
localhost: 31337,
|
|
25
|
+
hardhat: 31337,
|
|
21
26
|
arcTestnet: 5042002,
|
|
22
27
|
// Custom numeric IDs reserved for Solana clusters to avoid collision with any EVM chain IDs
|
|
23
28
|
// These values are chosen from the commonly referenced Solana cluster identifiers and
|
|
24
29
|
// are not used by any known EVM networks in this codebase
|
|
25
30
|
solanaMainnet: 501,
|
|
26
31
|
solanaLocalnet: 102
|
|
27
|
-
},
|
|
32
|
+
}, R = "4sGjMW1sUnHzSxGspuhpqLDx6wiyjNtZ", n = t.ethMainnet, y = (a) => !![t.localhost].includes(a), V = (a) => a ? y(a) ? n : a : n, A = "X4IiEZsSzGOrJq8tzq7Y3", e = f ? A : "XzUgeU8YiIIzkD7j2GWnTsFUck7wGgK9", S = "https://mainnet.helius-rpc.com/?api-key=24718f72-c710-45d6-853e-d447cf530579", o = {
|
|
28
33
|
[t.ethMainnet]: {
|
|
29
34
|
name: "Ethereum",
|
|
30
35
|
chainId: t.ethMainnet,
|
|
31
36
|
rpcUrl: "https://rpc.ankr.com/eth",
|
|
32
|
-
fetchRpcUrl: `https://eth-mainnet.g.alchemy.com/v2/${
|
|
33
|
-
wsRpcUrl: `wss://eth-mainnet.g.alchemy.com/v2/${a}`,
|
|
37
|
+
fetchRpcUrl: `https://eth-mainnet.g.alchemy.com/v2/${e}`,
|
|
34
38
|
supported: !0,
|
|
35
39
|
contractData: p,
|
|
36
40
|
quoterV2Address: "0x61fFE014bA17989E743c5F6cB21bF9697530B21e",
|
|
37
41
|
uniswapV3FactoryAddress: "0x1F98431c8aD98523631AE4a59f267346ea31F984",
|
|
38
42
|
priority: 1,
|
|
39
|
-
privateMempoolRpcUrl: "https://relay.flashbots.net"
|
|
40
|
-
maxPageSize: 9e5
|
|
43
|
+
privateMempoolRpcUrl: "https://relay.flashbots.net"
|
|
41
44
|
},
|
|
42
45
|
[t.arbMainnet]: {
|
|
43
46
|
name: "Arbitrum",
|
|
44
47
|
chainId: t.arbMainnet,
|
|
45
48
|
rpcUrl: "https://endpoints.omniatech.io/v1/arbitrum/one/public",
|
|
46
|
-
fetchRpcUrl: `https://arb-mainnet.g.alchemy.com/v2/${
|
|
47
|
-
wsRpcUrl: `wss://arb-mainnet.g.alchemy.com/v2/${a}`,
|
|
49
|
+
fetchRpcUrl: `https://arb-mainnet.g.alchemy.com/v2/${e}`,
|
|
48
50
|
supported: !0,
|
|
49
51
|
contractData: i,
|
|
50
52
|
quoterV2Address: "0x61fFE014bA17989E743c5F6cB21bF9697530B21e",
|
|
51
53
|
uniswapV3FactoryAddress: "0x1F98431c8aD98523631AE4a59f267346ea31F984",
|
|
52
|
-
priority: 2
|
|
53
|
-
maxPageSize: 5e5
|
|
54
|
+
priority: 2
|
|
54
55
|
},
|
|
55
56
|
[t.optimism]: {
|
|
56
57
|
name: "Optimism",
|
|
57
58
|
chainId: t.optimism,
|
|
58
59
|
rpcUrl: "https://optimism-mainnet.infura.io/v3/c26b99456bb6464bb498926ff5162903",
|
|
59
|
-
fetchRpcUrl: `https://opt-mainnet.g.alchemy.com/v2/${
|
|
60
|
-
wsRpcUrl: `wss://opt-mainnet.g.alchemy.com/v2/${a}`,
|
|
60
|
+
fetchRpcUrl: `https://opt-mainnet.g.alchemy.com/v2/${e}`,
|
|
61
61
|
supported: !0,
|
|
62
|
-
contractData:
|
|
62
|
+
contractData: l,
|
|
63
63
|
quoterV2Address: "0x61fFE014bA17989E743c5F6cB21bF9697530B21e",
|
|
64
64
|
uniswapV3FactoryAddress: "0x1F98431c8aD98523631AE4a59f267346ea31F984",
|
|
65
|
-
priority: 3
|
|
66
|
-
maxPageSize: 9e5
|
|
65
|
+
priority: 3
|
|
67
66
|
},
|
|
68
67
|
[t.polygon]: {
|
|
69
68
|
name: "Polygon",
|
|
70
69
|
chainId: t.polygon,
|
|
71
70
|
rpcUrl: "https://polygon-rpc.com",
|
|
72
|
-
fetchRpcUrl: `https://polygon-mainnet.g.alchemy.com/v2/${
|
|
73
|
-
wsRpcUrl: `wss://polygon-mainnet.g.alchemy.com/v2/${a}`,
|
|
71
|
+
fetchRpcUrl: `https://polygon-mainnet.g.alchemy.com/v2/${e}`,
|
|
74
72
|
supported: !0,
|
|
75
|
-
contractData:
|
|
73
|
+
contractData: m,
|
|
76
74
|
quoterV2Address: "0x61fFE014bA17989E743c5F6cB21bF9697530B21e",
|
|
77
75
|
uniswapV3FactoryAddress: "0x1F98431c8aD98523631AE4a59f267346ea31F984",
|
|
78
76
|
priority: 4,
|
|
79
|
-
maxPageSize:
|
|
77
|
+
maxPageSize: 1e6
|
|
80
78
|
},
|
|
81
79
|
[t.avalanche]: {
|
|
82
80
|
name: "Avalanche",
|
|
83
81
|
chainId: t.avalanche,
|
|
84
82
|
rpcUrl: "https://api.avax.network/ext/bc/C/rpc",
|
|
85
|
-
fetchRpcUrl: `https://avax-mainnet.g.alchemy.com/v2/${
|
|
86
|
-
wsRpcUrl: `wss://avax-mainnet.g.alchemy.com/v2/${a}`,
|
|
83
|
+
fetchRpcUrl: `https://avax-mainnet.g.alchemy.com/v2/${e}`,
|
|
87
84
|
supported: !0,
|
|
88
85
|
contractData: h,
|
|
89
86
|
quoterV2Address: "0xbe0F5544EC67e9B3b2D979aaA43f18Fd87E6257F",
|
|
@@ -95,8 +92,7 @@ const t = {
|
|
|
95
92
|
chainId: t.bnbMainnet,
|
|
96
93
|
rpcUrl: "https://bsc-dataseed.binance.org",
|
|
97
94
|
// maxPageSize: 1000,
|
|
98
|
-
fetchRpcUrl: `https://bnb-mainnet.g.alchemy.com/v2/${
|
|
99
|
-
wsRpcUrl: `wss://bnb-mainnet.g.alchemy.com/v2/${a}`,
|
|
95
|
+
fetchRpcUrl: `https://bnb-mainnet.g.alchemy.com/v2/${e}`,
|
|
100
96
|
supported: !0,
|
|
101
97
|
contractData: s,
|
|
102
98
|
quoterV2Address: "0x78D78E420Da98ad378D7799bE8f4AF69033EB077",
|
|
@@ -108,21 +104,18 @@ const t = {
|
|
|
108
104
|
chainId: t.base,
|
|
109
105
|
rpcUrl: "https://mainnet.base.org/",
|
|
110
106
|
// maxPageSize: 1000,
|
|
111
|
-
fetchRpcUrl: `https://base-mainnet.g.alchemy.com/v2/${
|
|
112
|
-
wsRpcUrl: `wss://base-mainnet.g.alchemy.com/v2/${a}`,
|
|
107
|
+
fetchRpcUrl: `https://base-mainnet.g.alchemy.com/v2/${e}`,
|
|
113
108
|
supported: !0,
|
|
114
109
|
contractData: d,
|
|
115
110
|
quoterV2Address: "0x3d4e44Eb1374240CE5F1B871ab261CD16335B76a",
|
|
116
111
|
uniswapV3FactoryAddress: "0x33128a8fC17869897dcE68Ed026d694621f6FDfD",
|
|
117
|
-
priority: 7
|
|
118
|
-
maxPageSize: 5e5
|
|
112
|
+
priority: 7
|
|
119
113
|
},
|
|
120
114
|
[t.arcTestnet]: {
|
|
121
115
|
name: "Arc Testnet",
|
|
122
116
|
chainId: t.arcTestnet,
|
|
123
|
-
rpcUrl: `https://arc-testnet.g.alchemy.com/v2/${
|
|
124
|
-
fetchRpcUrl: `https://arc-testnet.g.alchemy.com/v2/${
|
|
125
|
-
wsRpcUrl: `wss://arc-testnet.g.alchemy.com/v2/${a}`,
|
|
117
|
+
rpcUrl: `https://arc-testnet.g.alchemy.com/v2/${e}`,
|
|
118
|
+
fetchRpcUrl: `https://arc-testnet.g.alchemy.com/v2/${e}`,
|
|
126
119
|
supported: !0,
|
|
127
120
|
contractData: u,
|
|
128
121
|
priority: 8,
|
|
@@ -132,7 +125,7 @@ const t = {
|
|
|
132
125
|
name: "Solana",
|
|
133
126
|
chainId: t.solanaMainnet,
|
|
134
127
|
rpcUrl: "https://api.mainnet-beta.solana.com",
|
|
135
|
-
fetchRpcUrl: "https://
|
|
128
|
+
fetchRpcUrl: "https://wider-side-sunset.solana-mainnet.quiknode.pro/61054262c1a2b13dd570243c5fdd017c05cf7fe1",
|
|
136
129
|
supported: !0,
|
|
137
130
|
contractData: r,
|
|
138
131
|
priority: 8
|
|
@@ -146,21 +139,21 @@ const t = {
|
|
|
146
139
|
contractData: r,
|
|
147
140
|
priority: 9
|
|
148
141
|
},
|
|
149
|
-
...
|
|
150
|
-
},
|
|
142
|
+
...c ? {} : {}
|
|
143
|
+
}, D = {
|
|
151
144
|
name: "Localhost",
|
|
152
145
|
chainId: t.localhost,
|
|
153
146
|
rpcUrl: "http://127.0.0.1:8545",
|
|
154
147
|
fetchRpcUrl: "http://127.0.0.1:8545",
|
|
155
148
|
supported: !0,
|
|
156
149
|
contractData: b,
|
|
157
|
-
quoterV2Address:
|
|
158
|
-
uniswapV3FactoryAddress:
|
|
150
|
+
quoterV2Address: o[n].quoterV2Address,
|
|
151
|
+
uniswapV3FactoryAddress: o[n].uniswapV3FactoryAddress,
|
|
159
152
|
priority: 7
|
|
160
153
|
};
|
|
161
|
-
|
|
162
|
-
var
|
|
163
|
-
const
|
|
154
|
+
c && (o[t.localhost] = D);
|
|
155
|
+
var F = /* @__PURE__ */ ((a) => (a.Mainnet = "Mainnet", a.Testnet = "Testnet", a.Local = "Local", a))(F || {});
|
|
156
|
+
const w = {
|
|
164
157
|
Mainnet: [
|
|
165
158
|
t.polygon,
|
|
166
159
|
t.arbMainnet,
|
|
@@ -170,17 +163,17 @@ const $ = {
|
|
|
170
163
|
t.avalanche,
|
|
171
164
|
t.base
|
|
172
165
|
],
|
|
173
|
-
Testnet: [t.arcTestnet],
|
|
166
|
+
Testnet: [t.bnbTestnet, t.polygonMumbai, t.arcTestnet],
|
|
174
167
|
Local: [t.localhost]
|
|
175
|
-
},
|
|
168
|
+
}, q = (a) => [t.optimism, t.base].includes(a), _ = (a) => [t.solanaMainnet, t.solanaLocalnet].includes(a), k = t.ethMainnet, P = [
|
|
176
169
|
t.ethMainnet,
|
|
177
170
|
t.optimism,
|
|
178
171
|
t.base,
|
|
179
172
|
t.polygon,
|
|
180
173
|
t.arbMainnet,
|
|
181
|
-
t.arcTestnet
|
|
182
|
-
|
|
183
|
-
],
|
|
174
|
+
t.arcTestnet
|
|
175
|
+
// chainIds.solanaMainnet,
|
|
176
|
+
], N = [
|
|
184
177
|
t.ethMainnet,
|
|
185
178
|
t.optimism,
|
|
186
179
|
t.base,
|
|
@@ -188,19 +181,20 @@ const $ = {
|
|
|
188
181
|
t.arbMainnet
|
|
189
182
|
];
|
|
190
183
|
export {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
184
|
+
e as ALCHEMY_API_KEY,
|
|
185
|
+
A as ALCHEMY_TEST_KEY,
|
|
186
|
+
N as BRIDGE_SUPPORTED_CHAINS,
|
|
187
|
+
F as EthereumNetworkType,
|
|
188
|
+
S as HELIUS_RPC_URL,
|
|
189
|
+
k as WALLET_INITIAL_CHAIN_ID,
|
|
190
|
+
P as WALLET_SUPPORTED_CHAINS,
|
|
197
191
|
t as chainIds,
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
192
|
+
w as chainIdsByType,
|
|
193
|
+
V as getNonLocalhostChainId,
|
|
194
|
+
y as isLocalNetwork,
|
|
195
|
+
q as isOptimismLike,
|
|
196
|
+
_ as isSolanaLike,
|
|
203
197
|
n as localhostNetwork,
|
|
204
|
-
|
|
205
|
-
|
|
198
|
+
o as networkRegistry,
|
|
199
|
+
R as solanaChainIdStr
|
|
206
200
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./chains.constants.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./chains.constants.cjs"),i="https://api.coingecko.com/api/v3",c="https://pro-api.coingecko.com/api/v3",s=typeof window<"u"?"":process.env.COINGECKO_API_KEY,t="x-cg-pro-api-key",o=s?c:i,r=e=>`${o}/simple/price?ids=${e}&vs_currencies=USD,ETH`,h=(e,a)=>`${o}/simple/token_price/${a}?contract_addresses=${e}&vs_currencies=USD`,l=e=>`${o}/coins/${e}`,d=e=>`${o}/search?query=${encodeURIComponent(e)}`,I=(e,a)=>`${i}/coins/${e}/contract/${a}`,m=`${c}/coins/list`,p={[n.chainIds.arbMainnet]:"ethereum",[n.chainIds.localhost]:"ethereum",[n.chainIds.ethMainnet]:"ethereum",[n.chainIds.optimism]:"ethereum",[n.chainIds.avalanche]:"avalanche-2",[n.chainIds.polygon]:"matic-network",[n.chainIds.bnbMainnet]:"binancecoin",[n.chainIds.base]:"ethereum",[n.chainIds.solanaMainnet]:"solana",[n.chainIds.solanaLocalnet]:"solana"},g=e=>{switch(n.getNonLocalhostChainId(e)){case n.chainIds.ethMainnet:return"ethereum";case n.chainIds.polygon:return"polygon-pos";case n.chainIds.bnbMainnet:return"binance-smart-chain";case n.chainIds.optimism:return"optimistic-ethereum";case n.chainIds.arbMainnet:return"arbitrum-one";case n.chainIds.avalanche:return"avalanche";case n.chainIds.base:return"base";case n.chainIds.solanaMainnet:case n.chainIds.solanaLocalnet:return"solana";default:return"ethereum"}},u={[n.chainIds.polygon]:"polygon-pos",[n.chainIds.arbMainnet]:"arbitrum-one",[n.chainIds.ethMainnet]:"ethereum",[n.chainIds.avalanche]:"avalanche",[n.chainIds.bnbMainnet]:"binance-smart-chain",[n.chainIds.optimism]:"optimistic-ethereum",[n.chainIds.base]:"base",[n.chainIds.solanaMainnet]:"solana",[n.chainIds.solanaLocalnet]:"solana"};exports.COINGECKO_API_KEY=s;exports.CoinGeckoChainLabels=u;exports.coingeckoPriceUrl=r;exports.coingeckoPriceUrl2=h;exports.coingeckoTokenListUrl=m;exports.getCoinByAddress=I;exports.getCoinById=l;exports.getCoingeckoIdForNativeTokens=p;exports.getCoingeckoPlatform=g;exports.proCoingeckoUrl=c;exports.proHeader=t;exports.searchBySymbol=d;
|
|
@@ -6,7 +6,6 @@ export declare const coingeckoPriceUrl2: (tokenAddress: string, platform: string
|
|
|
6
6
|
export declare const getCoinById: (tokenId: string) => string;
|
|
7
7
|
export declare const searchBySymbol: (tokenSymbol: string) => string;
|
|
8
8
|
export declare const getCoinByAddress: (currentNetwork: string, tokenAddress: string) => string;
|
|
9
|
-
export declare const getCoinMarketChartByTokenId: (tokenId: string, days: string) => string;
|
|
10
9
|
export declare const coingeckoTokenListUrl = "https://pro-api.coingecko.com/api/v3/coins/list";
|
|
11
10
|
export declare const getCoingeckoIdForNativeTokens: {
|
|
12
11
|
[x: number]: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { chainIds as e, getNonLocalhostChainId as
|
|
2
|
-
const
|
|
1
|
+
import { chainIds as e, getNonLocalhostChainId as s } from "./chains.constants.mjs";
|
|
2
|
+
const t = "https://api.coingecko.com/api/v3", c = "https://pro-api.coingecko.com/api/v3", i = typeof window < "u" ? "" : process.env.COINGECKO_API_KEY, l = "x-cg-pro-api-key", a = i ? c : t, h = (n) => `${a}/simple/price?ids=${n}&vs_currencies=USD,ETH`, m = (n, o) => `${a}/simple/token_price/${o}?contract_addresses=${n}&vs_currencies=USD`, p = (n) => `${a}/coins/${n}`, u = (n) => `${a}/search?query=${encodeURIComponent(n)}`, b = (n, o) => `${t}/coins/${n}/contract/${o}`, g = `${c}/coins/list`, d = {
|
|
3
3
|
[e.arbMainnet]: "ethereum",
|
|
4
4
|
[e.localhost]: "ethereum",
|
|
5
5
|
[e.ethMainnet]: "ethereum",
|
|
@@ -10,8 +10,8 @@ const s = "https://api.coingecko.com/api/v3", o = "https://pro-api.coingecko.com
|
|
|
10
10
|
[e.base]: "ethereum",
|
|
11
11
|
[e.solanaMainnet]: "solana",
|
|
12
12
|
[e.solanaLocalnet]: "solana"
|
|
13
|
-
},
|
|
14
|
-
switch (
|
|
13
|
+
}, k = (n) => {
|
|
14
|
+
switch (s(n)) {
|
|
15
15
|
case e.ethMainnet:
|
|
16
16
|
return "ethereum";
|
|
17
17
|
case e.polygon:
|
|
@@ -32,7 +32,7 @@ const s = "https://api.coingecko.com/api/v3", o = "https://pro-api.coingecko.com
|
|
|
32
32
|
default:
|
|
33
33
|
return "ethereum";
|
|
34
34
|
}
|
|
35
|
-
},
|
|
35
|
+
}, C = {
|
|
36
36
|
[e.polygon]: "polygon-pos",
|
|
37
37
|
[e.arbMainnet]: "arbitrum-one",
|
|
38
38
|
[e.ethMainnet]: "ethereum",
|
|
@@ -44,17 +44,16 @@ const s = "https://api.coingecko.com/api/v3", o = "https://pro-api.coingecko.com
|
|
|
44
44
|
[e.solanaLocalnet]: "solana"
|
|
45
45
|
};
|
|
46
46
|
export {
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
i as COINGECKO_API_KEY,
|
|
48
|
+
C as CoinGeckoChainLabels,
|
|
49
49
|
h as coingeckoPriceUrl,
|
|
50
50
|
m as coingeckoPriceUrl2,
|
|
51
51
|
g as coingeckoTokenListUrl,
|
|
52
52
|
b as getCoinByAddress,
|
|
53
53
|
p as getCoinById,
|
|
54
|
-
d as
|
|
55
|
-
k as
|
|
56
|
-
|
|
57
|
-
o as proCoingeckoUrl,
|
|
54
|
+
d as getCoingeckoIdForNativeTokens,
|
|
55
|
+
k as getCoingeckoPlatform,
|
|
56
|
+
c as proCoingeckoUrl,
|
|
58
57
|
l as proHeader,
|
|
59
58
|
u as searchBySymbol
|
|
60
59
|
};
|