@layerswap/widget 0.1.4 → 0.1.14
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 +78 -3
- package/dist/Models/Theme.d.ts +7 -6
- package/dist/Models/Theme.js +7 -7
- package/dist/Models/WalletProvider.d.ts +0 -4
- package/dist/Models/WalletProvider.js +2 -0
- package/dist/components/Buttons/copyButton.js +4 -3
- package/dist/components/ColorSchema.js +79 -45
- package/dist/components/Common/AddressIcon.js +1 -0
- package/dist/components/Common/AverageCompletionTime.js +1 -1
- package/dist/components/Common/CountDownTimer.js +2 -2
- package/dist/components/Common/FormattedAverageCompletionTime.js +1 -1
- package/dist/components/HeaderWithMenu/index.js +1 -8
- package/dist/components/Input/Address/AddressNote.js +3 -2
- package/dist/components/Input/Address/AddressPicker/AddressWithIcon.js +2 -2
- package/dist/components/Input/Address/AddressPicker/ConnectedWallets/ConnectWalletButton.js +12 -5
- package/dist/components/Input/Address/AddressPicker/ExchangeNote.d.ts +1 -1
- package/dist/components/Input/Address/AddressPicker/ExchangeNote.js +1 -1
- package/dist/components/Input/RouteIcon.js +1 -1
- package/dist/components/LayerswapMenu/MenuList.js +2 -56
- package/dist/components/Pages/404/index.js +1 -0
- package/dist/components/Pages/Auth/Steps/CodeStep/VerifyEmailCode.js +1 -0
- package/dist/components/Pages/Auth/index.d.ts +1 -1
- package/dist/components/Pages/Auth/index.js +3 -2
- package/dist/components/Pages/Campaigns/Details/Leaderboard.js +1 -0
- package/dist/components/Pages/Campaigns/Details/index.d.ts +1 -1
- package/dist/components/Pages/Campaigns/Details/index.js +3 -2
- package/dist/components/Pages/Campaigns/index.d.ts +1 -1
- package/dist/components/Pages/Campaigns/index.js +3 -2
- package/dist/components/Pages/Maintanance/index.js +1 -0
- package/dist/components/Pages/NoCookies/index.js +1 -0
- package/dist/components/Pages/SwapHistory/History.js +1 -2
- package/dist/components/Pages/SwapHistory/index.d.ts +1 -1
- package/dist/components/Pages/SwapHistory/index.js +4 -3
- package/dist/components/Pages/SwapPages/Form/FeeDetails/Campaign.js +1 -0
- package/dist/components/Pages/SwapPages/Form/Form.js +1 -4
- package/dist/components/Pages/SwapPages/Form/SecondaryComponents/ValidationError.js +1 -1
- package/dist/components/Pages/SwapPages/Form/Select/Popover/PopoverSelect.js +1 -1
- package/dist/components/Pages/SwapPages/Form/index.js +1 -0
- package/dist/components/Pages/SwapPages/Withdraw/Coinbase/Carousel.js +8 -6
- package/dist/components/Pages/SwapPages/Withdraw/Processing/Processing.js +2 -2
- package/dist/components/Pages/SwapPages/Withdraw/Wallet/FuelWalletWithdrawal.d.ts +0 -4
- package/dist/components/Pages/SwapPages/Withdraw/Wallet/FuelWalletWithdrawal.js +159 -125
- package/dist/components/Pages/SwapPages/Withdraw/Wallet/ImtblxWalletWithdrawStep.d.ts +0 -4
- package/dist/components/Pages/SwapPages/Withdraw/Wallet/ImtblxWalletWithdrawStep.js +69 -51
- package/dist/components/Pages/SwapPages/Withdraw/Wallet/Loopring/ActivationTokentPicker.d.ts +0 -8
- package/dist/components/Pages/SwapPages/Withdraw/Wallet/Loopring/ActivationTokentPicker.js +87 -45
- package/dist/components/Pages/SwapPages/Withdraw/Wallet/Loopring/hooks.d.ts +0 -40
- package/dist/components/Pages/SwapPages/Withdraw/Wallet/Loopring/hooks.js +73 -46
- package/dist/components/Pages/SwapPages/Withdraw/Wallet/Loopring/index.d.ts +0 -4
- package/dist/components/Pages/SwapPages/Withdraw/Wallet/Loopring/index.js +175 -128
- package/dist/components/Pages/SwapPages/Withdraw/Wallet/SVMWalletWithdraw/index.d.ts +0 -7
- package/dist/components/Pages/SwapPages/Withdraw/Wallet/SVMWalletWithdraw/index.js +138 -116
- package/dist/components/Pages/SwapPages/Withdraw/Wallet/SVMWalletWithdraw/transactionSender.d.ts +0 -8
- package/dist/components/Pages/SwapPages/Withdraw/Wallet/SVMWalletWithdraw/transactionSender.js +96 -75
- package/dist/components/Pages/SwapPages/Withdraw/Wallet/SophonWalletWithdraw.js +2 -2
- package/dist/components/Pages/SwapPages/Withdraw/Wallet/StarknetWalletWithdraw.d.ts +0 -4
- package/dist/components/Pages/SwapPages/Withdraw/Wallet/StarknetWalletWithdraw.js +88 -71
- package/dist/components/Pages/SwapPages/Withdraw/Wallet/TonWalletWithdraw.d.ts +0 -4
- package/dist/components/Pages/SwapPages/Withdraw/Wallet/TonWalletWithdraw.js +146 -136
- package/dist/components/Pages/SwapPages/Withdraw/Wallet/TronWalletWithdraw.d.ts +0 -4
- package/dist/components/Pages/SwapPages/Withdraw/Wallet/TronWalletWithdraw.js +120 -99
- package/dist/components/Pages/SwapPages/Withdraw/Wallet/WalletTransfer/TransferToken.js +3 -3
- package/dist/components/Pages/SwapPages/Withdraw/Wallet/WalletTransfer/buttons.js +1 -0
- package/dist/components/Pages/SwapPages/Withdraw/Wallet/WalletTransfer/index.js +1 -1
- package/dist/components/Pages/SwapPages/Withdraw/Wallet/WalletTransfer/transactionMessage.js +2 -2
- package/dist/components/Pages/SwapPages/Withdraw/Wallet/WalletTransferContent.js +101 -33
- package/dist/components/Pages/SwapPages/Withdraw/Wallet/paradex/Evm.d.ts +0 -4
- package/dist/components/Pages/SwapPages/Withdraw/Wallet/paradex/Evm.js +60 -55
- package/dist/components/Pages/SwapPages/Withdraw/Wallet/paradex/Starknet.d.ts +0 -4
- package/dist/components/Pages/SwapPages/Withdraw/Wallet/paradex/Starknet.js +71 -55
- package/dist/components/Pages/SwapPages/Withdraw/Wallet/paradex/buttons.js +1 -0
- package/dist/components/Pages/SwapPages/Withdraw/Wallet/paradex/index.d.ts +0 -4
- package/dist/components/Pages/SwapPages/Withdraw/Wallet/paradex/index.js +56 -52
- package/dist/components/Pages/SwapPages/Withdraw/index.d.ts +1 -1
- package/dist/components/Pages/SwapPages/Withdraw/index.js +3 -2
- package/dist/components/Wallet/WalletModal/Connector.js +1 -1
- package/dist/components/Wallet/WalletProviders/FuelProvider.d.ts +0 -5
- package/dist/components/Wallet/WalletProviders/FuelProvider.js +25 -20
- package/dist/components/Wallet/WalletProviders/ImtblPassportProvider.d.ts +0 -5
- package/dist/components/Wallet/WalletProviders/ImtblPassportProvider.js +39 -36
- package/dist/components/Wallet/WalletProviders/SolanaProvider.d.ts +0 -5
- package/dist/components/Wallet/WalletProviders/SolanaProvider.js +49 -38
- package/dist/components/Wallet/WalletProviders/StarknetProvider.d.ts +0 -5
- package/dist/components/Wallet/WalletProviders/StarknetProvider.js +112 -117
- package/dist/components/Wallet/WalletProviders/TonConnectProvider.d.ts +0 -6
- package/dist/components/Wallet/WalletProviders/TonConnectProvider.js +58 -50
- package/dist/components/Wallet/WalletProviders/TronProvider.d.ts +0 -3
- package/dist/components/Wallet/WalletProviders/TronProvider.js +23 -15
- package/dist/components/Wallet/WalletProviders/Wagmi.d.ts +1 -1
- package/dist/components/Wallet/WalletProviders/Wagmi.js +20 -10
- package/dist/components/Wallet/WalletProviders/index.js +13 -6
- package/dist/components/Widget/Footer.d.ts +2 -1
- package/dist/components/Widget/Footer.js +13 -4
- package/dist/components/Widget/Index.d.ts +1 -1
- package/dist/components/Widget/Index.js +1 -1
- package/dist/components/WidgetLoading.d.ts +1 -0
- package/dist/components/WidgetLoading.js +5 -0
- package/dist/components/Wizard/Wizard.js +1 -1
- package/dist/components/shadcn/command.js +1 -1
- package/dist/components/themeWrapper.js +3 -2
- package/dist/context/{LayerswapContext.d.ts → LayerswapProvider.d.ts} +3 -8
- package/dist/context/{LayerswapContext.js → LayerswapProvider.js} +8 -9
- package/dist/context/authContext.js +1 -0
- package/dist/context/walletHooksProvider.js +1 -0
- package/dist/hooks/useWallet.js +10 -14
- package/dist/index.css +1 -1
- package/dist/index.d.ts +3 -5
- package/dist/index.js +2 -4
- package/dist/index.mjs +19 -0
- package/dist/lib/AppSettings.d.ts +7 -3
- package/dist/lib/AppSettings.js +8 -7
- package/dist/lib/address/formatter/index.js +8 -9
- package/dist/lib/address/validator/index.js +18 -20
- package/dist/lib/axiosInterceptor.js +1 -2
- package/dist/lib/balances/balanceResolver.js +16 -16
- package/dist/lib/balances/providers/evmBalanceProvider.js +3 -3
- package/dist/lib/balances/providers/loopringBalanceProvider.d.ts +0 -6
- package/dist/lib/balances/providers/loopringBalanceProvider.js +56 -43
- package/dist/lib/balances/providers/paradexBalanceProvider.d.ts +0 -6
- package/dist/lib/balances/providers/paradexBalanceProvider.js +42 -42
- package/dist/lib/balances/providers/solanaBalanceProvider.d.ts +0 -6
- package/dist/lib/balances/providers/solanaBalanceProvider.js +70 -71
- package/dist/lib/balances/providers/starknetBalanceProvider.d.ts +0 -6
- package/dist/lib/balances/providers/starknetBalanceProvider.js +48 -45
- package/dist/lib/balances/providers/tonBalanceProvider.d.ts +0 -18
- package/dist/lib/balances/providers/tonBalanceProvider.js +104 -100
- package/dist/lib/balances/providers/tronBalanceResolver.js +2 -3
- package/dist/lib/fuels/common/FakeAccount.d.ts +0 -24
- package/dist/lib/fuels/common/FakeAccount.js +58 -36
- package/dist/lib/fuels/common/PredicateConnector.d.ts +0 -54
- package/dist/lib/fuels/common/PredicateConnector.js +292 -205
- package/dist/lib/fuels/common/PredicateFactory.d.ts +0 -29
- package/dist/lib/fuels/common/PredicateFactory.js +123 -76
- package/dist/lib/fuels/common/PredicateWalletAdapter.d.ts +0 -17
- package/dist/lib/fuels/common/PredicateWalletAdapter.js +44 -29
- package/dist/lib/fuels/common/index.d.ts +0 -4
- package/dist/lib/fuels/common/index.js +4 -4
- package/dist/lib/fuels/connectors/fuel-wallet/FuelWalletConnector.d.ts +0 -51
- package/dist/lib/fuels/connectors/fuel-wallet/FuelWalletConnector.js +268 -234
- package/dist/lib/fuels/connectors/fuel-wallet/index.d.ts +0 -2
- package/dist/lib/fuels/connectors/fuel-wallet/index.js +2 -2
- package/dist/lib/fuels/connectors/fuel-wallet/types.d.ts +0 -50
- package/dist/lib/fuels/connectors/fuel-wallet/types.js +53 -9
- package/dist/lib/fuels/connectors/fuelet-wallet/FueletWalletConnector.d.ts +0 -7
- package/dist/lib/fuels/connectors/fuelet-wallet/FueletWalletConnector.js +20 -19
- package/dist/lib/fuels/connectors/fuelet-wallet/index.d.ts +0 -1
- package/dist/lib/fuels/connectors/fuelet-wallet/index.js +1 -1
- package/dist/lib/gases/gasResolver.d.ts +1 -1
- package/dist/lib/gases/gasResolver.js +10 -10
- package/dist/lib/gases/providers/evmGasProvider.js +5 -4
- package/dist/lib/gases/providers/loopringGasProvider.d.ts +0 -6
- package/dist/lib/gases/providers/loopringGasProvider.js +27 -24
- package/dist/lib/gases/providers/solanaGasProvider.d.ts +0 -7
- package/dist/lib/gases/providers/solanaGasProvider.js +32 -31
- package/dist/lib/gases/providers/starknetGasProvider.d.ts +0 -7
- package/dist/lib/gases/providers/starknetGasProvider.js +34 -33
- package/dist/lib/imtbl.d.ts +0 -69
- package/dist/lib/imtbl.js +63 -60
- package/dist/lib/internalApiClient.d.ts +0 -2
- package/dist/lib/internalApiClient.js +1 -4
- package/dist/lib/layerSwapApiClient.js +3 -3
- package/dist/lib/logError.js +2 -2
- package/dist/lib/nft/nftBalanceResolver.js +1 -2
- package/dist/lib/nft/providers/starknetNftProvider.d.ts +0 -6
- package/dist/lib/nft/providers/starknetNftProvider.js +49 -50
- package/dist/lib/wallets/connectors/EthereumProvider.d.ts +2 -2
- package/dist/lib/wallets/connectors/useSyncProviders/store.d.ts +1 -4
- package/dist/lib/wallets/fuel/Bako.d.ts +0 -15
- package/dist/lib/wallets/fuel/Bako.js +34 -29
- package/dist/lib/wallets/fuel/Basko.d.ts +0 -15
- package/dist/lib/wallets/fuel/Basko.js +34 -29
- package/dist/lib/wallets/fuel/useFuel.d.ts +0 -2
- package/dist/lib/wallets/fuel/useFuel.js +211 -192
- package/dist/lib/wallets/imtblX/useImtblX.d.ts +0 -2
- package/dist/lib/wallets/imtblX/useImtblX.js +87 -87
- package/dist/lib/wallets/paradex/Authorize/Ethereum.d.ts +0 -2
- package/dist/lib/wallets/paradex/Authorize/Ethereum.js +24 -23
- package/dist/lib/wallets/paradex/Authorize/Starknet.d.ts +0 -2
- package/dist/lib/wallets/paradex/Authorize/Starknet.js +14 -13
- package/dist/lib/wallets/paradex/lib/account.d.ts +0 -28
- package/dist/lib/wallets/paradex/lib/account.js +102 -53
- package/dist/lib/wallets/paradex/lib/index.d.ts +0 -24
- package/dist/lib/wallets/paradex/lib/index.js +20 -20
- package/dist/lib/wallets/paradex/lib/paraclear-provider.d.ts +0 -6
- package/dist/lib/wallets/paradex/lib/paraclear-provider.js +13 -9
- package/dist/lib/wallets/paradex/lib/paraclear.d.ts +0 -137
- package/dist/lib/wallets/paradex/lib/paraclear.js +258 -131
- package/dist/lib/wallets/paradex/lib/starknet-account-support.d.ts +0 -22
- package/dist/lib/wallets/paradex/lib/starknet-account-support.js +296 -220
- package/dist/lib/wallets/paradex/lib/starknet-signer.d.ts +0 -15
- package/dist/lib/wallets/paradex/lib/starknet-signer.js +120 -94
- package/dist/lib/wallets/paradex/useParadex.d.ts +0 -7
- package/dist/lib/wallets/paradex/useParadex.js +197 -194
- package/dist/lib/wallets/solana/transactionBuilder.d.ts +0 -4
- package/dist/lib/wallets/solana/transactionBuilder.js +63 -39
- package/dist/lib/wallets/solana/useSVM.d.ts +0 -5
- package/dist/lib/wallets/solana/useSVM.js +139 -142
- package/dist/lib/wallets/starknet/useStarknet.d.ts +0 -2
- package/dist/lib/wallets/starknet/useStarknet.js +139 -139
- package/dist/lib/wallets/ton/client.d.ts +0 -3
- package/dist/lib/wallets/ton/client.js +7 -7
- package/dist/lib/wallets/ton/useTON.d.ts +0 -2
- package/dist/lib/wallets/ton/useTON.js +121 -122
- package/dist/lib/wallets/tron/connectors/bitkeep.d.ts +0 -61
- package/dist/lib/wallets/tron/connectors/bitkeep.js +326 -303
- package/dist/lib/wallets/tron/connectors/index.d.ts +0 -4
- package/dist/lib/wallets/tron/connectors/index.js +4 -4
- package/dist/lib/wallets/tron/connectors/okxWallet.d.ts +0 -66
- package/dist/lib/wallets/tron/connectors/okxWallet.js +364 -336
- package/dist/lib/wallets/tron/connectors/tokenPocket.d.ts +0 -72
- package/dist/lib/wallets/tron/connectors/tokenPocket.js +337 -308
- package/dist/lib/wallets/tron/connectors/tronLink/index.d.ts +0 -102
- package/dist/lib/wallets/tron/connectors/tronLink/index.js +560 -520
- package/dist/lib/wallets/tron/connectors/tronLink/types.d.ts +0 -56
- package/dist/lib/wallets/tron/connectors/tronLink/types.js +53 -1
- package/dist/lib/wallets/tron/connectors/tronLink/utils.d.ts +0 -14
- package/dist/lib/wallets/tron/connectors/tronLink/utils.js +64 -61
- package/dist/lib/wallets/tron/useTron.d.ts +0 -2
- package/dist/lib/wallets/tron/useTron.js +111 -111
- package/dist/lib/wallets/utils/resolveWalletIcon.js +1 -0
- package/package.json +26 -77
- package/dist/hooks/useCopyClipboard.d.ts +0 -1
- package/dist/hooks/useCopyClipboard.js +0 -21
- package/dist/index.cjs +0 -125
- package/dist/lib/abis/ERC20.json +0 -258
- package/dist/lib/fuels/connectors/walletConnect/WalletConnectConnector.d.ts +0 -42
- package/dist/lib/fuels/connectors/walletConnect/WalletConnectConnector.js +0 -357
- package/dist/lib/fuels/connectors/walletConnect/constants.d.ts +0 -6
- package/dist/lib/fuels/connectors/walletConnect/constants.js +0 -7
- package/dist/lib/fuels/connectors/walletConnect/index.d.ts +0 -3
- package/dist/lib/fuels/connectors/walletConnect/index.js +0 -3
- package/dist/lib/fuels/connectors/walletConnect/types.d.ts +0 -12
- package/dist/lib/fuels/connectors/walletConnect/types.js +0 -1
- package/dist/lib/fuels/connectors/walletConnect/utils/index.d.ts +0 -1
- package/dist/lib/fuels/connectors/walletConnect/utils/index.js +0 -1
- package/dist/lib/fuels/connectors/walletConnect/utils/subscribeAndEnforceChain.d.ts +0 -2
- package/dist/lib/fuels/connectors/walletConnect/utils/subscribeAndEnforceChain.js +0 -39
- package/dist/lib/fuels/connectors/walletConnect/web3Modal.d.ts +0 -10
- package/dist/lib/fuels/connectors/walletConnect/web3Modal.js +0 -38
- package/dist/lib/loopring/LoopringAPI.d.ts +0 -12
- package/dist/lib/loopring/LoopringAPI.js +0 -13
- package/dist/lib/loopring/defs.d.ts +0 -425
- package/dist/lib/loopring/defs.js +0 -217
- package/dist/lib/loopring/eddsa.d.ts +0 -29
- package/dist/lib/loopring/eddsa.js +0 -208
- package/dist/lib/loopring/field.d.ts +0 -17
- package/dist/lib/loopring/field.js +0 -61
- package/dist/lib/loopring/formatter.d.ts +0 -137
- package/dist/lib/loopring/formatter.js +0 -516
- package/dist/lib/loopring/helpers.d.ts +0 -36
- package/dist/lib/loopring/helpers.js +0 -140
- package/dist/lib/loopring/jubjub.d.ts +0 -19
- package/dist/lib/loopring/jubjub.js +0 -79
- package/dist/lib/loopring/permutation.d.ts +0 -22
- package/dist/lib/loopring/permutation.js +0 -198
- package/dist/lib/loopring/poseidon/EDDSAUtil.d.ts +0 -14
- package/dist/lib/loopring/poseidon/EDDSAUtil.js +0 -61
- package/dist/lib/loopring/poseidon/babyJub.d.ts +0 -6
- package/dist/lib/loopring/poseidon/babyJub.js +0 -51
- package/dist/lib/loopring/poseidon/eddsa.d.ts +0 -29
- package/dist/lib/loopring/poseidon/eddsa.js +0 -210
- package/dist/lib/loopring/utils.d.ts +0 -76
- package/dist/lib/loopring/utils.js +0 -230
- package/dist/styles/dialog-transition.css +0 -28
- package/dist/styles/globals.css +0 -372
- package/dist/styles/manual-trasnfer-svg.css +0 -299
- package/dist/styles/vaul.css +0 -256
|
@@ -1,136 +1,146 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { useTonConnectUI } from '@tonconnect/ui-react';
|
|
9
|
-
import { Address, JettonMaster, beginCell, toNano } from '@ton/ton'
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
1
|
+
// import { FC, useCallback, useState } from 'react'
|
|
2
|
+
// import SubmitButton from '../../../../Buttons/submitButton';
|
|
3
|
+
// import toast from 'react-hot-toast';
|
|
4
|
+
// import useWallet from '../../../../../hooks/useWallet';
|
|
5
|
+
// import { useSwapTransactionStore } from '../../../../../stores/swapTransactionStore';
|
|
6
|
+
// import WalletIcon from '../../../../Icons/WalletIcon';
|
|
7
|
+
// import { WithdrawPageProps } from './WalletTransferContent';
|
|
8
|
+
// import { useTonConnectUI } from '@tonconnect/ui-react';
|
|
9
|
+
// import { Address, JettonMaster, beginCell, toNano } from '@ton/ton'
|
|
10
|
+
// import { Token } from '../../../../../Models/Network';
|
|
11
|
+
// import { BackendTransactionStatus } from '../../../../../lib/layerSwapApiClient';
|
|
12
|
+
// import tonClient from '../../../../../lib/wallets/ton/client';
|
|
13
|
+
// import { ConnectWalletButton } from './WalletTransfer/buttons';
|
|
14
|
+
// import TransactionMessages from '../Messages/TransactionMessages';
|
|
15
|
+
// import { datadogRum } from '@datadog/browser-rum';
|
|
16
|
+
// const TonWalletWithdrawStep: FC<WithdrawPageProps> = ({ amount, depositAddress, network, token, swapId, callData }) => {
|
|
17
|
+
// const [loading, setLoading] = useState(false);
|
|
18
|
+
// const { provider } = useWallet(network, 'withdrawal');
|
|
19
|
+
// const { setSwapTransaction } = useSwapTransactionStore();
|
|
20
|
+
// const [tonConnectUI] = useTonConnectUI();
|
|
21
|
+
// const [transactionErrorMessage, setTransactionErrorMessage] = useState<string | undefined>(undefined)
|
|
22
|
+
// const wallet = provider?.activeWallet
|
|
23
|
+
// const handleConnect = useCallback(async () => {
|
|
24
|
+
// setLoading(true)
|
|
25
|
+
// setTransactionErrorMessage(undefined)
|
|
26
|
+
// try {
|
|
27
|
+
// await provider?.connectWallet()
|
|
28
|
+
// }
|
|
29
|
+
// catch (e) {
|
|
30
|
+
// toast(e.message)
|
|
31
|
+
// }
|
|
32
|
+
// finally {
|
|
33
|
+
// setLoading(false)
|
|
34
|
+
// }
|
|
35
|
+
// }, [provider])
|
|
36
|
+
// const handleTransfer = useCallback(async () => {
|
|
37
|
+
// setLoading(true)
|
|
38
|
+
// setTransactionErrorMessage(undefined)
|
|
39
|
+
// if (!swapId || !depositAddress || !token || !wallet?.address || !callData || amount === undefined) {
|
|
40
|
+
// setLoading(false)
|
|
41
|
+
// return toast('Something went wrong, please try again.')
|
|
42
|
+
// }
|
|
43
|
+
// try {
|
|
44
|
+
// const transaction = await transactionBuilder(amount, token, depositAddress, wallet?.address, callData)
|
|
45
|
+
// const res = await tonConnectUI.sendTransaction(transaction)
|
|
46
|
+
// if (res) {
|
|
47
|
+
// setSwapTransaction(swapId, BackendTransactionStatus.Pending, res.boc);
|
|
48
|
+
// }
|
|
49
|
+
// }
|
|
50
|
+
// catch (e) {
|
|
51
|
+
// setTransactionErrorMessage(e.message)
|
|
52
|
+
// }
|
|
53
|
+
// finally {
|
|
54
|
+
// setLoading(false)
|
|
55
|
+
// }
|
|
56
|
+
// }, [swapId, depositAddress, network, token, amount, callData])
|
|
57
|
+
// if (!wallet) {
|
|
58
|
+
// return <ConnectWalletButton isDisabled={loading} isSubmitting={loading} onClick={handleConnect} />
|
|
59
|
+
// }
|
|
60
|
+
// return (
|
|
61
|
+
// <div className="w-full space-y-3 flex flex-col justify-between h-full text-primary-text">
|
|
62
|
+
// {
|
|
63
|
+
// transactionErrorMessage &&
|
|
64
|
+
// <TransactionMessage isLoading={loading} error={transactionErrorMessage} />
|
|
65
|
+
// }
|
|
66
|
+
// {
|
|
67
|
+
// !loading &&
|
|
68
|
+
// <SubmitButton isDisabled={!!loading} isSubmitting={!!loading} onClick={handleTransfer} icon={<WalletIcon className="stroke-2 w-6 h-6" aria-hidden="true" />} >
|
|
69
|
+
// {transactionErrorMessage ? 'Try again' : 'Send from wallet'}
|
|
70
|
+
// </SubmitButton>
|
|
71
|
+
// }
|
|
72
|
+
// </div>
|
|
73
|
+
// )
|
|
74
|
+
// }
|
|
75
|
+
// const TransactionMessage: FC<{ isLoading: boolean, error: string | undefined }> = ({ isLoading, error }) => {
|
|
76
|
+
// if (isLoading) {
|
|
77
|
+
// return <TransactionMessages.ConfirmTransactionMessage />
|
|
78
|
+
// }
|
|
79
|
+
// else if (error && error.includes('Reject request')) {
|
|
80
|
+
// return <TransactionMessages.TransactionRejectedMessage />
|
|
81
|
+
// }
|
|
82
|
+
// else if (error && error.includes('Transaction was not sent')) {
|
|
83
|
+
// return <TransactionMessages.TransactionFailedMessage />
|
|
84
|
+
// }
|
|
85
|
+
// else if (error) {
|
|
86
|
+
// const swapWithdrawalError = new Error(error);
|
|
87
|
+
// swapWithdrawalError.name = `SwapWithdrawalError`;
|
|
88
|
+
// swapWithdrawalError.cause = error;
|
|
89
|
+
// datadogRum.addError(swapWithdrawalError);
|
|
90
|
+
// return <TransactionMessages.UexpectedErrorMessage message={error} />
|
|
91
|
+
// }
|
|
92
|
+
// else return <></>
|
|
93
|
+
// }
|
|
94
|
+
// const transactionBuilder = async (amount: number, token: Token, depositAddress: string, sourceAddress: string, callData: string) => {
|
|
95
|
+
// const parsedCallData = JSON.parse(callData)
|
|
96
|
+
// if (token.contract) {
|
|
97
|
+
// const destinationAddress = Address.parse(depositAddress);
|
|
98
|
+
// const userAddress = Address.parse(sourceAddress)
|
|
99
|
+
// const forwardPayload = beginCell()
|
|
100
|
+
// .storeUint(0, 32) // 0 opcode means we have a comment
|
|
101
|
+
// .storeStringTail(parsedCallData.comment)
|
|
102
|
+
// .endCell();
|
|
103
|
+
// const body = beginCell()
|
|
104
|
+
// .storeUint(0x0f8a7ea5, 32) // opcode for jetton transfer
|
|
105
|
+
// .storeUint(0, 64) // query id
|
|
106
|
+
// .storeCoins(parsedCallData.amount) // jetton amount
|
|
107
|
+
// .storeAddress(destinationAddress) // TON wallet destination address
|
|
108
|
+
// .storeAddress(destinationAddress) // response excess destination
|
|
109
|
+
// .storeBit(0) // no custom payload
|
|
110
|
+
// .storeCoins(toNano('0.00002')) // forward amount (if >0, will send notification message)
|
|
111
|
+
// .storeBit(1) // we store forwardPayload as a reference
|
|
112
|
+
// .storeRef(forwardPayload)
|
|
113
|
+
// .endCell();
|
|
114
|
+
// const jettonMasterAddress = Address.parse(token.contract!)
|
|
115
|
+
// const jettonMaster = tonClient.open(JettonMaster.create(jettonMasterAddress))
|
|
116
|
+
// const jettonAddress = await jettonMaster.getWalletAddress(userAddress)
|
|
117
|
+
// const tx = {
|
|
118
|
+
// validUntil: Math.floor(Date.now() / 1000) + 360,
|
|
119
|
+
// messages: [
|
|
120
|
+
// {
|
|
121
|
+
// address: jettonAddress.toString(), // sender jetton wallet
|
|
122
|
+
// amount: toNano('0.045').toString(), // for commission fees, excess will be returned
|
|
123
|
+
// payload: body.toBoc().toString("base64") // payload with jetton transfer and comment body
|
|
124
|
+
// }
|
|
125
|
+
// ]
|
|
126
|
+
// }
|
|
127
|
+
// return tx
|
|
128
|
+
// } else {
|
|
129
|
+
// const body = beginCell()
|
|
130
|
+
// .storeUint(0, 32) // write 32 zero bits to indicate that a text comment will follow
|
|
131
|
+
// .storeStringTail(parsedCallData.comment) // write our text comment
|
|
132
|
+
// .endCell();
|
|
133
|
+
// const tx = {
|
|
134
|
+
// validUntil: Math.floor(Date.now() / 1000) + 360,
|
|
135
|
+
// messages: [
|
|
136
|
+
// {
|
|
137
|
+
// address: depositAddress,
|
|
138
|
+
// amount: toNano(amount).toString(),
|
|
139
|
+
// payload: body.toBoc().toString("base64") // payload with comment in body
|
|
140
|
+
// }
|
|
141
|
+
// ]
|
|
142
|
+
// }
|
|
143
|
+
// return tx
|
|
144
|
+
// }
|
|
145
|
+
// }
|
|
146
|
+
// export default TonWalletWithdrawStep;
|
|
@@ -1,99 +1,120 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import useWallet from '
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { ButtonWrapper, ConnectWalletButton } from './WalletTransfer/buttons';
|
|
9
|
-
import { useSettingsState } from '../../../../../context/settings';
|
|
10
|
-
import TransactionMessages from '../Messages/TransactionMessages';
|
|
11
|
-
import { datadogRum } from '@datadog/browser-rum';
|
|
12
|
-
import { TronWeb } from 'tronweb'
|
|
13
|
-
import useSWRGas from '../../../../../lib/gases/useSWRGas';
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
1
|
+
// import { FC, useCallback, useState } from 'react'
|
|
2
|
+
// import { BackendTransactionStatus } from '../../../../../lib/layerSwapApiClient';
|
|
3
|
+
// import useWallet from '../../../../../hooks/useWallet';
|
|
4
|
+
// import { useWallet as useTronWallet } from '@tronweb3/tronwallet-adapter-react-hooks';
|
|
5
|
+
// import { useSwapTransactionStore } from '../../../../../stores/swapTransactionStore';
|
|
6
|
+
// import WalletIcon from '../../../../Icons/WalletIcon';
|
|
7
|
+
// import { WithdrawPageProps } from './WalletTransferContent';
|
|
8
|
+
// import { ButtonWrapper, ConnectWalletButton } from './WalletTransfer/buttons';
|
|
9
|
+
// import { useSettingsState } from '../../../../../context/settings';
|
|
10
|
+
// import TransactionMessages from '../Messages/TransactionMessages';
|
|
11
|
+
// import { datadogRum } from '@datadog/browser-rum';
|
|
12
|
+
// import { TronWeb } from 'tronweb'
|
|
13
|
+
// import useSWRGas from '../../../../../lib/gases/useSWRGas';
|
|
14
|
+
// import { ContractParamter, Transaction, TransactionWrapper, TransferContract, TriggerSmartContract } from 'tronweb/lib/esm/types';
|
|
15
|
+
// import { Token } from '../../../../../Models/Network';
|
|
16
|
+
// const TronWalletWithdraw: FC<WithdrawPageProps> = ({ network, callData, swapId, token, amount, depositAddress }) => {
|
|
17
|
+
// const [loading, setLoading] = useState(false);
|
|
18
|
+
// const [error, setError] = useState<string | undefined>()
|
|
19
|
+
// const { provider } = useWallet(network, 'withdrawal');
|
|
20
|
+
// const { setSwapTransaction } = useSwapTransactionStore();
|
|
21
|
+
// const wallet = provider?.activeWallet
|
|
22
|
+
// const { wallet: tronWallet, signTransaction } = useTronWallet();
|
|
23
|
+
// const walletAddress = tronWallet?.adapter.address
|
|
24
|
+
// const tronNode = network?.node_url
|
|
25
|
+
// const networkName = network?.name
|
|
26
|
+
// const { networks } = useSettingsState()
|
|
27
|
+
// const networkWithTokens = networks.find(n => n.name === networkName)
|
|
28
|
+
// const { gas, isGasLoading } = useSWRGas(walletAddress, networkWithTokens, token)
|
|
29
|
+
// const handleTransfer = useCallback(async () => {
|
|
30
|
+
// setError(undefined)
|
|
31
|
+
// setLoading(true)
|
|
32
|
+
// try {
|
|
33
|
+
// if (!signTransaction || !swapId || !depositAddress || !amount || !token) throw new Error('Missing data')
|
|
34
|
+
// if (!walletAddress) throw new Error('Tron wallet not connected')
|
|
35
|
+
// if (!callData) throw new Error("No call data provided")
|
|
36
|
+
// const tronWeb = new TronWeb({ fullNode: tronNode, solidityNode: tronNode });
|
|
37
|
+
// const amountInWei = Math.pow(10, token?.decimals) * amount
|
|
38
|
+
// const initialTransaction = await buildInitialTransaction({ tronWeb, token, depositAddress, amountInWei, gas, issuerAddress: walletAddress })
|
|
39
|
+
// const transaction = await tronWeb.transactionBuilder.addUpdateData(initialTransaction, Buffer.from(callData).toString('hex'), "hex")
|
|
40
|
+
// const signature = await signTransaction(transaction)
|
|
41
|
+
// const res = await tronWeb.trx.sendRawTransaction(signature)
|
|
42
|
+
// if (signature && res.result) {
|
|
43
|
+
// setSwapTransaction(swapId, BackendTransactionStatus.Pending, signature.txID);
|
|
44
|
+
// } else {
|
|
45
|
+
// throw new Error(res.code.toString())
|
|
46
|
+
// }
|
|
47
|
+
// }
|
|
48
|
+
// catch (e) {
|
|
49
|
+
// if (e?.message) {
|
|
50
|
+
// if (e?.logs?.some(m => m?.includes('insufficient funds')) || e.message.includes('Attempt to debit an account')) setError('insufficientFunds')
|
|
51
|
+
// else setError(e.message)
|
|
52
|
+
// return
|
|
53
|
+
// }
|
|
54
|
+
// }
|
|
55
|
+
// finally {
|
|
56
|
+
// setLoading(false)
|
|
57
|
+
// }
|
|
58
|
+
// }, [swapId, callData, walletAddress, signTransaction, network, gas, depositAddress, amount, token])
|
|
59
|
+
// if (!wallet || !walletAddress) {
|
|
60
|
+
// return <ConnectWalletButton />
|
|
61
|
+
// }
|
|
62
|
+
// return (
|
|
63
|
+
// <div className="w-full space-y-3 flex flex-col justify-between h-full text-primary-text">
|
|
64
|
+
// <TransactionMessage
|
|
65
|
+
// error={error}
|
|
66
|
+
// isLoading={loading}
|
|
67
|
+
// />
|
|
68
|
+
// {
|
|
69
|
+
// wallet && !loading &&
|
|
70
|
+
// <ButtonWrapper isDisabled={!!loading || isGasLoading} isSubmitting={!!loading || isGasLoading} onClick={handleTransfer} icon={<WalletIcon className="stroke-2 w-6 h-6" aria-hidden="true" />} >
|
|
71
|
+
// {error ? 'Try again' : 'Send from wallet'}
|
|
72
|
+
// </ButtonWrapper>
|
|
73
|
+
// }
|
|
74
|
+
// </div>
|
|
75
|
+
// )
|
|
76
|
+
// }
|
|
77
|
+
// const TransactionMessage: FC<{ isLoading: boolean, error: string | undefined }> = ({ isLoading, error }) => {
|
|
78
|
+
// if (isLoading) {
|
|
79
|
+
// return <TransactionMessages.ConfirmTransactionMessage />
|
|
80
|
+
// }
|
|
81
|
+
// else if (error === "BANDWITH_ERROR") {
|
|
82
|
+
// return <TransactionMessages.InsufficientFundsMessage />
|
|
83
|
+
// }
|
|
84
|
+
// else if (error === "user reject this request") {
|
|
85
|
+
// return <TransactionMessages.TransactionRejectedMessage />
|
|
86
|
+
// }
|
|
87
|
+
// else if (error) {
|
|
88
|
+
// const swapWithdrawalError = new Error(error);
|
|
89
|
+
// swapWithdrawalError.name = `SwapWithdrawalError`;
|
|
90
|
+
// swapWithdrawalError.cause = error;
|
|
91
|
+
// datadogRum.addError(swapWithdrawalError);
|
|
92
|
+
// return <TransactionMessages.UexpectedErrorMessage message={error} />
|
|
93
|
+
// }
|
|
94
|
+
// else return <></>
|
|
95
|
+
// }
|
|
96
|
+
// type BuildIniitialTransactionProps = {
|
|
97
|
+
// tronWeb: TronWeb,
|
|
98
|
+
// token: Token,
|
|
99
|
+
// depositAddress: string,
|
|
100
|
+
// amountInWei: number,
|
|
101
|
+
// gas: number | undefined,
|
|
102
|
+
// issuerAddress: string
|
|
103
|
+
// }
|
|
104
|
+
// const buildInitialTransaction = async (props: BuildIniitialTransactionProps): Promise<Transaction<ContractParamter> | Transaction<TransferContract>> => {
|
|
105
|
+
// const { token, depositAddress, amountInWei, gas, issuerAddress, tronWeb } = props
|
|
106
|
+
// // native token
|
|
107
|
+
// if (!token.contract)
|
|
108
|
+
// return await tronWeb.transactionBuilder.sendTrx(depositAddress, amountInWei, issuerAddress)
|
|
109
|
+
// const estimatedFee = (gas && token) && Number((gas * Math.pow(10, token.decimals)).toFixed())
|
|
110
|
+
// return (await tronWeb.transactionBuilder.triggerSmartContract(
|
|
111
|
+
// token.contract,
|
|
112
|
+
// "transfer(address,uint256)",
|
|
113
|
+
// {
|
|
114
|
+
// feeLimit: estimatedFee || 100000000,
|
|
115
|
+
// },
|
|
116
|
+
// [{ type: 'address', value: depositAddress }, { type: 'uint256', value: amountInWei }],
|
|
117
|
+
// issuerAddress
|
|
118
|
+
// )).transaction
|
|
119
|
+
// }
|
|
120
|
+
// export default TronWalletWithdraw;
|
|
@@ -11,7 +11,7 @@ import TransactionMessage from "./transactionMessage";
|
|
|
11
11
|
import { ButtonWrapper } from "./buttons";
|
|
12
12
|
import { useSwapTransactionStore } from "../../../../../../stores/swapTransactionStore";
|
|
13
13
|
import { useSwapDataState } from "../../../../../../context/swap";
|
|
14
|
-
import { datadogRum } from "@datadog/browser-rum";
|
|
14
|
+
// import { datadogRum } from "@datadog/browser-rum";
|
|
15
15
|
import { isMobile } from "../../../../../../lib/openLink";
|
|
16
16
|
const TransferTokenButton = ({ depositAddress, amount, savedTransactionHash, swapId, chainId }) => {
|
|
17
17
|
const [applyingTransaction, setApplyingTransaction] = useState(!!savedTransactionHash);
|
|
@@ -40,7 +40,7 @@ const TransferTokenButton = ({ depositAddress, amount, savedTransactionHash, swa
|
|
|
40
40
|
const error = e;
|
|
41
41
|
error.name = `EstimateGasError`;
|
|
42
42
|
error.cause = error;
|
|
43
|
-
datadogRum.addError(error);
|
|
43
|
+
// datadogRum.addError(error);
|
|
44
44
|
console.error(e);
|
|
45
45
|
}
|
|
46
46
|
}
|
|
@@ -88,7 +88,7 @@ const TransferTokenButton = ({ depositAddress, amount, savedTransactionHash, swa
|
|
|
88
88
|
const error = new Error(e);
|
|
89
89
|
error.name = "TransferTokenError";
|
|
90
90
|
error.cause = e;
|
|
91
|
-
datadogRum.addError(error);
|
|
91
|
+
// datadogRum.addError(error);
|
|
92
92
|
}
|
|
93
93
|
}, [transaction, estimatedGas, depositAddress, amount, callData, chainId]);
|
|
94
94
|
const isError = transaction.isError;
|
|
@@ -38,6 +38,7 @@ export const ChangeNetworkMessage = ({ data, network }) => {
|
|
|
38
38
|
else if (data.isError) {
|
|
39
39
|
return _jsx(WalletMessage, { status: "error", header: 'Network switch failed', details: `Please try again or switch your wallet network manually to ${network}` });
|
|
40
40
|
}
|
|
41
|
+
return null;
|
|
41
42
|
};
|
|
42
43
|
export const ChangeNetworkButton = ({ chainId, network }) => {
|
|
43
44
|
const { switchChain, error, isPending, isError } = useSwitchChain();
|
|
@@ -29,7 +29,7 @@ const TransferFromWallet = ({ network, depositAddress, userDestinationAddress, a
|
|
|
29
29
|
}
|
|
30
30
|
}, [swapId]);
|
|
31
31
|
if (!swapId || !sequenceNumber)
|
|
32
|
-
return;
|
|
32
|
+
return null;
|
|
33
33
|
const hexed_sequence_number = sequenceNumber?.toString(16);
|
|
34
34
|
const sequence_number_even = (hexed_sequence_number?.length % 2 > 0 ? `0${hexed_sequence_number}` : hexed_sequence_number);
|
|
35
35
|
if ((source_network?.name.toLowerCase() === sameAccountNetwork?.toLowerCase() || destination_network?.name.toLowerCase() === sameAccountNetwork?.toLowerCase())
|
package/dist/components/Pages/SwapPages/Withdraw/Wallet/WalletTransfer/transactionMessage.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import resolveError from "./resolveError";
|
|
3
|
-
import { datadogRum } from '@datadog/browser-rum';
|
|
3
|
+
// import { datadogRum } from '@datadog/browser-rum';
|
|
4
4
|
import TransactionMessages from "../../Messages/TransactionMessages";
|
|
5
5
|
const TransactionMessage = ({ wait, transaction, applyingTransaction, activeAddress, selectedSourceAddress }) => {
|
|
6
6
|
const transactionResolvedError = resolveError(transaction?.error);
|
|
@@ -26,7 +26,7 @@ const TransactionMessage = ({ wait, transaction, applyingTransaction, activeAddr
|
|
|
26
26
|
const renderingError = new Error(unexpectedError.message);
|
|
27
27
|
renderingError.name = `SwapWithdrawalError`;
|
|
28
28
|
renderingError.cause = unexpectedError;
|
|
29
|
-
datadogRum.addError(renderingError);
|
|
29
|
+
// datadogRum.addError(renderingError);
|
|
30
30
|
return _jsx(TransactionMessages.UexpectedErrorMessage, { message: unexpectedError?.message });
|
|
31
31
|
}
|
|
32
32
|
else
|