@hinkal/common 0.2.27 → 0.2.28
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 +35 -17
- package/API/API.mjs +100 -80
- package/API/admin-calls.cjs +1 -1
- package/API/admin-calls.d.ts +8 -1
- package/API/admin-calls.mjs +6 -5
- 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 +10 -11
- package/API/callRelayer.cjs +1 -1
- package/API/callRelayer.d.ts +14 -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 -1
- package/API/deposit-and-withdraw-status-calls.d.ts +3 -2
- package/API/deposit-and-withdraw-status-calls.mjs +8 -8
- package/API/enclaveSignatureCalls.cjs +1 -0
- package/API/enclaveSignatureCalls.d.ts +10 -0
- package/API/enclaveSignatureCalls.mjs +16 -0
- package/API/enclaveUtxoCalls.cjs +1 -0
- package/API/enclaveUtxoCalls.d.ts +40 -0
- package/API/enclaveUtxoCalls.mjs +24 -0
- package/API/fetchCommitmentsCache.cjs +1 -1
- package/API/fetchCommitmentsCache.d.ts +2 -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/get-token-price-chart-data.cjs +1 -0
- package/API/get-token-price-chart-data.d.ts +16 -0
- package/API/get-token-price-chart-data.mjs +13 -0
- package/API/getCoingeckoPrice.cjs +1 -1
- package/API/getCoingeckoPrice.d.ts +0 -1
- package/API/getCoingeckoPrice.mjs +15 -16
- package/API/getGasEstimates.cjs +1 -1
- package/API/getGasEstimates.mjs +9 -9
- package/API/getServerURL.cjs +1 -1
- package/API/getServerURL.d.ts +3 -3
- package/API/getServerURL.mjs +51 -67
- package/API/getTokenPrice.cjs +1 -1
- package/API/getTokenPrice.d.ts +5 -0
- package/API/getTokenPrice.mjs +14 -7
- package/API/getWebsiteURL.cjs +1 -1
- package/API/getWebsiteURL.d.ts +1 -0
- package/API/getWebsiteURL.mjs +25 -10
- package/API/index.d.ts +3 -3
- package/API/kycCalls.cjs +1 -1
- package/API/kycCalls.d.ts +4 -8
- package/API/kycCalls.mjs +23 -26
- package/API/onrampCalls.cjs +1 -0
- package/API/onrampCalls.d.ts +20 -0
- package/API/onrampCalls.mjs +15 -0
- package/API/privacy-score-calls.cjs +1 -0
- package/API/privacy-score-calls.d.ts +17 -0
- package/API/privacy-score-calls.mjs +29 -0
- package/API/privateSendEmailNotificationsCalls.cjs +1 -0
- package/API/privateSendEmailNotificationsCalls.d.ts +8 -0
- package/API/privateSendEmailNotificationsCalls.mjs +11 -0
- package/API/privateSendNonceCalls.cjs +1 -0
- package/API/privateSendNonceCalls.d.ts +13 -0
- package/API/privateSendNonceCalls.mjs +15 -0
- package/API/privateSendRecipientInfoCalls.cjs +1 -0
- package/API/privateSendRecipientInfoCalls.d.ts +21 -0
- package/API/privateSendRecipientInfoCalls.mjs +15 -0
- package/API/proxyAccountsCalls.cjs +1 -1
- package/API/proxyAccountsCalls.d.ts +4 -2
- package/API/proxyAccountsCalls.mjs +18 -20
- package/API/relayCalls.cjs +1 -1
- package/API/relayCalls.mjs +4 -4
- package/API/rewardsUserCalls.cjs +1 -1
- package/API/rewardsUserCalls.d.ts +9 -0
- package/API/rewardsUserCalls.mjs +28 -22
- package/API/scheduled-transactions-calls.cjs +1 -1
- package/API/scheduled-transactions-calls.d.ts +2 -2
- package/API/scheduled-transactions-calls.mjs +9 -8
- package/API/simulate-batch-tx.cjs +1 -1
- package/API/simulate-batch-tx.d.ts +2 -2
- package/API/simulate-batch-tx.mjs +7 -6
- package/API/simulate-transaction.cjs +1 -0
- package/API/{is-tx-stateless.d.ts → simulate-transaction.d.ts} +1 -1
- package/API/simulate-transaction.mjs +18 -0
- package/API/snapshot-event-calls.cjs +1 -0
- package/API/snapshot-event-calls.d.ts +7 -0
- package/API/snapshot-event-calls.mjs +13 -0
- package/API/solana-calls.cjs +1 -1
- package/API/solana-calls.d.ts +8 -4
- package/API/solana-calls.mjs +15 -15
- package/API/temporaryWalletCalls.cjs +1 -1
- package/API/temporaryWalletCalls.mjs +13 -19
- package/API/token-calls.cjs +1 -1
- package/API/token-calls.mjs +6 -5
- package/API/tronSubsidyCalls.cjs +1 -0
- package/API/tronSubsidyCalls.d.ts +13 -0
- package/API/tronSubsidyCalls.mjs +11 -0
- package/README.md +27 -25
- package/constants/activity.constants.cjs +1 -1
- package/constants/activity.constants.mjs +4 -2
- package/constants/addresses.constants.cjs +1 -1
- package/constants/addresses.constants.mjs +1 -1
- package/constants/bridging.constants.cjs +1 -1
- package/constants/bridging.constants.d.ts +4 -0
- package/constants/bridging.constants.mjs +6 -2
- package/constants/chains.constants.cjs +1 -1
- package/constants/chains.constants.d.ts +6 -6
- package/constants/chains.constants.mjs +112 -69
- package/constants/coingecko.constants.cjs +1 -1
- package/constants/coingecko.constants.d.ts +2 -1
- package/constants/coingecko.constants.mjs +49 -38
- package/constants/deploy-data/deploy-data-solana.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-solana.json.mjs +390 -9
- package/constants/deploy-data/deploy-data-tronMainnet.json.cjs +1 -0
- package/constants/deploy-data/deploy-data-tronMainnet.json.mjs +4638 -0
- package/constants/deploy-data/deploy-data-tronNile.json.cjs +1 -0
- package/constants/deploy-data/deploy-data-tronNile.json.mjs +4638 -0
- package/constants/deploy-data/index.d.ts +3 -1
- package/constants/fees.constants.cjs +1 -1
- package/constants/fees.constants.d.ts +4 -1
- package/constants/fees.constants.mjs +8 -4
- package/constants/function-signatures.constants.cjs +1 -1
- package/constants/function-signatures.constants.d.ts +0 -1
- package/constants/function-signatures.constants.mjs +3 -4
- package/constants/images.constants.cjs +1 -0
- package/constants/images.constants.d.ts +1 -0
- package/constants/images.constants.mjs +4 -0
- package/constants/index.d.ts +6 -0
- package/constants/kyc.constants.cjs +1 -1
- package/constants/kyc.constants.mjs +39 -40
- package/constants/mediaUrls.constants.cjs +1 -1
- package/constants/mediaUrls.constants.d.ts +5 -1
- package/constants/mediaUrls.constants.mjs +6 -2
- package/constants/non-circular-tokens.constants.cjs +1 -0
- package/constants/non-circular-tokens.constants.d.ts +1 -0
- package/constants/non-circular-tokens.constants.mjs +4 -0
- package/constants/pay.constants.cjs +1 -0
- package/constants/pay.constants.d.ts +1 -0
- package/constants/pay.constants.mjs +4 -0
- package/constants/permit2.constants.cjs +1 -1
- package/constants/permit2.constants.d.ts +0 -1
- package/constants/permit2.constants.mjs +10 -11
- package/constants/protocol.constants.cjs +1 -1
- package/constants/protocol.constants.d.ts +6 -1
- package/constants/protocol.constants.mjs +38 -33
- package/constants/reorg-depths.constants.cjs +1 -1
- package/constants/reorg-depths.constants.mjs +3 -0
- package/constants/save-depths.cjs +1 -1
- package/constants/save-depths.mjs +6 -3
- package/constants/schedule.constants.cjs +1 -0
- package/constants/schedule.constants.d.ts +2 -0
- package/constants/schedule.constants.mjs +14 -0
- package/constants/server.constants.cjs +1 -1
- package/constants/server.constants.d.ts +31 -123
- package/constants/server.constants.mjs +65 -156
- package/constants/tasks.constants.cjs +1 -1
- package/constants/tasks.constants.mjs +5 -4
- package/constants/token-data/ERC20Registry.cjs +1 -1
- package/constants/token-data/ERC20Registry.mjs +48 -34
- package/constants/token-data/arbMainnetRegistry.json.cjs +1 -1
- package/constants/token-data/arbMainnetRegistry.json.mjs +1 -1
- package/constants/token-data/arbMainnetRegistryFixed.json.cjs +1 -1
- package/constants/token-data/arbMainnetRegistryFixed.json.mjs +1 -1
- package/constants/token-data/arcTestnetRegistry.json.cjs +1 -1
- package/constants/token-data/arcTestnetRegistry.json.mjs +2 -2
- package/constants/token-data/avalancheRegistry.json.cjs +1 -1
- package/constants/token-data/avalancheRegistry.json.mjs +1 -1
- package/constants/token-data/avalancheRegistryFixed.json.cjs +1 -1
- package/constants/token-data/avalancheRegistryFixed.json.mjs +1 -1
- package/constants/token-data/baseRegistry.json.cjs +1 -1
- package/constants/token-data/baseRegistry.json.mjs +3 -3
- package/constants/token-data/baseRegistryFixed.json.cjs +1 -1
- package/constants/token-data/baseRegistryFixed.json.mjs +1 -1
- package/constants/token-data/bnbMainnetRegistry.json.cjs +1 -1
- package/constants/token-data/bnbMainnetRegistry.json.mjs +2 -2
- package/constants/token-data/bnbMainnetRegistryFixed.json.cjs +1 -1
- package/constants/token-data/bnbMainnetRegistryFixed.json.mjs +2 -2
- package/constants/token-data/ethMainnetRegistry.json.cjs +1 -1
- package/constants/token-data/ethMainnetRegistry.json.mjs +1 -1
- package/constants/token-data/ethMainnetRegistryFixed.json.cjs +1 -1
- package/constants/token-data/ethMainnetRegistryFixed.json.mjs +1 -1
- package/constants/token-data/index.d.ts +2 -2
- package/constants/token-data/solanaMainnetRegistry.json.cjs +1 -1
- package/constants/token-data/solanaMainnetRegistry.json.mjs +143 -74
- package/constants/token-data/tronMainnetRegistry.json.cjs +1 -0
- package/constants/token-data/tronMainnetRegistry.json.mjs +24 -0
- package/constants/token-data/tronNileRegistry.json.cjs +1 -0
- package/constants/token-data/tronNileRegistry.json.mjs +24 -0
- package/constants/tokens.constants.cjs +1 -0
- package/constants/tokens.constants.d.ts +3 -0
- package/constants/tokens.constants.mjs +15 -0
- package/constants/tx-confirmation.constants.cjs +1 -0
- package/constants/tx-confirmation.constants.d.ts +4 -0
- package/constants/tx-confirmation.constants.mjs +7 -0
- package/constants/wallet.constants.cjs +1 -1
- package/constants/wallet.constants.d.ts +1 -7
- package/constants/wallet.constants.mjs +18 -8
- package/crypto/poseidon.cjs +1 -1
- package/crypto/poseidon.mjs +5 -5
- package/data-structures/AccountActions/AccountActions.cjs +1 -0
- package/data-structures/AccountActions/AccountActions.d.ts +17 -0
- package/data-structures/AccountActions/AccountActions.mjs +67 -0
- package/data-structures/AccountActions/index.d.ts +1 -0
- package/data-structures/ApprovalDBs/EventsPublicApprovalsDB.cjs +1 -1
- package/data-structures/ApprovalDBs/EventsPublicApprovalsDB.mjs +106 -109
- package/data-structures/BlockchainEvent/BlockchainEvent.cjs +1 -0
- package/data-structures/BlockchainEvent/BlockchainEvent.d.ts +14 -0
- package/data-structures/BlockchainEvent/BlockchainEvent.mjs +45 -0
- package/data-structures/Hinkal/Hinkal.cjs +1 -1
- package/data-structures/Hinkal/Hinkal.d.ts +66 -74
- package/data-structures/Hinkal/Hinkal.mjs +366 -392
- package/data-structures/Hinkal/IHinkal.d.ts +61 -71
- package/data-structures/Hinkal/handleAutoDepositBack.cjs +1 -1
- package/data-structures/Hinkal/handleAutoDepositBack.d.ts +2 -4
- package/data-structures/Hinkal/handleAutoDepositBack.mjs +146 -79
- package/data-structures/Hinkal/hinkalActionReceive.cjs +1 -1
- package/data-structures/Hinkal/hinkalActionReceive.d.ts +1 -2
- package/data-structures/Hinkal/hinkalActionReceive.mjs +26 -22
- package/data-structures/Hinkal/hinkalCheckTokenRegistry.cjs +1 -1
- package/data-structures/Hinkal/hinkalCheckTokenRegistry.d.ts +1 -0
- package/data-structures/Hinkal/hinkalCheckTokenRegistry.mjs +34 -22
- package/data-structures/Hinkal/hinkalClaimUtxo.cjs +1 -0
- package/data-structures/Hinkal/hinkalClaimUtxo.d.ts +6 -0
- package/data-structures/Hinkal/hinkalClaimUtxo.mjs +119 -0
- package/data-structures/Hinkal/hinkalDeposit.cjs +1 -1
- package/data-structures/Hinkal/hinkalDeposit.d.ts +2 -2
- package/data-structures/Hinkal/hinkalDeposit.mjs +101 -94
- package/data-structures/Hinkal/hinkalDepositAndBridge.cjs +1 -0
- package/data-structures/Hinkal/{hinkalDepostAndBridge.d.ts → hinkalDepositAndBridge.d.ts} +2 -2
- package/data-structures/Hinkal/hinkalDepositAndBridge.mjs +259 -0
- package/data-structures/Hinkal/hinkalDepositAndWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalDepositAndWithdraw.d.ts +2 -2
- package/data-structures/Hinkal/hinkalDepositAndWithdraw.mjs +159 -102
- package/data-structures/Hinkal/hinkalDepositOnChainUtxos.cjs +1 -1
- package/data-structures/Hinkal/hinkalDepositOnChainUtxos.d.ts +1 -1
- package/data-structures/Hinkal/hinkalDepositOnChainUtxos.mjs +131 -92
- package/data-structures/Hinkal/hinkalGetZkMeProvider.cjs +1 -1
- package/data-structures/Hinkal/hinkalGetZkMeProvider.mjs +4 -5
- package/data-structures/Hinkal/hinkalMultiSend.cjs +1 -1
- package/data-structures/Hinkal/hinkalMultiSend.d.ts +1 -1
- package/data-structures/Hinkal/hinkalMultiSend.mjs +4 -4
- package/data-structures/Hinkal/hinkalPrivateWallet.cjs +1 -1
- package/data-structures/Hinkal/hinkalPrivateWallet.d.ts +2 -2
- package/data-structures/Hinkal/hinkalPrivateWallet.mjs +121 -125
- package/data-structures/Hinkal/hinkalProoflessDeposit.cjs +1 -1
- package/data-structures/Hinkal/hinkalProoflessDeposit.d.ts +2 -1
- package/data-structures/Hinkal/hinkalProoflessDeposit.mjs +188 -38
- package/data-structures/Hinkal/hinkalProxySwap.cjs +1 -1
- package/data-structures/Hinkal/hinkalProxySwap.d.ts +1 -2
- package/data-structures/Hinkal/hinkalProxySwap.mjs +34 -31
- package/data-structures/Hinkal/hinkalProxyToPrivate.cjs +1 -1
- package/data-structures/Hinkal/hinkalProxyToPrivate.d.ts +1 -1
- package/data-structures/Hinkal/hinkalProxyToPrivate.mjs +32 -28
- package/data-structures/Hinkal/hinkalSignSubAccount.cjs +1 -1
- package/data-structures/Hinkal/hinkalSignSubAccount.d.ts +1 -2
- package/data-structures/Hinkal/hinkalSignSubAccount.mjs +17 -15
- package/data-structures/Hinkal/hinkalSolanaClaimUtxo.cjs +1 -0
- package/data-structures/Hinkal/hinkalSolanaClaimUtxo.d.ts +5 -0
- package/data-structures/Hinkal/hinkalSolanaClaimUtxo.mjs +130 -0
- package/data-structures/Hinkal/hinkalSolanaDeposit.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaDeposit.d.ts +6 -3
- package/data-structures/Hinkal/hinkalSolanaDeposit.mjs +98 -110
- package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.d.ts +3 -1
- package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.mjs +228 -197
- package/data-structures/Hinkal/hinkalSolanaProoflessDeposit.cjs +1 -0
- package/data-structures/Hinkal/hinkalSolanaProoflessDeposit.d.ts +5 -0
- package/data-structures/Hinkal/hinkalSolanaProoflessDeposit.mjs +28 -0
- package/data-structures/Hinkal/hinkalSolanaProxySend.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaProxySend.d.ts +4 -4
- package/data-structures/Hinkal/hinkalSolanaProxySend.mjs +44 -43
- package/data-structures/Hinkal/hinkalSolanaProxyShield.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaProxyShield.d.ts +2 -2
- package/data-structures/Hinkal/hinkalSolanaProxyShield.mjs +73 -71
- package/data-structures/Hinkal/hinkalSolanaProxySwap.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaProxySwap.d.ts +3 -3
- package/data-structures/Hinkal/hinkalSolanaProxySwap.mjs +79 -64
- package/data-structures/Hinkal/hinkalSolanaSwap.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaSwap.d.ts +1 -1
- package/data-structures/Hinkal/hinkalSolanaSwap.mjs +122 -100
- package/data-structures/Hinkal/hinkalSolanaTransfer.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaTransfer.d.ts +29 -2
- package/data-structures/Hinkal/hinkalSolanaTransfer.mjs +132 -70
- package/data-structures/Hinkal/hinkalSolanaWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaWithdraw.d.ts +3 -2
- package/data-structures/Hinkal/hinkalSolanaWithdraw.mjs +113 -75
- package/data-structures/Hinkal/hinkalSwap.cjs +1 -1
- package/data-structures/Hinkal/hinkalSwap.d.ts +1 -1
- package/data-structures/Hinkal/hinkalSwap.mjs +71 -103
- package/data-structures/Hinkal/hinkalTransfer.cjs +1 -1
- package/data-structures/Hinkal/hinkalTransfer.d.ts +1 -1
- package/data-structures/Hinkal/hinkalTransfer.mjs +96 -96
- package/data-structures/Hinkal/hinkalWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalWithdraw.d.ts +2 -1
- package/data-structures/Hinkal/hinkalWithdraw.mjs +97 -99
- package/data-structures/Hinkal/hinkalWithdrawStuckUtxos.cjs +1 -1
- package/data-structures/Hinkal/hinkalWithdrawStuckUtxos.d.ts +1 -2
- package/data-structures/Hinkal/hinkalWithdrawStuckUtxos.mjs +204 -113
- package/data-structures/Hinkal/index.d.ts +4 -0
- package/data-structures/Hinkal/resetMerkleTrees.cjs +1 -1
- package/data-structures/Hinkal/resetMerkleTrees.d.ts +1 -1
- package/data-structures/Hinkal/resetMerkleTrees.mjs +109 -54
- package/data-structures/IndexedDB/activity-db.cjs +1 -1
- package/data-structures/IndexedDB/activity-db.d.ts +4 -5
- package/data-structures/IndexedDB/activity-db.mjs +124 -131
- package/data-structures/IndexedDB/balances-db.cjs +1 -1
- package/data-structures/IndexedDB/balances-db.mjs +45 -38
- package/data-structures/IndexedDB/contact-db.cjs +1 -1
- package/data-structures/IndexedDB/contact-db.mjs +43 -36
- package/data-structures/IndexedDB/index.d.ts +1 -0
- package/data-structures/IndexedDB/pay-activity-db.cjs +1 -0
- package/data-structures/IndexedDB/pay-activity-db.d.ts +9 -0
- package/data-structures/IndexedDB/pay-activity-db.mjs +26 -0
- package/data-structures/IndexedDB/prices-db.cjs +1 -1
- package/data-structures/IndexedDB/prices-db.mjs +1 -1
- package/data-structures/IndexedDB/signatures-db.cjs +1 -1
- package/data-structures/IndexedDB/signatures-db.mjs +26 -40
- package/data-structures/TokenDBs/EventsPublicTokensDB.cjs +1 -1
- package/data-structures/TokenDBs/EventsPublicTokensDB.mjs +82 -79
- package/data-structures/TokenDBs/token-visibility-db.cjs +1 -1
- package/data-structures/TokenDBs/token-visibility-db.mjs +22 -36
- package/data-structures/crypto-keys/decodeUTXO.cjs +1 -1
- package/data-structures/crypto-keys/decodeUTXO.mjs +1 -1
- package/data-structures/crypto-keys/encryptDecryptUtxo.cjs +1 -1
- package/data-structures/crypto-keys/encryptDecryptUtxo.mjs +29 -30
- package/data-structures/crypto-keys/keys.cjs +1 -1
- package/data-structures/crypto-keys/keys.d.ts +9 -11
- package/data-structures/crypto-keys/keys.mjs +65 -110
- package/data-structures/event-service/evm/AbstractAccessTokenSnapshotService.cjs +1 -1
- package/data-structures/event-service/evm/AbstractAccessTokenSnapshotService.d.ts +3 -2
- 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 +3 -2
- 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 +9 -4
- package/data-structures/event-service/evm/AbstractCommitmentsSnapshotService.mjs +65 -48
- package/data-structures/event-service/evm/AbstractEventService.cjs +1 -1
- package/data-structures/event-service/evm/AbstractEventService.d.ts +4 -2
- package/data-structures/event-service/evm/AbstractEventService.mjs +13 -13
- package/data-structures/event-service/evm/AbstractNullifierSnapshotService.cjs +1 -1
- package/data-structures/event-service/evm/AbstractNullifierSnapshotService.d.ts +3 -2
- package/data-structures/event-service/evm/AbstractNullifierSnapshotService.mjs +5 -5
- package/data-structures/event-service/evm/AbstractSnapshotService.cjs +1 -1
- package/data-structures/event-service/evm/AbstractSnapshotService.d.ts +2 -2
- package/data-structures/event-service/evm/AbstractSnapshotService.mjs +5 -6
- package/data-structures/event-service/evm/BlockchainEventEmitter.cjs +1 -1
- package/data-structures/event-service/evm/BlockchainEventEmitter.d.ts +18 -7
- package/data-structures/event-service/evm/BlockchainEventEmitter.mjs +75 -49
- package/data-structures/event-service/evm/ClientBlockchainEventEmitter.cjs +1 -0
- package/data-structures/event-service/evm/ClientBlockchainEventEmitter.d.ts +11 -0
- package/data-structures/event-service/evm/ClientBlockchainEventEmitter.mjs +25 -0
- package/data-structures/event-service/evm/PollingBlockchainEventEmitter.cjs +1 -0
- package/data-structures/event-service/evm/PollingBlockchainEventEmitter.d.ts +6 -0
- package/data-structures/event-service/evm/PollingBlockchainEventEmitter.mjs +16 -0
- package/data-structures/event-service/helpers/ClientEventHelper.cjs +1 -0
- package/data-structures/event-service/helpers/ClientEventHelper.d.ts +10 -0
- package/data-structures/event-service/helpers/ClientEventHelper.mjs +38 -0
- package/data-structures/event-service/helpers/PollingEventHelper.cjs +1 -0
- package/data-structures/event-service/helpers/PollingEventHelper.d.ts +5 -0
- package/data-structures/event-service/helpers/PollingEventHelper.mjs +14 -0
- package/data-structures/event-service/index.d.ts +4 -0
- package/data-structures/event-service/solana/AbstractSolanaAccessTokenSnapshotService.cjs +1 -1
- package/data-structures/event-service/solana/AbstractSolanaAccessTokenSnapshotService.d.ts +3 -2
- 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 +9 -4
- package/data-structures/event-service/solana/AbstractSolanaCommitmentsSnapshotService.mjs +65 -48
- package/data-structures/event-service/solana/AbstractSolanaEventService.cjs +1 -1
- package/data-structures/event-service/solana/AbstractSolanaEventService.d.ts +5 -10
- package/data-structures/event-service/solana/AbstractSolanaEventService.mjs +13 -7
- package/data-structures/event-service/solana/AbstractSolanaNullifierSnapshotService.cjs +1 -1
- package/data-structures/event-service/solana/AbstractSolanaNullifierSnapshotService.d.ts +3 -2
- package/data-structures/event-service/solana/AbstractSolanaNullifierSnapshotService.mjs +4 -4
- package/data-structures/event-service/solana/AbstractSolanaSnapshotService.cjs +1 -1
- package/data-structures/event-service/solana/AbstractSolanaSnapshotService.d.ts +1 -2
- package/data-structures/event-service/solana/AbstractSolanaSnapshotService.mjs +1 -2
- package/data-structures/event-service/solana/ClientSolanaBlockchainEventEmitter.cjs +1 -0
- package/data-structures/event-service/solana/ClientSolanaBlockchainEventEmitter.d.ts +11 -0
- package/data-structures/event-service/solana/ClientSolanaBlockchainEventEmitter.mjs +26 -0
- package/data-structures/event-service/solana/PollingSolanaBlockchainEventEmitter.cjs +1 -0
- package/data-structures/event-service/solana/PollingSolanaBlockchainEventEmitter.d.ts +6 -0
- package/data-structures/event-service/solana/PollingSolanaBlockchainEventEmitter.mjs +16 -0
- package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.cjs +1 -1
- package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.d.ts +20 -19
- package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.mjs +126 -76
- package/data-structures/index.d.ts +2 -0
- package/data-structures/merkle-tree/MerkleTree.cjs +1 -1
- package/data-structures/merkle-tree/MerkleTree.d.ts +3 -2
- package/data-structures/merkle-tree/MerkleTree.mjs +27 -17
- package/data-structures/merkle-tree/getPatchedAccessTokenMerkleTree.cjs +1 -1
- package/data-structures/merkle-tree/getPatchedAccessTokenMerkleTree.d.ts +1 -2
- package/data-structures/merkle-tree/getPatchedAccessTokenMerkleTree.mjs +6 -6
- package/data-structures/presale/PresaleContractWrapper.d.ts +1 -1
- package/data-structures/provider-adapter/IProviderAdapter.d.ts +9 -13
- package/data-structures/snapshot/evm-snapshots/ClientAccessTokenSnapshotService.cjs +1 -1
- package/data-structures/snapshot/evm-snapshots/ClientAccessTokenSnapshotService.mjs +23 -18
- package/data-structures/snapshot/evm-snapshots/ClientApprovalsSnapshotService.cjs +1 -1
- package/data-structures/snapshot/evm-snapshots/ClientApprovalsSnapshotService.mjs +12 -7
- package/data-structures/snapshot/evm-snapshots/ClientCommitmentsSnapshotService.cjs +1 -1
- package/data-structures/snapshot/evm-snapshots/ClientCommitmentsSnapshotService.mjs +11 -5
- package/data-structures/snapshot/evm-snapshots/ClientNullifierSnapshotService.cjs +1 -1
- package/data-structures/snapshot/evm-snapshots/ClientNullifierSnapshotService.mjs +9 -4
- package/data-structures/snapshot/solana-snapshots/ClientSolanaAccessTokenSnapshotService.cjs +1 -1
- package/data-structures/snapshot/solana-snapshots/ClientSolanaAccessTokenSnapshotService.mjs +9 -4
- package/data-structures/snapshot/solana-snapshots/ClientSolanaCommitmentsSnapshotService.cjs +1 -1
- package/data-structures/snapshot/solana-snapshots/ClientSolanaCommitmentsSnapshotService.mjs +12 -6
- package/data-structures/snapshot/solana-snapshots/ClientSolanaNullifierSnapshotService.cjs +1 -1
- package/data-structures/snapshot/solana-snapshots/ClientSolanaNullifierSnapshotService.mjs +10 -5
- package/error-handling/customErrors/ErrorWithIndex.cjs +1 -0
- package/error-handling/customErrors/ErrorWithIndex.d.ts +4 -0
- package/error-handling/customErrors/ErrorWithIndex.mjs +9 -0
- package/error-handling/customErrors/ErrorWithTx.cjs +1 -1
- package/error-handling/customErrors/ErrorWithTx.d.ts +2 -3
- package/error-handling/customErrors/ErrorWithTx.mjs +5 -5
- package/error-handling/customErrors/index.d.ts +1 -0
- package/error-handling/error-codes.constants.cjs +2 -2
- package/error-handling/error-codes.constants.d.ts +29 -0
- package/error-handling/error-codes.constants.mjs +51 -22
- package/error-handling/get-error.message.cjs +1 -1
- package/error-handling/get-error.message.mjs +46 -47
- package/error-handling/index.d.ts +0 -1
- package/error-handling/isInsufficientFundsError.cjs +1 -0
- package/error-handling/isInsufficientFundsError.d.ts +1 -0
- package/error-handling/isInsufficientFundsError.mjs +19 -0
- package/functions/auto-deposit-back-helpers/get-gas-token-records.cjs +1 -0
- package/functions/auto-deposit-back-helpers/get-gas-token-records.d.ts +9 -0
- package/functions/auto-deposit-back-helpers/get-gas-token-records.mjs +74 -0
- package/functions/auto-deposit-back-helpers/get-tokens-to-deposit-back.cjs +1 -0
- package/functions/auto-deposit-back-helpers/get-tokens-to-deposit-back.d.ts +3 -0
- package/functions/auto-deposit-back-helpers/get-tokens-to-deposit-back.mjs +61 -0
- package/functions/auto-deposit-back-helpers/index.d.ts +4 -0
- package/functions/auto-deposit-back-helpers/select-gas-token.cjs +1 -0
- package/functions/auto-deposit-back-helpers/select-gas-token.d.ts +13 -0
- package/functions/auto-deposit-back-helpers/select-gas-token.mjs +79 -0
- package/functions/auto-deposit-back-helpers/update-hinkal.cjs +1 -0
- package/functions/auto-deposit-back-helpers/update-hinkal.d.ts +3 -0
- package/functions/auto-deposit-back-helpers/update-hinkal.mjs +18 -0
- package/functions/connectors.types.d.ts +11 -3
- package/functions/index.d.ts +1 -0
- package/functions/kyc/zkMeHelper.cjs +1 -1
- package/functions/kyc/zkMeHelper.mjs +17 -16
- package/functions/pre-transaction/addressTableLookup.cjs +1 -1
- package/functions/pre-transaction/addressTableLookup.mjs +1 -1
- package/functions/pre-transaction/constructAdminData.cjs +1 -1
- package/functions/pre-transaction/constructAdminData.d.ts +2 -2
- package/functions/pre-transaction/constructAdminData.mjs +12 -18
- package/functions/pre-transaction/convert-okx-instructions.cjs +1 -1
- package/functions/pre-transaction/convert-okx-instructions.mjs +20 -16
- package/functions/pre-transaction/ensureAmountChanges.cjs +1 -0
- package/functions/pre-transaction/ensureAmountChanges.d.ts +2 -0
- package/functions/pre-transaction/ensureAmountChanges.mjs +11 -0
- package/functions/pre-transaction/getExternalSwapAddress.cjs +1 -1
- package/functions/pre-transaction/getExternalSwapAddress.d.ts +1 -2
- package/functions/pre-transaction/getExternalSwapAddress.mjs +8 -8
- package/functions/pre-transaction/getFeeStructure.cjs +1 -1
- package/functions/pre-transaction/getFeeStructure.d.ts +2 -1
- package/functions/pre-transaction/getFeeStructure.mjs +13 -12
- package/functions/pre-transaction/getKycAndSignatureData.cjs +1 -0
- package/functions/pre-transaction/getKycAndSignatureData.d.ts +5 -0
- package/functions/pre-transaction/getKycAndSignatureData.mjs +20 -0
- package/functions/pre-transaction/getVolatileTransferAmount.cjs +1 -1
- package/functions/pre-transaction/getVolatileTransferAmount.mjs +22 -36
- package/functions/pre-transaction/index.d.ts +4 -0
- 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 +1 -9
- package/functions/pre-transaction/outputApprovalDataProcessing.mjs +19 -34
- package/functions/pre-transaction/sendV0Transaction.cjs +1 -1
- package/functions/pre-transaction/sendV0Transaction.d.ts +4 -8
- package/functions/pre-transaction/sendV0Transaction.mjs +150 -86
- package/functions/pre-transaction/shouldPatchAccessTokenMerkleTree.cjs +1 -1
- package/functions/pre-transaction/shouldPatchAccessTokenMerkleTree.d.ts +1 -1
- package/functions/pre-transaction/shouldPatchAccessTokenMerkleTree.mjs +7 -4
- package/functions/pre-transaction/store-instructions.cjs +1 -1
- package/functions/pre-transaction/store-instructions.mjs +11 -6
- package/functions/pre-transaction/waitForDepositedUtxosInMerkleTree.cjs +1 -0
- package/functions/pre-transaction/waitForDepositedUtxosInMerkleTree.d.ts +3 -0
- package/functions/pre-transaction/waitForDepositedUtxosInMerkleTree.mjs +33 -0
- package/functions/private-wallet/emporium.helpers.cjs +1 -1
- package/functions/private-wallet/emporium.helpers.d.ts +12 -7
- package/functions/private-wallet/emporium.helpers.mjs +105 -131
- package/functions/private-wallet/emporium.swap.helpers.cjs +1 -1
- package/functions/private-wallet/emporium.swap.helpers.d.ts +1 -4
- package/functions/private-wallet/emporium.swap.helpers.mjs +98 -100
- package/functions/snarkjs/common.snarkjs.cjs +1 -1
- package/functions/snarkjs/common.snarkjs.d.ts +4 -5
- package/functions/snarkjs/common.snarkjs.mjs +113 -111
- package/functions/snarkjs/constant.cjs +1 -1
- package/functions/snarkjs/constant.mjs +7 -1
- package/functions/snarkjs/constructEmporiumProof.cjs +1 -1
- package/functions/snarkjs/constructEmporiumProof.d.ts +4 -4
- package/functions/snarkjs/constructEmporiumProof.mjs +111 -121
- package/functions/snarkjs/constructGeneralZkProof.cjs +1 -1
- package/functions/snarkjs/constructGeneralZkProof.d.ts +2 -2
- package/functions/snarkjs/constructGeneralZkProof.mjs +104 -124
- package/functions/snarkjs/constructSolanaZkProof.cjs +1 -1
- package/functions/snarkjs/constructSolanaZkProof.d.ts +1 -1
- package/functions/snarkjs/constructSolanaZkProof.mjs +58 -64
- package/functions/snarkjs/fetchMerkleTreeSiblings.cjs +1 -1
- package/functions/snarkjs/fetchMerkleTreeSiblings.mjs +11 -10
- package/functions/snarkjs/fetchOnChainRootHashes.cjs +1 -0
- package/functions/snarkjs/fetchOnChainRootHashes.d.ts +4 -0
- package/functions/snarkjs/fetchOnChainRootHashes.mjs +15 -0
- package/functions/snarkjs/generateCircomData.cjs +1 -1
- package/functions/snarkjs/generateCircomData.d.ts +3 -3
- package/functions/snarkjs/generateCircomData.mjs +29 -31
- package/functions/snarkjs/getMerkleTreeSiblingsAndRootHashes.cjs +1 -1
- package/functions/snarkjs/getMerkleTreeSiblingsAndRootHashes.d.ts +12 -1
- package/functions/snarkjs/getMerkleTreeSiblingsAndRootHashes.mjs +161 -65
- package/functions/snarkjs/getZKFiles.cjs +1 -1
- package/functions/snarkjs/getZKFiles.mjs +7 -7
- package/functions/snarkjs/index.d.ts +1 -0
- package/functions/utils/addresses.cjs +1 -1
- package/functions/utils/addresses.d.ts +3 -0
- package/functions/utils/addresses.mjs +32 -17
- package/functions/utils/amounts.utils.cjs +1 -1
- package/functions/utils/amounts.utils.d.ts +1 -1
- package/functions/utils/amounts.utils.mjs +2 -2
- package/functions/utils/buildClaimableDepositPlan.cjs +1 -0
- package/functions/utils/buildClaimableDepositPlan.d.ts +15 -0
- package/functions/utils/buildClaimableDepositPlan.mjs +40 -0
- package/functions/utils/cacheDevice.utils.cjs +1 -1
- package/functions/utils/cacheDevice.utils.mjs +8 -6
- 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 +11 -7
- package/functions/utils/enclave-signature-storage.cjs +1 -0
- package/functions/utils/enclave-signature-storage.d.ts +2 -0
- package/functions/utils/enclave-signature-storage.mjs +13 -0
- package/functions/utils/enclave-utxo-storage.cjs +1 -0
- package/functions/utils/enclave-utxo-storage.d.ts +6 -0
- package/functions/utils/enclave-utxo-storage.mjs +34 -0
- package/functions/utils/encryptInputForEnclave.cjs +1 -1
- package/functions/utils/encryptInputForEnclave.mjs +21 -21
- package/functions/utils/erc20tokenFunctions.cjs +1 -1
- package/functions/utils/erc20tokenFunctions.mjs +35 -35
- package/functions/utils/evmNetworkFunctions.cjs +1 -1
- package/functions/utils/evmNetworkFunctions.mjs +5 -3
- package/functions/utils/fees.utils.cjs +1 -1
- package/functions/utils/fees.utils.mjs +31 -29
- package/functions/utils/getBlockExplorerUrl.cjs +1 -1
- package/functions/utils/getBlockExplorerUrl.mjs +3 -3
- package/functions/utils/getDataFromTransaction.d.ts +1 -1
- package/functions/utils/getRecipientInfoFromUserKeys.cjs +1 -1
- package/functions/utils/getRecipientInfoFromUserKeys.mjs +1 -1
- package/functions/utils/getUtxosFromReceipt.utils.cjs +1 -1
- package/functions/utils/getUtxosFromReceipt.utils.d.ts +2 -1
- package/functions/utils/getUtxosFromReceipt.utils.mjs +44 -15
- package/functions/utils/getUtxosFromReceiptSolana.cjs +1 -1
- package/functions/utils/getUtxosFromReceiptSolana.d.ts +2 -1
- package/functions/utils/getUtxosFromReceiptSolana.mjs +27 -16
- package/functions/utils/index.d.ts +12 -2
- package/functions/utils/involves-permit2-op.cjs +1 -1
- package/functions/utils/involves-permit2-op.d.ts +0 -1
- package/functions/utils/involves-permit2-op.mjs +4 -6
- 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/networks.utils.cjs +1 -1
- package/functions/utils/networks.utils.mjs +4 -2
- package/functions/utils/nftTokenFunctions.cjs +1 -1
- package/functions/utils/nftTokenFunctions.mjs +9 -23
- package/functions/utils/prepareHinkal.cjs +1 -1
- package/functions/utils/prepareHinkal.d.ts +6 -13
- package/functions/utils/prepareHinkal.mjs +44 -71
- package/functions/utils/process.utils.cjs +1 -1
- package/functions/utils/process.utils.d.ts +6 -0
- package/functions/utils/process.utils.mjs +22 -10
- package/functions/utils/proxyAvatar.utils.cjs +1 -0
- package/functions/utils/proxyAvatar.utils.d.ts +2 -0
- package/functions/utils/proxyAvatar.utils.mjs +5 -0
- package/functions/utils/publicBalance.utils.cjs +1 -1
- package/functions/utils/publicBalance.utils.d.ts +1 -1
- package/functions/utils/publicBalance.utils.mjs +55 -53
- package/functions/utils/serialize-utxos.utils.cjs +1 -0
- package/functions/utils/serialize-utxos.utils.d.ts +3 -0
- package/functions/utils/serialize-utxos.utils.mjs +13 -0
- package/functions/utils/string.utils.cjs +1 -1
- package/functions/utils/string.utils.d.ts +2 -0
- package/functions/utils/string.utils.mjs +35 -27
- package/functions/utils/time.utils.cjs +1 -1
- package/functions/utils/time.utils.mjs +1 -1
- package/functions/utils/token-check.utils.cjs +1 -1
- package/functions/utils/token-check.utils.d.ts +3 -0
- package/functions/utils/token-check.utils.mjs +18 -7
- package/functions/utils/tron.utils.cjs +1 -0
- package/functions/utils/tron.utils.d.ts +25 -0
- package/functions/utils/tron.utils.mjs +128 -0
- package/functions/utils/tronSimulation.utils.cjs +1 -0
- package/functions/utils/tronSimulation.utils.d.ts +1 -0
- package/functions/utils/tronSimulation.utils.mjs +30 -0
- package/functions/utils/tx-confirmation.utils.cjs +1 -0
- package/functions/utils/tx-confirmation.utils.d.ts +10 -0
- package/functions/utils/tx-confirmation.utils.mjs +50 -0
- 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/userAgent.cjs +1 -1
- package/functions/utils/userAgent.d.ts +0 -2
- package/functions/utils/userAgent.mjs +4 -23
- package/functions/utils/validateUsername.cjs +1 -0
- package/functions/utils/validateUsername.d.ts +5 -0
- package/functions/utils/validateUsername.mjs +16 -0
- package/functions/utils/walletBalances.utils.cjs +1 -1
- package/functions/utils/walletBalances.utils.d.ts +2 -17
- package/functions/utils/walletBalances.utils.mjs +5 -36
- package/functions/web3/connectors.utils.cjs +1 -1
- package/functions/web3/connectors.utils.d.ts +1 -0
- package/functions/web3/connectors.utils.mjs +14 -12
- package/functions/web3/crypto.cjs +1 -0
- package/functions/web3/crypto.d.ts +1 -0
- package/functions/web3/crypto.mjs +7 -0
- package/functions/web3/etherFunctions.cjs +1 -1
- package/functions/web3/etherFunctions.d.ts +1 -1
- package/functions/web3/etherFunctions.mjs +12 -15
- package/functions/web3/events/getApprovedBalance.cjs +1 -1
- package/functions/web3/events/getApprovedBalance.d.ts +3 -4
- package/functions/web3/events/getApprovedBalance.mjs +39 -44
- package/functions/web3/events/getInputUtxoAndBalance.cjs +1 -1
- package/functions/web3/events/getInputUtxoAndBalance.d.ts +1 -1
- package/functions/web3/events/getInputUtxoAndBalance.mjs +127 -132
- package/functions/web3/events/getShieldedBalance.cjs +1 -2
- package/functions/web3/events/getShieldedBalance.d.ts +1 -1
- package/functions/web3/events/getShieldedBalance.mjs +72 -69
- package/functions/web3/events/getTransactionLogEvents.cjs +1 -1
- package/functions/web3/events/getTransactionLogEvents.mjs +40 -36
- package/functions/web3/fetchSolanaMerkleTreeRootHash.cjs +1 -1
- package/functions/web3/fetchSolanaMerkleTreeRootHash.mjs +17 -10
- package/functions/web3/functionCalls/accessTokenCalls.cjs +1 -1
- package/functions/web3/functionCalls/accessTokenCalls.d.ts +1 -6
- package/functions/web3/functionCalls/accessTokenCalls.mjs +19 -25
- package/functions/web3/functionCalls/approveToken.cjs +1 -1
- package/functions/web3/functionCalls/approveToken.d.ts +1 -1
- package/functions/web3/functionCalls/approveToken.mjs +68 -63
- package/functions/web3/functionCalls/approveTokensToHinkal.cjs +1 -1
- package/functions/web3/functionCalls/approveTokensToHinkal.d.ts +1 -1
- package/functions/web3/functionCalls/approveTokensToHinkal.mjs +6 -6
- package/functions/web3/functionCalls/constructBatchCall.cjs +1 -1
- package/functions/web3/functionCalls/constructBatchCall.d.ts +3 -2
- package/functions/web3/functionCalls/constructBatchCall.mjs +53 -16
- package/functions/web3/functionCalls/estimateGasRelayer.d.ts +2 -3
- package/functions/web3/functionCalls/recoverTransactionFromError.cjs +1 -1
- package/functions/web3/functionCalls/recoverTransactionFromError.mjs +8 -7
- package/functions/web3/functionCalls/transactCallDirect.cjs +1 -1
- package/functions/web3/functionCalls/transactCallDirect.d.ts +2 -2
- package/functions/web3/functionCalls/transactCallDirect.mjs +56 -47
- package/functions/web3/functionCalls/transactCallDirectTron.cjs +1 -0
- package/functions/web3/functionCalls/transactCallDirectTron.d.ts +6 -0
- package/functions/web3/functionCalls/transactCallDirectTron.mjs +63 -0
- package/functions/web3/functionCalls/transactCallRelayer.cjs +1 -1
- package/functions/web3/functionCalls/transactCallRelayer.d.ts +15 -6
- package/functions/web3/functionCalls/transactCallRelayer.mjs +72 -67
- package/functions/web3/functionCalls/waitForErc20Approvals.cjs +1 -0
- package/functions/web3/functionCalls/waitForErc20Approvals.d.ts +9 -0
- package/functions/web3/functionCalls/waitForErc20Approvals.mjs +54 -0
- package/functions/web3/getContractMetadata.cjs +1 -1
- package/functions/web3/getContractMetadata.mjs +14 -18
- package/functions/web3/getPublicAddressBalance.cjs +1 -1
- package/functions/web3/getPublicAddressBalance.d.ts +1 -1
- package/functions/web3/getPublicAddressBalance.mjs +7 -7
- package/functions/web3/getSolanaPriorityFee.cjs +1 -0
- package/functions/web3/getSolanaPriorityFee.d.ts +3 -0
- package/functions/web3/getSolanaPriorityFee.mjs +32 -0
- package/functions/web3/getTokenHolder.cjs +1 -1
- package/functions/web3/getTokenHolder.mjs +35 -31
- package/functions/web3/index.d.ts +3 -0
- 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 +4 -15
- 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 +9 -20
- package/functions/web3/runContractFunction.cjs +1 -1
- package/functions/web3/runContractFunction.mjs +38 -50
- package/functions/web3/tron-wagmi-adapter.cjs +1 -0
- package/functions/web3/tron-wagmi-adapter.d.ts +8 -0
- package/functions/web3/tron-wagmi-adapter.mjs +31 -0
- package/functions/web3/uniswapAPI.cjs +1 -1
- package/functions/web3/uniswapAPI.mjs +24 -34
- package/index.cjs +1 -1
- package/index.mjs +1079 -958
- package/package.json +4 -2
- package/providers/EthersProviderAdapter.cjs +1 -1
- package/providers/EthersProviderAdapter.d.ts +11 -17
- package/providers/EthersProviderAdapter.mjs +53 -82
- package/providers/SolanaProviderAdapter.cjs +1 -1
- package/providers/SolanaProviderAdapter.d.ts +8 -11
- package/providers/SolanaProviderAdapter.mjs +20 -32
- package/providers/TronProviderAdapter.cjs +1 -0
- package/providers/TronProviderAdapter.d.ts +37 -0
- package/providers/TronProviderAdapter.mjs +145 -0
- package/providers/WagmiProviderAdapter.cjs +1 -1
- package/providers/WagmiProviderAdapter.d.ts +14 -19
- package/providers/WagmiProviderAdapter.mjs +104 -130
- package/providers/prepareEthersHinkal.cjs +1 -1
- package/providers/prepareEthersHinkal.d.ts +2 -2
- package/providers/prepareEthersHinkal.mjs +17 -10
- package/providers/prepareWagmiHinkal.cjs +1 -1
- package/providers/prepareWagmiHinkal.mjs +21 -13
- package/types/TransactionSimulator.types.d.ts +2 -9
- package/types/activities.types.cjs +1 -1
- package/types/activities.types.d.ts +13 -7
- package/types/activities.types.mjs +18 -18
- package/types/admin.types.cjs +1 -1
- package/types/admin.types.d.ts +11 -8
- package/types/admin.types.mjs +2 -2
- package/types/balances.types.d.ts +1 -1
- package/types/cache.types.cjs +1 -1
- package/types/cache.types.d.ts +12 -4
- package/types/cache.types.mjs +2 -2
- package/types/circom-data.types.d.ts +6 -14
- package/types/coingecko.types.d.ts +5 -0
- package/types/commitments.types.d.ts +4 -0
- package/types/connector.types.d.ts +1 -0
- package/types/ethereum-network.types.d.ts +1 -1
- package/types/events.types.cjs +1 -0
- package/types/events.types.d.ts +6 -0
- package/types/events.types.mjs +4 -0
- package/types/fee.types.cjs +1 -0
- package/types/fee.types.d.ts +4 -0
- package/types/fee.types.mjs +4 -0
- package/types/hinkal.types.cjs +1 -1
- package/types/hinkal.types.d.ts +5 -1
- package/types/hinkal.types.mjs +14 -13
- package/types/index.d.ts +5 -4
- package/types/onramp.types.cjs +1 -0
- package/types/onramp.types.d.ts +58 -0
- package/types/onramp.types.mjs +4 -0
- package/types/pay-activities.types.cjs +1 -0
- package/types/pay-activities.types.d.ts +29 -0
- package/types/pay-activities.types.mjs +6 -0
- package/types/proxy.types.d.ts +7 -3
- package/types/rewards.types.d.ts +1 -1
- package/types/sandbox.types.cjs +1 -1
- package/types/sandbox.types.d.ts +12 -72
- package/types/sandbox.types.mjs +2 -2
- package/types/schedule.types.cjs +1 -0
- package/types/schedule.types.d.ts +7 -0
- package/types/schedule.types.mjs +4 -0
- package/types/scheduled-transactions.types.d.ts +14 -0
- package/types/session.types.d.ts +2 -0
- package/types/solana.types.d.ts +10 -0
- package/types/token-prices.types.cjs +1 -1
- package/types/token-prices.types.d.ts +7 -0
- package/types/token-prices.types.mjs +4 -2
- package/types/transactions.types.d.ts +2 -2
- package/types/tron.types.d.ts +10 -0
- package/webworker/snarkjsWorker/snarkjsWorkerLauncher.cjs +1 -1
- package/webworker/snarkjsWorker/snarkjsWorkerLauncher.mjs +1 -1
- package/webworker/snarkjsWorker/snarkjsWorkerLogic.cjs +1 -1
- package/webworker/snarkjsWorker/snarkjsWorkerLogic.mjs +31 -27
- package/webworker/utxoWorker/utxoWorkerLauncher.cjs +1 -1
- package/webworker/utxoWorker/utxoWorkerLauncher.mjs +1 -1
- package/webworker/utxoWorker/utxoWorkerLogic.cjs +1 -1
- package/webworker/utxoWorker/utxoWorkerLogic.mjs +1 -1
- package/webworker/viteWorkerURL.constant.cjs +3 -3
- package/webworker/viteWorkerURL.constant.mjs +3 -3
- package/webworker/zkProofWorker/zkProofWorker.types.d.ts +1 -2
- package/webworker/zkProofWorker/zkProofWorkerLauncher.cjs +1 -1
- package/webworker/zkProofWorker/zkProofWorkerLauncher.mjs +1 -1
- package/webworker/zkProofWorker/zkProofWorkerLogic.cjs +1 -1
- package/webworker/zkProofWorker/zkProofWorkerLogic.mjs +27 -28
- package/API/ai-calls.cjs +0 -1
- package/API/ai-calls.d.ts +0 -17
- package/API/ai-calls.mjs +0 -21
- package/API/duneAPI.cjs +0 -1
- package/API/duneAPI.d.ts +0 -11
- package/API/duneAPI.mjs +0 -25
- package/API/enclaveCalls.cjs +0 -1
- package/API/enclaveCalls.d.ts +0 -9
- package/API/enclaveCalls.mjs +0 -11
- package/API/getBridgeProtocols.cjs +0 -1
- package/API/getBridgeProtocols.d.ts +0 -7
- package/API/getBridgeProtocols.mjs +0 -8
- package/API/getLifiStatus.cjs +0 -1
- package/API/getLifiStatus.d.ts +0 -24
- package/API/getLifiStatus.mjs +0 -15
- package/API/getRelayerURL.cjs +0 -1
- package/API/getRelayerURL.d.ts +0 -1
- package/API/getRelayerURL.mjs +0 -10
- package/API/is-tx-stateless.cjs +0 -1
- package/API/is-tx-stateless.mjs +0 -20
- package/API/passwordCalls.cjs +0 -1
- package/API/passwordCalls.d.ts +0 -9
- package/API/passwordCalls.mjs +0 -13
- package/API/restoreSnapshots.cjs +0 -1
- package/API/restoreSnapshots.d.ts +0 -1
- package/API/restoreSnapshots.mjs +0 -10
- package/constants/token-data/popularTokens.constants.cjs +0 -1
- package/constants/token-data/popularTokens.constants.d.ts +0 -3
- package/constants/token-data/popularTokens.constants.mjs +0 -13
- package/constants/token-data/tokenPricing.consts.d.ts +0 -2
- package/data-structures/Hinkal/hinkalActionFundApproveAndTransact.cjs +0 -1
- package/data-structures/Hinkal/hinkalActionFundApproveAndTransact.d.ts +0 -7
- package/data-structures/Hinkal/hinkalActionFundApproveAndTransact.mjs +0 -42
- package/data-structures/Hinkal/hinkalApprove.cjs +0 -1
- package/data-structures/Hinkal/hinkalApprove.d.ts +0 -3
- package/data-structures/Hinkal/hinkalApprove.mjs +0 -114
- package/data-structures/Hinkal/hinkalDepostAndBridge.cjs +0 -1
- package/data-structures/Hinkal/hinkalDepostAndBridge.mjs +0 -230
- package/data-structures/Hinkal/hinkalInsideTransact.cjs +0 -1
- package/data-structures/Hinkal/hinkalInsideTransact.d.ts +0 -4
- package/data-structures/Hinkal/hinkalInsideTransact.mjs +0 -120
- package/error-handling/handleErrorRestore.cjs +0 -1
- package/error-handling/handleErrorRestore.d.ts +0 -2
- package/error-handling/handleErrorRestore.mjs +0 -11
- package/functions/kyc/authentoHelper.cjs +0 -1
- package/functions/kyc/authentoHelper.d.ts +0 -12
- package/functions/kyc/authentoHelper.mjs +0 -30
- package/functions/utils/ethers-formatter.utils.cjs +0 -1
- package/functions/utils/ethers-formatter.utils.d.ts +0 -5
- package/functions/utils/ethers-formatter.utils.mjs +0 -59
- package/functions/utils/get-hinkal-approvals.cjs +0 -1
- package/functions/utils/get-hinkal-approvals.d.ts +0 -3
- package/functions/utils/get-hinkal-approvals.mjs +0 -38
- package/functions/utils/replaceAddressInCalldata.cjs +0 -1
- package/functions/utils/replaceAddressInCalldata.d.ts +0 -1
- package/functions/utils/replaceAddressInCalldata.mjs +0 -7
- package/functions/web3/functionCalls/estimateGasRelayer.cjs +0 -1
- package/functions/web3/functionCalls/estimateGasRelayer.mjs +0 -22
- package/functions/web3/functionCalls/inHinkalApprovalCalls.cjs +0 -1
- package/functions/web3/functionCalls/inHinkalApprovalCalls.d.ts +0 -5
- package/functions/web3/functionCalls/inHinkalApprovalCalls.mjs +0 -29
- package/types/bridging.types.d.ts +0 -29
- package/types/duneAPI.types.d.ts +0 -9
- package/types/relayer.types.d.ts +0 -25
- package/types/routing.types.cjs +0 -1
- package/types/routing.types.d.ts +0 -7
- package/types/routing.types.mjs +0 -4
|
@@ -1,17 +1,9 @@
|
|
|
1
1
|
import { Utxo } from '../../data-structures/utxo/Utxo';
|
|
2
2
|
import { IHinkal } from '../../data-structures/Hinkal/IHinkal';
|
|
3
|
-
export declare const outputApprovalDataProcessing: (hinkal: IHinkal, inputUtxos: Utxo[], amountChange: bigint, interactionToIgnore?: string, tokenId?: number) => {
|
|
3
|
+
export declare const outputApprovalDataProcessing: (hinkal: IHinkal, chainId: number, inputUtxos: Utxo[], amountChange: bigint, interactionToIgnore?: string, tokenId?: number) => {
|
|
4
4
|
useApprovalUtxoData: {
|
|
5
5
|
approvalChanges: bigint[];
|
|
6
6
|
externalApprovalAddresses: string[];
|
|
7
7
|
conversionInHinkalAddress: bigint[];
|
|
8
8
|
} | undefined;
|
|
9
9
|
};
|
|
10
|
-
export declare const outputApprovalDataProcessingForHinkalApprove: (hinkal: IHinkal, inputUtxos: Utxo[], approvedTo: string, approvalAmount: bigint, deltaAmount: bigint, tokenId?: number) => {
|
|
11
|
-
useApprovalUtxoData: {
|
|
12
|
-
approvalChanges: bigint[];
|
|
13
|
-
externalApprovalAddresses: string[];
|
|
14
|
-
conversionInHinkalAddress: bigint[];
|
|
15
|
-
};
|
|
16
|
-
deltaAmountOverride: bigint;
|
|
17
|
-
};
|
|
@@ -1,39 +1,24 @@
|
|
|
1
|
-
import { transactionErrorCodes as
|
|
2
|
-
import { APPROVED_UTXO_CONVERSION_COUNT as
|
|
3
|
-
import { defaultUseApprovalUTXOData as
|
|
4
|
-
import { isUseApprovalDataEmpty as
|
|
5
|
-
import { countTotalAmountInUtxos as
|
|
6
|
-
import { caseInsensitiveEqual as
|
|
7
|
-
const
|
|
8
|
-
if (
|
|
9
|
-
throw new Error(
|
|
10
|
-
const p =
|
|
11
|
-
if (
|
|
12
|
-
let
|
|
13
|
-
for (let
|
|
14
|
-
const
|
|
15
|
-
|
|
1
|
+
import { transactionErrorCodes as A } from "../../error-handling/error-codes.constants.mjs";
|
|
2
|
+
import { APPROVED_UTXO_CONVERSION_COUNT as d } from "../../constants/conversion.constants.mjs";
|
|
3
|
+
import { defaultUseApprovalUTXOData as f } from "../../types/hinkal.types.mjs";
|
|
4
|
+
import { isUseApprovalDataEmpty as u } from "../utils/processUseApprovalUtxoData.mjs";
|
|
5
|
+
import { countTotalAmountInUtxos as E } from "../utils/amounts.utils.mjs";
|
|
6
|
+
import { caseInsensitiveEqual as I } from "../utils/caseInsensitive.utils.mjs";
|
|
7
|
+
const w = (m, c, s, n, v, a) => {
|
|
8
|
+
if (a && a > 0)
|
|
9
|
+
throw new Error(A.INSUFFICIENT_FUNDS);
|
|
10
|
+
const p = E(s), { erc20TokenAddress: U } = s[0], i = m.getApprovedUtxosForToken(U, c).filter((o) => !I(o.interactionAddress, v)), t = f(d, 0n);
|
|
11
|
+
if (n < 0n && p + n < 0n) {
|
|
12
|
+
let o = -(p + n);
|
|
13
|
+
for (let r = 0; r < Math.min(i.length, d) && o !== 0n; r += 1) {
|
|
14
|
+
const e = i[r], l = e.amount >= o ? -o : -e.amount;
|
|
15
|
+
o += l, t.approvalChanges[r] = l, t.externalApprovalAddresses[r] = e.interactionAddress, t.conversionInHinkalAddress[r] = e.inHinkalAddress;
|
|
16
16
|
}
|
|
17
|
-
if (
|
|
18
|
-
throw new Error(
|
|
17
|
+
if (o !== 0n)
|
|
18
|
+
throw new Error(A.INSUFFICIENT_FUNDS);
|
|
19
19
|
}
|
|
20
|
-
return { useApprovalUtxoData:
|
|
21
|
-
}, O = (i, d, s, f, A, p) => {
|
|
22
|
-
if (p && p > 0)
|
|
23
|
-
throw new Error(v.INSUFFICIENT_FUNDS);
|
|
24
|
-
const U = N(d), { erc20TokenAddress: c } = d[0], r = F(l, 0n), n = i.userKeys.getInHinkalAddress(s), o = i.getApprovedUtxosForToken(c).sort((t, e) => t.inHinkalAddress === n ? -1 : e.inHinkalAddress === n ? 1 : t.amount === e.amount ? 0 : t.amount < e.amount ? -1 : 1), a = o[0]?.inHinkalAddress === n, u = a ? o[0].amount : 0n, x = f - u;
|
|
25
|
-
r.approvalChanges[0] = x, r.externalApprovalAddresses[0] = s, r.conversionInHinkalAddress[0] = i.userKeys.getInHinkalAddress(s);
|
|
26
|
-
const k = a ? 1 : 0, m = k === 0 ? 1 : 0;
|
|
27
|
-
let I = A;
|
|
28
|
-
for (let t = k; t < Math.min(l, o.length) && !(t + m >= l); t += 1) {
|
|
29
|
-
const e = o[t];
|
|
30
|
-
I += e.amount, r.approvalChanges[t + m] = -e.amount, r.externalApprovalAddresses[t + m] = e.interactionAddress, r.conversionInHinkalAddress[t + m] = e.inHinkalAddress;
|
|
31
|
-
}
|
|
32
|
-
if (U + I < 0n)
|
|
33
|
-
throw new Error(v.INSUFFICIENT_FUNDS);
|
|
34
|
-
return { useApprovalUtxoData: r, deltaAmountOverride: I };
|
|
20
|
+
return { useApprovalUtxoData: u(t) ? void 0 : t };
|
|
35
21
|
};
|
|
36
22
|
export {
|
|
37
|
-
|
|
38
|
-
O as outputApprovalDataProcessingForHinkalApprove
|
|
23
|
+
w as outputApprovalDataProcessing
|
|
39
24
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("@solana/spl-token"),c=require("@solana/web3.js"),d=require("../../constants/protocol.constants.cjs"),A=require("../../data-structures/AccountActions/AccountActions.cjs"),B=require("../web3/getSolanaPriorityFee.cjs"),C=require("../utils/process.utils.cjs"),g=require("../../types/fee.types.cjs"),y=5e3,L=6e4,f=async(t,a,r="confirmed")=>await C.pollForValue(()=>t.getTransaction(a,{commitment:r,maxSupportedTransactionVersion:0}),{timeoutMs:L,intervalMs:y})??null,w=async(t,a,r,n)=>{try{const{blockhash:s}=await t.getLatestBlockhash(),e=[c.ComputeBudgetProgram.setComputeUnitLimit({units:d.MAX_COMPUTE_UNIT_LIMIT}),...r],o=new c.TransactionMessage({payerKey:a,recentBlockhash:s,instructions:e}).compileToV0Message(n),i=new c.VersionedTransaction(o),l=await t.simulateTransaction(i,{sigVerify:!1,replaceRecentBlockhash:!0}),{unitsConsumed:u}=l.value;if(!u)return d.MAX_COMPUTE_UNIT_LIMIT;const T=Math.ceil(u*(1+d.COMPUTE_UNIT_PADDING_PERCENTAGE));return Math.max(d.MIN_COMPUTE_UNIT_LIMIT,Math.min(T,d.MAX_COMPUTE_UNIT_LIMIT))}catch{return d.MAX_COMPUTE_UNIT_LIMIT}},O=(t,a,r,n)=>{const s=new Set;return a&&s.add(a.toBase58()),r?.forEach(e=>s.add(e.toBase58())),t.forEach(e=>{s.add(e.programId.toBase58()),e.keys.forEach(o=>{s.add(o.pubkey.toBase58())})}),n&&n.forEach(e=>{s.add(e.key.toBase58()),e.state.addresses.forEach(o=>{s.add(o.toBase58())})}),[...s].map(e=>new c.PublicKey(e))},p=t=>{if(!t)throw new Error("Failed to fetch Solana transaction details for signature");if(t.meta?.err){const a=JSON.stringify(t.meta.err);throw new Error(`Solana transaction failed on-chain: ${a}`)}},M=async(t,a,r,n,s)=>{const e=r.filter(h=>!h.programId.equals(c.ComputeBudgetProgram.programId)),o=await w(t,a,e,n),i=c.ComputeBudgetProgram.setComputeUnitLimit({units:o}),u=t.rpcEndpoint.includes("helius")?await B.getSolanaPriorityFee(O(e,a,[c.ComputeBudgetProgram.programId],n),s):0,T=c.ComputeBudgetProgram.setComputeUnitPrice({microLamports:u});return[i,T,...e]},P=async(t,a,r,n,s)=>{if(a.length===0)return"";for(let e=0;e<d.SOLANA_BLOCKHEIGHT_EXPIRED_RETRY_COUNT;e+=1){const o=e===d.SOLANA_BLOCKHEIGHT_EXPIRED_RETRY_COUNT-1;try{const i=await M(t,r.publicKey,a,s,o?g.SolanaPriorityFeeMode.HIGH:g.SolanaPriorityFeeMode.RECOMMENDED),{blockhash:l,lastValidBlockHeight:u}=await t.getLatestBlockhash(),T=new c.TransactionMessage({payerKey:r.publicKey,instructions:i,recentBlockhash:l}).compileToV0Message(s),h=new c.VersionedTransaction(T);h.sign(n);const E=await t.sendTransaction(h);await t.confirmTransaction({signature:E,blockhash:l,lastValidBlockHeight:u},"confirmed");const I=await f(t,E);return p(I),E}catch(i){if(i instanceof Error&&(i.name==="TransactionExpiredBlockheightExceededError"||i.message?.includes("block height exceeded"))&&!o)continue;throw i}}return""},N=async(t,a,r,n)=>{if(!r)return null;const s=await m.getAssociatedTokenAddress(r,n,!0,m.TOKEN_PROGRAM_ID,m.ASSOCIATED_TOKEN_PROGRAM_ID);if(!await t.getAccountInfo(s)){const o=m.createAssociatedTokenAccountInstruction(a.publicKey,s,n,r,m.TOKEN_PROGRAM_ID,m.ASSOCIATED_TOKEN_PROGRAM_ID);await P(t,[o],a,[a])}return s},R=async({connection:t,chainId:a,subAccount:r,payerPublicKey:n,instructions:s,lookupTableAccounts:e})=>{const o=A.AccountActions.getPrivateKeyFromSubAccount(a,r);if(!o)throw Error("Private key is not available");for(let i=0;i<d.SOLANA_BLOCKHEIGHT_EXPIRED_RETRY_COUNT;i+=1){const l=i===d.SOLANA_BLOCKHEIGHT_EXPIRED_RETRY_COUNT-1;try{const u=await M(t,n,s,e,l?g.SolanaPriorityFeeMode.HIGH:g.SolanaPriorityFeeMode.RECOMMENDED),{blockhash:T,lastValidBlockHeight:h}=await t.getLatestBlockhash(),E=new c.TransactionMessage({payerKey:n,recentBlockhash:T,instructions:u}).compileToV0Message(e),I=new c.VersionedTransaction(E),_=await A.AccountActions.sendAndSignSolanaTransactionFromPrivateKey(t,o,I,!0);await t.confirmTransaction({signature:_,blockhash:T,lastValidBlockHeight:h},"confirmed");const S=await f(t,_);return p(S),_}catch(u){if(u instanceof Error&&(u.name==="TransactionExpiredBlockheightExceededError"||u.message?.includes("block height exceeded"))&&!l)continue;throw u}}throw new Error("Failed to send proxy v0 transaction due to expired blockheight after all retries")},U=async(t,a,r,n)=>{const{blockhash:s}=await t.getLatestBlockhash(),e=await M(t,a,r,n),o=new c.TransactionMessage({payerKey:a,recentBlockhash:s,instructions:e}).compileToV0Message(n),i=new c.VersionedTransaction(o);return Buffer.from(i.serialize()).toString("base64")};exports.ensureAtaExists=N;exports.estimateComputeUnitLimit=w;exports.fetchSolanaTransaction=f;exports.getAccountsFromInstructions=O;exports.sendProxyV0Transaction=R;exports.sendV0Transaction=P;exports.serializeProxyV0Transaction=U;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { AddressLookupTableAccount, Connection, Keypair, PublicKey, TransactionInstruction } from '@solana/web3.js';
|
|
2
|
-
import { RelayerTransaction } from '../../types/relayer.types';
|
|
1
|
+
import { AddressLookupTableAccount, Connection, Finality, Keypair, PublicKey, TransactionInstruction, VersionedTransactionResponse } from '@solana/web3.js';
|
|
3
2
|
import { SubAccount } from '../../types/proxy.types';
|
|
3
|
+
export declare const fetchSolanaTransaction: (connection: Connection, signature: string, finality?: Finality) => Promise<VersionedTransactionResponse | null>;
|
|
4
4
|
export declare const estimateComputeUnitLimit: (connection: Connection, payerKey: PublicKey, instructions: TransactionInstruction[], lookupTableAccounts?: AddressLookupTableAccount[]) => Promise<number>;
|
|
5
|
+
export declare const getAccountsFromInstructions: (instructions: TransactionInstruction[], payerKey?: PublicKey, additionalAccounts?: PublicKey[], lookupTableAccounts?: AddressLookupTableAccount[]) => PublicKey[];
|
|
5
6
|
export declare const sendV0Transaction: (connection: Connection, instructions: TransactionInstruction[], payer: Keypair, signers: Keypair[], lookupTableAccounts?: AddressLookupTableAccount[]) => Promise<string>;
|
|
6
7
|
export declare const ensureAtaExists: (connection: Connection, payer: Keypair, mintPubkey: PublicKey | null, owner: PublicKey) => Promise<PublicKey | null>;
|
|
7
8
|
type SendProxyV0TransactionParams = {
|
|
@@ -11,12 +12,7 @@ type SendProxyV0TransactionParams = {
|
|
|
11
12
|
payerPublicKey: PublicKey;
|
|
12
13
|
instructions: TransactionInstruction[];
|
|
13
14
|
lookupTableAccounts?: AddressLookupTableAccount[];
|
|
14
|
-
convertParams: {
|
|
15
|
-
fromAddress: string;
|
|
16
|
-
toAddress: string;
|
|
17
|
-
programAddress: string;
|
|
18
|
-
};
|
|
19
15
|
};
|
|
20
|
-
export declare const sendProxyV0Transaction: ({ connection, chainId, subAccount, payerPublicKey, instructions, lookupTableAccounts,
|
|
16
|
+
export declare const sendProxyV0Transaction: ({ connection, chainId, subAccount, payerPublicKey, instructions, lookupTableAccounts, }: SendProxyV0TransactionParams) => Promise<string>;
|
|
21
17
|
export declare const serializeProxyV0Transaction: (connection: Connection, payerPublicKey: PublicKey, instructions: TransactionInstruction[], lookupTableAccounts?: AddressLookupTableAccount[]) => Promise<string>;
|
|
22
18
|
export {};
|
|
@@ -1,121 +1,185 @@
|
|
|
1
|
-
import { getAssociatedTokenAddress as
|
|
2
|
-
import { ComputeBudgetProgram as
|
|
3
|
-
import { MAX_COMPUTE_UNIT_LIMIT as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
1
|
+
import { getAssociatedTokenAddress as k, TOKEN_PROGRAM_ID as M, ASSOCIATED_TOKEN_PROGRAM_ID as _, createAssociatedTokenAccountInstruction as O } from "@solana/spl-token";
|
|
2
|
+
import { ComputeBudgetProgram as u, TransactionMessage as T, VersionedTransaction as w, PublicKey as N } from "@solana/web3.js";
|
|
3
|
+
import { MAX_COMPUTE_UNIT_LIMIT as f, COMPUTE_UNIT_PADDING_PERCENTAGE as x, MIN_COMPUTE_UNIT_LIMIT as C, SOLANA_BLOCKHEIGHT_EXPIRED_RETRY_COUNT as g } from "../../constants/protocol.constants.mjs";
|
|
4
|
+
import { AccountActions as A } from "../../data-structures/AccountActions/AccountActions.mjs";
|
|
5
|
+
import { getSolanaPriorityFee as V } from "../web3/getSolanaPriorityFee.mjs";
|
|
6
|
+
import { pollForValue as P } from "../utils/process.utils.mjs";
|
|
7
|
+
import { SolanaPriorityFeeMode as E } from "../../types/fee.types.mjs";
|
|
8
|
+
const U = 5e3, R = 6e4, y = async (t, a, n = "confirmed") => await P(
|
|
9
|
+
() => t.getTransaction(a, {
|
|
10
|
+
commitment: n,
|
|
11
|
+
maxSupportedTransactionVersion: 0
|
|
12
|
+
}),
|
|
13
|
+
{ timeoutMs: R, intervalMs: U }
|
|
14
|
+
) ?? null, D = async (t, a, n, r) => {
|
|
7
15
|
try {
|
|
8
|
-
const { blockhash: s } = await t.getLatestBlockhash(),
|
|
9
|
-
|
|
16
|
+
const { blockhash: s } = await t.getLatestBlockhash(), e = [
|
|
17
|
+
u.setComputeUnitLimit({ units: f }),
|
|
10
18
|
...n
|
|
11
|
-
],
|
|
19
|
+
], o = new T({
|
|
12
20
|
payerKey: a,
|
|
13
21
|
recentBlockhash: s,
|
|
14
|
-
instructions:
|
|
15
|
-
}).compileToV0Message(
|
|
22
|
+
instructions: e
|
|
23
|
+
}).compileToV0Message(r), i = new w(o), d = await t.simulateTransaction(i, {
|
|
16
24
|
sigVerify: !1,
|
|
17
25
|
replaceRecentBlockhash: !0
|
|
18
|
-
}), { unitsConsumed:
|
|
19
|
-
if (!
|
|
20
|
-
return
|
|
21
|
-
const
|
|
22
|
-
return Math.max(C, Math.min(
|
|
26
|
+
}), { unitsConsumed: c } = d.value;
|
|
27
|
+
if (!c)
|
|
28
|
+
return f;
|
|
29
|
+
const l = Math.ceil(c * (1 + x));
|
|
30
|
+
return Math.max(C, Math.min(l, f));
|
|
23
31
|
} catch {
|
|
24
|
-
return
|
|
32
|
+
return f;
|
|
33
|
+
}
|
|
34
|
+
}, H = (t, a, n, r) => {
|
|
35
|
+
const s = /* @__PURE__ */ new Set();
|
|
36
|
+
return a && s.add(a.toBase58()), n?.forEach((e) => s.add(e.toBase58())), t.forEach((e) => {
|
|
37
|
+
s.add(e.programId.toBase58()), e.keys.forEach((o) => {
|
|
38
|
+
s.add(o.pubkey.toBase58());
|
|
39
|
+
});
|
|
40
|
+
}), r && r.forEach((e) => {
|
|
41
|
+
s.add(e.key.toBase58()), e.state.addresses.forEach((o) => {
|
|
42
|
+
s.add(o.toBase58());
|
|
43
|
+
});
|
|
44
|
+
}), [...s].map((e) => new N(e));
|
|
45
|
+
}, L = (t) => {
|
|
46
|
+
if (!t)
|
|
47
|
+
throw new Error("Failed to fetch Solana transaction details for signature");
|
|
48
|
+
if (t.meta?.err) {
|
|
49
|
+
const a = JSON.stringify(t.meta.err);
|
|
50
|
+
throw new Error(`Solana transaction failed on-chain: ${a}`);
|
|
25
51
|
}
|
|
26
|
-
},
|
|
27
|
-
const
|
|
28
|
-
(
|
|
29
|
-
), o = await
|
|
52
|
+
}, B = async (t, a, n, r, s) => {
|
|
53
|
+
const e = n.filter(
|
|
54
|
+
(h) => !h.programId.equals(u.programId)
|
|
55
|
+
), o = await D(
|
|
30
56
|
t,
|
|
31
57
|
a,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
), i =
|
|
35
|
-
|
|
58
|
+
e,
|
|
59
|
+
r
|
|
60
|
+
), i = u.setComputeUnitLimit({ units: o }), c = t.rpcEndpoint.includes("helius") ? await V(
|
|
61
|
+
H(
|
|
62
|
+
e,
|
|
63
|
+
a,
|
|
64
|
+
[u.programId],
|
|
65
|
+
r
|
|
66
|
+
),
|
|
67
|
+
s
|
|
68
|
+
) : 0, l = u.setComputeUnitPrice({
|
|
69
|
+
microLamports: c
|
|
36
70
|
});
|
|
37
|
-
return [i,
|
|
38
|
-
},
|
|
71
|
+
return [i, l, ...e];
|
|
72
|
+
}, K = async (t, a, n, r, s) => {
|
|
39
73
|
if (a.length === 0)
|
|
40
74
|
return "";
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
},
|
|
75
|
+
for (let e = 0; e < g; e += 1) {
|
|
76
|
+
const o = e === g - 1;
|
|
77
|
+
try {
|
|
78
|
+
const i = await B(
|
|
79
|
+
t,
|
|
80
|
+
n.publicKey,
|
|
81
|
+
a,
|
|
82
|
+
s,
|
|
83
|
+
o ? E.HIGH : E.RECOMMENDED
|
|
84
|
+
), { blockhash: d, lastValidBlockHeight: c } = await t.getLatestBlockhash(), l = new T({
|
|
85
|
+
payerKey: n.publicKey,
|
|
86
|
+
instructions: i,
|
|
87
|
+
recentBlockhash: d
|
|
88
|
+
}).compileToV0Message(s), h = new w(l);
|
|
89
|
+
h.sign(r);
|
|
90
|
+
const m = await t.sendTransaction(h);
|
|
91
|
+
await t.confirmTransaction({ signature: m, blockhash: d, lastValidBlockHeight: c }, "confirmed");
|
|
92
|
+
const I = await y(t, m);
|
|
93
|
+
return L(I), m;
|
|
94
|
+
} catch (i) {
|
|
95
|
+
if (i instanceof Error && (i.name === "TransactionExpiredBlockheightExceededError" || i.message?.includes("block height exceeded")) && !o)
|
|
96
|
+
continue;
|
|
97
|
+
throw i;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return "";
|
|
101
|
+
}, J = async (t, a, n, r) => {
|
|
55
102
|
if (!n)
|
|
56
103
|
return null;
|
|
57
|
-
const s = await
|
|
104
|
+
const s = await k(n, r, !0, M, _);
|
|
58
105
|
if (!await t.getAccountInfo(s)) {
|
|
59
|
-
const
|
|
106
|
+
const o = O(
|
|
60
107
|
a.publicKey,
|
|
61
108
|
s,
|
|
62
|
-
|
|
109
|
+
r,
|
|
63
110
|
n,
|
|
64
|
-
|
|
65
|
-
|
|
111
|
+
M,
|
|
112
|
+
_
|
|
66
113
|
);
|
|
67
|
-
await
|
|
114
|
+
await K(t, [o], a, [a]);
|
|
68
115
|
}
|
|
69
116
|
return s;
|
|
70
|
-
},
|
|
117
|
+
}, Y = async ({
|
|
71
118
|
connection: t,
|
|
72
119
|
chainId: a,
|
|
73
120
|
subAccount: n,
|
|
74
|
-
payerPublicKey:
|
|
121
|
+
payerPublicKey: r,
|
|
75
122
|
instructions: s,
|
|
76
|
-
lookupTableAccounts:
|
|
77
|
-
convertParams: i
|
|
123
|
+
lookupTableAccounts: e
|
|
78
124
|
}) => {
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
125
|
+
const o = A.getPrivateKeyFromSubAccount(a, n);
|
|
126
|
+
if (!o)
|
|
127
|
+
throw Error("Private key is not available");
|
|
128
|
+
for (let i = 0; i < g; i += 1) {
|
|
129
|
+
const d = i === g - 1;
|
|
130
|
+
try {
|
|
131
|
+
const c = await B(
|
|
132
|
+
t,
|
|
133
|
+
r,
|
|
134
|
+
s,
|
|
135
|
+
e,
|
|
136
|
+
d ? E.HIGH : E.RECOMMENDED
|
|
137
|
+
), { blockhash: l, lastValidBlockHeight: h } = await t.getLatestBlockhash(), m = new T({
|
|
138
|
+
payerKey: r,
|
|
139
|
+
recentBlockhash: l,
|
|
140
|
+
instructions: c
|
|
141
|
+
}).compileToV0Message(e), I = new w(m), p = await A.sendAndSignSolanaTransactionFromPrivateKey(
|
|
142
|
+
t,
|
|
143
|
+
o,
|
|
144
|
+
I,
|
|
145
|
+
!0
|
|
146
|
+
);
|
|
147
|
+
await t.confirmTransaction(
|
|
148
|
+
{
|
|
149
|
+
signature: p,
|
|
150
|
+
blockhash: l,
|
|
151
|
+
lastValidBlockHeight: h
|
|
152
|
+
},
|
|
153
|
+
"confirmed"
|
|
154
|
+
);
|
|
155
|
+
const S = await y(t, p);
|
|
156
|
+
return L(S), p;
|
|
157
|
+
} catch (c) {
|
|
158
|
+
if (c instanceof Error && (c.name === "TransactionExpiredBlockheightExceededError" || c.message?.includes("block height exceeded")) && !d)
|
|
159
|
+
continue;
|
|
160
|
+
throw c;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
throw new Error("Failed to send proxy v0 transaction due to expired blockheight after all retries");
|
|
164
|
+
}, $ = async (t, a, n, r) => {
|
|
165
|
+
const { blockhash: s } = await t.getLatestBlockhash(), e = await B(
|
|
104
166
|
t,
|
|
105
167
|
a,
|
|
106
168
|
n,
|
|
107
|
-
|
|
108
|
-
),
|
|
169
|
+
r
|
|
170
|
+
), o = new T({
|
|
109
171
|
payerKey: a,
|
|
110
172
|
recentBlockhash: s,
|
|
111
|
-
instructions:
|
|
112
|
-
}).compileToV0Message(
|
|
113
|
-
return Buffer.from(
|
|
173
|
+
instructions: e
|
|
174
|
+
}).compileToV0Message(r), i = new w(o);
|
|
175
|
+
return Buffer.from(i.serialize()).toString("base64");
|
|
114
176
|
};
|
|
115
177
|
export {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
178
|
+
J as ensureAtaExists,
|
|
179
|
+
D as estimateComputeUnitLimit,
|
|
180
|
+
y as fetchSolanaTransaction,
|
|
181
|
+
H as getAccountsFromInstructions,
|
|
182
|
+
Y as sendProxyV0Transaction,
|
|
183
|
+
K as sendV0Transaction,
|
|
184
|
+
$ as serializeProxyV0Transaction
|
|
121
185
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=async(e,c,r,t,k)=>{const[s,o]=await Promise.all([e.checkTokenRegistry(c,r,t),e.checkAccessToken(c,k)]);return{patchAccessTokenMerkleTree:s&&!o,hasAccessToken:o,kycRequired:s}};exports.shouldPatchAccessTokenMerkleTree=n;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IHinkal } from '../../data-structures/Hinkal/IHinkal';
|
|
2
|
-
export declare const shouldPatchAccessTokenMerkleTree: (hinkal: IHinkal, erc20Addresses: string[], amountChanges: bigint[]) => Promise<{
|
|
2
|
+
export declare const shouldPatchAccessTokenMerkleTree: (hinkal: IHinkal, chainId: number, erc20Addresses: string[], amountChanges: bigint[], accessKeyOverride?: string) => Promise<{
|
|
3
3
|
patchAccessTokenMerkleTree: boolean;
|
|
4
4
|
hasAccessToken: boolean;
|
|
5
5
|
kycRequired: boolean;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
const
|
|
2
|
-
const
|
|
3
|
-
|
|
1
|
+
const n = async (e, c, r, k, t) => {
|
|
2
|
+
const [s, o] = await Promise.all([
|
|
3
|
+
e.checkTokenRegistry(c, r, k),
|
|
4
|
+
e.checkAccessToken(c, t)
|
|
5
|
+
]);
|
|
6
|
+
return { patchAccessTokenMerkleTree: s && !o, hasAccessToken: o, kycRequired: s };
|
|
4
7
|
};
|
|
5
8
|
export {
|
|
6
|
-
|
|
9
|
+
n as shouldPatchAccessTokenMerkleTree
|
|
7
10
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./sendV0Transaction.cjs"),a=require("./solana.cjs"),b=async(u,n,t,s,c,e)=>{const o=a.getInstructionsAccountPublicKey(n.programId,s,t.publicKey,c),r=await n.methods.storeInstructions(Number(c),e).accounts({signer:t.publicKey,originalDeployer:s,instructionsAccount:o}).instruction();return await i.sendV0Transaction(u,[r],t,[t]),o};exports.storeInstructions=b;
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
import { sendV0Transaction as
|
|
2
|
-
import { getInstructionsAccountPublicKey as
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
|
|
1
|
+
import { sendV0Transaction as e } from "./sendV0Transaction.mjs";
|
|
2
|
+
import { getInstructionsAccountPublicKey as a } from "./solana.mjs";
|
|
3
|
+
const b = async (u, c, t, n, o, r) => {
|
|
4
|
+
const s = a(
|
|
5
|
+
c.programId,
|
|
6
|
+
n,
|
|
7
|
+
t.publicKey,
|
|
8
|
+
o
|
|
9
|
+
), i = await c.methods.storeInstructions(Number(o), r).accounts({ signer: t.publicKey, originalDeployer: n, instructionsAccount: s }).instruction();
|
|
10
|
+
return await e(u, [i], t, [t]), s;
|
|
6
11
|
};
|
|
7
12
|
export {
|
|
8
|
-
|
|
13
|
+
b as storeInstructions
|
|
9
14
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("../utils/time.utils.cjs"),T=60,I=(n,r)=>{if(!n.length)return!0;const e=new Set(r.map(t=>t.toString()));return n.every(({utxo:t})=>{const o=BigInt(t.getCommitment());return e.has(o.toString())})},f=(n,r,e=20)=>{const t=n.merkleTreeHinkalByChain[r],o=t.getStartIndex(),{count:c}=t.toJSON(),i=BigInt(c);if(i===0n)return[];const g=t.getMerkleData(),l=[],m=i<BigInt(e)?i:BigInt(e);for(let s=0n;s<m;s+=1n){const u=o+i-1n-s,a=g.get(u);a&&a!==0n&&l.push(a)}return l},k=async(n,r,e)=>{if(e.length){for(let t=0;t<T;t+=1){const o=f(n,r);if(I(e,o))return;await w.waitLittle()}throw new Error("Timeout while waiting for deposited UTXOs to appear in Merkle tree.")}};exports.waitForDepositedUtxosInMerkleTree=k;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { waitLittle as w } from "../utils/time.utils.mjs";
|
|
2
|
+
const f = 60, I = (n, r) => {
|
|
3
|
+
if (!n.length)
|
|
4
|
+
return !0;
|
|
5
|
+
const e = new Set(r.map((t) => t.toString()));
|
|
6
|
+
return n.every(({ utxo: t }) => {
|
|
7
|
+
const o = BigInt(t.getCommitment());
|
|
8
|
+
return e.has(o.toString());
|
|
9
|
+
});
|
|
10
|
+
}, T = (n, r, e = 20) => {
|
|
11
|
+
const t = n.merkleTreeHinkalByChain[r], o = t.getStartIndex(), { count: c } = t.toJSON(), s = BigInt(c);
|
|
12
|
+
if (s === 0n)
|
|
13
|
+
return [];
|
|
14
|
+
const m = t.getMerkleData(), l = [], g = s < BigInt(e) ? s : BigInt(e);
|
|
15
|
+
for (let i = 0n; i < g; i += 1n) {
|
|
16
|
+
const u = o + s - 1n - i, a = m.get(u);
|
|
17
|
+
a && a !== 0n && l.push(a);
|
|
18
|
+
}
|
|
19
|
+
return l;
|
|
20
|
+
}, p = async (n, r, e) => {
|
|
21
|
+
if (e.length) {
|
|
22
|
+
for (let t = 0; t < f; t += 1) {
|
|
23
|
+
const o = T(n, r);
|
|
24
|
+
if (I(e, o))
|
|
25
|
+
return;
|
|
26
|
+
await w();
|
|
27
|
+
}
|
|
28
|
+
throw new Error("Timeout while waiting for deposited UTXOs to appear in Merkle tree.");
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
export {
|
|
32
|
+
p as waitForDepositedUtxosInMerkleTree
|
|
33
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("../../constants/protocol.constants.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("ethers"),l=require("../../constants/protocol.constants.cjs"),q=require("../../types/ethereum-network.types.cjs");require("idb-keyval");const y=require("../../constants/chains.constants.cjs"),C=require("../utils/getContractAddress.cjs"),F=require("../utils/create-provider.cjs");require("../../constants/token-data/index.cjs");require("../../error-handling/error-codes.constants.cjs");require("../../constants/tokens.constants.cjs");require("../utils/convertIntegrationProviderToExternalActionId.cjs");require("../../types/circom-data.types.cjs");require("../../types/activities.types.cjs");require("circomlibjs-hinkal-fork");require("../../data-structures/crypto-keys/keys.cjs");require("../../constants/server.constants.cjs");require("../../API/getServerURL.cjs");require("../../data-structures/http/HttpClient.cjs");require("axios");require("../../constants/vite.constants.cjs");const g=require("../utils/caseInsensitive.utils.cjs"),I=require("../../error-handling/logger.cjs");require("@solana/web3.js");require("tronweb");require("@coral-xyz/anchor");require("@solana/spl-token");const A=require("../../data-structures/AccountActions/AccountActions.cjs");require("buffer");require("libsodium-wrappers");require("lodash");require("../../API/enclaveUtxoCalls.cjs");require("../../constants/contracts.constants.cjs");require("../../constants/kyc.constants.cjs");require("../../constants/coingecko.constants.cjs");require("../../constants/reorg-depths.constants.cjs");require("../../constants/addresses.constants.cjs");require("../../constants/token.limits.constants.cjs");require("../../constants/presale.constants.cjs");require("../../constants/activity.constants.cjs");require("../../constants/tasks.constants.cjs");require("../../constants/events.constants.cjs");require("../../constants/schedule.constants.cjs");require("../utils/userAgent.cjs");require("multiformats");require("async-mutex");require("process");require("../../providers/EthersProviderAdapter.cjs");require("node-forge");const h=({contract:e,func:t,args:n,callDataString:r,invokeWallet:o,value:i})=>{let s=new Uint8Array,a=r?u.ethers.getBytesCopy(r):new Uint8Array;if(typeof e=="object"){if(s=u.ethers.getBytesCopy(C.getContractAddress(e)),r?.length&&r?.length>0)throw Error("If function and args are providedm no calldata is needed");t&&n&&!r&&(a=u.ethers.getBytesCopy(e.interface.encodeFunctionData(t,n)))}else s=u.ethers.getBytesCopy(e);const d=u.ethers.getBytesCopy(new Uint8Array([o?1:0])),c=u.ethers.zeroPadValue(u.ethers.toBeHex(i??0n),16),p=u.ethers.concat([s,d,c,a]);return u.ethers.hexlify(p)},z=async(e,t,n,r,o,i)=>{const s=n?await A.AccountActions.signTypedDataFromPrivateKey(e,n,{name:"Emporium",version:"1.0.0",chainId:e,verifyingContract:t},{EmporiumSignature:[{name:"message",type:"uint256"}]},{message:o}):void 0,{v:a,r:d,s:c}=s?u.ethers.Signature.from(s):{v:0,r:u.ethers.ZeroHash,s:u.ethers.ZeroHash};return u.ethers.AbiCoder.defaultAbiCoder().encode(["tuple(uint8 v,bytes32 r, bytes32 s, uint256 message, address signerAddress, bytes[] ops)"],[{v:a,r:d,s:c,message:o??0n,signerAddress:i??l.zeroAddress,ops:r}])},W=e=>{const[t]=u.ethers.AbiCoder.defaultAbiCoder().decode(["tuple(uint8 v,bytes32 r, bytes32 s, uint256 message, address signerAddress, bytes[] ops)"],e),{v:n,r,s:o,message:i,signerAddress:s,ops:a}=t;return{v:n,r,s:o,message:i,signerAddress:s,ops:a}},f=(e,t,n,r)=>h(e?{contract:e,func:"transfer",args:[t,n],invokeWallet:r}:{contract:t,value:n,invokeWallet:r}),b=(e,t,n,r,o)=>{const i=e.getContractWithFetcher(t,q.ContractType.HinkalContract);return n.map((s,a)=>{const d=g.caseInsensitiveEqual(s,l.zeroAddress)?void 0:e.getContractWithFetcher(t,q.ContractType.ERC20Contract,s);return f(d,o??C.getContractAddress(i),r[a],!0)})},E=(e,t,n,r)=>h({contract:e,func:"approve",args:[t,n],invokeWallet:r}),O=(e,t,n,r,o,i,s,a)=>{const d=[];for(let c=0;c<n.length;c+=1){const p=n[c],m=g.caseInsensitiveEqual(p,l.zeroAddress)?void 0:e.getContractWithFetcher(t,q.ContractType.ERC20Contract,p);d.push(f(m,s,r[c],!1))}if(a)for(let c=0;c<o.length;c+=1){const p=o[c];if(!g.caseInsensitiveEqual(p,l.zeroAddress)){const m=e.getContractWithFetcher(t,q.ContractType.ERC20Contract,p);d.push(E(m,a,i[c],!0))}}return d},T=(e,t,n,r,o,i,s,a)=>{const d=[],c=[o],p=[i];a.nativeFee>0n&&!g.caseInsensitiveEqual(o,l.zeroAddress)&&(c.push(l.zeroAddress),p.push(a.nativeFee));const w=O(e,t,c,p,[o],[s],n,r);d.push(...w);let v=a.nativeFee;return g.caseInsensitiveEqual(o,l.zeroAddress)&&(v+=s),d.push(h({contract:r,callDataString:a.calldata,value:v>0n?v:void 0,invokeWallet:!0})),d},k="0xef0100",B=async(e,t)=>{try{const n=F.createCustomRpcProvider(e),r=await n.getCode(t);if(r==="0x"||!r)return{delegated:!1,implementation:void 0,nonce:void 0};if(r.toLowerCase().startsWith(k)&&r.length===48){const o=`0x${r.slice(8)}`,i=await n.getTransactionCount(t);return{delegated:!0,implementation:u.ethers.getAddress(o),nonce:i}}else throw Error("checkEOAWithDelegation: It is a contract")}catch(n){throw I.Logger.error("checkEOAWithDelegation error",{error:n}),n}},D=e=>{const{hinkalWalletAddress:t}=y.networkRegistry[e].contractData;if(!t||g.caseInsensitiveEqual(t,l.zeroAddress))throw Error("Hinkal Wallet Address is not set");return t},P=async(e,t)=>{if(e===y.chainIds.localhost||!t)return;const n=A.AccountActions.getSignerAddressFromPrivateKey(e,t),{delegated:r,implementation:o}=await B(e,n),i=D(e);if(!r||!g.caseInsensitiveEqual(o,i)){const s=await A.AccountActions.authorizeDelegation(e,t,i);return{v:s.signature.v.toString(),r:s.signature.r,s:s.signature.s,nonce:s.nonce.toString(),address:i,chainId:String(e)}}},H=e=>{if(!e)return;const{v:t,r:n,s:r,nonce:o,chainId:i,address:s}=e;return{signature:u.ethers.Signature.from({v:t,r:n,s:r}),nonce:BigInt(o),chainId:BigInt(i),address:s}};exports.checkEOAWithDelegation=B;exports.createApproveEmporiumOp=E;exports.createLifiBridgeOps=T;exports.createTransaferEmporiumOpsBatch=b;exports.createTransferToEmporiumOp=f;exports.decodeEmporiumMetadata=W;exports.emporiumOp=h;exports.encodeEmporiumMetadata=z;exports.generateFundAndApproveOps=O;exports.getAuthorizationDataIfNeeded=P;exports.recoverAuthorizationData=H;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { ethers } from 'ethers';
|
|
1
2
|
import { IHinkal } from '../../data-structures/Hinkal/IHinkal';
|
|
2
3
|
import { type AuthorizationData } from '../../types/hinkal.types';
|
|
3
|
-
import { ethers } from 'ethers';
|
|
4
4
|
import { BridgeQuote } from '../../types/bridging-tx.types';
|
|
5
5
|
export declare const emporiumOp: ({ contract, func, args, callDataString, invokeWallet, value, }: {
|
|
6
6
|
contract: ethers.BaseContract | string;
|
|
@@ -11,14 +11,19 @@ export declare const emporiumOp: ({ contract, func, args, callDataString, invoke
|
|
|
11
11
|
value?: bigint | undefined;
|
|
12
12
|
}) => string;
|
|
13
13
|
export declare const encodeEmporiumMetadata: (chainId: number, emporiumAddress: string, privateKey: string | undefined, ops: string[], message?: bigint, signerAddress?: string) => Promise<string>;
|
|
14
|
+
export declare const decodeEmporiumMetadata: (metadata: string) => {
|
|
15
|
+
v: number;
|
|
16
|
+
r: string;
|
|
17
|
+
s: string;
|
|
18
|
+
message: bigint;
|
|
19
|
+
signerAddress: string;
|
|
20
|
+
ops: string[];
|
|
21
|
+
};
|
|
14
22
|
export declare const createTransferToEmporiumOp: (tokenContract: ethers.Contract | undefined, to: string, amount: bigint, invokeWallet: boolean) => string;
|
|
15
|
-
export declare const createTransaferEmporiumOpsBatch: (hinkal: IHinkal, erc20TokenAddresses: string[], amounts: bigint[], to?: string) => string[];
|
|
23
|
+
export declare const createTransaferEmporiumOpsBatch: (hinkal: IHinkal, chainId: number, erc20TokenAddresses: string[], amounts: bigint[], to?: string) => string[];
|
|
16
24
|
export declare const createApproveEmporiumOp: (tokenContract: ethers.Contract, to: string, amount: bigint, invokeWallet: boolean) => string;
|
|
17
|
-
export declare const
|
|
18
|
-
export declare const
|
|
19
|
-
export declare const generateFundAndApproveOps: (hinkal: IHinkal, erc20AddressesToFund: string[], fundAmounts: bigint[], approveTokenAddresses: string[], approveAmounts: bigint[], walletAddress: string, spenderAddress: string | undefined) => string[];
|
|
20
|
-
export declare const generateFundApproveAndTransactOps: (hinkal: IHinkal, erc20AddressesToFund: string[], fundAmounts: bigint[], approveTokenAddresses: string[], approveAmounts: bigint[], walletAddress: string, spenderAddress: string | undefined, to?: string, callDataString?: string, value?: bigint) => string[];
|
|
21
|
-
export declare const createLifiBridgeOps: (hinkal: IHinkal, fromAddress: string, lifiRouterAddress: string, tokenAddress: string, fundAmount: bigint, bridgeAmount: bigint, quote: BridgeQuote) => string[];
|
|
25
|
+
export declare const generateFundAndApproveOps: (hinkal: IHinkal, chainId: number, erc20AddressesToFund: string[], fundAmounts: bigint[], approveTokenAddresses: string[], approveAmounts: bigint[], walletAddress: string, spenderAddress: string | undefined) => string[];
|
|
26
|
+
export declare const createLifiBridgeOps: (hinkal: IHinkal, chainId: number, fromAddress: string, lifiRouterAddress: string, tokenAddress: string, fundAmount: bigint, bridgeAmount: bigint, quote: BridgeQuote) => string[];
|
|
22
27
|
export declare const checkEOAWithDelegation: (chainId: number, eoaAddress: string) => Promise<{
|
|
23
28
|
delegated: boolean;
|
|
24
29
|
implementation: undefined;
|