@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
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { SolanaSubmitMode as e } from "../../types/solana-transact.types.mjs";
|
|
2
|
+
import { addPaddingToUtxos as t } from "../../functions/web3/events/getShieldedBalance.mjs";
|
|
3
|
+
import { buildOutputUtxos as n } from "../../functions/pre-transaction/outputUtxoProcessing.mjs";
|
|
4
|
+
import { buildOutCommitments as r } from "../../functions/snarkjs/common.snarkjs.mjs";
|
|
5
|
+
import { collectInputCommitments as i, finalizeSolanaTxEnclaveCall as a, finalizeSolanaTxEnclaveCallRelay as o, prepareSolanaTxEnclaveCall as s } from "../../functions/snarkjs/constructTxEnclave.mjs";
|
|
6
|
+
import { speculativeMerkleTree as c } from "../../functions/pre-transaction/speculativeUtxo.mjs";
|
|
7
|
+
import { solanaTransactCallRelayer as l } from "../../functions/web3/functionCalls/transactCallRelayer.mjs";
|
|
8
|
+
import { constructSolanaZkProof as u } from "../../functions/snarkjs/constructSolanaZkProof.mjs";
|
|
9
|
+
import { ethers as d } from "ethers";
|
|
10
|
+
import { PublicKey as f } from "@solana/web3.js";
|
|
11
|
+
//#region libs/shared/common/src/data-structures/Hinkal/hinkalSolanaTransact.ts
|
|
12
|
+
var p = (e = []) => e.map(({ accountIndexes: e, data: t, programIndex: n }) => ({
|
|
13
|
+
accountIndexes: Buffer.from(e),
|
|
14
|
+
data: Buffer.from(t),
|
|
15
|
+
programIndex: n
|
|
16
|
+
})), m = (e = []) => e.map(({ pubkey: e, isSigner: t, isWritable: n }) => ({
|
|
17
|
+
pubkey: new f(e),
|
|
18
|
+
isSigner: t,
|
|
19
|
+
isWritable: n
|
|
20
|
+
})), h = async (e, n) => {
|
|
21
|
+
let { inputUtxos: r, chainId: i, mintAddresses: a, amountChanges: o, useBlockedUtxos: s, onChainCreation: c } = n;
|
|
22
|
+
return r || [...await t(e, i, a, o, void 0, void 0, s, c)];
|
|
23
|
+
}, g = (e, t, r) => {
|
|
24
|
+
let { amountChanges: i, recipientAddress: a, recipientAmounts: o } = e;
|
|
25
|
+
return n(t, r, i, a === void 0 ? void 0 : [a], a === void 0 ? void 0 : [o ?? []]);
|
|
26
|
+
}, _ = async (e, t, n) => {
|
|
27
|
+
let { chainId: i, mintAddresses: a, relayAddress: o, recipient: s, relayerFee: l, variableRate: f, functionName: _, hinkalInstructions: v, remainingAccounts: y, swapperAccountSalt: b, onChainCreation: x, speculative: S } = t, C = await h(e, t), w = g(t, n, C), T = e.merkleTreeHinkalByChain[i], E = S ? c(T, C, S.pendingLeaves) : T, D = {
|
|
28
|
+
tokenNumber: a.length,
|
|
29
|
+
nullifierAmount: C[0].length,
|
|
30
|
+
outputAmount: w[0].length
|
|
31
|
+
}, { proofAArr: O, proofBArr: k, proofCArr: A, publicInputsArr: j, commitmentValidationData: M, rootHashHinkalIndex: N, encryptedOutputs: P, onChainEncryptedOutput: F } = await u(E, n, a, C, w, l ?? 0n, f ?? 0n, s, o, D, x, i, p(v), m(y), b, E !== T);
|
|
32
|
+
return {
|
|
33
|
+
args: {
|
|
34
|
+
proofAArr: O,
|
|
35
|
+
proofBArr: k,
|
|
36
|
+
proofCArr: A,
|
|
37
|
+
publicInputsArr: j,
|
|
38
|
+
encryptedOutputs: P,
|
|
39
|
+
relayerFee: (l ?? 0n).toString(),
|
|
40
|
+
..._ === "swap" ? {
|
|
41
|
+
variableRate: (f ?? 0n).toString(),
|
|
42
|
+
onChainEncryptedOutput: F,
|
|
43
|
+
onChainCreation: x ?? [],
|
|
44
|
+
hinkalInstructions: v ?? []
|
|
45
|
+
} : {},
|
|
46
|
+
dimensions: D,
|
|
47
|
+
rootHashIndex: N.toString()
|
|
48
|
+
},
|
|
49
|
+
commitmentValidationData: M,
|
|
50
|
+
notes: {
|
|
51
|
+
inputNullifiers: C.flat().filter((e) => e.amount > 0n).map((e) => e.getNullifier()),
|
|
52
|
+
outCommitments: r(w).flat(),
|
|
53
|
+
encryptedOutputs: P.map((e) => d.hexlify(new Uint8Array(e)))
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
}, v = async (e, t, n) => {
|
|
57
|
+
let { inputUtxos: r } = t, { jobId: a, signedMessageHash: o } = await s(e, {
|
|
58
|
+
chainId: t.chainId,
|
|
59
|
+
mintAddresses: t.mintAddresses,
|
|
60
|
+
amountChanges: t.amountChanges,
|
|
61
|
+
relayAddress: t.relayAddress,
|
|
62
|
+
recipient: t.recipient,
|
|
63
|
+
signer: t.signer,
|
|
64
|
+
functionName: t.functionName,
|
|
65
|
+
accounts: t.accounts,
|
|
66
|
+
onChainCreation: t.onChainCreation,
|
|
67
|
+
relayerFee: t.relayerFee,
|
|
68
|
+
variableRate: t.variableRate,
|
|
69
|
+
swapperAccountSalt: t.swapperAccountSalt,
|
|
70
|
+
hinkalInstructions: t.hinkalInstructions,
|
|
71
|
+
remainingAccounts: t.remainingAccounts,
|
|
72
|
+
recipientAddress: t.recipientAddress,
|
|
73
|
+
recipientAmounts: t.recipientAmounts,
|
|
74
|
+
recipientAmount: t.recipientAmount,
|
|
75
|
+
displayRecipient: t.displayRecipient,
|
|
76
|
+
useBlockedUtxos: t.useBlockedUtxos,
|
|
77
|
+
messageSeed: t.messageSeed,
|
|
78
|
+
inputCommitments: t.speculative ? void 0 : i(r),
|
|
79
|
+
speculative: t.speculative
|
|
80
|
+
}, n), { R8: c, S: l } = n.signEddsa(BigInt(o));
|
|
81
|
+
return {
|
|
82
|
+
jobId: a,
|
|
83
|
+
eddsaSignature: {
|
|
84
|
+
R8: c,
|
|
85
|
+
S: l
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
}, y = (t, n) => {
|
|
89
|
+
let { chainId: r, relayAddress: i, functionName: a, accounts: o, submit: s } = t;
|
|
90
|
+
if (s.mode !== e.Relayer) throw Error("hinkalSolanaTransact: relayer submit expected");
|
|
91
|
+
return l({
|
|
92
|
+
chainId: r,
|
|
93
|
+
relayAddress: i,
|
|
94
|
+
functionName: a,
|
|
95
|
+
args: n.args,
|
|
96
|
+
accounts: o,
|
|
97
|
+
commitmentValidationData: n.commitmentValidationData,
|
|
98
|
+
adminData: s.adminData
|
|
99
|
+
});
|
|
100
|
+
}, b = async (t, n) => {
|
|
101
|
+
if (t.submit.mode !== e.Relayer) return n;
|
|
102
|
+
let r = await y(t, n);
|
|
103
|
+
return n.notes && t.onTxSubmitLocally?.(n.notes), r;
|
|
104
|
+
}, x = async (t, n) => {
|
|
105
|
+
if (n.userKeys && !n.inputUtxos) throw Error("hinkalSolanaTransact: userKeys requires explicit inputUtxos");
|
|
106
|
+
let r = n.userKeys ?? t.userKeys, { chainId: i, submit: s } = n;
|
|
107
|
+
if (t.generateProofRemotely) {
|
|
108
|
+
let { jobId: c, eddsaSignature: l } = await v(t, n, r);
|
|
109
|
+
if (s.mode === e.Relayer) return o(c, l, i, { adminData: s.adminData });
|
|
110
|
+
let { solanaArgs: u, commitmentValidationData: d } = await a(c, l);
|
|
111
|
+
return b(n, {
|
|
112
|
+
args: u,
|
|
113
|
+
commitmentValidationData: d
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
return b(n, await _(t, n, r));
|
|
117
|
+
};
|
|
118
|
+
//#endregion
|
|
119
|
+
export { x as hinkalSolanaTransact };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const e=require(`../../constants/chains.constants.cjs`),t=require(`../../constants/protocol.constants.cjs`),n=require(`../../error-handling/error-codes.constants.cjs`),r=require(`../../functions/utils/addresses.cjs`),i=require(`../../types/external-action.types.cjs`),a=require(`../../types/solana-transact.types.cjs`);require(`../../types/index.cjs`);const o=require(`../../functions/utils/token-check.utils.cjs`),s=require(`../../functions/pre-transaction/constructAdminData.cjs`),c=require(`../../functions/pre-transaction/calculateSolanaNullifierCount.cjs`),l=require(`../../functions/pre-transaction/getFeeStructure.cjs`);require(`../../functions/pre-transaction/index.cjs`);const u=require(`../../functions/utils/fees.utils.cjs`),d=require(`./hinkalSolanaTransact.cjs`);var f=async(f,p,m,h,g,_,v,y=!1)=>{if(y)throw Error(`onlyGasEstimate is not supported for Solana transfer`);if(!r.isValidPrivateAddress(h))throw Error(n.transactionErrorCodes.RECIPIENT_FORMAT_INCORRECT);let b=o.validateAndGetChainId(p),x=[...m],S=p.map(e=>e.erc20TokenAddress);if(S.length>1)throw Error(`Solana Transfer: Only one mint address is supported`);let{originalDeployer:C}=e.networkRegistry[b].contractData;if(!C)throw Error(`missing data`);let w=g??S[0],T={mintTo:w,nullifierCount:await c.calculateSolanaNullifierCount(f,b,S,x),rootInsertCount:2},E=_??await l.getFeeStructure(b,w,S,i.ExternalActionId.Transact,[],25n,T);E.variableRate||=t.HINKAL_PRIVATE_SEND_VARIABLE_RATE;let D=-x[0],O=u.calculateTotalFee(D,E);x[0]-=O;let[k,A]=await Promise.all([f.getRandomRelay(b,!0),f.getEthereumAddressByChain(b)]);if(!k)throw Error(n.transactionErrorCodes.RELAYER_NOT_AVAILABLE);let j={recipient:k,mint:S[0]===`11111111111111111111111111111111`?void 0:S[0]},M=s.constructAdminData(v,b,S,x,A);return d.hinkalSolanaTransact(f,{chainId:b,mintAddresses:S,amountChanges:x,relayAddress:k,recipient:t.solanaNativeAddress,signer:k,functionName:`transfer`,accounts:j,relayerFee:O,recipientAddress:h,recipientAmounts:[D],submit:{mode:a.SolanaSubmitMode.Relayer,adminData:M}})};exports.hinkalSolanaTransfer=f;
|
|
@@ -1,31 +1,3 @@
|
|
|
1
|
-
import { AdminTransactionType,
|
|
1
|
+
import { AdminTransactionType, ERC20Token, FeeStructure } from '../../types';
|
|
2
2
|
import { IHinkal } from './IHinkal';
|
|
3
|
-
|
|
4
|
-
import { constructAdminData } from '../../functions/pre-transaction';
|
|
5
|
-
type SolanaTransferPlan = {
|
|
6
|
-
chainId: number;
|
|
7
|
-
relay: string;
|
|
8
|
-
commitmentValidationData?: CommitmentValidationDataType;
|
|
9
|
-
args: {
|
|
10
|
-
proofAArr: number[];
|
|
11
|
-
proofBArr: number[];
|
|
12
|
-
proofCArr: number[];
|
|
13
|
-
publicInputsArr: number[][];
|
|
14
|
-
encryptedOutputs: number[][];
|
|
15
|
-
relayerFee: string;
|
|
16
|
-
dimensions: {
|
|
17
|
-
tokenNumber: number;
|
|
18
|
-
nullifierAmount: number;
|
|
19
|
-
outputAmount: number;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
accounts: {
|
|
23
|
-
recipient: string;
|
|
24
|
-
mint?: string;
|
|
25
|
-
};
|
|
26
|
-
adminData: ReturnType<typeof constructAdminData>;
|
|
27
|
-
recipientUtxo: Utxo;
|
|
28
|
-
};
|
|
29
|
-
export declare const buildSolanaTransferPlan: (hinkal: IHinkal, erc20Tokens: ERC20Token[], amountChangesInput: bigint[], recipientAddress: string, feeToken?: string, feeStructureOverride?: FeeStructure, action?: AdminTransactionType) => Promise<SolanaTransferPlan>;
|
|
30
|
-
export declare const hinkalSolanaTransfer: (hinkal: IHinkal, erc20Tokens: ERC20Token[], amountChanges: bigint[], recipientAddress: string, feeToken?: string, feeStructureOverride?: FeeStructure, action?: AdminTransactionType, onlyGasEstimate?: boolean) => Promise<string>;
|
|
31
|
-
export {};
|
|
3
|
+
export declare const hinkalSolanaTransfer: (hinkal: IHinkal, erc20Tokens: ERC20Token[], amountChangesInput: bigint[], recipientAddress: string, feeToken?: string, feeStructureOverride?: FeeStructure, action?: AdminTransactionType, onlyGasEstimate?: boolean) => Promise<string>;
|
|
@@ -1,87 +1,56 @@
|
|
|
1
1
|
import { networkRegistry as e } from "../../constants/chains.constants.mjs";
|
|
2
2
|
import { HINKAL_PRIVATE_SEND_VARIABLE_RATE as t, solanaNativeAddress as n } from "../../constants/protocol.constants.mjs";
|
|
3
3
|
import { transactionErrorCodes as r } from "../../error-handling/error-codes.constants.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { ExternalActionId as s } from "../../types/external-action.types.mjs";
|
|
4
|
+
import { isValidPrivateAddress as i } from "../../functions/utils/addresses.mjs";
|
|
5
|
+
import { ExternalActionId as a } from "../../types/external-action.types.mjs";
|
|
6
|
+
import { SolanaSubmitMode as o } from "../../types/solana-transact.types.mjs";
|
|
8
7
|
import "../../types/index.mjs";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { calcEncryptedOutputs as f } from "../../functions/snarkjs/common.snarkjs.mjs";
|
|
14
|
-
import { constructAdminData as p } from "../../functions/pre-transaction/constructAdminData.mjs";
|
|
15
|
-
import { ensureAmountChanges as m } from "../../functions/pre-transaction/ensureAmountChanges.mjs";
|
|
16
|
-
import { getFeeStructure as h } from "../../functions/pre-transaction/getFeeStructure.mjs";
|
|
8
|
+
import { validateAndGetChainId as s } from "../../functions/utils/token-check.utils.mjs";
|
|
9
|
+
import { constructAdminData as c } from "../../functions/pre-transaction/constructAdminData.mjs";
|
|
10
|
+
import { calculateSolanaNullifierCount as l } from "../../functions/pre-transaction/calculateSolanaNullifierCount.mjs";
|
|
11
|
+
import { getFeeStructure as u } from "../../functions/pre-transaction/getFeeStructure.mjs";
|
|
17
12
|
import "../../functions/pre-transaction/index.mjs";
|
|
18
|
-
import { calculateTotalFee as
|
|
19
|
-
import {
|
|
20
|
-
import { solanaTransactCallRelayer as v } from "../../functions/web3/functionCalls/transactCallRelayer.mjs";
|
|
21
|
-
import { ethers as y } from "ethers";
|
|
13
|
+
import { calculateTotalFee as d } from "../../functions/utils/fees.utils.mjs";
|
|
14
|
+
import { hinkalSolanaTransact as f } from "./hinkalSolanaTransact.mjs";
|
|
22
15
|
//#region libs/shared/common/src/data-structures/Hinkal/hinkalSolanaTransfer.ts
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
let
|
|
37
|
-
|
|
38
|
-
let j =
|
|
39
|
-
|
|
40
|
-
let
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
m([F], [[I]], T);
|
|
52
|
-
let { proofAArr: V, proofBArr: H, proofCArr: U, publicInputsArr: W, commitmentValidationData: G } = await _(o.generateProofRemotely, O[w], D, [k[0]], [F], [[I, L]], R, j, 0n, n, N, z, B, w), K = {
|
|
53
|
-
recipient: N,
|
|
54
|
-
mint: k[0] === "11111111111111111111111111111111" ? void 0 : k[0]
|
|
55
|
-
};
|
|
56
|
-
return {
|
|
57
|
-
chainId: w,
|
|
58
|
-
relay: N,
|
|
59
|
-
args: {
|
|
60
|
-
proofAArr: V,
|
|
61
|
-
proofBArr: H,
|
|
62
|
-
proofCArr: U,
|
|
63
|
-
publicInputsArr: W,
|
|
64
|
-
encryptedOutputs: B,
|
|
65
|
-
relayerFee: j.toString(),
|
|
66
|
-
dimensions: z
|
|
67
|
-
},
|
|
68
|
-
accounts: K,
|
|
69
|
-
adminData: p(C, w, k, T, P),
|
|
70
|
-
commitmentValidationData: G,
|
|
71
|
-
recipientUtxo: L
|
|
72
|
-
};
|
|
73
|
-
}, S = async (e, t, n, r, i, a, o, s = !1) => {
|
|
74
|
-
if (s) throw Error("onlyGasEstimate is not supported for Solana transfer");
|
|
75
|
-
let c = await x(e, t, n, r, i, a, o);
|
|
76
|
-
return v({
|
|
77
|
-
chainId: c.chainId,
|
|
78
|
-
relayAddress: c.relay,
|
|
16
|
+
var p = async (p, m, h, g, _, v, y, b = !1) => {
|
|
17
|
+
if (b) throw Error("onlyGasEstimate is not supported for Solana transfer");
|
|
18
|
+
if (!i(g)) throw Error(r.RECIPIENT_FORMAT_INCORRECT);
|
|
19
|
+
let x = s(m), S = [...h], C = m.map((e) => e.erc20TokenAddress);
|
|
20
|
+
if (C.length > 1) throw Error("Solana Transfer: Only one mint address is supported");
|
|
21
|
+
let { originalDeployer: w } = e[x].contractData;
|
|
22
|
+
if (!w) throw Error("missing data");
|
|
23
|
+
let T = _ ?? C[0], E = {
|
|
24
|
+
mintTo: T,
|
|
25
|
+
nullifierCount: await l(p, x, C, S),
|
|
26
|
+
rootInsertCount: 2
|
|
27
|
+
}, D = v ?? await u(x, T, C, a.Transact, [], 25n, E);
|
|
28
|
+
D.variableRate ||= t;
|
|
29
|
+
let O = -S[0], k = d(O, D);
|
|
30
|
+
S[0] -= k;
|
|
31
|
+
let [A, j] = await Promise.all([p.getRandomRelay(x, !0), p.getEthereumAddressByChain(x)]);
|
|
32
|
+
if (!A) throw Error(r.RELAYER_NOT_AVAILABLE);
|
|
33
|
+
let M = {
|
|
34
|
+
recipient: A,
|
|
35
|
+
mint: C[0] === "11111111111111111111111111111111" ? void 0 : C[0]
|
|
36
|
+
}, N = c(y, x, C, S, j);
|
|
37
|
+
return f(p, {
|
|
38
|
+
chainId: x,
|
|
39
|
+
mintAddresses: C,
|
|
40
|
+
amountChanges: S,
|
|
41
|
+
relayAddress: A,
|
|
42
|
+
recipient: n,
|
|
43
|
+
signer: A,
|
|
79
44
|
functionName: "transfer",
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
45
|
+
accounts: M,
|
|
46
|
+
relayerFee: k,
|
|
47
|
+
recipientAddress: g,
|
|
48
|
+
recipientAmounts: [O],
|
|
49
|
+
submit: {
|
|
50
|
+
mode: o.Relayer,
|
|
51
|
+
adminData: N
|
|
52
|
+
}
|
|
84
53
|
});
|
|
85
54
|
};
|
|
86
55
|
//#endregion
|
|
87
|
-
export {
|
|
56
|
+
export { p as hinkalSolanaTransfer };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const e=require(`../../constants/chains.constants.cjs`);require(`../../constants/protocol.constants.cjs`);const t=require(`../../error-handling/error-codes.constants.cjs`),n=require(`../../types/external-action.types.cjs`),r=require(`../../types/solana-transact.types.cjs`);require(`../../types/index.cjs`);const i=require(`../../functions/utils/token-check.utils.cjs`),a=require(`../../functions/pre-transaction/constructAdminData.cjs`),o=require(`../../functions/pre-transaction/calculateSolanaNullifierCount.cjs`),s=require(`../../functions/pre-transaction/getFeeStructure.cjs`);require(`../../functions/pre-transaction/index.cjs`),require(`../../constants/index.cjs`);const c=require(`../../functions/utils/fees.utils.cjs`),l=require(`./hinkalSolanaTransact.cjs`);var u=async(u,d,f,p,m,h,g,_)=>{let v=i.validateAndGetChainId(d),y=d.map(e=>e.erc20TokenAddress),b=d[0];if(!b)throw Error(`Solana Withdraw: No Token Found`);let{originalDeployer:x}=e.networkRegistry[v].contractData;if(!x)throw Error(`missing data`);let S=m??y[0],C={mintTo:y[0],recipient:p,nullifierCount:await o.calculateSolanaNullifierCount(u,v,y,f)},w=h??await s.getFeeStructure(v,S,y,n.ExternalActionId.Transact,[],g,C);h&&g!==void 0&&(w={...w,variableRate:g});let T=await c.calculateModifiedFeeStructure(v,b,-f[0],w);f[0]-=T.flatFee;let[E,D]=await Promise.all([u.getRandomRelay(v,!0),u.getEthereumAddress()]);if(!E)throw Error(t.transactionErrorCodes.RELAYER_NOT_AVAILABLE);if(y.length>1)throw Error(`Solana Withdraw: Only one mint address is supported`);let O={recipient:p,mint:y[0]===`11111111111111111111111111111111`?void 0:y[0]},k=a.constructAdminData(_,v,y,f,D);return l.hinkalSolanaTransact(u,{chainId:v,mintAddresses:y,amountChanges:f,relayAddress:E,recipient:p,signer:E,functionName:`transact`,accounts:O,relayerFee:T.flatFee,variableRate:T.variableRate,submit:{mode:r.SolanaSubmitMode.Relayer,adminData:k}})};exports.hinkalSolanaWithdraw=u;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { AdminTransactionType, FeeStructure } from '../../types';
|
|
2
2
|
import { IHinkal } from './IHinkal';
|
|
3
3
|
import { ERC20Token } from '../../types/token.types';
|
|
4
|
-
export declare const hinkalSolanaWithdraw: (hinkal: IHinkal, erc20Tokens: ERC20Token[], amountChanges: bigint[], recipientAddress: string, feeToken?: string, feeStructureOverride?: FeeStructure, action?: AdminTransactionType) => Promise<string>;
|
|
4
|
+
export declare const hinkalSolanaWithdraw: (hinkal: IHinkal, erc20Tokens: ERC20Token[], amountChanges: bigint[], recipientAddress: string, feeToken?: string, feeStructureOverride?: FeeStructure, variableRateOverride?: bigint, action?: AdminTransactionType) => Promise<string>;
|
|
@@ -1,68 +1,57 @@
|
|
|
1
1
|
import { networkRegistry as e } from "../../constants/chains.constants.mjs";
|
|
2
2
|
import "../../constants/protocol.constants.mjs";
|
|
3
3
|
import { transactionErrorCodes as t } from "../../error-handling/error-codes.constants.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { getCurrentTimeInSeconds as i } from "../../functions/utils/time.utils.mjs";
|
|
7
|
-
import { ExternalActionId as a } from "../../types/external-action.types.mjs";
|
|
4
|
+
import { ExternalActionId as n } from "../../types/external-action.types.mjs";
|
|
5
|
+
import { SolanaSubmitMode as r } from "../../types/solana-transact.types.mjs";
|
|
8
6
|
import "../../types/index.mjs";
|
|
9
|
-
import { validateAndGetChainId as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { constructAdminData as u } from "../../functions/pre-transaction/constructAdminData.mjs";
|
|
14
|
-
import { ensureAmountChanges as d } from "../../functions/pre-transaction/ensureAmountChanges.mjs";
|
|
15
|
-
import { getFeeStructure as f } from "../../functions/pre-transaction/getFeeStructure.mjs";
|
|
7
|
+
import { validateAndGetChainId as i } from "../../functions/utils/token-check.utils.mjs";
|
|
8
|
+
import { constructAdminData as a } from "../../functions/pre-transaction/constructAdminData.mjs";
|
|
9
|
+
import { calculateSolanaNullifierCount as o } from "../../functions/pre-transaction/calculateSolanaNullifierCount.mjs";
|
|
10
|
+
import { getFeeStructure as s } from "../../functions/pre-transaction/getFeeStructure.mjs";
|
|
16
11
|
import "../../functions/pre-transaction/index.mjs";
|
|
17
12
|
import "../../constants/index.mjs";
|
|
18
|
-
import { calculateModifiedFeeStructure as
|
|
19
|
-
import {
|
|
20
|
-
import { solanaTransactCallRelayer as h } from "../../functions/web3/functionCalls/transactCallRelayer.mjs";
|
|
21
|
-
import { ethers as g } from "ethers";
|
|
13
|
+
import { calculateModifiedFeeStructure as c } from "../../functions/utils/fees.utils.mjs";
|
|
14
|
+
import { hinkalSolanaTransact as l } from "./hinkalSolanaTransact.mjs";
|
|
22
15
|
//#region libs/shared/common/src/data-structures/Hinkal/hinkalSolanaWithdraw.ts
|
|
23
|
-
var
|
|
24
|
-
let
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
let
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
16
|
+
var u = async (u, d, f, p, m, h, g, _) => {
|
|
17
|
+
let v = i(d), y = d.map((e) => e.erc20TokenAddress), b = d[0];
|
|
18
|
+
if (!b) throw Error("Solana Withdraw: No Token Found");
|
|
19
|
+
let { originalDeployer: x } = e[v].contractData;
|
|
20
|
+
if (!x) throw Error("missing data");
|
|
21
|
+
let S = m ?? y[0], C = {
|
|
22
|
+
mintTo: y[0],
|
|
23
|
+
recipient: p,
|
|
24
|
+
nullifierCount: await o(u, v, y, f)
|
|
25
|
+
}, w = h ?? await s(v, S, y, n.Transact, [], g, C);
|
|
26
|
+
h && g !== void 0 && (w = {
|
|
27
|
+
...w,
|
|
28
|
+
variableRate: g
|
|
29
|
+
});
|
|
30
|
+
let T = await c(v, b, -f[0], w);
|
|
31
|
+
f[0] -= T.flatFee;
|
|
32
|
+
let [E, D] = await Promise.all([u.getRandomRelay(v, !0), u.getEthereumAddress()]);
|
|
33
|
+
if (!E) throw Error(t.RELAYER_NOT_AVAILABLE);
|
|
34
|
+
if (y.length > 1) throw Error("Solana Withdraw: Only one mint address is supported");
|
|
35
|
+
let O = {
|
|
36
|
+
recipient: p,
|
|
37
|
+
mint: y[0] === "11111111111111111111111111111111" ? void 0 : y[0]
|
|
38
|
+
}, k = a(_, v, y, f, D);
|
|
39
|
+
return l(u, {
|
|
40
|
+
chainId: v,
|
|
41
|
+
mintAddresses: y,
|
|
42
|
+
amountChanges: f,
|
|
43
|
+
relayAddress: E,
|
|
44
|
+
recipient: p,
|
|
45
|
+
signer: E,
|
|
52
46
|
functionName: "transact",
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
dimensions: P
|
|
61
|
-
},
|
|
62
|
-
accounts: H,
|
|
63
|
-
commitmentValidationData: V,
|
|
64
|
-
adminData: u(x, S, C, c, await i.getEthereumAddress())
|
|
47
|
+
accounts: O,
|
|
48
|
+
relayerFee: T.flatFee,
|
|
49
|
+
variableRate: T.variableRate,
|
|
50
|
+
submit: {
|
|
51
|
+
mode: r.Relayer,
|
|
52
|
+
adminData: k
|
|
53
|
+
}
|
|
65
54
|
});
|
|
66
55
|
};
|
|
67
56
|
//#endregion
|
|
68
|
-
export {
|
|
57
|
+
export { u as hinkalSolanaWithdraw };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`../../constants/protocol.constants.cjs`);const e=require(`../../error-handling/error-codes.constants.cjs`),t=require(`../../
|
|
1
|
+
require(`../../constants/protocol.constants.cjs`);const e=require(`../../error-handling/error-codes.constants.cjs`),t=require(`../../types/transact.types.cjs`),n=require(`../../functions/utils/token-check.utils.cjs`),r=require(`../../functions/snarkjs/common.snarkjs.cjs`),i=require(`../../functions/pre-transaction/constructAdminData.cjs`),a=require(`../../functions/pre-transaction/getFeeStructure.cjs`),o=require(`../../functions/pre-transaction/getExternalSwapAddress.cjs`);require(`../../functions/pre-transaction/index.cjs`);const s=require(`./hinkalTransact.cjs`),c=require(`../../constants/bridging.constants.cjs`),l=require(`../../functions/pre-transaction/merge-with-fee-structure.cjs`);var u=async(u,d,f,p,m,h,g,_=c.DEFAULT_BRIDGING_SLIPPAGE,v)=>{let y=n.validateAndGetChainId(d),b=d.map(e=>e.erc20TokenAddress),x=await u.getEthereumAddressByChain(y),S=g??await a.getFeeStructure(y,h,b,p,void 0,35n);await l.mergeWithFeeStructure(y,b,f,S);let C=o.getExternalSwapAddress(y,p),w=[!1,!0,!1].slice(0,f.length),T=await u.getRandomRelay(y,!0);if(!T)throw Error(e.transactionErrorCodes.RELAYER_NOT_AVAILABLE);let E=i.constructAdminData(v,y,b,f,x,d),D=r.buildSwapSlippageValues(f,_);return f.length>1&&(f[1]=0n),s.hinkalTransact(u,{chainId:y,erc20Addresses:b,amountChanges:f,externalAddress:C,externalActionId:p,externalActionMetadata:m,onChainCreation:w,feeStructure:S,relay:T,slippageValues:D,submit:{mode:t.SubmitMode.Relayer,adminData:E}})};exports.hinkalSwap=u;
|
|
@@ -4,4 +4,4 @@ import { FeeStructure } from '../../types/hinkal.types';
|
|
|
4
4
|
import { ERC20Token } from '../../types/token.types';
|
|
5
5
|
import { AdminTransactionType } from '../../types/admin.types';
|
|
6
6
|
export declare const hinkalSwap: (hinkal: IHinkal, erc20tokens: ERC20Token[], deltaAmounts: bigint[], externalActionId: ExternalActionId, data: string, // call data used to call the router contracts.
|
|
7
|
-
feeToken?: string, feeStructureOverride?: FeeStructure, action?: AdminTransactionType) => Promise<string>;
|
|
7
|
+
feeToken?: string, feeStructureOverride?: FeeStructure, slippagePercentage?: number, action?: AdminTransactionType) => Promise<string>;
|
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
import "../../constants/protocol.constants.mjs";
|
|
2
2
|
import { transactionErrorCodes as e } from "../../error-handling/error-codes.constants.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import { SubmitMode as t } from "../../types/transact.types.mjs";
|
|
4
4
|
import { validateAndGetChainId as n } from "../../functions/utils/token-check.utils.mjs";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
5
|
+
import { buildSwapSlippageValues as r } from "../../functions/snarkjs/common.snarkjs.mjs";
|
|
6
|
+
import { constructAdminData as i } from "../../functions/pre-transaction/constructAdminData.mjs";
|
|
7
|
+
import { getFeeStructure as a } from "../../functions/pre-transaction/getFeeStructure.mjs";
|
|
8
|
+
import { getExternalSwapAddress as o } from "../../functions/pre-transaction/getExternalSwapAddress.mjs";
|
|
9
9
|
import "../../functions/pre-transaction/index.mjs";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { mergeWithFeeStructure as u } from "../../functions/pre-transaction/merge-with-fee-structure.mjs";
|
|
10
|
+
import { hinkalTransact as s } from "./hinkalTransact.mjs";
|
|
11
|
+
import { DEFAULT_BRIDGING_SLIPPAGE as c } from "../../constants/bridging.constants.mjs";
|
|
12
|
+
import { mergeWithFeeStructure as l } from "../../functions/pre-transaction/merge-with-fee-structure.mjs";
|
|
14
13
|
//#region libs/shared/common/src/data-structures/Hinkal/hinkalSwap.ts
|
|
15
|
-
var
|
|
16
|
-
let
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
c.push(n);
|
|
20
|
-
}
|
|
21
|
-
return {
|
|
22
|
-
inputUtxosArray: s,
|
|
23
|
-
outputUtxosArray: c
|
|
24
|
-
};
|
|
25
|
-
}, f = async (t, r, i, f, p, m, h, g) => {
|
|
26
|
-
let _ = n(r), v = r.map((e) => e.erc20TokenAddress), y = await t.getEthereumAddressByChain(_), b = h ?? await o(_, m, v, f, void 0, 35n);
|
|
27
|
-
await u(_, v, i, b);
|
|
28
|
-
let x = {
|
|
29
|
-
externalActionId: f,
|
|
30
|
-
externalAddress: l(_, f),
|
|
31
|
-
externalActionMetadata: p
|
|
32
|
-
}, [S, { inputUtxosArray: C, outputUtxosArray: w }] = await Promise.all([t.getRandomRelay(_, !0), d(t, _, v, i)]);
|
|
33
|
-
if (!S) throw Error(e.RELAYER_NOT_AVAILABLE);
|
|
34
|
-
let T = [
|
|
14
|
+
var u = async (u, d, f, p, m, h, g, _ = c, v) => {
|
|
15
|
+
let y = n(d), b = d.map((e) => e.erc20TokenAddress), x = await u.getEthereumAddressByChain(y), S = g ?? await a(y, h, b, p, void 0, 35n);
|
|
16
|
+
await l(y, b, f, S);
|
|
17
|
+
let C = o(y, p), w = [
|
|
35
18
|
!1,
|
|
36
19
|
!0,
|
|
37
20
|
!1
|
|
38
|
-
].slice(0,
|
|
39
|
-
|
|
21
|
+
].slice(0, f.length), T = await u.getRandomRelay(y, !0);
|
|
22
|
+
if (!T) throw Error(e.RELAYER_NOT_AVAILABLE);
|
|
23
|
+
let E = i(v, y, b, f, x, d), D = r(f, _);
|
|
24
|
+
return f.length > 1 && (f[1] = 0n), s(u, {
|
|
25
|
+
chainId: y,
|
|
26
|
+
erc20Addresses: b,
|
|
27
|
+
amountChanges: f,
|
|
28
|
+
externalAddress: C,
|
|
29
|
+
externalActionId: p,
|
|
30
|
+
externalActionMetadata: m,
|
|
31
|
+
onChainCreation: w,
|
|
32
|
+
feeStructure: S,
|
|
33
|
+
relay: T,
|
|
34
|
+
slippageValues: D,
|
|
35
|
+
submit: {
|
|
36
|
+
mode: t.Relayer,
|
|
37
|
+
adminData: E
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
40
|
};
|
|
41
41
|
//#endregion
|
|
42
|
-
export {
|
|
42
|
+
export { u as hinkalSwap };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../../constants/chains.constants.cjs`),t=require(`../../constants/protocol.constants.cjs`),n=require(`../../types/hinkal.types.cjs`),r=require(`../utxo/Utxo.cjs`),i=require(`../../types/transact.types.cjs`),a=require(`../../functions/web3/events/getShieldedBalance.cjs`),o=require(`../../functions/pre-transaction/outputUtxoProcessing.cjs`),s=require(`../../functions/snarkjs/common.snarkjs.cjs`),c=require(`../../functions/snarkjs/constructTxEnclave.cjs`),l=require(`../../functions/pre-transaction/speculativeUtxo.cjs`),u=require(`../../functions/snarkjs/constructGeneralZkProof.cjs`),d=require(`../../functions/web3/functionCalls/submitProof.cjs`);var f=2,p=6,m=(e,t)=>{let n=Math.max(...t.map(e=>e.length))<=f?f:p;return t.map(t=>{let i=t[0];if(!i)throw Error(`hinkalTransact: inputUtxos must contain at least one note per token`);let a=[...t];for(;a.length<n;)a.push(new r.Utxo({amount:0n,erc20TokenAddress:i.erc20TokenAddress,mintAddress:i.mintAddress,nullifyingKey:e.getShieldedPrivateKey(),spendingPublicKey:e.getSpendingKeyPair().pubSpendingBJJPoint}));return a})},h=(e,t,n)=>{if(t.length!==1||t[0].length!==1)throw Error(`selfOutputAmounts only supports a single token with a single self-output`);let i=t[0][0],a=n.reduce((e,t)=>e+t,0n);if(a!==i.amount)throw Error(`selfOutputAmounts sum to ${a}, expected ${i.amount}`);return[n.map(t=>new r.Utxo({amount:t,erc20TokenAddress:i.erc20TokenAddress,mintAddress:i.mintAddress,nullifyingKey:e.getShieldedPrivateKey(),timeStamp:i.timeStamp,spendingPublicKey:e.getSpendingKeyPair().pubSpendingBJJPoint}))]},g=async(e,r,i)=>{let{chainId:s,erc20Addresses:c,amountChanges:d,externalAddress:f,externalActionId:p,externalActionMetadata:g,feeStructure:_,relay:v,onChainCreation:y,recipientAddress:b,recipientAmounts:x,useBlockedUtxos:S,inputUtxos:C,forceEmptyUtxos:w,originalSender:T,subAccountPrivateKey:E,emporiumOps:D,createBlockedUtxos:O,selfOutputAmounts:k,speculative:A,slippageValues:j}=r,M=C?m(i,C):[...await a.addPaddingToUtxos(e,s,c,d,void 0,w,S,y)],N=o.buildOutputUtxos(i,M,d,b,x),P=k?h(i,N,k):N,F=e.merkleTreeHinkalByChain[s],I=A?l.speculativeMerkleTree(F,M,A.pendingLeaves):F,{zkCallData:L,circomData:R,dimData:z,commitmentValidationData:B}=await u.constructZkProof(I,M,P,i,p??0n,f,D??g??`0x00`,_??n.zeroFeeStructure,v??t.zeroAddress,s,y,void 0,T,E,void 0,O,I!==F,j);return{zkCallData:L,circomData:R,dimData:z,commitmentValidationData:B}},_=async(t,n,r)=>{let{chainId:i,erc20Addresses:a,externalAddress:o,amountChanges:s,relay:l,feeStructure:u,externalActionId:d,externalActionMetadata:f,onChainCreation:p,recipientAddress:m,recipientAmounts:h,useBlockedUtxos:g,createBlockedUtxos:_,skipLock:v,selfOutputAmounts:y,forceEmptyUtxos:b,messageSeed:x,inputUtxos:S,originalSender:C,speculative:w,slippageValues:T}=n,{jobId:E,signedMessageHash:D}=await c.prepareTxEnclaveCall(t,{chainId:i,hinkalAddress:e.networkRegistry[i].contractData.hinkalAddress,erc20Addresses:a,externalAddress:o,originalSender:C,amountChanges:s,relay:l,feeStructure:u,externalActionId:d,externalActionMetadata:f,onChainCreation:p,recipientAddress:m,recipientAmounts:h,useBlockedUtxos:g,createBlockedUtxos:_,skipLock:v,selfOutputAmounts:y,forceEmptyUtxos:b,messageSeed:x,inputCommitments:w?void 0:c.collectInputCommitments(S),speculative:w,slippageValues:T},r),{R8:O,S:k}=r.signEddsa(BigInt(D));return{jobId:E,eddsaSignature:{R8:O,S:k}}},v=async(e,t,n)=>{let r=await d.submitProof(e,t,n);return t.submit.mode!==i.SubmitMode.ProofOnly&&t.onTxSubmitLocally?.(n.circomData),r},y=async(e,t)=>{if(t.userKeys&&!t.inputUtxos)throw Error(`hinkalTransact: userKeys requires explicit inputUtxos`);let n=t.userKeys??e.userKeys,{chainId:r,submit:a}=t;if(e.generateProofRemotely){let{jobId:o,eddsaSignature:l}=await _(e,t,n);if(a.mode===i.SubmitMode.Relayer)return c.finalizeTxEnclaveCallRelay(o,l,r,{adminData:a.adminData,authorizationData:a.authorizationData,withUniswapWorkAround:a.withUniswapWorkAround});let{zkCallData:u,circomData:d,dimData:f,commitmentValidationData:p,tronProofSignature:m}=await c.finalizeTxEnclaveCall(o,l);return v(e,t,{zkCallData:u,circomData:s.deserializeCircomData(d),dimData:f,commitmentValidationData:p,tronProofSignature:m})}return v(e,t,await g(e,t,n))};exports.hinkalTransact=y;
|