@gurge/sdk 0.3.150 → 0.3.151
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/README.md +43 -29
- package/common/src/API/API.cjs +1 -1
- package/common/src/API/API.d.ts +21 -46
- package/common/src/API/API.mjs +96 -121
- package/common/src/API/admin-calls.cjs +1 -1
- package/common/src/API/admin-calls.d.ts +1 -1
- package/common/src/API/admin-calls.mjs +3 -1
- package/common/src/API/callLifiAPI.cjs +1 -1
- package/common/src/API/callLifiAPI.d.ts +4 -0
- package/common/src/API/callLifiAPI.mjs +7 -2
- package/common/src/API/callNearIntentsAPI.cjs +1 -1
- package/common/src/API/callNearIntentsAPI.mjs +2 -2
- package/common/src/API/callRelayer.cjs +1 -1
- package/common/src/API/callRelayer.d.ts +36 -1
- package/common/src/API/callRelayer.mjs +7 -1
- package/common/src/API/dashboardAccountMemberCalls.cjs +1 -1
- package/common/src/API/dashboardAccountMemberCalls.d.ts +15 -0
- package/common/src/API/dashboardAccountMemberCalls.mjs +5 -2
- package/common/src/API/dashboardPayoutCalls.cjs +1 -1
- package/common/src/API/dashboardPayoutCalls.d.ts +2 -1
- package/common/src/API/dashboardPayoutCalls.mjs +4 -1
- package/common/src/API/dashboardTransactionCalls.cjs +1 -1
- package/common/src/API/dashboardTransactionCalls.d.ts +4 -1
- package/common/src/API/dashboardTransactionCalls.mjs +2 -2
- package/common/src/API/enclaveRecipientInfoCalls.d.ts +0 -2
- package/common/src/API/enclaveSignatureCalls.cjs +1 -1
- package/common/src/API/enclaveSignatureCalls.d.ts +2 -1
- package/common/src/API/enclaveSignatureCalls.mjs +5 -8
- package/common/src/API/enclaveUtxoCalls.cjs +1 -1
- package/common/src/API/enclaveUtxoCalls.d.ts +40 -27
- package/common/src/API/enclaveUtxoCalls.mjs +16 -17
- package/common/src/API/evm-rpc-fallback.cjs +1 -0
- package/common/src/API/evm-rpc-fallback.d.ts +1 -0
- package/common/src/API/evm-rpc-fallback.mjs +17 -0
- package/common/src/API/evm-token-assets.d.ts +8 -0
- package/common/src/API/getOdosPriceForToken.cjs +1 -0
- package/common/src/API/getOdosPriceForToken.d.ts +1 -0
- package/common/src/API/getOdosPriceForToken.mjs +14 -0
- package/common/src/API/getWebsiteURL.d.ts +1 -3
- package/common/src/API/index.cjs +1 -1
- package/common/src/API/index.d.ts +2 -3
- package/common/src/API/index.mjs +4 -5
- package/common/src/API/payoutNotificationStateCalls.cjs +1 -0
- package/common/src/API/payoutNotificationStateCalls.d.ts +10 -0
- package/common/src/API/payoutNotificationStateCalls.mjs +10 -0
- package/common/src/API/privateSendRecipientInfoCalls.cjs +1 -1
- package/common/src/API/privateSendRecipientInfoCalls.d.ts +3 -6
- package/common/src/API/privateSendRecipientInfoCalls.mjs +12 -6
- package/common/src/API/proxyAccountsCalls.cjs +1 -1
- package/common/src/API/proxyAccountsCalls.d.ts +2 -3
- package/common/src/API/proxyAccountsCalls.mjs +11 -10
- package/common/src/API/rewardsUserCalls.cjs +1 -1
- package/common/src/API/rewardsUserCalls.d.ts +1 -40
- package/common/src/API/rewardsUserCalls.mjs +2 -10
- package/common/src/API/route-config.cjs +1 -0
- package/common/src/API/route-config.d.ts +1 -0
- package/common/src/API/route-config.mjs +26 -0
- package/common/src/API/scheduled-transactions-calls.cjs +1 -1
- package/common/src/API/scheduled-transactions-calls.d.ts +2 -5
- package/common/src/API/scheduled-transactions-calls.mjs +2 -6
- package/common/src/API/solana-nft-assets.d.ts +1 -0
- package/common/src/API/solana-priority-fee.cjs +1 -0
- package/common/src/API/solana-priority-fee.d.ts +3 -0
- package/common/src/API/solana-priority-fee.mjs +20 -0
- package/common/src/API/solana-rpc-fallback.cjs +1 -0
- package/common/src/API/solana-rpc-fallback.d.ts +1 -0
- package/common/src/API/solana-rpc-fallback.mjs +13 -0
- package/common/src/API/temporaryWalletCalls.cjs +1 -1
- package/common/src/API/temporaryWalletCalls.d.ts +3 -5
- package/common/src/API/temporaryWalletCalls.mjs +8 -9
- package/common/src/API/tenderly.api.cjs +1 -1
- package/common/src/API/tenderly.api.d.ts +5 -10
- package/common/src/API/tenderly.api.mjs +1 -1
- package/common/src/API/weeklyAnalyticCalls.cjs +1 -1
- package/common/src/API/weeklyAnalyticCalls.d.ts +1 -11
- package/common/src/API/weeklyAnalyticCalls.mjs +2 -5
- package/common/src/constants/addresses.constants.cjs +1 -1
- package/common/src/constants/addresses.constants.d.ts +4 -46
- package/common/src/constants/addresses.constants.mjs +19 -60
- package/common/src/constants/balance.constants.cjs +1 -0
- package/common/src/constants/balance.constants.d.ts +3 -0
- package/common/src/constants/balance.constants.mjs +4 -0
- package/common/src/constants/bridging.constants.cjs +1 -1
- package/common/src/constants/bridging.constants.d.ts +10 -0
- package/common/src/constants/bridging.constants.mjs +2 -1
- package/common/src/constants/chains.constants.cjs +1 -1
- package/common/src/constants/chains.constants.d.ts +21 -19
- package/common/src/constants/chains.constants.mjs +175 -198
- package/common/src/constants/coingecko.constants.cjs +1 -1
- package/common/src/constants/coingecko.constants.d.ts +3 -1
- package/common/src/constants/coingecko.constants.mjs +1 -1
- package/common/src/constants/contracts.constants.cjs +1 -1
- package/common/src/constants/contracts.constants.d.ts +1 -109
- package/common/src/constants/contracts.constants.mjs +16 -34
- package/common/src/constants/deploy-data/deploy-data-arbMainnet.json.cjs +1 -1
- package/common/src/constants/deploy-data/deploy-data-arbMainnet.json.mjs +8 -9
- package/common/src/constants/deploy-data/deploy-data-arcTestnet.json.cjs +1 -1
- package/common/src/constants/deploy-data/deploy-data-arcTestnet.json.mjs +7 -6
- package/common/src/constants/deploy-data/deploy-data-base.json.cjs +1 -1
- package/common/src/constants/deploy-data/deploy-data-base.json.mjs +8 -9
- package/common/src/constants/deploy-data/deploy-data-bnbMainnet.json.cjs +1 -0
- package/common/src/constants/deploy-data/deploy-data-bnbMainnet.json.mjs +12 -0
- package/common/src/constants/deploy-data/deploy-data-ethMainnet.json.cjs +1 -1
- package/common/src/constants/deploy-data/deploy-data-ethMainnet.json.mjs +8 -9
- package/common/src/constants/deploy-data/deploy-data-localhost.json.cjs +1 -1
- package/common/src/constants/deploy-data/deploy-data-localhost.json.mjs +0 -3
- package/common/src/constants/deploy-data/deploy-data-optimism.json.cjs +1 -1
- package/common/src/constants/deploy-data/deploy-data-optimism.json.mjs +8 -9
- package/common/src/constants/deploy-data/deploy-data-optimismTest.json.cjs +1 -1
- package/common/src/constants/deploy-data/deploy-data-optimismTest.json.mjs +5 -9
- package/common/src/constants/deploy-data/deploy-data-polygon.json.cjs +1 -1
- package/common/src/constants/deploy-data/deploy-data-polygon.json.mjs +8 -9
- package/common/src/constants/deploy-data/deploy-data-sepoliaTestnet.json.cjs +1 -1
- package/common/src/constants/deploy-data/deploy-data-sepoliaTestnet.json.mjs +0 -1
- package/common/src/constants/deploy-data/deploy-data-solana.json.cjs +1 -1
- package/common/src/constants/deploy-data/deploy-data-solana.json.mjs +2 -2
- package/common/src/constants/deploy-data/deploy-data-tempo.json.cjs +1 -1
- package/common/src/constants/deploy-data/deploy-data-tempo.json.mjs +7 -7
- package/common/src/constants/deploy-data/deploy-data-tronMainnet.json.cjs +1 -1
- package/common/src/constants/deploy-data/deploy-data-tronMainnet.json.mjs +2 -4
- package/common/src/constants/deploy-data/deploy-data-tronNile.json.cjs +1 -1
- package/common/src/constants/deploy-data/deploy-data-tronNile.json.mjs +2 -4
- package/common/src/constants/deploy-data/index.cjs +1 -1
- package/common/src/constants/deploy-data/index.d.ts +2 -1
- package/common/src/constants/deploy-data/index.mjs +16 -15
- package/common/src/constants/deploy-data/shared-deploy-data-evm.json.cjs +1 -1
- package/common/src/constants/deploy-data/shared-deploy-data-evm.json.mjs +36 -45
- package/common/src/constants/deploy-data/shared-deploy-data-solana.json.cjs +1 -1
- package/common/src/constants/deploy-data/shared-deploy-data-solana.json.mjs +1 -1
- package/common/src/constants/deploy-data/shared-deploy-data-tron.json.cjs +1 -1
- package/common/src/constants/deploy-data/shared-deploy-data-tron.json.mjs +2 -46
- package/common/src/constants/enclaveAuth.constants.d.ts +5 -0
- package/common/src/constants/events.constants.cjs +1 -1
- package/common/src/constants/events.constants.mjs +1 -15
- package/common/src/constants/fees.constants.cjs +1 -1
- package/common/src/constants/fees.constants.mjs +2 -2
- package/common/src/constants/index.cjs +1 -1
- package/common/src/constants/index.d.ts +1 -3
- package/common/src/constants/index.mjs +1 -1
- package/common/src/constants/lifi.constants.cjs +1 -1
- package/common/src/constants/lifi.constants.mjs +6 -3
- package/common/src/constants/mediaUrls.constants.d.ts +0 -1
- package/common/src/constants/okx.constants.d.ts +1 -0
- package/common/src/constants/pay.constants.d.ts +1 -0
- package/common/src/constants/protocol.constants.cjs +2 -1
- package/common/src/constants/protocol.constants.d.ts +22 -12
- package/common/src/constants/protocol.constants.mjs +3 -15
- package/common/src/constants/server.constants.cjs +1 -1
- package/common/src/constants/server.constants.d.ts +14 -36
- package/common/src/constants/server.constants.mjs +19 -49
- package/common/src/constants/tokens.constants.cjs +1 -1
- package/common/src/constants/tokens.constants.d.ts +1 -0
- package/common/src/constants/tokens.constants.mjs +4 -1
- package/common/src/constants/tx-confirmation.constants.cjs +1 -1
- package/common/src/constants/tx-confirmation.constants.d.ts +1 -0
- package/common/src/constants/tx-confirmation.constants.mjs +2 -2
- package/common/src/crypto/ecdh-sealed-keys.cjs +1 -1
- package/common/src/crypto/ecdh-sealed-keys.mjs +17 -2
- package/common/src/crypto/index.cjs +1 -1
- package/common/src/crypto/index.d.ts +0 -1
- package/common/src/crypto/index.mjs +1 -2
- package/common/src/data-structures/ApprovalDBs/EventsPublicApprovalsDB.d.ts +1 -2
- package/common/src/data-structures/Hinkal/Hinkal.cjs +1 -1
- package/common/src/data-structures/Hinkal/Hinkal.d.ts +18 -23
- package/common/src/data-structures/Hinkal/Hinkal.mjs +142 -174
- package/common/src/data-structures/Hinkal/IHinkal.d.ts +18 -24
- package/common/src/data-structures/Hinkal/handleAutoDepositBack.cjs +1 -1
- package/common/src/data-structures/Hinkal/handleAutoDepositBack.d.ts +1 -1
- package/common/src/data-structures/Hinkal/handleAutoDepositBack.mjs +36 -35
- package/common/src/data-structures/Hinkal/hinkalActionReceive.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalActionReceive.mjs +13 -11
- package/common/src/data-structures/Hinkal/hinkalBridgePrivateToPrivate.cjs +1 -0
- package/common/src/data-structures/Hinkal/hinkalBridgePrivateToPrivate.d.ts +6 -0
- package/common/src/data-structures/Hinkal/hinkalBridgePrivateToPrivate.mjs +100 -0
- package/common/src/data-structures/Hinkal/hinkalClaimUtxo.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalClaimUtxo.d.ts +1 -1
- package/common/src/data-structures/Hinkal/hinkalClaimUtxo.mjs +40 -50
- package/common/src/data-structures/Hinkal/hinkalDeposit.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalDeposit.d.ts +1 -0
- package/common/src/data-structures/Hinkal/hinkalDeposit.mjs +50 -119
- package/common/src/data-structures/Hinkal/hinkalDepositAndBridge.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalDepositAndBridge.d.ts +2 -2
- package/common/src/data-structures/Hinkal/hinkalDepositAndBridge.mjs +113 -109
- package/common/src/data-structures/Hinkal/hinkalDepositAndWithdraw.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalDepositAndWithdraw.d.ts +3 -2
- package/common/src/data-structures/Hinkal/hinkalDepositAndWithdraw.mjs +98 -64
- package/common/src/data-structures/Hinkal/hinkalDepositOnChainUtxos.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalDepositOnChainUtxos.d.ts +20 -7
- package/common/src/data-structures/Hinkal/hinkalDepositOnChainUtxos.mjs +50 -48
- package/common/src/data-structures/Hinkal/hinkalNearDepositAndBridge.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalNearDepositAndBridge.mjs +8 -3
- package/common/src/data-structures/Hinkal/hinkalPalEvmDeposit.d.ts +1 -1
- package/common/src/data-structures/Hinkal/hinkalPalTronDepositPrepare.d.ts +2 -2
- package/common/src/data-structures/Hinkal/hinkalPrivateWallet.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalPrivateWallet.mjs +50 -38
- package/common/src/data-structures/Hinkal/hinkalProoflessDeposit.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalProoflessDeposit.d.ts +2 -3
- package/common/src/data-structures/Hinkal/hinkalProoflessDeposit.mjs +52 -117
- package/common/src/data-structures/Hinkal/hinkalProoflessDeposit.utils.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalProoflessDeposit.utils.d.ts +3 -0
- package/common/src/data-structures/Hinkal/hinkalProoflessDeposit.utils.mjs +26 -32
- package/common/src/data-structures/Hinkal/hinkalProxySend.cjs +1 -0
- package/common/src/data-structures/Hinkal/hinkalProxySend.d.ts +6 -0
- package/common/src/data-structures/Hinkal/hinkalProxySend.mjs +16 -0
- package/common/src/data-structures/Hinkal/hinkalProxySwap.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalProxySwap.d.ts +1 -1
- package/common/src/data-structures/Hinkal/hinkalProxySwap.mjs +13 -12
- package/common/src/data-structures/Hinkal/hinkalProxyToPrivate.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalProxyToPrivate.mjs +19 -17
- package/common/src/data-structures/Hinkal/hinkalSolanaClaimUtxo.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalSolanaClaimUtxo.d.ts +1 -1
- package/common/src/data-structures/Hinkal/hinkalSolanaClaimUtxo.mjs +50 -79
- package/common/src/data-structures/Hinkal/hinkalSolanaDeposit.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalSolanaDeposit.d.ts +2 -2
- package/common/src/data-structures/Hinkal/hinkalSolanaDeposit.mjs +47 -51
- package/common/src/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.d.ts +8 -4
- package/common/src/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.mjs +115 -133
- package/common/src/data-structures/Hinkal/hinkalSolanaProoflessDeposit.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalSolanaProoflessDeposit.d.ts +1 -1
- package/common/src/data-structures/Hinkal/hinkalSolanaProoflessDeposit.mjs +16 -12
- package/common/src/data-structures/Hinkal/hinkalSolanaProxySend.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalSolanaProxySend.mjs +1 -3
- package/common/src/data-structures/Hinkal/hinkalSolanaProxyShield.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalSolanaProxyShield.d.ts +24 -2
- package/common/src/data-structures/Hinkal/hinkalSolanaProxyShield.mjs +82 -56
- package/common/src/data-structures/Hinkal/hinkalSolanaProxySwap.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalSolanaProxySwap.d.ts +1 -1
- package/common/src/data-structures/Hinkal/hinkalSolanaProxySwap.mjs +11 -13
- package/common/src/data-structures/Hinkal/hinkalSolanaSponsoredShield.cjs +1 -0
- package/common/src/data-structures/Hinkal/hinkalSolanaSponsoredShield.d.ts +8 -0
- package/common/src/data-structures/Hinkal/hinkalSolanaSponsoredShield.mjs +32 -0
- package/common/src/data-structures/Hinkal/hinkalSolanaSwap.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalSolanaSwap.mjs +58 -79
- package/common/src/data-structures/Hinkal/hinkalSolanaTransact.cjs +1 -0
- package/common/src/data-structures/Hinkal/hinkalSolanaTransact.d.ts +3 -0
- package/common/src/data-structures/Hinkal/hinkalSolanaTransact.mjs +119 -0
- package/common/src/data-structures/Hinkal/hinkalSolanaTransfer.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalSolanaTransfer.d.ts +2 -30
- package/common/src/data-structures/Hinkal/hinkalSolanaTransfer.mjs +46 -77
- package/common/src/data-structures/Hinkal/hinkalSolanaWithdraw.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalSolanaWithdraw.d.ts +1 -1
- package/common/src/data-structures/Hinkal/hinkalSolanaWithdraw.mjs +46 -57
- package/common/src/data-structures/Hinkal/hinkalSwap.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalSwap.d.ts +1 -1
- package/common/src/data-structures/Hinkal/hinkalSwap.mjs +32 -32
- package/common/src/data-structures/Hinkal/hinkalTransact.cjs +1 -0
- package/common/src/data-structures/Hinkal/hinkalTransact.d.ts +3 -0
- package/common/src/data-structures/Hinkal/hinkalTransact.mjs +106 -0
- package/common/src/data-structures/Hinkal/hinkalTransfer.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalTransfer.mjs +39 -44
- package/common/src/data-structures/Hinkal/hinkalWithdraw.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalWithdraw.d.ts +1 -1
- package/common/src/data-structures/Hinkal/hinkalWithdraw.mjs +38 -49
- package/common/src/data-structures/Hinkal/hinkalWithdrawStuckUtxos.cjs +1 -1
- package/common/src/data-structures/Hinkal/hinkalWithdrawStuckUtxos.mjs +160 -102
- package/common/src/data-structures/Hinkal/index.d.ts +2 -1
- package/common/src/data-structures/Hinkal/prepareTronDepositToSelf.d.ts +27 -0
- package/common/src/data-structures/Hinkal/resetMerkleTrees.cjs +1 -1
- package/common/src/data-structures/Hinkal/resetMerkleTrees.mjs +7 -6
- package/common/src/data-structures/IndexedDB/activity-db.cjs +1 -1
- package/common/src/data-structures/IndexedDB/activity-db.mjs +34 -34
- package/common/src/data-structures/IndexedDB/contact-db.cjs +1 -1
- package/common/src/data-structures/IndexedDB/contact-db.d.ts +0 -1
- package/common/src/data-structures/IndexedDB/contact-db.mjs +14 -28
- package/common/src/data-structures/IndexedDB/index.cjs +1 -1
- package/common/src/data-structures/IndexedDB/index.d.ts +1 -0
- package/common/src/data-structures/IndexedDB/index.mjs +1 -0
- package/common/src/data-structures/IndexedDB/key-val-store.cjs +1 -1
- package/common/src/data-structures/IndexedDB/key-val-store.d.ts +2 -0
- package/common/src/data-structures/IndexedDB/key-val-store.mjs +14 -0
- package/common/src/data-structures/IndexedDB/pay-activity-db.cjs +1 -1
- package/common/src/data-structures/IndexedDB/pay-activity-db.mjs +43 -1
- package/common/src/data-structures/IndexedDB/private-balances-db.cjs +1 -1
- package/common/src/data-structures/IndexedDB/private-balances-db.d.ts +1 -0
- package/common/src/data-structures/IndexedDB/private-balances-db.mjs +3 -0
- package/common/src/data-structures/IndexedDB/scheduled-transactions-db.cjs +1 -0
- package/common/src/data-structures/IndexedDB/scheduled-transactions-db.d.ts +11 -0
- package/common/src/data-structures/IndexedDB/scheduled-transactions-db.mjs +34 -0
- package/common/src/data-structures/IndexedDB/signatures-db.cjs +1 -1
- package/common/src/data-structures/IndexedDB/signatures-db.mjs +11 -11
- package/common/src/data-structures/MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.cjs +1 -1
- package/common/src/data-structures/MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.d.ts +1 -0
- package/common/src/data-structures/MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.mjs +29 -26
- package/common/src/data-structures/TokenDBs/AlchemyPublicTokensDB.d.ts +0 -1
- package/common/src/data-structures/TokenDBs/PrivateTokensDB.cjs +1 -1
- package/common/src/data-structures/TokenDBs/PrivateTokensDB.mjs +17 -18
- package/common/src/data-structures/TokenDBs/TronPublicTokensDB.d.ts +1 -0
- package/common/src/data-structures/WalletManager/WalletManager.d.ts +1 -0
- package/common/src/data-structures/cacheDevices/BaseCacheDevice.cjs +1 -1
- package/common/src/data-structures/cacheDevices/BaseCacheDevice.d.ts +1 -0
- package/common/src/data-structures/cacheDevices/BaseCacheDevice.mjs +3 -0
- package/common/src/data-structures/cacheDevices/FileCacheDevice.cjs +1 -1
- package/common/src/data-structures/cacheDevices/FileCacheDevice.d.ts +3 -0
- package/common/src/data-structures/cacheDevices/FileCacheDevice.mjs +12 -3
- package/common/src/data-structures/crypto-keys/decodeUTXO.cjs +1 -1
- package/common/src/data-structures/crypto-keys/decodeUTXO.d.ts +9 -9
- package/common/src/data-structures/crypto-keys/decodeUTXO.mjs +11 -71
- package/common/src/data-structures/crypto-keys/encryptDecryptUtxo.cjs +1 -1
- package/common/src/data-structures/crypto-keys/encryptDecryptUtxo.d.ts +2 -3
- package/common/src/data-structures/crypto-keys/encryptDecryptUtxo.mjs +39 -23
- package/common/src/data-structures/crypto-keys/keys.cjs +1 -1
- package/common/src/data-structures/crypto-keys/keys.d.ts +13 -27
- package/common/src/data-structures/crypto-keys/keys.mjs +64 -79
- package/common/src/data-structures/event-service/evm/BlockchainEventEmitter.cjs +1 -1
- package/common/src/data-structures/event-service/evm/BlockchainEventEmitter.d.ts +3 -2
- package/common/src/data-structures/event-service/evm/BlockchainEventEmitter.mjs +46 -38
- package/common/src/data-structures/event-service/evm/ClientBlockchainEventEmitter.cjs +1 -1
- package/common/src/data-structures/event-service/evm/ClientBlockchainEventEmitter.d.ts +1 -1
- package/common/src/data-structures/event-service/evm/ClientBlockchainEventEmitter.mjs +2 -2
- package/common/src/data-structures/event-service/solana/AbstractSolanaCommitmentsSnapshotService.cjs +1 -1
- package/common/src/data-structures/event-service/solana/AbstractSolanaCommitmentsSnapshotService.mjs +27 -23
- package/common/src/data-structures/merkle-tree/MerkleTree.cjs +1 -1
- package/common/src/data-structures/merkle-tree/MerkleTree.d.ts +11 -0
- package/common/src/data-structures/merkle-tree/MerkleTree.mjs +12 -1
- package/common/src/data-structures/private-balances/HinkalPrivateBalanceController.cjs +1 -1
- package/common/src/data-structures/private-balances/HinkalPrivateBalanceController.d.ts +4 -0
- package/common/src/data-structures/private-balances/HinkalPrivateBalanceController.mjs +100 -86
- package/common/src/data-structures/provider-adapter/IProviderAdapter.d.ts +1 -5
- package/common/src/data-structures/token-price-fetcher/TokenChecker.cjs +1 -1
- package/common/src/data-structures/token-price-fetcher/TokenChecker.d.ts +1 -0
- package/common/src/data-structures/token-price-fetcher/TokenChecker.mjs +5 -3
- package/common/src/data-structures/utxo/Utxo.cjs +1 -1
- package/common/src/data-structures/utxo/Utxo.d.ts +1 -4
- package/common/src/data-structures/utxo/Utxo.mjs +7 -17
- package/common/src/error-handling/error-codes.constants.cjs +2 -2
- package/common/src/error-handling/error-codes.constants.d.ts +14 -14
- package/common/src/error-handling/error-codes.constants.mjs +30 -32
- package/common/src/error-handling/get-error.message.cjs +1 -1
- package/common/src/error-handling/get-error.message.mjs +28 -18
- package/common/src/error-handling/index.cjs +1 -1
- package/common/src/error-handling/index.d.ts +1 -0
- package/common/src/error-handling/index.mjs +1 -0
- package/common/src/externalABIs/index.cjs +1 -1
- package/common/src/externalABIs/index.d.ts +1 -113
- package/common/src/externalABIs/index.mjs +2 -6
- package/common/src/functions/auto-deposit-back-helpers/get-gas-token-records.cjs +1 -1
- package/common/src/functions/auto-deposit-back-helpers/get-gas-token-records.mjs +7 -6
- package/common/src/functions/auto-deposit-back-helpers/select-gas-token.cjs +1 -1
- package/common/src/functions/auto-deposit-back-helpers/select-gas-token.mjs +8 -8
- package/common/src/functions/index.cjs +1 -1
- package/common/src/functions/index.d.ts +0 -1
- package/common/src/functions/index.mjs +21 -20
- package/common/src/functions/pre-transaction/buildCommitmentValidationData.cjs +1 -1
- package/common/src/functions/pre-transaction/buildCommitmentValidationData.mjs +36 -38
- package/common/src/functions/pre-transaction/calculateSolanaNullifierCount.cjs +1 -1
- package/common/src/functions/pre-transaction/calculateSolanaNullifierCount.mjs +38 -5
- package/common/src/functions/pre-transaction/ensureAmountChanges.cjs +1 -1
- package/common/src/functions/pre-transaction/ensureAmountChanges.mjs +3 -10
- package/common/src/functions/pre-transaction/getExternalSwapAddress.cjs +1 -1
- package/common/src/functions/pre-transaction/getExternalSwapAddress.mjs +2 -18
- package/common/src/functions/pre-transaction/getSolanaCalldataHash.cjs +1 -1
- package/common/src/functions/pre-transaction/getSolanaCalldataHash.d.ts +1 -1
- package/common/src/functions/pre-transaction/getSolanaCalldataHash.mjs +11 -10
- package/common/src/functions/pre-transaction/getVolatileTransferAmount.cjs +1 -1
- package/common/src/functions/pre-transaction/getVolatileTransferAmount.mjs +1 -1
- package/common/src/functions/pre-transaction/index.cjs +1 -1
- package/common/src/functions/pre-transaction/index.d.ts +2 -2
- package/common/src/functions/pre-transaction/index.mjs +2 -3
- package/common/src/functions/pre-transaction/merge-with-fee-structure-emporium.cjs +1 -1
- package/common/src/functions/pre-transaction/merge-with-fee-structure-emporium.mjs +2 -2
- package/common/src/functions/pre-transaction/outputUtxoProcessing.cjs +1 -1
- package/common/src/functions/pre-transaction/outputUtxoProcessing.d.ts +2 -1
- package/common/src/functions/pre-transaction/outputUtxoProcessing.mjs +19 -18
- package/common/src/functions/pre-transaction/sendV0Transaction.cjs +2 -2
- package/common/src/functions/pre-transaction/sendV0Transaction.d.ts +5 -2
- package/common/src/functions/pre-transaction/sendV0Transaction.mjs +4 -4
- package/common/src/functions/pre-transaction/solana-public-signals.d.ts +1 -0
- package/common/src/functions/pre-transaction/solana.cjs +1 -1
- package/common/src/functions/pre-transaction/solana.d.ts +13 -0
- package/common/src/functions/pre-transaction/solana.mjs +46 -21
- package/common/src/functions/pre-transaction/solanaTransfer.utils.cjs +1 -1
- package/common/src/functions/pre-transaction/solanaTransfer.utils.mjs +16 -15
- package/common/src/functions/pre-transaction/speculativeUtxo.cjs +1 -0
- package/common/src/functions/pre-transaction/speculativeUtxo.d.ts +9 -0
- package/common/src/functions/pre-transaction/speculativeUtxo.mjs +19 -0
- package/common/src/functions/pre-transaction/store-proof.cjs +1 -1
- package/common/src/functions/pre-transaction/store-proof.d.ts +1 -1
- package/common/src/functions/pre-transaction/store-proof.mjs +1 -0
- package/common/src/functions/private-wallet/emporium.helpers.cjs +1 -1
- package/common/src/functions/private-wallet/emporium.helpers.d.ts +9 -3
- package/common/src/functions/private-wallet/emporium.helpers.mjs +116 -72
- package/common/src/functions/private-wallet/emporium.swap.helpers.cjs +1 -1
- package/common/src/functions/private-wallet/emporium.swap.helpers.d.ts +0 -1
- package/common/src/functions/private-wallet/emporium.swap.helpers.mjs +38 -80
- package/common/src/functions/private-wallet/index.cjs +1 -1
- package/common/src/functions/private-wallet/index.d.ts +0 -1
- package/common/src/functions/private-wallet/index.mjs +0 -1
- package/common/src/functions/snarkjs/common.snarkjs.cjs +1 -1
- package/common/src/functions/snarkjs/common.snarkjs.d.ts +4 -4
- package/common/src/functions/snarkjs/common.snarkjs.mjs +104 -65
- package/common/src/functions/snarkjs/constant.cjs +1 -1
- package/common/src/functions/snarkjs/constant.d.ts +231 -144
- package/common/src/functions/snarkjs/constant.mjs +231 -145
- package/common/src/functions/snarkjs/constructGeneralZkProof.cjs +1 -1
- package/common/src/functions/snarkjs/constructGeneralZkProof.d.ts +1 -1
- package/common/src/functions/snarkjs/constructGeneralZkProof.mjs +85 -69
- package/common/src/functions/snarkjs/constructSignatureFromMnemonicProofInput.cjs +1 -0
- package/common/src/functions/snarkjs/constructSignatureFromMnemonicProofInput.d.ts +7 -0
- package/common/src/functions/snarkjs/constructSignatureFromMnemonicProofInput.mjs +2 -0
- package/common/src/functions/snarkjs/constructSolanaZkProof.cjs +1 -1
- package/common/src/functions/snarkjs/constructSolanaZkProof.d.ts +4 -1
- package/common/src/functions/snarkjs/constructSolanaZkProof.mjs +62 -61
- package/common/src/functions/snarkjs/constructTxEnclave.cjs +1 -0
- package/common/src/functions/snarkjs/constructTxEnclave.d.ts +34 -0
- package/common/src/functions/snarkjs/constructTxEnclave.mjs +95 -0
- package/common/src/functions/snarkjs/constructTxEnclaveVerify.cjs +1 -0
- package/common/src/functions/snarkjs/constructTxEnclaveVerify.d.ts +5 -0
- package/common/src/functions/snarkjs/constructTxEnclaveVerify.mjs +295 -0
- package/common/src/functions/snarkjs/fetchMerkleTreeSiblings.d.ts +1 -3
- package/common/src/functions/snarkjs/fetchOnChainRootHashes.cjs +1 -1
- package/common/src/functions/snarkjs/fetchOnChainRootHashes.d.ts +1 -0
- package/common/src/functions/snarkjs/fetchOnChainRootHashes.mjs +16 -18
- package/common/src/functions/snarkjs/fetchTronInsertionSiblings.cjs +1 -0
- package/common/src/functions/snarkjs/fetchTronInsertionSiblings.d.ts +7 -0
- package/common/src/functions/snarkjs/fetchTronInsertionSiblings.mjs +13 -0
- package/common/src/functions/snarkjs/generateCircomData.cjs +1 -1
- package/common/src/functions/snarkjs/generateCircomData.d.ts +1 -1
- package/common/src/functions/snarkjs/generateCircomData.mjs +41 -31
- package/common/src/functions/snarkjs/generateMainAndCommitmentZkProof.cjs +1 -1
- package/common/src/functions/snarkjs/generateMainAndCommitmentZkProof.d.ts +1 -1
- package/common/src/functions/snarkjs/generateMainAndCommitmentZkProof.mjs +7 -7
- package/common/src/functions/snarkjs/generateSignatureFromMnemonicProof.cjs +1 -0
- package/common/src/functions/snarkjs/generateSignatureFromMnemonicProof.d.ts +2 -0
- package/common/src/functions/snarkjs/generateSignatureFromMnemonicProof.mjs +3 -0
- package/common/src/functions/snarkjs/generateZkProof.cjs +1 -1
- package/common/src/functions/snarkjs/generateZkProof.d.ts +1 -1
- package/common/src/functions/snarkjs/generateZkProof.mjs +9 -16
- package/common/src/functions/snarkjs/getMerkleTreeSiblingsAndRootHashes.cjs +1 -1
- package/common/src/functions/snarkjs/getMerkleTreeSiblingsAndRootHashes.d.ts +4 -2
- package/common/src/functions/snarkjs/getMerkleTreeSiblingsAndRootHashes.mjs +19 -13
- package/common/src/functions/snarkjs/getZKFiles.cjs +1 -1
- package/common/src/functions/snarkjs/getZKFiles.mjs +9 -3
- package/common/src/functions/snarkjs/index.cjs +1 -1
- package/common/src/functions/snarkjs/index.d.ts +2 -0
- package/common/src/functions/snarkjs/index.mjs +2 -0
- package/common/src/functions/snarkjs/signedMessageHash.cjs +1 -1
- package/common/src/functions/snarkjs/signedMessageHash.d.ts +16 -0
- package/common/src/functions/snarkjs/signedMessageHash.mjs +36 -7
- package/common/src/functions/snarkjs/verifySignedEnclaveResponse.cjs +1 -0
- package/common/src/functions/snarkjs/verifySignedEnclaveResponse.d.ts +1 -0
- package/common/src/functions/snarkjs/verifySignedEnclaveResponse.mjs +11 -0
- package/common/src/functions/utils/addresses.cjs +1 -1
- package/common/src/functions/utils/addresses.d.ts +2 -1
- package/common/src/functions/utils/addresses.mjs +30 -21
- package/common/src/functions/utils/bridge-arrival.utils.cjs +1 -0
- package/common/src/functions/utils/bridge-arrival.utils.d.ts +1 -0
- package/common/src/functions/utils/bridge-arrival.utils.mjs +16 -0
- package/common/src/functions/utils/bridge-claimable-utxo.utils.cjs +1 -0
- package/common/src/functions/utils/bridge-claimable-utxo.utils.d.ts +19 -0
- package/common/src/functions/utils/bridge-claimable-utxo.utils.mjs +24 -0
- package/common/src/functions/utils/bridge-claimable.utils.cjs +1 -0
- package/common/src/functions/utils/bridge-claimable.utils.d.ts +15 -0
- package/common/src/functions/utils/bridge-claimable.utils.mjs +3 -0
- package/common/src/functions/utils/bridge-flow.utils.cjs +1 -0
- package/common/src/functions/utils/bridge-flow.utils.d.ts +4 -0
- package/common/src/functions/utils/bridge-flow.utils.mjs +2 -0
- package/common/src/functions/utils/buildClaimableDepositPlan.d.ts +3 -2
- package/common/src/functions/utils/convertEmporiumOpToCallInfo.cjs +1 -1
- package/common/src/functions/utils/convertEmporiumOpToCallInfo.mjs +5 -10
- package/common/src/functions/utils/convertIntegrationProviderToExternalActionId.cjs +1 -1
- package/common/src/functions/utils/convertIntegrationProviderToExternalActionId.mjs +1 -1
- package/common/src/functions/utils/create-provider.cjs +1 -1
- package/common/src/functions/utils/create-provider.d.ts +9 -2
- package/common/src/functions/utils/create-provider.mjs +45 -9
- package/common/src/functions/utils/deposit-claimable.utils.cjs +1 -1
- package/common/src/functions/utils/deposit-claimable.utils.d.ts +2 -5
- package/common/src/functions/utils/deposit-claimable.utils.mjs +3 -6
- package/common/src/functions/utils/enclave-recipient-info-storage.cjs +1 -1
- package/common/src/functions/utils/enclave-recipient-info-storage.d.ts +4 -1
- package/common/src/functions/utils/enclave-recipient-info-storage.mjs +1 -0
- package/common/src/functions/utils/enclave-signature-storage.cjs +1 -1
- package/common/src/functions/utils/enclave-signature-storage.d.ts +1 -1
- package/common/src/functions/utils/enclave-signature-storage.mjs +3 -3
- package/common/src/functions/utils/enclave-utxo-storage.cjs +1 -1
- package/common/src/functions/utils/enclave-utxo-storage.d.ts +6 -7
- package/common/src/functions/utils/enclave-utxo-storage.mjs +16 -2
- package/common/src/functions/utils/enclaveSessionSigning.cjs +1 -0
- package/common/src/functions/utils/enclaveSessionSigning.d.ts +16 -0
- package/common/src/functions/utils/enclaveSessionSigning.mjs +2 -0
- package/common/src/functions/utils/encodeTokenWithId.cjs +1 -1
- package/common/src/functions/utils/encodeTokenWithId.d.ts +1 -2
- package/common/src/functions/utils/encodeTokenWithId.mjs +2 -5
- package/common/src/functions/utils/encryptInputForEnclave.cjs +1 -1
- package/common/src/functions/utils/encryptInputForEnclave.d.ts +8 -0
- package/common/src/functions/utils/encryptInputForEnclave.mjs +43 -23
- package/common/src/functions/utils/erc20tokenFunctions.cjs +1 -1
- package/common/src/functions/utils/erc20tokenFunctions.mjs +2 -15
- package/common/src/functions/utils/fees.utils.cjs +1 -1
- package/common/src/functions/utils/fees.utils.d.ts +3 -0
- package/common/src/functions/utils/fees.utils.mjs +42 -29
- package/common/src/functions/utils/formatter.d.ts +2 -0
- package/common/src/functions/utils/getDataFromTransaction.d.ts +4 -3
- package/common/src/functions/utils/getRecipientInfoFromUserKeys.cjs +1 -1
- package/common/src/functions/utils/getRecipientInfoFromUserKeys.mjs +2 -3
- package/common/src/functions/utils/getUtxosFromReceipt.utils.cjs +1 -1
- package/common/src/functions/utils/getUtxosFromReceipt.utils.d.ts +1 -1
- package/common/src/functions/utils/getUtxosFromReceipt.utils.mjs +2 -26
- package/common/src/functions/utils/getUtxosFromReceiptSolana.cjs +1 -1
- package/common/src/functions/utils/getUtxosFromReceiptSolana.mjs +7 -24
- package/common/src/functions/utils/index.cjs +1 -1
- package/common/src/functions/utils/index.d.ts +17 -3
- package/common/src/functions/utils/index.mjs +27 -13
- package/common/src/functions/utils/ipfs.d.ts +2 -3
- package/common/src/functions/utils/legacyKeys.cjs +1 -0
- package/common/src/functions/utils/legacyKeys.d.ts +10 -0
- package/common/src/functions/utils/legacyKeys.mjs +8 -0
- package/common/src/functions/utils/lifi.utils.d.ts +3 -0
- package/common/src/functions/utils/mnemonics.cjs +1 -1
- package/common/src/functions/utils/mnemonics.mjs +4 -6
- package/common/src/functions/utils/nearIntents.utils.cjs +1 -1
- package/common/src/functions/utils/nearIntents.utils.mjs +27 -13
- package/common/src/functions/utils/networks.utils.d.ts +1 -0
- package/common/src/functions/utils/prepareHinkal.cjs +1 -1
- package/common/src/functions/utils/prepareHinkal.d.ts +1 -3
- package/common/src/functions/utils/prepareHinkal.mjs +2 -1
- package/common/src/functions/utils/process.utils.cjs +1 -1
- package/common/src/functions/utils/process.utils.d.ts +0 -1
- package/common/src/functions/utils/process.utils.mjs +2 -11
- package/common/src/functions/utils/proxyAvatar.utils.cjs +1 -0
- package/common/src/functions/utils/proxyAvatar.utils.mjs +3 -0
- package/common/src/functions/utils/publicBalance.utils.cjs +1 -1
- package/common/src/functions/utils/publicBalance.utils.d.ts +0 -1
- package/common/src/functions/utils/publicBalance.utils.mjs +37 -23
- package/common/src/functions/utils/recovery-balance.utils.cjs +1 -0
- package/common/src/functions/utils/recovery-balance.utils.d.ts +2 -0
- package/common/src/functions/utils/recovery-balance.utils.mjs +1 -0
- package/common/src/functions/utils/resolve-domain-address.cjs +1 -0
- package/common/src/functions/utils/resolve-domain-address.d.ts +4 -0
- package/common/src/functions/utils/resolve-domain-address.mjs +3 -0
- package/common/src/functions/utils/serialize-utxos.utils.cjs +1 -1
- package/common/src/functions/utils/serialize-utxos.utils.mjs +6 -4
- package/common/src/functions/utils/solana-program.utils.cjs +1 -0
- package/common/src/functions/utils/solana-program.utils.d.ts +3 -0
- package/common/src/functions/utils/solana-program.utils.mjs +17 -0
- package/common/src/functions/utils/solana-sponsored.utils.cjs +1 -0
- package/common/src/functions/utils/solana-sponsored.utils.d.ts +22 -0
- package/common/src/functions/utils/solana-sponsored.utils.mjs +30 -0
- package/common/src/functions/utils/solanaMint.utils.cjs +1 -1
- package/common/src/functions/utils/solanaMint.utils.d.ts +7 -0
- package/common/src/functions/utils/solanaMint.utils.mjs +18 -8
- package/common/src/functions/utils/sponsored-shield.utils.cjs +1 -0
- package/common/src/functions/utils/sponsored-shield.utils.d.ts +3 -0
- package/common/src/functions/utils/sponsored-shield.utils.mjs +3 -0
- package/common/src/functions/utils/temp-wallet.utils.cjs +1 -0
- package/common/src/functions/utils/temp-wallet.utils.d.ts +8 -0
- package/common/src/functions/utils/temp-wallet.utils.mjs +43 -0
- package/common/src/functions/utils/temporary-wallet-recovery.utils.cjs +1 -0
- package/common/src/functions/utils/temporary-wallet-recovery.utils.d.ts +7 -0
- package/common/src/functions/utils/temporary-wallet-recovery.utils.mjs +10 -0
- package/common/src/functions/utils/transfer-claimable.utils.cjs +1 -1
- package/common/src/functions/utils/transfer-claimable.utils.d.ts +1 -2
- package/common/src/functions/utils/transfer-claimable.utils.mjs +1 -4
- package/common/src/functions/utils/tron.utils.cjs +1 -1
- package/common/src/functions/utils/tron.utils.d.ts +5 -14
- package/common/src/functions/utils/tron.utils.mjs +89 -152
- package/common/src/functions/utils/tronSimulation.utils.cjs +1 -1
- package/common/src/functions/utils/tronSimulation.utils.mjs +4 -6
- package/common/src/functions/utils/tx-confirmation.utils.cjs +1 -1
- package/common/src/functions/utils/tx-confirmation.utils.d.ts +1 -0
- package/common/src/functions/utils/tx-confirmation.utils.mjs +16 -13
- package/common/src/functions/utils/validateWalletAddress.cjs +1 -0
- package/common/src/functions/utils/validateWalletAddress.d.ts +1 -0
- package/common/src/functions/utils/validateWalletAddress.mjs +2 -0
- package/common/src/functions/utils/voidWallets.utils.cjs +1 -0
- package/common/src/functions/utils/voidWallets.utils.d.ts +4 -0
- package/common/src/functions/utils/voidWallets.utils.mjs +1 -0
- package/common/src/functions/utils/waasStamp.cjs +1 -0
- package/common/src/functions/utils/waasStamp.d.ts +5 -0
- package/common/src/functions/utils/waasStamp.mjs +2 -0
- package/common/src/functions/web3/connectors.utils.d.ts +1 -0
- package/common/src/functions/web3/etherFunctions.d.ts +1 -0
- package/common/src/functions/web3/events/getInputUtxoAndBalance.cjs +1 -1
- package/common/src/functions/web3/events/getInputUtxoAndBalance.d.ts +5 -12
- package/common/src/functions/web3/events/getInputUtxoAndBalance.mjs +50 -61
- package/common/src/functions/web3/events/getInputUtxosEnclave.cjs +1 -1
- package/common/src/functions/web3/events/getInputUtxosEnclave.d.ts +4 -3
- package/common/src/functions/web3/events/getInputUtxosEnclave.mjs +42 -35
- package/common/src/functions/web3/events/getShieldedBalance.cjs +1 -1
- package/common/src/functions/web3/events/getShieldedBalance.d.ts +4 -4
- package/common/src/functions/web3/events/getShieldedBalance.mjs +109 -93
- package/common/src/functions/web3/fetchSolanaMerkleTreeRootHash.cjs +1 -1
- package/common/src/functions/web3/fetchSolanaMerkleTreeRootHash.mjs +9 -6
- package/common/src/functions/web3/functionCalls/approveToken.cjs +1 -1
- package/common/src/functions/web3/functionCalls/approveToken.d.ts +1 -1
- package/common/src/functions/web3/functionCalls/approveToken.mjs +21 -107
- package/common/src/functions/web3/functionCalls/constructBatchCall.cjs +1 -1
- package/common/src/functions/web3/functionCalls/constructBatchCall.d.ts +2 -2
- package/common/src/functions/web3/functionCalls/constructBatchCall.mjs +23 -18
- package/common/src/functions/web3/functionCalls/submitProof.cjs +1 -0
- package/common/src/functions/web3/functionCalls/submitProof.d.ts +5 -0
- package/common/src/functions/web3/functionCalls/submitProof.mjs +26 -0
- package/common/src/functions/web3/functionCalls/transactCallDirectTron.cjs +1 -1
- package/common/src/functions/web3/functionCalls/transactCallDirectTron.d.ts +7 -3
- package/common/src/functions/web3/functionCalls/transactCallDirectTron.mjs +81 -53
- package/common/src/functions/web3/functionCalls/transactCallRelayer.cjs +1 -1
- package/common/src/functions/web3/functionCalls/transactCallRelayer.d.ts +8 -13
- package/common/src/functions/web3/functionCalls/transactCallRelayer.mjs +12 -8
- package/common/src/functions/web3/getPublicAddressBalance.cjs +1 -1
- package/common/src/functions/web3/getPublicAddressBalance.d.ts +1 -2
- package/common/src/functions/web3/getPublicAddressBalance.mjs +6 -5
- package/common/src/functions/web3/getTokenHolder.cjs +1 -1
- package/common/src/functions/web3/getTokenHolder.mjs +3 -2
- package/common/src/functions/web3/index.cjs +1 -1
- package/common/src/functions/web3/index.d.ts +1 -4
- package/common/src/functions/web3/index.mjs +1 -4
- package/common/src/functions/web3/lifiAPI.cjs +1 -1
- package/common/src/functions/web3/lifiAPI.mjs +38 -7
- package/common/src/providers/EthersProviderAdapter.cjs +1 -1
- package/common/src/providers/EthersProviderAdapter.d.ts +0 -1
- package/common/src/providers/EthersProviderAdapter.mjs +0 -3
- package/common/src/providers/SolanaProviderAdapter.cjs +1 -1
- package/common/src/providers/SolanaProviderAdapter.d.ts +1 -5
- package/common/src/providers/SolanaProviderAdapter.mjs +4 -11
- package/common/src/providers/TronProviderAdapter.cjs +1 -1
- package/common/src/providers/TronProviderAdapter.d.ts +0 -1
- package/common/src/providers/TronProviderAdapter.mjs +7 -4
- package/common/src/providers/WagmiProviderAdapter.cjs +1 -1
- package/common/src/providers/WagmiProviderAdapter.d.ts +0 -1
- package/common/src/providers/WagmiProviderAdapter.mjs +32 -39
- package/common/src/types/API.types.d.ts +0 -4
- package/common/src/types/WeeklyAnalytics.types.d.ts +1 -26
- package/common/src/types/activities.types.cjs +1 -1
- package/common/src/types/activities.types.d.ts +0 -9
- package/common/src/types/activities.types.mjs +1 -1
- package/common/src/types/admin.types.cjs +1 -1
- package/common/src/types/admin.types.d.ts +4 -1
- package/common/src/types/admin.types.mjs +1 -1
- package/common/src/types/bridging-tx.types.d.ts +26 -3
- package/common/src/types/cache.types.cjs +1 -1
- package/common/src/types/cache.types.d.ts +4 -3
- package/common/src/types/cache.types.mjs +1 -1
- package/common/src/types/circom-data.types.cjs +1 -1
- package/common/src/types/circom-data.types.d.ts +32 -27
- package/common/src/types/circom-data.types.mjs +1 -1
- package/common/src/types/commitments.types.d.ts +2 -0
- package/common/src/types/dashboard-account.d.ts +15 -0
- package/common/src/types/dashboard-payout.types.d.ts +1 -0
- package/common/src/types/dashboard-transaction.types.d.ts +3 -0
- package/common/src/types/enclaveApi.types.d.ts +77 -0
- package/common/src/types/ethereum-network.types.cjs +1 -1
- package/common/src/types/ethereum-network.types.d.ts +13 -29
- package/common/src/types/ethereum-network.types.mjs +1 -1
- package/common/src/types/events.types.d.ts +1 -0
- package/common/src/types/external-action.types.cjs +1 -1
- package/common/src/types/external-action.types.d.ts +4 -7
- package/common/src/types/external-action.types.mjs +1 -1
- package/common/src/types/hinkal.types.cjs +1 -1
- package/common/src/types/hinkal.types.d.ts +12 -29
- package/common/src/types/hinkal.types.mjs +12 -20
- package/common/src/types/index.cjs +1 -1
- package/common/src/types/index.d.ts +6 -5
- package/common/src/types/index.mjs +3 -2
- package/common/src/types/near-intents.types.d.ts +2 -0
- package/common/src/types/new-rewards.type.d.ts +0 -70
- package/common/src/types/offscreen.types.cjs +1 -1
- package/common/src/types/offscreen.types.d.ts +0 -1
- package/common/src/types/offscreen.types.mjs +1 -1
- package/common/src/types/pay-activities.types.d.ts +24 -4
- package/common/src/types/payout-notification.types.d.ts +11 -0
- package/common/src/types/proxy-progress.types.d.ts +5 -0
- package/common/src/types/remote-proof.types.d.ts +5 -6
- package/common/src/types/remote-tx-build.types.d.ts +298 -0
- package/common/src/types/scheduled-transactions.types.d.ts +25 -12
- package/common/src/types/snark.types.d.ts +1 -3
- package/common/src/types/solana-transact.types.cjs +1 -0
- package/common/src/types/solana-transact.types.d.ts +35 -0
- package/common/src/types/solana-transact.types.mjs +6 -0
- package/common/src/types/solana.types.cjs +1 -0
- package/common/src/types/solana.types.d.ts +12 -3
- package/common/src/types/solana.types.mjs +6 -0
- package/common/src/types/temp-wallet.types.d.ts +9 -0
- package/common/src/types/tenderly.api.types.d.ts +70 -0
- package/common/src/types/token.types.cjs +1 -1
- package/common/src/types/token.types.d.ts +10 -0
- package/common/src/types/token.types.mjs +2 -2
- package/common/src/types/transact.types.cjs +1 -0
- package/common/src/types/transact.types.d.ts +53 -0
- package/common/src/types/transact.types.mjs +6 -0
- package/common/src/types/transaction.types.d.ts +0 -1
- package/common/src/types/transactions.types.d.ts +0 -1
- package/common/src/webworker/logError-ScFy7p5w.js +2 -0
- package/common/src/webworker/package.json +26 -25
- package/common/src/webworker/snarkjsWorker/snarkjsWorkerLauncher.ts?worker&url.cjs +1 -1
- package/common/src/webworker/snarkjsWorker/snarkjsWorkerLauncher.ts?worker&url.mjs +1 -1
- package/common/src/webworker/snarkjsWorkerNode.cjs +1 -1
- package/common/src/webworker/utxoWorker/utxoWorker.types.d.ts +4 -2
- package/common/src/webworker/utxoWorker/utxoWorkerLauncher.ts?worker&url.cjs +1 -1
- package/common/src/webworker/utxoWorker/utxoWorkerLauncher.ts?worker&url.mjs +1 -1
- package/common/src/webworker/utxoWorkerNode.cjs +1 -1
- package/common/src/webworker/viteWorkerURL.constant.cjs +3 -3
- package/common/src/webworker/viteWorkerURL.constant.mjs +3 -3
- package/common/src/webworker/workerProxy-B_eSl85g.js +1 -0
- package/common/src/webworker/zkProofWorker/zkProofWorkerLauncher.ts?worker&url.cjs +1 -1
- package/common/src/webworker/zkProofWorker/zkProofWorkerLauncher.ts?worker&url.mjs +1 -1
- package/common/src/webworker/zkProofWorkerNode.cjs +1 -1
- package/index.cjs +1 -1
- package/index.mjs +1 -1
- package/internal/swapApi.cjs +1 -1
- package/internal/swapApi.d.ts +3 -3
- package/internal/swapApi.mjs +22 -25
- package/package.json +26 -25
- package/providers/prepareEthersHinkal.cjs +1 -1
- package/providers/prepareEthersHinkal.d.ts +1 -0
- package/providers/prepareEthersHinkal.mjs +2 -2
- package/providers/prepareSolanaHinkal.cjs +1 -1
- package/providers/prepareSolanaHinkal.d.ts +1 -0
- package/providers/prepareSolanaHinkal.mjs +2 -2
- package/providers/prepareTronHinkal.cjs +1 -1
- package/providers/prepareTronHinkal.d.ts +1 -0
- package/providers/prepareTronHinkal.mjs +2 -2
- package/providers/prepareWagmiHinkal.cjs +1 -1
- package/providers/prepareWagmiHinkal.d.ts +1 -0
- package/providers/prepareWagmiHinkal.mjs +2 -2
- package/services/Hinkal.cjs +1 -1
- package/services/Hinkal.d.ts +16 -10
- package/services/Hinkal.mjs +29 -17
- package/types/IHinkal.d.ts +16 -10
- package/types/swap.types.d.ts +3 -20
- package/common/src/API/accessCodeCalls.cjs +0 -1
- package/common/src/API/accessCodeCalls.d.ts +0 -23
- package/common/src/API/accessCodeCalls.mjs +0 -13
- package/common/src/API/brotherhoodCalls.cjs +0 -1
- package/common/src/API/brotherhoodCalls.d.ts +0 -82
- package/common/src/API/brotherhoodCalls.mjs +0 -17
- package/common/src/API/callOdosAPI.cjs +0 -1
- package/common/src/API/callOdosAPI.d.ts +0 -63
- package/common/src/API/callOdosAPI.mjs +0 -18
- package/common/src/API/callOneInchAPI.cjs +0 -1
- package/common/src/API/callOneInchAPI.d.ts +0 -18
- package/common/src/API/callOneInchAPI.mjs +0 -13
- package/common/src/API/deposit-and-withdraw-status-calls.cjs +0 -1
- package/common/src/API/deposit-and-withdraw-status-calls.d.ts +0 -21
- package/common/src/API/deposit-and-withdraw-status-calls.mjs +0 -13
- package/common/src/API/generate-trading-points.cjs +0 -1
- package/common/src/API/generate-trading-points.d.ts +0 -27
- package/common/src/API/generate-trading-points.mjs +0 -23
- package/common/src/API/getAnyRecipientInfo.d.ts +0 -1
- package/common/src/API/leaderboardCalls.cjs +0 -1
- package/common/src/API/leaderboardCalls.d.ts +0 -14
- package/common/src/API/leaderboardCalls.mjs +0 -8
- package/common/src/API/referralsCalls.cjs +0 -1
- package/common/src/API/referralsCalls.d.ts +0 -22
- package/common/src/API/referralsCalls.mjs +0 -11
- package/common/src/API/send-telegram-callback.cjs +0 -1
- package/common/src/API/send-telegram-callback.d.ts +0 -7
- package/common/src/API/send-telegram-callback.mjs +0 -11
- package/common/src/constants/mystery-boxes.constants.d.ts +0 -0
- package/common/src/constants/price-impact.constants.d.ts +0 -2
- package/common/src/constants/rewards.constants.d.ts +0 -15
- package/common/src/constants/tasks.constants.cjs +0 -1
- package/common/src/constants/tasks.constants.d.ts +0 -9
- package/common/src/constants/tasks.constants.mjs +0 -124
- package/common/src/crypto/ecdh-dual-path.cjs +0 -1
- package/common/src/crypto/ecdh-dual-path.d.ts +0 -13
- package/common/src/crypto/ecdh-dual-path.mjs +0 -6
- package/common/src/data-structures/Hinkal/hinkalMultiSend.cjs +0 -1
- package/common/src/data-structures/Hinkal/hinkalMultiSend.d.ts +0 -3
- package/common/src/data-structures/Hinkal/hinkalMultiSend.mjs +0 -12
- package/common/src/data-structures/Hinkal/hinkalProoflessDepositViaWrapper.cjs +0 -1
- package/common/src/data-structures/Hinkal/hinkalProoflessDepositViaWrapper.d.ts +0 -6
- package/common/src/data-structures/Hinkal/hinkalProoflessDepositViaWrapper.mjs +0 -128
- package/common/src/data-structures/Hinkal/prepareDepositOnChainUtxosZkProof.cjs +0 -1
- package/common/src/data-structures/Hinkal/prepareDepositOnChainUtxosZkProof.d.ts +0 -22
- package/common/src/data-structures/Hinkal/prepareDepositOnChainUtxosZkProof.mjs +0 -34
- package/common/src/data-structures/TokenDBs/AlchemyPublicTokensDB.cjs +0 -1
- package/common/src/data-structures/TokenDBs/AlchemyPublicTokensDB.mjs +0 -172
- package/common/src/data-structures/TokenDBs/ArcPublicTokensDB.cjs +0 -1
- package/common/src/data-structures/TokenDBs/ArcPublicTokensDB.mjs +0 -94
- package/common/src/data-structures/TokenDBs/EventsPublicTokensDB.cjs +0 -1
- package/common/src/data-structures/TokenDBs/EventsPublicTokensDB.mjs +0 -134
- package/common/src/data-structures/TokenDBs/PublicTokensDB.cjs +0 -1
- package/common/src/data-structures/TokenDBs/PublicTokensDB.mjs +0 -32
- package/common/src/data-structures/TokenDBs/TempoPublicTokensDB.cjs +0 -1
- package/common/src/data-structures/TokenDBs/TempoPublicTokensDB.mjs +0 -41
- package/common/src/data-structures/TokenDBs/TronPublicTokensDB.cjs +0 -1
- package/common/src/data-structures/TokenDBs/TronPublicTokensDB.mjs +0 -47
- package/common/src/data-structures/TokenDBs/index.cjs +0 -1
- package/common/src/data-structures/TokenDBs/index.mjs +0 -6
- package/common/src/externalABIs/IQuoterV2.json.cjs +0 -1
- package/common/src/externalABIs/IQuoterV2.json.mjs +0 -203
- package/common/src/externalABIs/ISwapRouter.json.cjs +0 -1
- package/common/src/externalABIs/ISwapRouter.json.mjs +0 -537
- package/common/src/externalABIs/IUniswapV3Factory.json.cjs +0 -1
- package/common/src/externalABIs/IUniswapV3Factory.json.mjs +0 -188
- package/common/src/externalABIs/IUniswapV3Pool.json.cjs +0 -1
- package/common/src/externalABIs/IUniswapV3Pool.json.mjs +0 -938
- package/common/src/externalABIs/UniswapV2PoolAbi.json.cjs +0 -1
- package/common/src/externalABIs/UniswapV2PoolAbi.json.mjs +0 -78
- package/common/src/functions/pre-transaction/interaction-to-action.cjs +0 -1
- package/common/src/functions/pre-transaction/interaction-to-action.d.ts +0 -2
- package/common/src/functions/pre-transaction/interaction-to-action.mjs +0 -1
- package/common/src/functions/pre-transaction/recipientUtxoProcessing.cjs +0 -1
- package/common/src/functions/pre-transaction/recipientUtxoProcessing.d.ts +0 -3
- package/common/src/functions/pre-transaction/recipientUtxoProcessing.mjs +0 -32
- package/common/src/functions/pre-transaction/waitForDepositedUtxosInMerkleTree.cjs +0 -1
- package/common/src/functions/pre-transaction/waitForDepositedUtxosInMerkleTree.mjs +0 -29
- package/common/src/functions/private-wallet/opProducer.cjs +0 -1
- package/common/src/functions/private-wallet/opProducer.d.ts +0 -5
- package/common/src/functions/private-wallet/opProducer.mjs +0 -3
- package/common/src/functions/snarkjs/generateZkProofEnclave.cjs +0 -1
- package/common/src/functions/snarkjs/generateZkProofEnclave.d.ts +0 -5
- package/common/src/functions/snarkjs/generateZkProofEnclave.mjs +0 -27
- package/common/src/functions/utils/bit.operations.cjs +0 -1
- package/common/src/functions/utils/bit.operations.d.ts +0 -3
- package/common/src/functions/utils/bit.operations.mjs +0 -4
- package/common/src/functions/utils/get-signature-header.cjs +0 -1
- package/common/src/functions/utils/get-signature-header.d.ts +0 -5
- package/common/src/functions/utils/get-signature-header.mjs +0 -4
- package/common/src/functions/utils/ipfs.cjs +0 -1
- package/common/src/functions/utils/ipfs.mjs +0 -1
- package/common/src/functions/utils/reloadPage.cjs +0 -1
- package/common/src/functions/utils/reloadPage.mjs +0 -4
- package/common/src/functions/web3/getSolanaPriorityFee.cjs +0 -1
- package/common/src/functions/web3/getSolanaPriorityFee.d.ts +0 -3
- package/common/src/functions/web3/getSolanaPriorityFee.mjs +0 -26
- package/common/src/functions/web3/odosAPI.cjs +0 -1
- package/common/src/functions/web3/odosAPI.d.ts +0 -5
- package/common/src/functions/web3/odosAPI.mjs +0 -35
- package/common/src/functions/web3/oneInchAPI.cjs +0 -1
- package/common/src/functions/web3/oneInchAPI.d.ts +0 -5
- package/common/src/functions/web3/oneInchAPI.mjs +0 -34
- package/common/src/functions/web3/uniswapAPI.cjs +0 -1
- package/common/src/functions/web3/uniswapAPI.d.ts +0 -16
- package/common/src/functions/web3/uniswapAPI.mjs +0 -60
- package/common/src/types/brotherhood-user.types.d.ts +0 -11
- package/common/src/types/crypto.types.d.ts +0 -8
- package/common/src/types/generatePoints.d.ts +0 -14
- package/common/src/types/new-rewards.type.cjs +0 -1
- package/common/src/types/new-rewards.type.mjs +0 -10
- package/common/src/types/referral.types.d.ts +0 -12
- package/common/src/types/rewards.types.d.ts +0 -34
- package/common/src/types/scheduled-transactions.types.cjs +0 -1
- package/common/src/types/scheduled-transactions.types.mjs +0 -6
- package/common/src/types/token-with-id.types.d.ts +0 -4
- package/common/src/webworker/logError-CZYZ3oyV.js +0 -2
- package/common/src/webworker/workerProxy-DPeuP2Mg.js +0 -1
|
@@ -3,4 +3,5 @@ import { Types as TronWebTypes } from 'tronweb';
|
|
|
3
3
|
import { IHinkal } from './IHinkal';
|
|
4
4
|
import { AdminTransactionType, ERC20Token } from '../../types';
|
|
5
5
|
export declare const hinkalDeposit: (hinkal: IHinkal, erc20Tokens: ERC20Token[], amountChanges: bigint[], preEstimateGas?: boolean, returnTxData?: boolean) => Promise<ethers.TransactionResponse | ethers.TransactionRequest | string | TronWebTypes.Transaction<TronWebTypes.TriggerSmartContract>>;
|
|
6
|
+
export declare const hinkalDepositForOthers: (hinkal: IHinkal, erc20Tokens: ERC20Token[], amountsByRecipient: bigint[][], recipientInfos: string[], preEstimateGas?: boolean, returnTxData?: boolean, action?: AdminTransactionType) => Promise<ethers.TransactionResponse | ethers.TransactionRequest | string | TronWebTypes.Transaction<TronWebTypes.TriggerSmartContract>>;
|
|
6
7
|
export declare const hinkalDepositForOther: (hinkal: IHinkal, erc20Tokens: ERC20Token[], amountChanges: bigint[], recipientInfo: string, preEstimateGas?: boolean, returnTxData?: boolean, action?: AdminTransactionType) => Promise<ethers.TransactionResponse | ethers.TransactionRequest | string | TronWebTypes.Transaction<TronWebTypes.TriggerSmartContract>>;
|
|
@@ -1,121 +1,52 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { validateAndGetChainId as v } from "../../functions/utils/token-check.utils.mjs";
|
|
10
|
-
import { addPaddingToUtxos as y } from "../../functions/web3/events/getShieldedBalance.mjs";
|
|
11
|
-
import { outputUtxoProcessing as b } from "../../functions/pre-transaction/outputUtxoProcessing.mjs";
|
|
12
|
-
import { constructAdminData as x } from "../../functions/pre-transaction/constructAdminData.mjs";
|
|
13
|
-
import { simulateTronTransaction as S } from "../../functions/utils/tronSimulation.utils.mjs";
|
|
14
|
-
import { constructZkProof as C } from "../../functions/snarkjs/constructGeneralZkProof.mjs";
|
|
15
|
-
import { waitForTronErc20Approvals as w } from "../../functions/web3/functionCalls/waitForErc20Approvals.mjs";
|
|
16
|
-
import { transactCallDirect as T } from "../../functions/web3/functionCalls/transactCallDirect.mjs";
|
|
17
|
-
import { emitTxPublicData as E } from "../../API/admin-calls.mjs";
|
|
1
|
+
import { transactionErrorCodes as e } from "../../error-handling/error-codes.constants.mjs";
|
|
2
|
+
import { addressToHexFormat as t } from "../../functions/utils/tron.utils.mjs";
|
|
3
|
+
import { isValidPrivateAddress as n } from "../../functions/utils/addresses.mjs";
|
|
4
|
+
import { SubmitMode as r } from "../../types/transact.types.mjs";
|
|
5
|
+
import { validateAndGetChainId as i } from "../../functions/utils/token-check.utils.mjs";
|
|
6
|
+
import { constructAdminData as a } from "../../functions/pre-transaction/constructAdminData.mjs";
|
|
7
|
+
import { hinkalTransact as o } from "./hinkalTransact.mjs";
|
|
8
|
+
import { emitTxPublicData as s } from "../../API/admin-calls.mjs";
|
|
18
9
|
//#region libs/shared/common/src/data-structures/Hinkal/hinkalDeposit.ts
|
|
19
|
-
var
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
let
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
feeLimit: n,
|
|
61
|
-
callValue: F,
|
|
62
|
-
input: e
|
|
63
|
-
}, [], T);
|
|
64
|
-
return t;
|
|
65
|
-
}
|
|
66
|
-
await u(y, T, C, D), D.size > 0 && await w(y, T, C, Array.from(D.entries()).map(([e, t]) => ({
|
|
67
|
-
tokenAddress: e,
|
|
68
|
-
requiredAmount: t
|
|
69
|
-
}))), l && (await S(r, C, "transact", x, [
|
|
70
|
-
M,
|
|
71
|
-
O,
|
|
72
|
-
k,
|
|
73
|
-
A,
|
|
74
|
-
N,
|
|
75
|
-
P
|
|
76
|
-
], T, E > 0n ? E : void 0), await d(y, r, C, T, p(x, "transact", [
|
|
77
|
-
M,
|
|
78
|
-
O,
|
|
79
|
-
k,
|
|
80
|
-
A,
|
|
81
|
-
N,
|
|
82
|
-
P
|
|
83
|
-
]), E));
|
|
84
|
-
let I = await y.contract(x, C).transact(M, O, k, A, N, P).send({
|
|
85
|
-
feeLimit: n,
|
|
86
|
-
callValue: F
|
|
87
|
-
}), L = typeof I == "string" ? I : I?.txid ?? I?.transaction?.txID;
|
|
88
|
-
if (!L) throw Error("Tron deposit failed (missing txid)");
|
|
89
|
-
return L;
|
|
90
|
-
}, A = async (t, n, a, o = !0, s = !1) => {
|
|
91
|
-
let c = v(n), l = e(c), u = n.map((e) => e.erc20TokenAddress), [{ externalActionData: d, contractTransaction: f, contractToApprove: p }, { inputUtxosArray: m, outputUtxosArray: h }] = await Promise.all([D(t, c), O(t, c, u, a)]), { zkCallData: g, circomData: _, dimData: y } = await C(t.merkleTreeHinkalByChain[c], m, h, t.userKeys, d.externalActionId, d.externalAddress, d.externalActionMetadata, t.generateProofRemotely, i, r, c);
|
|
92
|
-
return l ? await k(t, c, n, a, g, _, y, o, s) : await T(t, c, a, n, g, _, y, p, f, o, s);
|
|
93
|
-
}, j = async (t, n, o, l, u = !0, d = !1, f) => {
|
|
94
|
-
let p = v(n), m = e(p), h = n.map((e) => e.erc20TokenAddress), [g, _, y, , b] = l.split(",");
|
|
95
|
-
if (!c(l)) throw Error(a.RECIPIENT_FORMAT_INCORRECT);
|
|
96
|
-
let S = h.map((e) => [new s({
|
|
97
|
-
amount: 0n,
|
|
98
|
-
erc20TokenAddress: e,
|
|
99
|
-
nullifyingKey: t.userKeys.getShieldedPrivateKey(),
|
|
100
|
-
spendingPublicKey: t.userKeys.getSpendingKeyPair().pubSpendingBJJPoint,
|
|
101
|
-
isNewStyle: !0
|
|
102
|
-
}), new s({
|
|
103
|
-
amount: 0n,
|
|
104
|
-
erc20TokenAddress: e,
|
|
105
|
-
nullifyingKey: t.userKeys.getShieldedPrivateKey(),
|
|
106
|
-
spendingPublicKey: t.userKeys.getSpendingKeyPair().pubSpendingBJJPoint,
|
|
107
|
-
isNewStyle: !0
|
|
108
|
-
})]), w = h.map((e, t) => [new s({
|
|
109
|
-
amount: o[t],
|
|
110
|
-
erc20TokenAddress: e,
|
|
111
|
-
H0: [BigInt(_), BigInt(y)],
|
|
112
|
-
stealthAddress: g,
|
|
113
|
-
encryptionKey: b,
|
|
114
|
-
isNewStyle: !0
|
|
115
|
-
})]), { externalActionData: O, contractTransaction: A, contractToApprove: j } = await D(t, p), { zkCallData: M, circomData: N, dimData: P } = await C(t.merkleTreeHinkalByChain[p], S, w, t.userKeys, O.externalActionId, O.externalAddress, O.externalActionMetadata, t.generateProofRemotely, i, r, p);
|
|
116
|
-
if (m) return await k(t, p, n, o, M, N, P, u, d);
|
|
117
|
-
let F = await T(t, p, o, n, M, N, P, j, A, u, d);
|
|
118
|
-
return E(x(f, p, h, o, await t.getEthereumAddress())), F;
|
|
119
|
-
};
|
|
10
|
+
var c = async (e, n, a, s = !0, c = !1) => {
|
|
11
|
+
let l = i(n);
|
|
12
|
+
return o(e, {
|
|
13
|
+
chainId: l,
|
|
14
|
+
erc20Addresses: n.map((e) => e.erc20TokenAddress),
|
|
15
|
+
amountChanges: a,
|
|
16
|
+
externalAddress: t(await e.getEthereumAddressByChain(l)),
|
|
17
|
+
submit: {
|
|
18
|
+
mode: r.Self,
|
|
19
|
+
erc20Tokens: n,
|
|
20
|
+
approvalAmounts: a,
|
|
21
|
+
preEstimateGas: s,
|
|
22
|
+
returnTxData: c
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}, l = async (c, l, u, d, f = !0, p = !1, m) => {
|
|
26
|
+
if (d.length === 0) throw Error("recipientInfos must not be empty");
|
|
27
|
+
if (u.length !== d.length) throw Error("amountsByRecipient must have one entry per recipientInfo");
|
|
28
|
+
let h = i(l), g = l.map((e) => e.erc20TokenAddress);
|
|
29
|
+
d.forEach((t, r) => {
|
|
30
|
+
if (!n(t)) throw Error(e.RECIPIENT_FORMAT_INCORRECT);
|
|
31
|
+
if (u[r].length !== g.length) throw Error("Each amountsByRecipient entry must have one amount per erc20Token");
|
|
32
|
+
});
|
|
33
|
+
let _ = g.map((e, t) => u.reduce((e, n) => e + n[t], 0n)), v = t(await c.getEthereumAddressByChain(h)), y = await o(c, {
|
|
34
|
+
chainId: h,
|
|
35
|
+
erc20Addresses: g,
|
|
36
|
+
amountChanges: _.map(() => 0n),
|
|
37
|
+
externalAddress: v,
|
|
38
|
+
recipientAddress: d,
|
|
39
|
+
recipientAmounts: u,
|
|
40
|
+
forceEmptyUtxos: !0,
|
|
41
|
+
submit: {
|
|
42
|
+
mode: r.Self,
|
|
43
|
+
erc20Tokens: l,
|
|
44
|
+
approvalAmounts: _,
|
|
45
|
+
preEstimateGas: f,
|
|
46
|
+
returnTxData: p
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
return s(a(m, h, g, _, await c.getEthereumAddress())), y;
|
|
50
|
+
}, u = async (e, t, n, r, i = !0, a = !1, o) => l(e, t, [n], [r], i, a, o);
|
|
120
51
|
//#endregion
|
|
121
|
-
export {
|
|
52
|
+
export { c as hinkalDeposit, u as hinkalDepositForOther };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../../constants/chains.constants.cjs`),t=require(`../../constants/protocol.constants.cjs`),n=require(`../../functions/utils/caseInsensitive.utils.cjs`),r=require(`../../error-handling/error-codes.constants.cjs`),
|
|
1
|
+
const e=require(`../../constants/chains.constants.cjs`),t=require(`../../constants/protocol.constants.cjs`),n=require(`../../functions/utils/caseInsensitive.utils.cjs`),r=require(`../../crypto/poseidon.cjs`),i=require(`../../error-handling/error-codes.constants.cjs`),a=require(`../../functions/web3/etherFunctions.cjs`),o=require(`../../functions/utils/addresses.cjs`),s=require(`../../types/external-action.types.cjs`),c=require(`../../types/transact.types.cjs`),l=require(`../../API/API.cjs`),u=require(`../../functions/utils/token-check.utils.cjs`),d=require(`../../functions/utils/erc20tokenFunctions.cjs`),f=require(`../../functions/pre-transaction/constructAdminData.cjs`),p=require(`../AccountActions/AccountActions.cjs`),m=require(`../../functions/pre-transaction/getFeeStructure.cjs`),h=require(`../../functions/pre-transaction/speculativeUtxo.cjs`),g=require(`../../functions/private-wallet/emporium.helpers.cjs`),_=require(`../../functions/web3/functionCalls/transactCallRelayer.cjs`),v=require(`./hinkalTransact.cjs`),y=require(`../../constants/addresses.constants.cjs`),b=require(`../../functions/utils/convertEmporiumOpToCallInfo.cjs`),x=require(`../../functions/utils/fees.utils.cjs`);require(`../../functions/utils/index.cjs`);const S=require(`./hinkalDepositOnChainUtxos.cjs`);var C=async(o,u,d,m,_,b,x,S)=>{if(m.length===0)throw Error(`No recipients to bridge`);let C=d.erc20TokenAddress,{contractData:w}=e.networkRegistry[u],{emporiumAddress:T}=w;if(!T)throw Error(`No Emporium Address`);let E=y.SWAP_ROUTER_ADDRESSES[s.ExternalActionId.Lifi][u];if(!E)throw Error(`LIFI not configured for chain ${u}`);let D=await o.getRandomRelay(u);if(!D)throw Error(i.transactionErrorCodes.RELAYER_NOT_AVAILABLE);let O=await o.getEthereumAddressByChain(u),k=o.generateProofRemotely,A=k?5:1,j=[];for(let i=0;i<m.length;i+=A){let d=m.slice(i,i+A),y=await Promise.all(d.map(async({utxo:d,nativeUtxo:m,bridgeAmount:y,quote:w,temporarySubAccount:A,recipientAddress:j,destinationChainId:M,destinationTokenAddress:N},P)=>{let F=_[i+P];await l.API.addTemporaryWalletNonce(u,b,A.index);let I=n.caseInsensitiveEqual(C,t.zeroAddress),L=w.nativeFee>0n&&!I,R=[C],z=[-d.amount],B=[!1],V=[[d]];L&&m&&(R.push(t.zeroAddress),z.push(-m.amount),B.push(!1),V.push([m]));let H=g.createLifiBridgeOps(o,u,A.ethAddress,E,C,d.amount,y,w),U=f.constructAdminData(x,u,R,[-d.amount],O),[W,G]=await Promise.all([(async()=>{let n=a.randomBigInt(31),i=k?await g.encodeEmporiumMetadata(u,T,A.privateKey,H,r.poseidonFunction(n),p.AccountActions.getSignerAddressFromPrivateKey(e.getOnchainChainId(u),A.privateKey),F.flatFee):void 0;return v.hinkalTransact(o,{chainId:u,erc20Addresses:R,amountChanges:z,externalAddress:T,externalActionId:s.ExternalActionId.Emporium,externalActionMetadata:i,onChainCreation:B,feeStructure:F,relay:D??t.zeroAddress,messageSeed:n,inputUtxos:V,useBlockedUtxos:!0,speculative:S&&{pendingLeaves:S,inputUtxos:V.map(e=>e.map(h.toSpeculativeUtxo))},subAccountPrivateKey:A.privateKey,emporiumOps:H,submit:{mode:c.SubmitMode.ProofOnly}})})(),g.getAuthorizationDataIfNeeded(u,A.privateKey)]),{zkCallData:K,circomData:q,dimData:J,commitmentValidationData:Y,tronProofSignature:X}=W;return{zkCallData:K,dimData:J,circomData:q,commitmentValidationData:Y,authorizationData:G,recipientAddress:j,adminData:U,tronProofSignature:X,destinationChainId:M,destinationTokenAddress:N,destinationTokenAmount:w.expectedAmount.toString()}}));j.push(...y)}return j},w=e=>e.map(e=>e.quote.nativeFee),T=async(e,n,r,i)=>{let{chainId:a,hashedEthereumAddress:o,feeStructures:s,mainTokenAmounts:c}=i,{needsNativeDeposit:l,txCompletionTime:u,ref:f,action:p,hashedDashboardAccountId:m,preEstimateGas:h}=i,g=[n],v=[c];if(l){let e=await d.getErc20TokenFromAPI(a,t.zeroAddress);if(!e)throw Error(`No native token`);g.push(e),v.push(w(r))}let y=await S.prepareDepositOnChainUtxos(e,a,g,v),{depositedUtxos:b,pendingLeaves:x}=y,[T,E=[]]=b,D=r.map((e,t)=>({...e,utxo:T[t],nativeUtxo:l?E[t]:void 0})),[O,k]=await Promise.all([S.submitDepositOnChainUtxos(e,y,h),C(e,a,n,D,s,o,p,x)]);return{depositTxHash:O,scheduleId:await _.transactCallRelayerBatch(a,k,o,u,f,m,O)}},E=async(e,r,i,a,c,l,d,f,p=!0)=>{if(i.length===0)throw Error(`No recipients to bridge`);let h=r.erc20TokenAddress,_=u.validateAndGetChainId([r]),v=await e.getEthereumAddressByChain(_),S=y.SWAP_ROUTER_ADDRESSES[s.ExternalActionId.Lifi][_];if(!S)throw Error(`LIFI router not configured`);let C=n.caseInsensitiveEqual(h,t.zeroAddress),w;if(c)w=c;else{let n=i[0],r=C?n.bridgeAmount+n.quote.nativeFee:n.bridgeAmount,a=g.createLifiBridgeOps(e,_,n.temporarySubAccount.ethAddress,S,h,r,n.bridgeAmount,n.quote).map(e=>b.convertEmporiumOpToCallInfo(e,n.temporarySubAccount.ethAddress,_));w=await m.getFeeStructure(_,h,[h],s.ExternalActionId.Emporium,a,t.PAY_SEND_VARIABLE_RATE)}let E=i.reduce((e,t)=>e+t.quote.nativeFee,0n),D=i.map(e=>C?e.bridgeAmount+e.quote.nativeFee:e.bridgeAmount),O=await Promise.all(D.map(e=>x.calculateModifiedFeeStructure(_,r,e,w)));return T(e,r,i,{chainId:_,ethereumAddress:v,hashedEthereumAddress:o.hashEthereumAddress(v),feeStructures:O,mainTokenAmounts:D.map((e,t)=>e+O[t].flatFee),needsNativeDeposit:E>0n&&!C,txCompletionTime:a,ref:l,action:d,hashedDashboardAccountId:f?o.hashString(f):void 0,preEstimateGas:p})};exports.hinkalDepositAndBridge=E;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { IHinkal } from './IHinkal';
|
|
2
|
-
import { AdminTransactionType,
|
|
2
|
+
import { AdminTransactionType, DepositAndSendExtendedResult, ERC20Token, PublicBridgeRecipient } from '../../types';
|
|
3
3
|
import { FeeStructure } from '../../types/hinkal.types';
|
|
4
|
-
export declare const hinkalDepositAndBridge: (hinkal: IHinkal, erc20Token: ERC20Token, recipients:
|
|
4
|
+
export declare const hinkalDepositAndBridge: (hinkal: IHinkal, erc20Token: ERC20Token, recipients: PublicBridgeRecipient[], txCompletionTime?: number, feeStructureOverride?: FeeStructure, ref?: string, action?: AdminTransactionType, dashboardAccountId?: string, preEstimateGas?: boolean) => Promise<DepositAndSendExtendedResult>;
|
|
@@ -1,120 +1,124 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { PAY_SEND_VARIABLE_RATE as
|
|
3
|
-
import { caseInsensitiveEqual as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import "../../types/
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import { getFeeStructure as
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
1
|
+
import { getOnchainChainId as e, networkRegistry as t } from "../../constants/chains.constants.mjs";
|
|
2
|
+
import { PAY_SEND_VARIABLE_RATE as n, zeroAddress as r } from "../../constants/protocol.constants.mjs";
|
|
3
|
+
import { caseInsensitiveEqual as i } from "../../functions/utils/caseInsensitive.utils.mjs";
|
|
4
|
+
import { poseidonFunction as a } from "../../crypto/poseidon.mjs";
|
|
5
|
+
import { transactionErrorCodes as o } from "../../error-handling/error-codes.constants.mjs";
|
|
6
|
+
import { randomBigInt as s } from "../../functions/web3/etherFunctions.mjs";
|
|
7
|
+
import { hashEthereumAddress as c, hashString as l } from "../../functions/utils/addresses.mjs";
|
|
8
|
+
import { ExternalActionId as u } from "../../types/external-action.types.mjs";
|
|
9
|
+
import { SubmitMode as d } from "../../types/transact.types.mjs";
|
|
10
|
+
import { API as f } from "../../API/API.mjs";
|
|
11
|
+
import { validateAndGetChainId as p } from "../../functions/utils/token-check.utils.mjs";
|
|
12
|
+
import { getErc20TokenFromAPI as m } from "../../functions/utils/erc20tokenFunctions.mjs";
|
|
13
|
+
import { constructAdminData as h } from "../../functions/pre-transaction/constructAdminData.mjs";
|
|
14
|
+
import { AccountActions as g } from "../AccountActions/AccountActions.mjs";
|
|
15
|
+
import { getFeeStructure as _ } from "../../functions/pre-transaction/getFeeStructure.mjs";
|
|
16
|
+
import { toSpeculativeUtxo as v } from "../../functions/pre-transaction/speculativeUtxo.mjs";
|
|
17
|
+
import { createLifiBridgeOps as y, encodeEmporiumMetadata as b, getAuthorizationDataIfNeeded as x } from "../../functions/private-wallet/emporium.helpers.mjs";
|
|
18
|
+
import { transactCallRelayerBatch as S } from "../../functions/web3/functionCalls/transactCallRelayer.mjs";
|
|
19
|
+
import { hinkalTransact as C } from "./hinkalTransact.mjs";
|
|
20
|
+
import { SWAP_ROUTER_ADDRESSES as w } from "../../constants/addresses.constants.mjs";
|
|
21
|
+
import { convertEmporiumOpToCallInfo as T } from "../../functions/utils/convertEmporiumOpToCallInfo.mjs";
|
|
22
|
+
import { calculateModifiedFeeStructure as E } from "../../functions/utils/fees.utils.mjs";
|
|
20
23
|
import "../../functions/utils/index.mjs";
|
|
21
|
-
import {
|
|
22
|
-
import { constructZkProof as S } from "../../functions/snarkjs/constructGeneralZkProof.mjs";
|
|
23
|
-
import { transactCallRelayerBatch as C } from "../../functions/web3/functionCalls/transactCallRelayer.mjs";
|
|
24
|
-
import { safeUpdateDepositAndWithdrawStatus as w } from "../../API/deposit-and-withdraw-status-calls.mjs";
|
|
25
|
-
import { hinkalDepositOnChainUtxos as T } from "./hinkalDepositOnChainUtxos.mjs";
|
|
26
|
-
import "../../functions/index.mjs";
|
|
24
|
+
import { prepareDepositOnChainUtxos as D, submitDepositOnChainUtxos as O } from "./hinkalDepositOnChainUtxos.mjs";
|
|
27
25
|
//#region libs/shared/common/src/data-structures/Hinkal/hinkalDepositAndBridge.ts
|
|
28
|
-
var
|
|
29
|
-
if (
|
|
30
|
-
let
|
|
31
|
-
if (!
|
|
32
|
-
let
|
|
33
|
-
if (!
|
|
34
|
-
let
|
|
35
|
-
if (!
|
|
36
|
-
let
|
|
37
|
-
for (let
|
|
38
|
-
let
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
26
|
+
var k = async (n, c, l, p, m, _, S, T) => {
|
|
27
|
+
if (p.length === 0) throw Error("No recipients to bridge");
|
|
28
|
+
let E = l.erc20TokenAddress, { contractData: D } = t[c], { emporiumAddress: O } = D;
|
|
29
|
+
if (!O) throw Error("No Emporium Address");
|
|
30
|
+
let k = w[u.Lifi][c];
|
|
31
|
+
if (!k) throw Error(`LIFI not configured for chain ${c}`);
|
|
32
|
+
let A = await n.getRandomRelay(c);
|
|
33
|
+
if (!A) throw Error(o.RELAYER_NOT_AVAILABLE);
|
|
34
|
+
let j = await n.getEthereumAddressByChain(c), M = n.generateProofRemotely, N = M ? 5 : 1, P = [];
|
|
35
|
+
for (let t = 0; t < p.length; t += N) {
|
|
36
|
+
let o = p.slice(t, t + N), l = await Promise.all(o.map(async ({ utxo: o, nativeUtxo: l, bridgeAmount: p, quote: w, temporarySubAccount: D, recipientAddress: N, destinationChainId: P, destinationTokenAddress: F }, I) => {
|
|
37
|
+
let L = m[t + I];
|
|
38
|
+
await f.addTemporaryWalletNonce(c, _, D.index);
|
|
39
|
+
let R = i(E, r), z = w.nativeFee > 0n && !R, B = [E], V = [-o.amount], H = [!1], U = [[o]];
|
|
40
|
+
z && l && (B.push(r), V.push(-l.amount), H.push(!1), U.push([l]));
|
|
41
|
+
let W = y(n, c, D.ethAddress, k, E, o.amount, p, w), G = h(S, c, B, [-o.amount], j), [K, q] = await Promise.all([(async () => {
|
|
42
|
+
let t = s(31), i = M ? await b(c, O, D.privateKey, W, a(t), g.getSignerAddressFromPrivateKey(e(c), D.privateKey), L.flatFee) : void 0;
|
|
43
|
+
return C(n, {
|
|
44
|
+
chainId: c,
|
|
45
|
+
erc20Addresses: B,
|
|
46
|
+
amountChanges: V,
|
|
47
|
+
externalAddress: O,
|
|
48
|
+
externalActionId: u.Emporium,
|
|
49
|
+
externalActionMetadata: i,
|
|
50
|
+
onChainCreation: H,
|
|
51
|
+
feeStructure: L,
|
|
52
|
+
relay: A ?? r,
|
|
53
|
+
messageSeed: t,
|
|
54
|
+
inputUtxos: U,
|
|
55
|
+
useBlockedUtxos: !0,
|
|
56
|
+
speculative: T && {
|
|
57
|
+
pendingLeaves: T,
|
|
58
|
+
inputUtxos: U.map((e) => e.map(v))
|
|
59
|
+
},
|
|
60
|
+
subAccountPrivateKey: D.privateKey,
|
|
61
|
+
emporiumOps: W,
|
|
62
|
+
submit: { mode: d.ProofOnly }
|
|
60
63
|
});
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
let F = b(t, l, f.ethAddress, j, O, e.amount, a, c), I = await y(l, u, a, p), L = m(E, l, v, [-e.amount], N), [{ zkCallData: R, circomData: z, dimData: B, commitmentValidationData: V }, H] = await Promise.all([S(t.merkleTreeHinkalByChain[l], D, k, t.userKeys, s.Emporium, A, F, t.generateProofRemotely, I, M ?? n, l, w, void 0, void 0, f.privateKey), x(l, f.privateKey)]);
|
|
64
|
+
})(), x(c, D.privateKey)]), { zkCallData: J, circomData: Y, dimData: X, commitmentValidationData: Z, tronProofSignature: Q } = K;
|
|
64
65
|
return {
|
|
65
|
-
zkCallData:
|
|
66
|
-
dimData:
|
|
67
|
-
circomData:
|
|
68
|
-
commitmentValidationData:
|
|
69
|
-
authorizationData:
|
|
70
|
-
recipientAddress:
|
|
71
|
-
adminData:
|
|
66
|
+
zkCallData: J,
|
|
67
|
+
dimData: X,
|
|
68
|
+
circomData: Y,
|
|
69
|
+
commitmentValidationData: Z,
|
|
70
|
+
authorizationData: q,
|
|
71
|
+
recipientAddress: N,
|
|
72
|
+
adminData: G,
|
|
73
|
+
tronProofSignature: Q,
|
|
74
|
+
destinationChainId: P,
|
|
75
|
+
destinationTokenAddress: F,
|
|
76
|
+
destinationTokenAmount: w.expectedAmount.toString()
|
|
72
77
|
};
|
|
73
78
|
}));
|
|
74
|
-
|
|
79
|
+
P.push(...l);
|
|
75
80
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
return await w({
|
|
84
|
-
id: g,
|
|
85
|
-
chainId: l,
|
|
86
|
-
hashedEthereumAddress: h,
|
|
87
|
-
phase: c.AFTER_SCHEDULE_WITHDRAW,
|
|
88
|
-
scheduleId: L
|
|
89
|
-
}), L;
|
|
90
|
-
}, D = async (e, i, a, o, c, d, m, y, x = !0) => {
|
|
91
|
-
let S = i.erc20TokenAddress, C = f([i]), w = y ? u(y) : void 0, D = l(await e.getEthereumAddressByChain(C)), O = _[s.Lifi][C];
|
|
92
|
-
if (!O) throw Error("LIFI router not configured");
|
|
93
|
-
let k;
|
|
94
|
-
if (c) k = c;
|
|
95
|
-
else {
|
|
96
|
-
let n = a[0], r = b(e, C, n.temporarySubAccount.ethAddress, O, S, n.bridgeAmount, n.bridgeAmount, n.quote).map((e) => v(e, n.temporarySubAccount.ethAddress, C));
|
|
97
|
-
k = await h(C, S, [S], s.Emporium, r, t);
|
|
98
|
-
}
|
|
99
|
-
let A = {
|
|
100
|
-
feeToken: k.feeToken,
|
|
101
|
-
flatFee: 0n,
|
|
102
|
-
variableRate: 0n
|
|
103
|
-
}, j = a.reduce((e, t) => e + t.quote.nativeFee, 0n) > 0n && !r(S, n), M = a.map((e) => e.bridgeAmount), N = a.map((e) => e.recipientAddress), { userDepositedUtxos: P, statusId: F, depositTxHash: I } = await T(e, C, i, M, N, k, D, x), L = [];
|
|
104
|
-
if (j) {
|
|
105
|
-
let t = await p(C, n);
|
|
106
|
-
if (!t) throw Error("No native token");
|
|
107
|
-
let { userDepositedUtxos: r } = await T(e, C, t, a.map((e) => e.quote.nativeFee), N, A, D, x);
|
|
108
|
-
L = r;
|
|
81
|
+
return P;
|
|
82
|
+
}, A = (e) => e.map((e) => e.quote.nativeFee), j = async (e, t, n, i) => {
|
|
83
|
+
let { chainId: a, hashedEthereumAddress: o, feeStructures: s, mainTokenAmounts: c } = i, { needsNativeDeposit: l, txCompletionTime: u, ref: d, action: f, hashedDashboardAccountId: p, preEstimateGas: h } = i, g = [t], _ = [c];
|
|
84
|
+
if (l) {
|
|
85
|
+
let e = await m(a, r);
|
|
86
|
+
if (!e) throw Error("No native token");
|
|
87
|
+
g.push(e), _.push(A(n));
|
|
109
88
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
89
|
+
let v = await D(e, a, g, _), { depositedUtxos: y, pendingLeaves: b } = v, [x, C = []] = y, w = n.map((e, t) => ({
|
|
90
|
+
...e,
|
|
91
|
+
utxo: x[t],
|
|
92
|
+
nativeUtxo: l ? C[t] : void 0
|
|
93
|
+
})), [T, E] = await Promise.all([O(e, v, h), k(e, a, t, w, s, o, f, b)]);
|
|
94
|
+
return {
|
|
95
|
+
depositTxHash: T,
|
|
96
|
+
scheduleId: await S(a, E, o, u, d, p, T)
|
|
117
97
|
};
|
|
98
|
+
}, M = async (e, t, a, o, s, d, f, m, h = !0) => {
|
|
99
|
+
if (a.length === 0) throw Error("No recipients to bridge");
|
|
100
|
+
let g = t.erc20TokenAddress, v = p([t]), b = await e.getEthereumAddressByChain(v), x = w[u.Lifi][v];
|
|
101
|
+
if (!x) throw Error("LIFI router not configured");
|
|
102
|
+
let S = i(g, r), C;
|
|
103
|
+
if (s) C = s;
|
|
104
|
+
else {
|
|
105
|
+
let t = a[0], r = S ? t.bridgeAmount + t.quote.nativeFee : t.bridgeAmount, i = y(e, v, t.temporarySubAccount.ethAddress, x, g, r, t.bridgeAmount, t.quote).map((e) => T(e, t.temporarySubAccount.ethAddress, v));
|
|
106
|
+
C = await _(v, g, [g], u.Emporium, i, n);
|
|
107
|
+
}
|
|
108
|
+
let D = a.reduce((e, t) => e + t.quote.nativeFee, 0n), O = a.map((e) => S ? e.bridgeAmount + e.quote.nativeFee : e.bridgeAmount), k = await Promise.all(O.map((e) => E(v, t, e, C)));
|
|
109
|
+
return j(e, t, a, {
|
|
110
|
+
chainId: v,
|
|
111
|
+
ethereumAddress: b,
|
|
112
|
+
hashedEthereumAddress: c(b),
|
|
113
|
+
feeStructures: k,
|
|
114
|
+
mainTokenAmounts: O.map((e, t) => e + k[t].flatFee),
|
|
115
|
+
needsNativeDeposit: D > 0n && !S,
|
|
116
|
+
txCompletionTime: o,
|
|
117
|
+
ref: d,
|
|
118
|
+
action: f,
|
|
119
|
+
hashedDashboardAccountId: m ? l(m) : void 0,
|
|
120
|
+
preEstimateGas: h
|
|
121
|
+
});
|
|
118
122
|
};
|
|
119
123
|
//#endregion
|
|
120
|
-
export {
|
|
124
|
+
export { M as hinkalDepositAndBridge };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../../constants/chains.constants.cjs`),t=require(`../../constants/protocol.constants.cjs`),n=require(`../../functions/utils/caseInsensitive.utils.cjs`),r=require(`../../error-handling/error-codes.constants.cjs`),i=require(
|
|
1
|
+
require(`../../../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../constants/chains.constants.cjs`),t=require(`../../constants/protocol.constants.cjs`),n=require(`../../functions/utils/caseInsensitive.utils.cjs`),r=require(`../../error-handling/error-codes.constants.cjs`),i=require(`../utxo/Utxo.cjs`),a=require(`../../functions/utils/tron.utils.cjs`),o=require(`../../functions/utils/addresses.cjs`),s=require(`../../types/external-action.types.cjs`),c=require(`../../types/transact.types.cjs`),l=require(`../../functions/utils/token-check.utils.cjs`),u=require(`../crypto-keys/encryptDecryptUtxo.cjs`),d=require(`../../functions/pre-transaction/constructAdminData.cjs`),f=require(`../../functions/pre-transaction/getFeeStructure.cjs`),p=require(`../../functions/pre-transaction/speculativeUtxo.cjs`),m=require(`../../functions/web3/functionCalls/transactCallDirectTron.cjs`),h=require(`../../functions/web3/functionCalls/transactCallRelayer.cjs`),g=require(`./hinkalTransact.cjs`);require(`../../functions/index.cjs`);const _=require(`./hinkalDepositOnChainUtxos.cjs`);let v=require(`ethers`);var y=async(e,o,s,l,u,f,m,h)=>{if(l.length===0)throw Error(`userDepositedUtxos must not be empty`);let _=s.erc20TokenAddress,[v,y]=await Promise.all([e.getRandomRelay(o),e.getEthereumAddressByChain(o)]);if(!v)throw Error(r.transactionErrorCodes.RELAYER_NOT_AVAILABLE);let b=e.generateProofRemotely?5:1,x=[],S=a.addressToHexFormat(y);for(let r=0;r<l.length;r+=b){let s=l.slice(r,r+b),y=await Promise.all(s.map(async({recipientAddress:s,utxo:l},y)=>{let b=r+y,x=a.addressToHexFormat(s),C=n.caseInsensitiveEqual(l.erc20TokenAddress,_)?l:i.Utxo.createFrom(l,{erc20TokenAddress:_}),w=d.constructAdminData(f,o,[_],[-l.amount],S),{zkCallData:T,circomData:E,dimData:D,commitmentValidationData:O,tronProofSignature:k}=await g.hinkalTransact(e,{chainId:o,erc20Addresses:[_],amountChanges:[-l.amount],externalAddress:x,feeStructure:u,relay:v??t.zeroAddress,inputUtxos:[[C]],useBlockedUtxos:!0,speculative:h&&{pendingLeaves:h,inputUtxos:[[p.toSpeculativeUtxo(C)]]},submit:{mode:c.SubmitMode.ProofOnly},skipLock:!0});return{zkCallData:T,dimData:D,circomData:E,commitmentValidationData:O,adminData:w,recipientAddress:s,tronProofSignature:k,destinationChainId:m?.chainId,destinationTokenAddress:m?.tokenAddress,destinationTokenAmount:m?.tokenAmounts?.[b]}}));x.push(...y)}return x},b=async(e,t,n,r,i)=>{let{chainId:a,hashedEthereumAddress:o,feeStructure:s,action:c,destination:l}=i,{txCompletionTime:u,ref:d,hashedDashboardAccountId:f,preEstimateGas:p}=i,m=n.map(e=>e+s.flatFee),g=await _.prepareDepositOnChainUtxos(e,a,[t],[m]),{depositedUtxos:v,pendingLeaves:b}=g,x=v[0].map((e,t)=>({recipientAddress:r[t],utxo:e})),[S,C]=await Promise.all([_.submitDepositOnChainUtxos(e,g,p),y(e,a,t,x,s,c,l,b)]);return{depositTxHash:S,scheduleId:await h.transactCallRelayerBatch(a,C,o,u,d,f,S)}},x=async(e,t,n,r,i)=>{let{chainId:o,ethereumAddress:s,hashedEthereumAddress:l,feeStructure:d,action:f,destination:p}=i,{txCompletionTime:_,ref:b,hashedDashboardAccountId:x,preEstimateGas:S}=i,C=n.map(e=>e+d.flatFee),w=C.reduce((e,t)=>e+t,0n),T=await g.hinkalTransact(e,{chainId:o,erc20Addresses:[t.erc20TokenAddress],amountChanges:[w],externalAddress:s,selfOutputAmounts:C,createBlockedUtxos:!0,forceEmptyUtxos:!0,submit:{mode:c.SubmitMode.ProofOnly}}),E=T.circomData.encryptedOutputs?.[0];if(!E||E.length!==C.length)throw Error(`Deposit proof is missing encryptedOutputs for the deposited UTXOs`);let D=E.map((t,n)=>({recipientAddress:r[n],utxo:u.decryptUtxo(v.ethers.getBytes(t),e.userKeys)})),O=T.circomData.outCommitments.flat().map(e=>BigInt(e)).filter(e=>e!==0n).map(e=>e.toString()),[k,A]=await Promise.all([(async()=>{a.swapTronBCoordinate(T.zkCallData);let n=await m.transactCallDirectTron(e,o,w,t,T.zkCallData,T.circomData,T.dimData,void 0,void 0,S,T.tronProofSignature);if(!n)throw Error(`Deposit transaction hash not found`);return n})(),y(e,o,t,D,d,f,p,O)]);return{depositTxHash:k,scheduleId:await h.transactCallRelayerBatch(o,A,l,_,b,x,k)}},S=async(t,n,r,i,c,u,d,p,m,h=!0,g)=>{let _=l.validateAndGetChainId([n]),v=n.erc20TokenAddress,y=a.addressToHexFormat(await t.getEthereumAddressByChain(_)),S={chainId:_,ethereumAddress:y,hashedEthereumAddress:o.hashEthereumAddress(y),feeStructure:u??await f.getFeeStructure(_,v,[v],s.ExternalActionId.Transact,[],25n),txCompletionTime:c,ref:d,action:p,hashedDashboardAccountId:m?o.hashString(m):void 0,preEstimateGas:h,destination:g};if(!e.isTronLike(_))return b(t,n,r,i,S);if(r.length>4)throw Error(`Tron supports at most 4 recipients per deposit - no circuit emits more outputs`);return x(t,n,r,i,S)};exports.hinkalDepositAndWithdraw=S;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IHinkal } from './IHinkal';
|
|
2
2
|
import { AdminTransactionType, DepositAndSendExtendedResult, ERC20Token, RecipientUtxo } from '../../types';
|
|
3
|
+
import { DestinationMetadata } from '../../types/bridging-tx.types';
|
|
3
4
|
import { FeeStructure } from '../../types/hinkal.types';
|
|
4
|
-
export declare const hinkalWithdrawBatch: (hinkal: IHinkal, chainId: number, erc20Token: ERC20Token, userDepositedUtxos: RecipientUtxo[],
|
|
5
|
+
export declare const hinkalWithdrawBatch: (hinkal: IHinkal, chainId: number, erc20Token: ERC20Token, userDepositedUtxos: RecipientUtxo[], feeStructure: FeeStructure, hashedEthereumAddress: string, txCompletionTime?: number, ref?: string, action?: AdminTransactionType, hashedDashboardAccountId?: string, destination?: DestinationMetadata) => Promise<string>;
|
|
5
6
|
export declare const hinkalDepositAndWithdraw: (hinkal: IHinkal, erc20Token: ERC20Token, recipientAmounts: bigint[], recipientAddresses: string[], txCompletionTime?: number, feeStructureOverride?: FeeStructure, // Should be passed fee for only one withdraw transaction, multiplication happening in this function
|
|
6
|
-
ref?: string, action?: AdminTransactionType, dashboardAccountId?: string, preEstimateGas?: boolean) => Promise<DepositAndSendExtendedResult>;
|
|
7
|
+
ref?: string, action?: AdminTransactionType, dashboardAccountId?: string, preEstimateGas?: boolean, destination?: DestinationMetadata) => Promise<DepositAndSendExtendedResult>;
|