@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
|
@@ -11,9 +11,7 @@ import { PublicKey as c } from "@solana/web3.js";
|
|
|
11
11
|
var l = async (n, a, o, l) => {
|
|
12
12
|
let u = t([n]), d = i.getAddressFromSubAccount(u, o);
|
|
13
13
|
if (!d) throw Error("Public account address is not available");
|
|
14
|
-
let {
|
|
15
|
-
if (!f) throw Error("RPC URL not found for the specified chain ID");
|
|
16
|
-
let p = r(f), m = new c(d), { instructions: h, programId: g } = await s(p, m, new c(l), n, a);
|
|
14
|
+
let { rpcUrl: f } = e[u], p = r(f), m = new c(d), { instructions: h, programId: g } = await s(p, m, new c(l), n, a);
|
|
17
15
|
return {
|
|
18
16
|
connection: p,
|
|
19
17
|
chainId: u,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`../../../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../constants/chains.constants.cjs`);require(`../../constants/protocol.constants.cjs`);const t=require(`../../error-handling/error-codes.constants.cjs`),n=require(`../../functions/utils/solanaMint.utils.cjs`),r=require(`../../functions/utils/addresses.cjs`),i=require(`../../functions/utils/token-check.utils.cjs`),a=require(`../../functions/pre-transaction/solana.cjs`),o=require(`../../functions/pre-transaction/constructAdminData.cjs`),s=require(`../../functions/utils/create-provider.cjs`),c=require(`../AccountActions/AccountActions.cjs`),l=require(`../../functions/pre-transaction/sendV0Transaction.cjs`),u=require(`../../API/admin-calls.cjs`);let
|
|
1
|
+
require(`../../../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../constants/chains.constants.cjs`);require(`../../constants/protocol.constants.cjs`);const t=require(`../../error-handling/error-codes.constants.cjs`),n=require(`../../functions/utils/solanaMint.utils.cjs`),r=require(`../../functions/utils/addresses.cjs`),i=require(`../../functions/utils/token-check.utils.cjs`),a=require(`../../functions/pre-transaction/solana.cjs`),o=require(`../../functions/pre-transaction/constructAdminData.cjs`),s=require(`../../functions/utils/create-provider.cjs`),c=require(`../AccountActions/AccountActions.cjs`),l=require(`../../functions/pre-transaction/sendV0Transaction.cjs`),u=require(`../../functions/utils/solana-program.utils.cjs`),d=require(`../../API/admin-calls.cjs`),f=require(`../../functions/utils/fees.utils.cjs`),p=require(`../../functions/pre-transaction/solanaTransfer.utils.cjs`),m=require(`./hinkalProoflessDeposit.utils.cjs`);let h=require(`@solana/web3.js`),g=require(`@coral-xyz/anchor`);var _=async({program:e,mintPublicKey:t,mintAddressString:n,tokenAmount:r,stealthAddressStructure:i,recipientEncryptionKey:o,senderPublickey:s,originalDeployer:c,storageAccount:l,storageVault:u,merkleAccount:d,rootBuckets:f,createBlockedUtxos:p})=>{let h=new g.BN(r.toString()),_=a.buildAnchorStealthAddressStructure(i),v=n===`11111111111111111111111111111111`?null:t,y=n===`11111111111111111111111111111111`?null:void 0,[b]=m.buildProoflessEncryptedOutputs([i],[o]),x=Buffer.from(b.slice(2),`hex`),{current:S,next:C}=f;return e.methods.prooflessDeposit(h,_,x,p).accounts({mint:v,signer:s,signerAta:y,originalDeployer:c,storageAccount:l,storageVault:u,merkleAccount:d,rootBucketCurrent:S,rootBucketNext:C??e.programId,storageVaultAta:y}).instruction()},v=async({chainId:i,token:o,tokenAmount:c,senderAddress:l,recipientInfo:d,createBlockedUtxos:f=!1})=>{if(!r.isValidPrivateAddress(d))throw Error(t.transactionErrorCodes.RECIPIENT_FORMAT_INCORRECT);let{hinkalIdl:p,hinkalAddress:m,originalDeployer:g}=e.networkRegistry[i].contractData;if(!p)throw Error(`No IDL configured for Solana program on this network`);if(!g)throw Error(`missing original deployer`);let{rpcUrl:v}=e.networkRegistry[i],y=s.createCustomSolanaConnection(v),b=u.createReadOnlySolanaProgram(y,p),x=new h.PublicKey(g),S=new h.PublicKey(m),C=new h.PublicKey(l),{erc20TokenAddress:w}=o,{mintPublicKey:T}=n.formatMintAddress(w),E=T.toString(),D=a.getStorageAccountPublicKey(S,x),O=a.getStorageVaultPublicKey(S,x),k=a.getMerkleAccountPublicKey(S,x),A=r.constructStealthAddressStructure(d),j=r.getEncryptionKeyFromRecipientInfo(d),M=await a.resolveSolanaRootBuckets(b,k,1),N=await _({program:b,mintPublicKey:T,mintAddressString:E,tokenAmount:c,stealthAddressStructure:A,recipientEncryptionKey:j,senderPublickey:C,originalDeployer:x,storageAccount:D,storageVault:O,merkleAccount:k,rootBuckets:M,createBlockedUtxos:f}),P=n.getSolanaTokenProgramId(o.is2022Program);return{connection:y,senderAddress:l,senderPublickey:C,instructions:[N],storageAccount:D,storageVault:O,rootBucketCurrent:M.current,programId:P}},y=async(e,n,r,i,a,o,s=!1,l=0n)=>{let u=c.AccountActions.getAddressFromSubAccount(n,a);if(!u)throw Error(`Public account address is not available`);let d=await v({chainId:n,token:r,tokenAmount:i,senderAddress:u,recipientInfo:o??e.getRecipientInfo(),createBlockedUtxos:s});if(l<=0n)return d;let m=await e.getRandomRelay(n,!1);if(!m)throw Error(t.transactionErrorCodes.RELAYER_NOT_AVAILABLE);let{instructions:g}=await p.buildSolanaTransferInstructions(d.connection,d.senderPublickey,new h.PublicKey(m),r,f.calculateVariableFee(i,l));return{...d,instructions:[...g,...d.instructions]}},b=async(e,t,n,r,a,s=!1,c=0n,u)=>{if(!r)throw Error(`subAccount is required`);let f=i.validateAndGetChainId([t]),[{connection:p,senderPublickey:m,instructions:h},g]=await Promise.all([y(e,f,t,n,r,a,s,c),e.getEthereumAddress()]),_=await l.sendProxyV0Transaction({connection:p,chainId:f,subAccount:r,payerPublicKey:m,instructions:h});return d.emitTxPublicData(o.constructAdminData(u,f,[t.erc20TokenAddress],[n],g)),_};exports.hinkalSolanaProxyShield=b;
|
|
@@ -1,6 +1,28 @@
|
|
|
1
|
+
import { Connection, PublicKey, TransactionInstruction } from '@solana/web3.js';
|
|
1
2
|
import { ERC20Token } from '../../types/token.types';
|
|
2
3
|
import { IHinkal } from './IHinkal';
|
|
3
4
|
import { SubAccount } from '../../types/proxy.types';
|
|
4
5
|
import { AdminTransactionType } from '../../types/admin.types';
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
type SolanaProxyShieldContext = {
|
|
7
|
+
connection: Connection;
|
|
8
|
+
senderAddress: string;
|
|
9
|
+
senderPublickey: PublicKey;
|
|
10
|
+
instructions: TransactionInstruction[];
|
|
11
|
+
storageAccount: PublicKey;
|
|
12
|
+
storageVault: PublicKey;
|
|
13
|
+
rootBucketCurrent: PublicKey;
|
|
14
|
+
programId: PublicKey;
|
|
15
|
+
};
|
|
16
|
+
type BuildSolanaShieldContextParams = {
|
|
17
|
+
chainId: number;
|
|
18
|
+
token: ERC20Token;
|
|
19
|
+
tokenAmount: bigint;
|
|
20
|
+
senderAddress: string;
|
|
21
|
+
recipientInfo: string;
|
|
22
|
+
createBlockedUtxos?: boolean;
|
|
23
|
+
};
|
|
24
|
+
export declare const buildSolanaShieldContext: ({ chainId, token, tokenAmount, senderAddress, recipientInfo, createBlockedUtxos, }: BuildSolanaShieldContextParams) => Promise<SolanaProxyShieldContext>;
|
|
25
|
+
export declare const buildSolanaProxyShieldContext: (hinkal: IHinkal, chainId: number, token: ERC20Token, tokenAmount: bigint, subAccount: SubAccount, recipientInfo?: string, createBlockedUtxos?: boolean, variableRate?: bigint) => Promise<SolanaProxyShieldContext>;
|
|
26
|
+
export declare const hinkalSolanaProxyShield: (hinkal: IHinkal, token: ERC20Token, tokenAmount: bigint, subAccount: SubAccount, recipientInfo?: string, createBlockedUtxos?: boolean, variableRate?: bigint, action?: AdminTransactionType) => Promise<string>;
|
|
27
|
+
export declare const getSolanaProxyShieldSerializedTransaction: (hinkal: IHinkal, token: ERC20Token, tokenAmount: bigint, subAccount: SubAccount, recipientInfo?: string, createBlockedUtxos?: boolean, variableRate?: bigint) => Promise<string>;
|
|
28
|
+
export {};
|
|
@@ -1,69 +1,95 @@
|
|
|
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 { formatMintAddress as n } from "../../functions/utils/solanaMint.utils.mjs";
|
|
5
|
-
import { constructStealthAddressStructure as
|
|
6
|
-
import { validateAndGetChainId as
|
|
7
|
-
import { buildAnchorStealthAddressStructure as
|
|
8
|
-
import { constructAdminData as
|
|
9
|
-
import { createCustomSolanaConnection as
|
|
10
|
-
import { AccountActions as
|
|
11
|
-
import { sendProxyV0Transaction as
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
4
|
+
import { formatMintAddress as n, getSolanaTokenProgramId as r } from "../../functions/utils/solanaMint.utils.mjs";
|
|
5
|
+
import { constructStealthAddressStructure as i, getEncryptionKeyFromRecipientInfo as a, isValidPrivateAddress as o } from "../../functions/utils/addresses.mjs";
|
|
6
|
+
import { validateAndGetChainId as s } from "../../functions/utils/token-check.utils.mjs";
|
|
7
|
+
import { buildAnchorStealthAddressStructure as c, getMerkleAccountPublicKey as l, getStorageAccountPublicKey as u, getStorageVaultPublicKey as d, resolveSolanaRootBuckets as f } from "../../functions/pre-transaction/solana.mjs";
|
|
8
|
+
import { constructAdminData as p } from "../../functions/pre-transaction/constructAdminData.mjs";
|
|
9
|
+
import { createCustomSolanaConnection as m } from "../../functions/utils/create-provider.mjs";
|
|
10
|
+
import { AccountActions as h } from "../AccountActions/AccountActions.mjs";
|
|
11
|
+
import { sendProxyV0Transaction as g } from "../../functions/pre-transaction/sendV0Transaction.mjs";
|
|
12
|
+
import { createReadOnlySolanaProgram as _ } from "../../functions/utils/solana-program.utils.mjs";
|
|
13
|
+
import { emitTxPublicData as v } from "../../API/admin-calls.mjs";
|
|
14
|
+
import { calculateVariableFee as y } from "../../functions/utils/fees.utils.mjs";
|
|
15
|
+
import { buildSolanaTransferInstructions as b } from "../../functions/pre-transaction/solanaTransfer.utils.mjs";
|
|
16
|
+
import { buildProoflessEncryptedOutputs as x } from "./hinkalProoflessDeposit.utils.mjs";
|
|
17
|
+
import { PublicKey as S } from "@solana/web3.js";
|
|
18
|
+
import { BN as C } from "@coral-xyz/anchor";
|
|
16
19
|
//#region libs/shared/common/src/data-structures/Hinkal/hinkalSolanaProxyShield.ts
|
|
17
|
-
var
|
|
18
|
-
let
|
|
19
|
-
return e.methods.prooflessDeposit(
|
|
20
|
-
mint:
|
|
21
|
-
signer:
|
|
22
|
-
signerAta:
|
|
23
|
-
originalDeployer:
|
|
24
|
-
storageAccount:
|
|
25
|
-
storageVault:
|
|
26
|
-
|
|
20
|
+
var w = async ({ program: e, mintPublicKey: t, mintAddressString: n, tokenAmount: r, stealthAddressStructure: i, recipientEncryptionKey: a, senderPublickey: o, originalDeployer: s, storageAccount: l, storageVault: u, merkleAccount: d, rootBuckets: f, createBlockedUtxos: p }) => {
|
|
21
|
+
let m = new C(r.toString()), h = c(i), g = n === "11111111111111111111111111111111" ? null : t, _ = n === "11111111111111111111111111111111" ? null : void 0, [v] = x([i], [a]), y = Buffer.from(v.slice(2), "hex"), { current: b, next: S } = f;
|
|
22
|
+
return e.methods.prooflessDeposit(m, h, y, p).accounts({
|
|
23
|
+
mint: g,
|
|
24
|
+
signer: o,
|
|
25
|
+
signerAta: _,
|
|
26
|
+
originalDeployer: s,
|
|
27
|
+
storageAccount: l,
|
|
28
|
+
storageVault: u,
|
|
29
|
+
merkleAccount: d,
|
|
30
|
+
rootBucketCurrent: b,
|
|
31
|
+
rootBucketNext: S ?? e.programId,
|
|
32
|
+
storageVaultAta: _
|
|
27
33
|
}).instruction();
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
if (!x) throw Error("
|
|
33
|
-
let {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
if (!A) throw Error("RPC URL not found for the specified chain ID");
|
|
38
|
-
let j = u(A), { mintPublicKey: M } = n(k), N = M.toString(), P = s(D, E), F = c(D, E), I = await v({
|
|
39
|
-
program: T,
|
|
40
|
-
mintPublicKey: M,
|
|
41
|
-
mintAddressString: N,
|
|
34
|
+
}, T = async ({ chainId: s, token: c, tokenAmount: p, senderAddress: h, recipientInfo: g, createBlockedUtxos: v = !1 }) => {
|
|
35
|
+
if (!o(g)) throw Error(t.RECIPIENT_FORMAT_INCORRECT);
|
|
36
|
+
let { hinkalIdl: y, hinkalAddress: b, originalDeployer: x } = e[s].contractData;
|
|
37
|
+
if (!y) throw Error("No IDL configured for Solana program on this network");
|
|
38
|
+
if (!x) throw Error("missing original deployer");
|
|
39
|
+
let { rpcUrl: C } = e[s], T = m(C), E = _(T, y), D = new S(x), O = new S(b), k = new S(h), { erc20TokenAddress: A } = c, { mintPublicKey: j } = n(A), M = j.toString(), N = u(O, D), P = d(O, D), F = l(O, D), I = i(g), L = a(g), R = await f(E, F, 1), z = await w({
|
|
40
|
+
program: E,
|
|
41
|
+
mintPublicKey: j,
|
|
42
|
+
mintAddressString: M,
|
|
42
43
|
tokenAmount: p,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
stealthAddressStructure: I,
|
|
45
|
+
recipientEncryptionKey: L,
|
|
46
|
+
senderPublickey: k,
|
|
47
|
+
originalDeployer: D,
|
|
48
|
+
storageAccount: N,
|
|
49
|
+
storageVault: P,
|
|
50
|
+
merkleAccount: F,
|
|
51
|
+
rootBuckets: R,
|
|
52
|
+
createBlockedUtxos: v
|
|
53
|
+
}), B = r(c.is2022Program);
|
|
49
54
|
return {
|
|
50
|
-
connection:
|
|
51
|
-
senderAddress:
|
|
52
|
-
senderPublickey:
|
|
53
|
-
instructions: [
|
|
54
|
-
storageAccount:
|
|
55
|
-
|
|
55
|
+
connection: T,
|
|
56
|
+
senderAddress: h,
|
|
57
|
+
senderPublickey: k,
|
|
58
|
+
instructions: [z],
|
|
59
|
+
storageAccount: N,
|
|
60
|
+
storageVault: P,
|
|
61
|
+
rootBucketCurrent: R.current,
|
|
62
|
+
programId: B
|
|
56
63
|
};
|
|
57
|
-
},
|
|
64
|
+
}, E = async (e, n, r, i, a, o, s = !1, c = 0n) => {
|
|
65
|
+
let l = h.getAddressFromSubAccount(n, a);
|
|
66
|
+
if (!l) throw Error("Public account address is not available");
|
|
67
|
+
let u = await T({
|
|
68
|
+
chainId: n,
|
|
69
|
+
token: r,
|
|
70
|
+
tokenAmount: i,
|
|
71
|
+
senderAddress: l,
|
|
72
|
+
recipientInfo: o ?? e.getRecipientInfo(),
|
|
73
|
+
createBlockedUtxos: s
|
|
74
|
+
});
|
|
75
|
+
if (c <= 0n) return u;
|
|
76
|
+
let d = await e.getRandomRelay(n, !1);
|
|
77
|
+
if (!d) throw Error(t.RELAYER_NOT_AVAILABLE);
|
|
78
|
+
let { instructions: f } = await b(u.connection, u.senderPublickey, new S(d), r, y(i, c));
|
|
79
|
+
return {
|
|
80
|
+
...u,
|
|
81
|
+
instructions: [...f, ...u.instructions]
|
|
82
|
+
};
|
|
83
|
+
}, D = async (e, t, n, r, i, a = !1, o = 0n, c) => {
|
|
58
84
|
if (!r) throw Error("subAccount is required");
|
|
59
|
-
let
|
|
60
|
-
connection:
|
|
61
|
-
chainId:
|
|
85
|
+
let l = s([t]), [{ connection: u, senderPublickey: d, instructions: f }, m] = await Promise.all([E(e, l, t, n, r, i, a, o), e.getEthereumAddress()]), h = await g({
|
|
86
|
+
connection: u,
|
|
87
|
+
chainId: l,
|
|
62
88
|
subAccount: r,
|
|
63
|
-
payerPublicKey:
|
|
64
|
-
instructions:
|
|
89
|
+
payerPublicKey: d,
|
|
90
|
+
instructions: f
|
|
65
91
|
});
|
|
66
|
-
return p(
|
|
92
|
+
return v(p(c, l, [t.erc20TokenAddress], [n], m)), h;
|
|
67
93
|
};
|
|
68
94
|
//#endregion
|
|
69
|
-
export {
|
|
95
|
+
export { D as hinkalSolanaProxyShield };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`../../../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../constants/chains.constants.cjs`),t=require(`../../error-handling/error-codes.constants.cjs`),n=require(`../../types/external-action.types.cjs`),r=require(`../../functions/utils/token-check.utils.cjs`),i=require(`../../functions/pre-transaction/constructAdminData.cjs`),a=require(`../../functions/utils/create-provider.cjs`),o=require(`../AccountActions/AccountActions.cjs`),s=require(`../../functions/pre-transaction/sendV0Transaction.cjs`),c=require(`../../functions/pre-transaction/getFeeStructure.cjs`)
|
|
1
|
+
require(`../../../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../constants/chains.constants.cjs`),t=require(`../../error-handling/error-codes.constants.cjs`),n=require(`../../types/external-action.types.cjs`),r=require(`../../functions/utils/token-check.utils.cjs`),i=require(`../../functions/pre-transaction/constructAdminData.cjs`),a=require(`../../functions/utils/create-provider.cjs`),o=require(`../AccountActions/AccountActions.cjs`),s=require(`../../functions/pre-transaction/sendV0Transaction.cjs`),c=require(`../../functions/pre-transaction/getFeeStructure.cjs`),l=require(`../../API/admin-calls.cjs`);require(`../../constants/index.cjs`);const u=require(`../../functions/pre-transaction/solanaTransfer.utils.cjs`);require(`../AccountActions/index.cjs`);let d=require(`@solana/web3.js`);var f=async(e,t)=>{let{addressLookupTableAccount:n,instructionLists:r}=JSON.parse(t).data,i=await Promise.all(n.map(async t=>{let n=await e.getAddressLookupTable(new d.PublicKey(t));if(!n.value)throw Error(`Failed to fetch lookup table: ${t}`);return n.value}));if(r.length===0)throw Error(`No instructions found`);return{instructions:r.map(e=>new d.TransactionInstruction({keys:e.accounts.map(e=>({pubkey:new d.PublicKey(e.pubkey),isSigner:e.isSigner,isWritable:e.isWritable})),programId:new d.PublicKey(e.programId),data:Buffer.from(e.data,`base64`)})),lookupTableAccounts:i}},p=async(e,t)=>{let n=d.VersionedTransaction.deserialize(Buffer.from(t,`base64`)),r=await Promise.all(n.message.addressTableLookups.map(async({accountKey:t})=>{let n=await e.getAddressLookupTable(t);if(!n.value)throw Error(`Failed to fetch lookup table: ${t.toBase58()}`);return n.value})),{instructions:i}=d.TransactionMessage.decompile(n.message,{addressLookupTableAccounts:r});return{instructions:i,lookupTableAccounts:r}},m=async(t,r,i,s)=>{let c=o.AccountActions.getAddressFromSubAccount(t,i);if(!c)throw Error(`Public account address is not available`);let{rpcUrl:l}=e.networkRegistry[t],u=a.createCustomSolanaConnection(l),m=new d.PublicKey(c),{instructions:h,lookupTableAccounts:g}=s===n.ExternalActionId.Lifi?await p(u,r):await f(u,r);return{connection:u,walletPublicKey:m,instructions:h,lookupTableAccounts:g}},h=async(e,a,o,f,p,h,g,_,v,y)=>{let b=r.validateAndGetChainId(a),[{connection:x,walletPublicKey:S,instructions:C,lookupTableAccounts:w},T,E]=await Promise.all([m(b,f,p,h),g?e.getRandomRelay(b):Promise.resolve(null),e.getEthereumAddressByChain(b)]),D=C;if(g){if(!T)throw Error(t.transactionErrorCodes.RELAYER_NOT_AVAILABLE);let e=a[1],r=o[1]*(v??await c.getFeeStructure(b,_,a.map(e=>e.erc20TokenAddress),n.ExternalActionId.Emporium)).variableRate/10000n,{instructions:i}=await u.buildSolanaTransferInstructions(x,S,new d.PublicKey(T),e,r);D=[...C,...i]}let O=await s.sendProxyV0Transaction({connection:x,chainId:b,subAccount:p,payerPublicKey:S,instructions:D,lookupTableAccounts:w});return l.emitTxPublicData(i.constructAdminData(y,b,a.map(e=>e.erc20TokenAddress),o,E,a)),O};exports.hinkalSolanaProxySwap=h;
|
|
@@ -2,5 +2,5 @@ import { AdminTransactionType, ERC20Token, SubAccount } from '../../types';
|
|
|
2
2
|
import { IHinkal } from './IHinkal';
|
|
3
3
|
import { FeeStructure } from '../../types/hinkal.types';
|
|
4
4
|
import { ExternalActionId } from '../../types/external-action.types';
|
|
5
|
-
export declare const hinkalSolanaProxySwap: (hinkal: IHinkal, erc20Tokens: ERC20Token[], amountChanges: bigint[], data: string, subAccount: SubAccount, externalActionId: ExternalActionId, feeToken?: string, feeStructureOverride?: FeeStructure, action?: AdminTransactionType) => Promise<string>;
|
|
5
|
+
export declare const hinkalSolanaProxySwap: (hinkal: IHinkal, erc20Tokens: ERC20Token[], amountChanges: bigint[], data: string, subAccount: SubAccount, externalActionId: ExternalActionId, isTheSameChainSwap: boolean, feeToken?: string, feeStructureOverride?: FeeStructure, action?: AdminTransactionType) => Promise<string>;
|
|
6
6
|
export declare const getSolanaProxySwapSerializedTransaction: (chainId: number, data: string, subAccount: SubAccount, externalActionId: ExternalActionId) => Promise<string>;
|
|
@@ -7,8 +7,8 @@ import { createCustomSolanaConnection as a } from "../../functions/utils/create-
|
|
|
7
7
|
import { AccountActions as o } from "../AccountActions/AccountActions.mjs";
|
|
8
8
|
import { sendProxyV0Transaction as s } from "../../functions/pre-transaction/sendV0Transaction.mjs";
|
|
9
9
|
import { getFeeStructure as c } from "../../functions/pre-transaction/getFeeStructure.mjs";
|
|
10
|
-
import "../../constants/index.mjs";
|
|
11
10
|
import { emitTxPublicData as l } from "../../API/admin-calls.mjs";
|
|
11
|
+
import "../../constants/index.mjs";
|
|
12
12
|
import { buildSolanaTransferInstructions as u } from "../../functions/pre-transaction/solanaTransfer.utils.mjs";
|
|
13
13
|
import "../AccountActions/index.mjs";
|
|
14
14
|
import { PublicKey as d, TransactionInstruction as f, TransactionMessage as p, VersionedTransaction as m } from "@solana/web3.js";
|
|
@@ -45,35 +45,33 @@ var h = async (e, t) => {
|
|
|
45
45
|
}, _ = async (t, r, i, s) => {
|
|
46
46
|
let c = o.getAddressFromSubAccount(t, i);
|
|
47
47
|
if (!c) throw Error("Public account address is not available");
|
|
48
|
-
let {
|
|
49
|
-
if (!l) throw Error("RPC URL not found for the specified chain ID");
|
|
50
|
-
let u = a(l), f = new d(c), { instructions: p, lookupTableAccounts: m } = s === n.Lifi ? await g(u, r) : await h(u, r);
|
|
48
|
+
let { rpcUrl: l } = e[t], u = a(l), f = new d(c), { instructions: p, lookupTableAccounts: m } = s === n.Lifi ? await g(u, r) : await h(u, r);
|
|
51
49
|
return {
|
|
52
50
|
connection: u,
|
|
53
51
|
walletPublicKey: f,
|
|
54
52
|
instructions: p,
|
|
55
53
|
lookupTableAccounts: m
|
|
56
54
|
};
|
|
57
|
-
}, v = async (e, a, o, f, p, m, h, g, v) => {
|
|
58
|
-
let
|
|
59
|
-
_(
|
|
60
|
-
|
|
61
|
-
e.getEthereumAddressByChain(
|
|
55
|
+
}, v = async (e, a, o, f, p, m, h, g, v, y) => {
|
|
56
|
+
let b = r(a), [{ connection: x, walletPublicKey: S, instructions: C, lookupTableAccounts: w }, T, E] = await Promise.all([
|
|
57
|
+
_(b, f, p, m),
|
|
58
|
+
h ? e.getRandomRelay(b) : Promise.resolve(null),
|
|
59
|
+
e.getEthereumAddressByChain(b)
|
|
62
60
|
]), D = C;
|
|
63
|
-
if (
|
|
61
|
+
if (h) {
|
|
64
62
|
if (!T) throw Error(t.RELAYER_NOT_AVAILABLE);
|
|
65
|
-
let e = a[1], r = o[1] * (
|
|
63
|
+
let e = a[1], r = o[1] * (v ?? await c(b, g, a.map((e) => e.erc20TokenAddress), n.Emporium)).variableRate / 10000n, { instructions: i } = await u(x, S, new d(T), e, r);
|
|
66
64
|
D = [...C, ...i];
|
|
67
65
|
}
|
|
68
66
|
let O = await s({
|
|
69
67
|
connection: x,
|
|
70
|
-
chainId:
|
|
68
|
+
chainId: b,
|
|
71
69
|
subAccount: p,
|
|
72
70
|
payerPublicKey: S,
|
|
73
71
|
instructions: D,
|
|
74
72
|
lookupTableAccounts: w
|
|
75
73
|
});
|
|
76
|
-
return l(i(
|
|
74
|
+
return l(i(y, b, a.map((e) => e.erc20TokenAddress), o, E, a)), O;
|
|
77
75
|
};
|
|
78
76
|
//#endregion
|
|
79
77
|
export { v as hinkalSolanaProxySwap };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../../types/solana.types.cjs`),t=require(`../../functions/utils/token-check.utils.cjs`),n=require(`../../functions/pre-transaction/constructAdminData.cjs`),r=require(`../AccountActions/AccountActions.cjs`),i=require(`../../API/admin-calls.cjs`),a=require(`../../functions/utils/solana-sponsored.utils.cjs`);var o=async(o,s,c,l,u,d,f)=>{let p=t.validateAndGetChainId([s]),m=r.AccountActions.getAddressFromSubAccount(p,c);if(!m)throw Error(`Missing temp wallet address for bridge shield`);let h=await o.getRandomRelay(p,!0);if(!h)throw Error(`No Solana relayer available for bridge shield`);let{txHash:g,feeWei:_}=await a.sendSolanaSponsoredTx({chainId:p,tempSubAccount:c,intent:{kind:e.SolanaSponsoredTxKind.Shield,tokenAddress:s.erc20TokenAddress,amount:l.toString(),senderAddress:m,relayAddress:h,recipientInfo:u,variableRate:f?.toString()}}),v=l-_;return i.emitTxPublicData(n.constructAdminData(d,p,[s.erc20TokenAddress],[v],m)),{txHash:g,shieldedAmount:v}};exports.hinkalSolanaSponsoredShield=o;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AdminTransactionType } from '../../types/admin.types';
|
|
2
|
+
import { SubAccount } from '../../types/proxy.types';
|
|
3
|
+
import { ERC20Token } from '../../types/token.types';
|
|
4
|
+
import { IHinkal } from './IHinkal';
|
|
5
|
+
export declare const hinkalSolanaSponsoredShield: (hinkal: IHinkal, token: ERC20Token, tempSubAccount: SubAccount, landedAmount: bigint, recipientInfo: string, action?: AdminTransactionType, variableRate?: bigint) => Promise<{
|
|
6
|
+
txHash: string;
|
|
7
|
+
shieldedAmount: bigint;
|
|
8
|
+
}>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { SolanaSponsoredTxKind as e } from "../../types/solana.types.mjs";
|
|
2
|
+
import { validateAndGetChainId as t } from "../../functions/utils/token-check.utils.mjs";
|
|
3
|
+
import { constructAdminData as n } from "../../functions/pre-transaction/constructAdminData.mjs";
|
|
4
|
+
import { AccountActions as r } from "../AccountActions/AccountActions.mjs";
|
|
5
|
+
import { emitTxPublicData as i } from "../../API/admin-calls.mjs";
|
|
6
|
+
import { sendSolanaSponsoredTx as a } from "../../functions/utils/solana-sponsored.utils.mjs";
|
|
7
|
+
//#region libs/shared/common/src/data-structures/Hinkal/hinkalSolanaSponsoredShield.ts
|
|
8
|
+
var o = async (o, s, c, l, u, d, f) => {
|
|
9
|
+
let p = t([s]), m = r.getAddressFromSubAccount(p, c);
|
|
10
|
+
if (!m) throw Error("Missing temp wallet address for bridge shield");
|
|
11
|
+
let h = await o.getRandomRelay(p, !0);
|
|
12
|
+
if (!h) throw Error("No Solana relayer available for bridge shield");
|
|
13
|
+
let { txHash: g, feeWei: _ } = await a({
|
|
14
|
+
chainId: p,
|
|
15
|
+
tempSubAccount: c,
|
|
16
|
+
intent: {
|
|
17
|
+
kind: e.Shield,
|
|
18
|
+
tokenAddress: s.erc20TokenAddress,
|
|
19
|
+
amount: l.toString(),
|
|
20
|
+
senderAddress: m,
|
|
21
|
+
relayAddress: h,
|
|
22
|
+
recipientInfo: u,
|
|
23
|
+
variableRate: f?.toString()
|
|
24
|
+
}
|
|
25
|
+
}), v = l - _;
|
|
26
|
+
return i(n(d, p, [s.erc20TokenAddress], [v], m)), {
|
|
27
|
+
txHash: g,
|
|
28
|
+
shieldedAmount: v
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
//#endregion
|
|
32
|
+
export { o as hinkalSolanaSponsoredShield };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`../../../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../constants/chains.constants.cjs`),t=require(`../../constants/protocol.constants.cjs`),n=require(`../../error-handling/error-codes.constants.cjs`),r=require(`../../functions/web3/etherFunctions.cjs`),i=require(
|
|
1
|
+
require(`../../../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../constants/chains.constants.cjs`),t=require(`../../constants/protocol.constants.cjs`),n=require(`../../error-handling/error-codes.constants.cjs`),r=require(`../../functions/web3/etherFunctions.cjs`),i=require(`../../types/external-action.types.cjs`),a=require(`../../types/cache.types.cjs`),o=require(`../../types/solana-transact.types.cjs`);require(`../../types/index.cjs`);const s=require(`../../functions/utils/token-check.utils.cjs`),c=require(`../../functions/pre-transaction/solana.cjs`),l=require(`../../functions/pre-transaction/constructAdminData.cjs`),u=require(`../../functions/pre-transaction/calculateSolanaNullifierCount.cjs`),d=require(`../../functions/pre-transaction/convert-okx-instructions.cjs`),f=require(`../../functions/pre-transaction/getFeeStructure.cjs`),p=require(`./hinkalSolanaTransact.cjs`);let m=require(`@solana/web3.js`);var h=async(h,g,_,v,y,b,x,S,C)=>{let w=s.validateAndGetChainId(g),T=new m.PublicKey(t.solanaNativeAddress),{hinkalAddress:E,originalDeployer:D}=e.networkRegistry[w].contractData;if(!D)throw Error(`No IDL configured for Solana program on this network`);let O=new m.PublicKey(D),k=new m.PublicKey(E),A=g.map(e=>e.erc20TokenAddress),j=x??A[1];if(x&&x!==A[1])throw Error(`Solana swap fee token must match the output token`);let M={mintFrom:A[0],mintTo:A[1],nullifierCount:await u.calculateSolanaNullifierCount(h,w,A,_),rootInsertCount:2},N=S??await f.getFeeStructure(w,j,A,i.ExternalActionId.Okx,[],void 0,M),P=_[1],F=Number(h.cacheDevice.get(a.StorageKeys.SLIPPAGE_PERCENTAGE)??0),I=g[1],L=r.getAmountInToken(I,P),R=Number(L)*F/100;_[1]-=r.getAmountInWei(I,R.toFixed(I.decimals));let z=P*BigInt(N.variableRate??0)/10000n+N.flatFee;if(_[1]-=z,_[1]<0)throw Error(n.transactionErrorCodes.LOW_OUTPUT_AMOUNT);let[B,V]=await Promise.all([h.getRandomRelay(w,!0),h.getEthereumAddressByChain(w)]);if(!B)throw Error(n.transactionErrorCodes.RELAYER_NOT_AVAILABLE);let{remainingAccounts:H,hinkalInstructions:U}=d.convertOKXToHinkalInstructions(y,c.getSwapperAccountPublicKeyFromSalt(k,O,v)),W=g[0].erc20TokenAddress===`11111111111111111111111111111111`?null:new m.PublicKey(g[0].erc20TokenAddress),G=g[1].erc20TokenAddress===`11111111111111111111111111111111`?null:new m.PublicKey(g[1].erc20TokenAddress),K={recipient:T.toString(),mintFrom:W?.toString()??null,mintTo:G?.toString()??null,remainingAccounts:H.map(e=>({pubkey:e.pubkey.toString(),isSigner:e.isSigner,isWritable:e.isWritable})),addressLookupTableAccount:b},q=l.constructAdminData(C,w,A,_,V,g),J=U.map(e=>({accountIndexes:[...e.accountIndexes],data:[...e.data],programIndex:e.programIndex}));return p.hinkalSolanaTransact(h,{chainId:w,mintAddresses:A,amountChanges:_,relayAddress:B,recipient:T.toString(),signer:B,functionName:`swap`,accounts:K,onChainCreation:[!1,!0],relayerFee:N.flatFee,variableRate:N.variableRate,hinkalInstructions:J,remainingAccounts:K.remainingAccounts,swapperAccountSalt:v,submit:{mode:o.SolanaSubmitMode.Relayer,adminData:q}})};exports.hinkalSolanaSwap=h;
|
|
@@ -1,92 +1,71 @@
|
|
|
1
1
|
import { networkRegistry as e } from "../../constants/chains.constants.mjs";
|
|
2
2
|
import { solanaNativeAddress as t } from "../../constants/protocol.constants.mjs";
|
|
3
3
|
import { transactionErrorCodes as n } from "../../error-handling/error-codes.constants.mjs";
|
|
4
|
-
import { getAmountInToken as r, getAmountInWei as i
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { StorageKeys as l } from "../../types/cache.types.mjs";
|
|
4
|
+
import { getAmountInToken as r, getAmountInWei as i } from "../../functions/web3/etherFunctions.mjs";
|
|
5
|
+
import { ExternalActionId as a } from "../../types/external-action.types.mjs";
|
|
6
|
+
import { StorageKeys as o } from "../../types/cache.types.mjs";
|
|
7
|
+
import { SolanaSubmitMode as s } from "../../types/solana-transact.types.mjs";
|
|
9
8
|
import "../../types/index.mjs";
|
|
10
|
-
import { validateAndGetChainId as
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import { getFeeStructure as v } from "../../functions/pre-transaction/getFeeStructure.mjs";
|
|
19
|
-
import { constructSolanaZkProof as y } from "../../functions/snarkjs/constructSolanaZkProof.mjs";
|
|
20
|
-
import { solanaTransactCallRelayer as b } from "../../functions/web3/functionCalls/transactCallRelayer.mjs";
|
|
21
|
-
import { ethers as x } from "ethers";
|
|
22
|
-
import { PublicKey as S } from "@solana/web3.js";
|
|
9
|
+
import { validateAndGetChainId as c } from "../../functions/utils/token-check.utils.mjs";
|
|
10
|
+
import { getSwapperAccountPublicKeyFromSalt as l } from "../../functions/pre-transaction/solana.mjs";
|
|
11
|
+
import { constructAdminData as u } from "../../functions/pre-transaction/constructAdminData.mjs";
|
|
12
|
+
import { calculateSolanaNullifierCount as d } from "../../functions/pre-transaction/calculateSolanaNullifierCount.mjs";
|
|
13
|
+
import { convertOKXToHinkalInstructions as f } from "../../functions/pre-transaction/convert-okx-instructions.mjs";
|
|
14
|
+
import { getFeeStructure as p } from "../../functions/pre-transaction/getFeeStructure.mjs";
|
|
15
|
+
import { hinkalSolanaTransact as m } from "./hinkalSolanaTransact.mjs";
|
|
16
|
+
import { PublicKey as h } from "@solana/web3.js";
|
|
23
17
|
//#region libs/shared/common/src/data-structures/Hinkal/hinkalSolanaSwap.ts
|
|
24
|
-
var
|
|
25
|
-
let
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
]);
|
|
46
|
-
if (!U) throw Error(n.RELAYER_NOT_AVAILABLE);
|
|
47
|
-
let K = s.userKeys.getShieldedPrivateKey(), q = o.findCorrectRandomization(a(31), K), J = {
|
|
48
|
-
tokenNumber: 2,
|
|
49
|
-
nullifierAmount: W[0].length,
|
|
50
|
-
outputAmount: 1
|
|
51
|
-
}, Y = ee(G).map((e) => [...x.getBytes(e[0])]), X = m(j, A, C), { remainingAccounts: Z, hinkalInstructions: Q } = g(re, X);
|
|
52
|
-
_(W, G, f);
|
|
53
|
-
let { proofAArr: $, proofBArr: se, proofCArr: ce, publicInputsArr: le, commitmentValidationData: ue } = await y(s.generateProofRemotely, P[E], N, M, W, G, q, F.flatFee, F.variableRate, D.toString(), U, J, Y, E, Q, Z, C), de = te(j, A), fe = p(j, A), pe = d[0].erc20TokenAddress === "11111111111111111111111111111111" ? null : new S(d[0].erc20TokenAddress), me = d[1].erc20TokenAddress === "11111111111111111111111111111111" ? null : new S(d[1].erc20TokenAddress), he = {
|
|
54
|
-
recipient: D.toString(),
|
|
55
|
-
storageAccount: de.toString(),
|
|
56
|
-
storageVault: fe.toString(),
|
|
57
|
-
swapperAccount: X.toString(),
|
|
58
|
-
mintFrom: pe?.toString() ?? null,
|
|
59
|
-
mintTo: me?.toString() ?? null,
|
|
60
|
-
remainingAccounts: Z.map((e) => ({
|
|
18
|
+
var g = async (g, _, v, y, b, x, S, C, w) => {
|
|
19
|
+
let T = c(_), E = new h(t), { hinkalAddress: D, originalDeployer: O } = e[T].contractData;
|
|
20
|
+
if (!O) throw Error("No IDL configured for Solana program on this network");
|
|
21
|
+
let k = new h(O), A = new h(D), j = _.map((e) => e.erc20TokenAddress), M = S ?? j[1];
|
|
22
|
+
if (S && S !== j[1]) throw Error("Solana swap fee token must match the output token");
|
|
23
|
+
let N = {
|
|
24
|
+
mintFrom: j[0],
|
|
25
|
+
mintTo: j[1],
|
|
26
|
+
nullifierCount: await d(g, T, j, v),
|
|
27
|
+
rootInsertCount: 2
|
|
28
|
+
}, P = C ?? await p(T, M, j, a.Okx, [], void 0, N), F = v[1], I = Number(g.cacheDevice.get(o.SLIPPAGE_PERCENTAGE) ?? 0), L = _[1], R = r(L, F), z = Number(R) * I / 100;
|
|
29
|
+
v[1] -= i(L, z.toFixed(L.decimals));
|
|
30
|
+
let B = F * BigInt(P.variableRate ?? 0) / 10000n + P.flatFee;
|
|
31
|
+
if (v[1] -= B, v[1] < 0) throw Error(n.LOW_OUTPUT_AMOUNT);
|
|
32
|
+
let [V, H] = await Promise.all([g.getRandomRelay(T, !0), g.getEthereumAddressByChain(T)]);
|
|
33
|
+
if (!V) throw Error(n.RELAYER_NOT_AVAILABLE);
|
|
34
|
+
let { remainingAccounts: U, hinkalInstructions: W } = f(b, l(A, k, y)), G = _[0].erc20TokenAddress === "11111111111111111111111111111111" ? null : new h(_[0].erc20TokenAddress), K = _[1].erc20TokenAddress === "11111111111111111111111111111111" ? null : new h(_[1].erc20TokenAddress), q = {
|
|
35
|
+
recipient: E.toString(),
|
|
36
|
+
mintFrom: G?.toString() ?? null,
|
|
37
|
+
mintTo: K?.toString() ?? null,
|
|
38
|
+
remainingAccounts: U.map((e) => ({
|
|
61
39
|
pubkey: e.pubkey.toString(),
|
|
62
40
|
isSigner: e.isSigner,
|
|
63
41
|
isWritable: e.isWritable
|
|
64
42
|
})),
|
|
65
|
-
addressLookupTableAccount:
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
43
|
+
addressLookupTableAccount: x
|
|
44
|
+
}, J = u(w, T, j, v, H, _), Y = W.map((e) => ({
|
|
45
|
+
accountIndexes: [...e.accountIndexes],
|
|
46
|
+
data: [...e.data],
|
|
47
|
+
programIndex: e.programIndex
|
|
48
|
+
}));
|
|
49
|
+
return m(g, {
|
|
50
|
+
chainId: T,
|
|
51
|
+
mintAddresses: j,
|
|
52
|
+
amountChanges: v,
|
|
53
|
+
relayAddress: V,
|
|
54
|
+
recipient: E.toString(),
|
|
55
|
+
signer: V,
|
|
70
56
|
functionName: "swap",
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
data: [...e.data],
|
|
83
|
-
programIndex: e.programIndex
|
|
84
|
-
}))
|
|
85
|
-
},
|
|
86
|
-
accounts: he,
|
|
87
|
-
commitmentValidationData: ue,
|
|
88
|
-
adminData: h(T, E, M, f, oe, d)
|
|
57
|
+
accounts: q,
|
|
58
|
+
onChainCreation: [!1, !0],
|
|
59
|
+
relayerFee: P.flatFee,
|
|
60
|
+
variableRate: P.variableRate,
|
|
61
|
+
hinkalInstructions: Y,
|
|
62
|
+
remainingAccounts: q.remainingAccounts,
|
|
63
|
+
swapperAccountSalt: y,
|
|
64
|
+
submit: {
|
|
65
|
+
mode: s.Relayer,
|
|
66
|
+
adminData: J
|
|
67
|
+
}
|
|
89
68
|
});
|
|
90
69
|
};
|
|
91
70
|
//#endregion
|
|
92
|
-
export {
|
|
71
|
+
export { g as hinkalSolanaSwap };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`../../../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../types/solana-transact.types.cjs`),t=require(`../../functions/web3/events/getShieldedBalance.cjs`),n=require(`../../functions/pre-transaction/outputUtxoProcessing.cjs`),r=require(`../../functions/snarkjs/common.snarkjs.cjs`),i=require(`../../functions/snarkjs/constructTxEnclave.cjs`),a=require(`../../functions/pre-transaction/speculativeUtxo.cjs`),o=require(`../../functions/web3/functionCalls/transactCallRelayer.cjs`),s=require(`../../functions/snarkjs/constructSolanaZkProof.cjs`);let c=require(`ethers`),l=require(`@solana/web3.js`);var u=(e=[])=>e.map(({accountIndexes:e,data:t,programIndex:n})=>({accountIndexes:Buffer.from(e),data:Buffer.from(t),programIndex:n})),d=(e=[])=>e.map(({pubkey:e,isSigner:t,isWritable:n})=>({pubkey:new l.PublicKey(e),isSigner:t,isWritable:n})),f=async(e,n)=>{let{inputUtxos:r,chainId:i,mintAddresses:a,amountChanges:o,useBlockedUtxos:s,onChainCreation:c}=n;return r||[...await t.addPaddingToUtxos(e,i,a,o,void 0,void 0,s,c)]},p=(e,t,r)=>{let{amountChanges:i,recipientAddress:a,recipientAmounts:o}=e;return n.buildOutputUtxos(t,r,i,a===void 0?void 0:[a],a===void 0?void 0:[o??[]])},m=async(e,t,n)=>{let{chainId:i,mintAddresses:o,relayAddress:l,recipient:m,relayerFee:h,variableRate:g,functionName:_,hinkalInstructions:v,remainingAccounts:y,swapperAccountSalt:b,onChainCreation:x,speculative:S}=t,C=await f(e,t),w=p(t,n,C),T=e.merkleTreeHinkalByChain[i],E=S?a.speculativeMerkleTree(T,C,S.pendingLeaves):T,D={tokenNumber:o.length,nullifierAmount:C[0].length,outputAmount:w[0].length},{proofAArr:O,proofBArr:k,proofCArr:A,publicInputsArr:j,commitmentValidationData:M,rootHashHinkalIndex:N,encryptedOutputs:P,onChainEncryptedOutput:F}=await s.constructSolanaZkProof(E,n,o,C,w,h??0n,g??0n,m,l,D,x,i,u(v),d(y),b,E!==T);return{args:{proofAArr:O,proofBArr:k,proofCArr:A,publicInputsArr:j,encryptedOutputs:P,relayerFee:(h??0n).toString(),..._===`swap`?{variableRate:(g??0n).toString(),onChainEncryptedOutput:F,onChainCreation:x??[],hinkalInstructions:v??[]}:{},dimensions:D,rootHashIndex:N.toString()},commitmentValidationData:M,notes:{inputNullifiers:C.flat().filter(e=>e.amount>0n).map(e=>e.getNullifier()),outCommitments:r.buildOutCommitments(w).flat(),encryptedOutputs:P.map(e=>c.ethers.hexlify(new Uint8Array(e)))}}},h=async(e,t,n)=>{let{inputUtxos:r}=t,{jobId:a,signedMessageHash:o}=await i.prepareSolanaTxEnclaveCall(e,{chainId:t.chainId,mintAddresses:t.mintAddresses,amountChanges:t.amountChanges,relayAddress:t.relayAddress,recipient:t.recipient,signer:t.signer,functionName:t.functionName,accounts:t.accounts,onChainCreation:t.onChainCreation,relayerFee:t.relayerFee,variableRate:t.variableRate,swapperAccountSalt:t.swapperAccountSalt,hinkalInstructions:t.hinkalInstructions,remainingAccounts:t.remainingAccounts,recipientAddress:t.recipientAddress,recipientAmounts:t.recipientAmounts,recipientAmount:t.recipientAmount,displayRecipient:t.displayRecipient,useBlockedUtxos:t.useBlockedUtxos,messageSeed:t.messageSeed,inputCommitments:t.speculative?void 0:i.collectInputCommitments(r),speculative:t.speculative},n),{R8:s,S:c}=n.signEddsa(BigInt(o));return{jobId:a,eddsaSignature:{R8:s,S:c}}},g=(t,n)=>{let{chainId:r,relayAddress:i,functionName:a,accounts:s,submit:c}=t;if(c.mode!==e.SolanaSubmitMode.Relayer)throw Error(`hinkalSolanaTransact: relayer submit expected`);return o.solanaTransactCallRelayer({chainId:r,relayAddress:i,functionName:a,args:n.args,accounts:s,commitmentValidationData:n.commitmentValidationData,adminData:c.adminData})},_=async(t,n)=>{if(t.submit.mode!==e.SolanaSubmitMode.Relayer)return n;let r=await g(t,n);return n.notes&&t.onTxSubmitLocally?.(n.notes),r},v=async(t,n)=>{if(n.userKeys&&!n.inputUtxos)throw Error(`hinkalSolanaTransact: userKeys requires explicit inputUtxos`);let r=n.userKeys??t.userKeys,{chainId:a,submit:o}=n;if(t.generateProofRemotely){let{jobId:s,eddsaSignature:c}=await h(t,n,r);if(o.mode===e.SolanaSubmitMode.Relayer)return i.finalizeSolanaTxEnclaveCallRelay(s,c,a,{adminData:o.adminData});let{solanaArgs:l,commitmentValidationData:u}=await i.finalizeSolanaTxEnclaveCall(s,c);return _(n,{args:l,commitmentValidationData:u})}return _(n,await m(t,n,r))};exports.hinkalSolanaTransact=v;
|