@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,28 +1,28 @@
|
|
|
1
1
|
import { EVMBalanceProvider } from "./providers/evmBalanceProvider";
|
|
2
|
-
import { FuelBalanceProvider } from "./providers/fuelBalanceProvider";
|
|
3
|
-
import { ImmutableXBalanceProvider } from "./providers/immutableXBalanceProvider";
|
|
4
|
-
import { LoopringBalanceProvider } from "./providers/loopringBalanceProvider";
|
|
5
|
-
import { ParadexBalanceProvider } from "./providers/paradexBalanceProvider";
|
|
2
|
+
// import { FuelBalanceProvider } from "./providers/fuelBalanceProvider";
|
|
3
|
+
// import { ImmutableXBalanceProvider } from "./providers/immutableXBalanceProvider";
|
|
4
|
+
// import { LoopringBalanceProvider } from "./providers/loopringBalanceProvider";
|
|
5
|
+
// import { ParadexBalanceProvider } from "./providers/paradexBalanceProvider";
|
|
6
6
|
import { QueryBalanceProvider } from "./providers/queryBalanceProvider";
|
|
7
|
-
import { SolanaBalanceProvider } from "./providers/solanaBalanceProvider";
|
|
8
|
-
import { StarknetBalanceProvider } from "./providers/starknetBalanceProvider";
|
|
9
|
-
import { TonBalanceProvider } from "./providers/tonBalanceProvider";
|
|
10
|
-
import { TronBalanceProvider } from "./providers/tronBalanceResolver";
|
|
7
|
+
// import { SolanaBalanceProvider } from "./providers/solanaBalanceProvider";
|
|
8
|
+
// import { StarknetBalanceProvider } from "./providers/starknetBalanceProvider";
|
|
9
|
+
// import { TonBalanceProvider } from "./providers/tonBalanceProvider";
|
|
10
|
+
// import { TronBalanceProvider } from "./providers/tronBalanceResolver";
|
|
11
11
|
import { ZkSyncBalanceProvider } from "./providers/zkSyncBalanceProvider";
|
|
12
12
|
export class BalanceResolver {
|
|
13
13
|
constructor() {
|
|
14
14
|
this.providers = [
|
|
15
15
|
new QueryBalanceProvider(),
|
|
16
|
-
new StarknetBalanceProvider(),
|
|
16
|
+
// new StarknetBalanceProvider(),
|
|
17
17
|
new EVMBalanceProvider(),
|
|
18
|
-
new FuelBalanceProvider(),
|
|
19
|
-
new ImmutableXBalanceProvider(),
|
|
20
|
-
new LoopringBalanceProvider(),
|
|
21
|
-
new SolanaBalanceProvider(),
|
|
22
|
-
new TonBalanceProvider(),
|
|
18
|
+
// new FuelBalanceProvider(),
|
|
19
|
+
// new ImmutableXBalanceProvider(),
|
|
20
|
+
// new LoopringBalanceProvider(),
|
|
21
|
+
// new SolanaBalanceProvider(),
|
|
22
|
+
// new TonBalanceProvider(),
|
|
23
23
|
new ZkSyncBalanceProvider(),
|
|
24
|
-
new TronBalanceProvider(),
|
|
25
|
-
new ParadexBalanceProvider()
|
|
24
|
+
// new TronBalanceProvider(),
|
|
25
|
+
// new ParadexBalanceProvider()
|
|
26
26
|
];
|
|
27
27
|
}
|
|
28
28
|
getBalance(address, network) {
|
|
@@ -5,7 +5,7 @@ import { erc20Abi } from 'viem';
|
|
|
5
5
|
import { multicall } from '@wagmi/core';
|
|
6
6
|
import { getBalance } from '@wagmi/core';
|
|
7
7
|
import resolveChain from "../../resolveChain";
|
|
8
|
-
import { datadogRum } from "@datadog/browser-rum"
|
|
8
|
+
// import { datadogRum } from "@datadog/browser-rum"
|
|
9
9
|
export class EVMBalanceProvider {
|
|
10
10
|
constructor() {
|
|
11
11
|
this.fetchBalance = async (address, network) => {
|
|
@@ -123,7 +123,7 @@ export const getErc20Balances = async ({ address, network, assets, publicClient,
|
|
|
123
123
|
const error = new Error(e);
|
|
124
124
|
error.name = "ERC20BalanceError";
|
|
125
125
|
error.cause = e;
|
|
126
|
-
datadogRum.addError(error);
|
|
126
|
+
// datadogRum.addError(error);
|
|
127
127
|
return null;
|
|
128
128
|
}
|
|
129
129
|
};
|
|
@@ -149,7 +149,7 @@ export const getTokenBalance = async (address, network, contract) => {
|
|
|
149
149
|
const error = new Error(e);
|
|
150
150
|
error.name = "TokenBalanceError";
|
|
151
151
|
error.cause = e;
|
|
152
|
-
datadogRum.addError(error);
|
|
152
|
+
// datadogRum.addError(error);
|
|
153
153
|
return null;
|
|
154
154
|
}
|
|
155
155
|
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { NetworkWithTokens } from "../../../Models/Network";
|
|
2
|
-
import { Balance } from "../../../Models/Balance";
|
|
3
|
-
export declare class LoopringBalanceProvider {
|
|
4
|
-
supportsNetwork(network: NetworkWithTokens): boolean;
|
|
5
|
-
fetchBalance: (address: string, network: NetworkWithTokens) => Promise<Balance[] | undefined>;
|
|
6
|
-
}
|
|
@@ -1,43 +1,56 @@
|
|
|
1
|
-
import axios from "axios";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
|
|
1
|
+
// import axios from "axios";
|
|
2
|
+
// import { NetworkWithTokens } from "../../../Models/Network";
|
|
3
|
+
// import formatAmount from "../../formatAmount";
|
|
4
|
+
// import KnownInternalNames from "../../knownIds";
|
|
5
|
+
// import { LOOPRING_URLs } from "../../loopring/defs";
|
|
6
|
+
// import { LoopringAPI } from "../../loopring/LoopringAPI";
|
|
7
|
+
// import { Balance } from "../../../Models/Balance";
|
|
8
|
+
// import { insertIfNotExists } from "./helpers";
|
|
9
|
+
// export class LoopringBalanceProvider {
|
|
10
|
+
// supportsNetwork(network: NetworkWithTokens): boolean {
|
|
11
|
+
// return (KnownInternalNames.Networks.LoopringMainnet.includes(network.name) || KnownInternalNames.Networks.LoopringGoerli.includes(network.name))
|
|
12
|
+
// }
|
|
13
|
+
// fetchBalance = async (address: string, network: NetworkWithTokens) => {
|
|
14
|
+
// let balances: Balance[] = [];
|
|
15
|
+
// if (!network?.tokens) return
|
|
16
|
+
// try {
|
|
17
|
+
// const account: { data: AccountInfo } = await axios.get(`${LoopringAPI.BaseApi}${LOOPRING_URLs.ACCOUNT_ACTION}?owner=${address}`)
|
|
18
|
+
// const accInfo = account.data
|
|
19
|
+
// const tokens = insertIfNotExists(network.tokens || [], network.token)
|
|
20
|
+
// const tokensString = tokens?.map(obj => obj.contract).join(',');
|
|
21
|
+
// const result: { data: LpBalance[] } = await axios.get(`${LoopringAPI.BaseApi}${LOOPRING_URLs.GET_USER_EXCHANGE_BALANCES}?accountId=${accInfo.accountId}&tokens=${tokensString}`)
|
|
22
|
+
// const loopringBalances = tokens?.map(asset => {
|
|
23
|
+
// const amount = result.data.find(d => d.tokenId == Number(asset.contract))?.total;
|
|
24
|
+
// return ({
|
|
25
|
+
// network: network.name,
|
|
26
|
+
// token: asset?.symbol,
|
|
27
|
+
// amount: amount ? formatAmount(amount, Number(asset?.decimals)) : 0,
|
|
28
|
+
// request_time: new Date().toJSON(),
|
|
29
|
+
// decimals: Number(asset?.decimals),
|
|
30
|
+
// isNativeCurrency: false
|
|
31
|
+
// })
|
|
32
|
+
// });
|
|
33
|
+
// balances = [
|
|
34
|
+
// ...loopringBalances,
|
|
35
|
+
// ]
|
|
36
|
+
// }
|
|
37
|
+
// catch (e) {
|
|
38
|
+
// console.log(e)
|
|
39
|
+
// }
|
|
40
|
+
// return balances
|
|
41
|
+
// }
|
|
42
|
+
// }
|
|
43
|
+
// interface AccountInfo {
|
|
44
|
+
// accountId: number;
|
|
45
|
+
// }
|
|
46
|
+
// type PendingBalances = {
|
|
47
|
+
// withdraw: string;
|
|
48
|
+
// deposit: string;
|
|
49
|
+
// }
|
|
50
|
+
// type LpBalance = {
|
|
51
|
+
// accountId: number;
|
|
52
|
+
// tokenId: number;
|
|
53
|
+
// total: string;
|
|
54
|
+
// locked: string;
|
|
55
|
+
// pending: PendingBalances;
|
|
56
|
+
// }
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { Balance } from "../../../Models/Balance";
|
|
2
|
-
import { NetworkWithTokens } from "../../../Models/Network";
|
|
3
|
-
export declare class ParadexBalanceProvider {
|
|
4
|
-
supportsNetwork(network: NetworkWithTokens): boolean;
|
|
5
|
-
fetchBalance: (address: string, network: NetworkWithTokens) => Promise<Balance[]>;
|
|
6
|
-
}
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
}
|
|
1
|
+
// import { Balance } from "../../../Models/Balance";
|
|
2
|
+
// import { NetworkWithTokens } from "../../../Models/Network";
|
|
3
|
+
// import AppSettings from "../../AppSettings";
|
|
4
|
+
// import KnownInternalNames from "../../knownIds";
|
|
5
|
+
// import * as Paradex from "../../wallets/paradex/lib";
|
|
6
|
+
// import { insertIfNotExists } from "./helpers";
|
|
7
|
+
// export class ParadexBalanceProvider {
|
|
8
|
+
// supportsNetwork(network: NetworkWithTokens): boolean {
|
|
9
|
+
// return KnownInternalNames.Networks.ParadexMainnet.includes(network.name) || KnownInternalNames.Networks.ParadexTestnet.includes(network.name)
|
|
10
|
+
// }
|
|
11
|
+
// fetchBalance = async (address: string, network: NetworkWithTokens) => {
|
|
12
|
+
// try {
|
|
13
|
+
// const environment = AppSettings.ApiVersion === 'sandbox' ? 'testnet' : 'prod'
|
|
14
|
+
// const config = await Paradex.Config.fetchConfig(environment);
|
|
15
|
+
// const tokens = insertIfNotExists(network.tokens || [], network.token)
|
|
16
|
+
// const paraclearProvider = new Paradex.ParaclearProvider.DefaultProvider(config);
|
|
17
|
+
// const result: Balance[] = []
|
|
18
|
+
// for (const token of tokens) {
|
|
19
|
+
// const getBalanceResult = await Paradex.Paraclear.getTokenBalance({
|
|
20
|
+
// provider: paraclearProvider, //account can be passed as the provider
|
|
21
|
+
// config,
|
|
22
|
+
// account: { address },
|
|
23
|
+
// token: token.symbol,
|
|
24
|
+
// });
|
|
25
|
+
// const balance = {
|
|
26
|
+
// network: network.name,
|
|
27
|
+
// token: token.symbol,
|
|
28
|
+
// amount: Number(getBalanceResult.size),
|
|
29
|
+
// request_time: new Date().toJSON(),
|
|
30
|
+
// decimals: Number(token?.decimals),
|
|
31
|
+
// isNativeCurrency: false
|
|
32
|
+
// }
|
|
33
|
+
// result.push(balance)
|
|
34
|
+
// }
|
|
35
|
+
// return result
|
|
36
|
+
// }
|
|
37
|
+
// catch (e) {
|
|
38
|
+
// console.log(e)
|
|
39
|
+
// throw e
|
|
40
|
+
// }
|
|
41
|
+
// }
|
|
42
|
+
// }
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { Balance } from "../../../Models/Balance";
|
|
2
|
-
import { NetworkWithTokens } from "../../../Models/Network";
|
|
3
|
-
export declare class SolanaBalanceProvider {
|
|
4
|
-
supportsNetwork(network: NetworkWithTokens): boolean;
|
|
5
|
-
fetchBalance: (address: string, network: NetworkWithTokens) => Promise<Balance[] | undefined>;
|
|
6
|
-
}
|
|
@@ -1,71 +1,70 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
}
|
|
1
|
+
// import { Balance } from "../../../Models/Balance";
|
|
2
|
+
// import { NetworkType, NetworkWithTokens } from "../../../Models/Network";
|
|
3
|
+
// import formatAmount from "../../formatAmount";
|
|
4
|
+
// import { insertIfNotExists } from "./helpers";
|
|
5
|
+
// export class SolanaBalanceProvider {
|
|
6
|
+
// supportsNetwork(network: NetworkWithTokens): boolean {
|
|
7
|
+
// return network.type === NetworkType.Solana
|
|
8
|
+
// }
|
|
9
|
+
// fetchBalance = async (address: string, network: NetworkWithTokens) => {
|
|
10
|
+
// if (!address) return
|
|
11
|
+
// const tokens = insertIfNotExists(network.tokens || [], network.token)
|
|
12
|
+
// const SolanaWeb3 = await import("@solana/web3.js");
|
|
13
|
+
// const { PublicKey, Connection } = SolanaWeb3
|
|
14
|
+
// class SolanaConnection extends Connection { }
|
|
15
|
+
// const { getAssociatedTokenAddress } = await import('@solana/spl-token');
|
|
16
|
+
// const walletPublicKey = new PublicKey(address)
|
|
17
|
+
// let balances: Balance[] = []
|
|
18
|
+
// if (!network?.tokens || !walletPublicKey) return
|
|
19
|
+
// const connection = new SolanaConnection(
|
|
20
|
+
// `${network.node_url}`,
|
|
21
|
+
// "confirmed"
|
|
22
|
+
// );
|
|
23
|
+
// async function getTokenBalanceWeb3(connection: SolanaConnection, tokenAccount) {
|
|
24
|
+
// try {
|
|
25
|
+
// const info = await connection.getTokenAccountBalance(tokenAccount);
|
|
26
|
+
// return info?.value?.uiAmount;
|
|
27
|
+
// } catch (error) {
|
|
28
|
+
// if (error.message && error.message.includes("could not find account")) {
|
|
29
|
+
// return 0;
|
|
30
|
+
// }
|
|
31
|
+
// throw error;
|
|
32
|
+
// }
|
|
33
|
+
// }
|
|
34
|
+
// for (const token of tokens) {
|
|
35
|
+
// try {
|
|
36
|
+
// let result: number | null = null
|
|
37
|
+
// if (token.contract) {
|
|
38
|
+
// const sourceToken = new PublicKey(token?.contract!);
|
|
39
|
+
// const associatedTokenFrom = await getAssociatedTokenAddress(
|
|
40
|
+
// sourceToken,
|
|
41
|
+
// walletPublicKey
|
|
42
|
+
// );
|
|
43
|
+
// if (!associatedTokenFrom) return
|
|
44
|
+
// result = await getTokenBalanceWeb3(connection, associatedTokenFrom)
|
|
45
|
+
// } else {
|
|
46
|
+
// const res = await connection.getBalance(walletPublicKey)
|
|
47
|
+
// result = res ? formatAmount(Number(res), token.decimals) : 0
|
|
48
|
+
// }
|
|
49
|
+
// if (result != null && !isNaN(result)) {
|
|
50
|
+
// const balance = {
|
|
51
|
+
// network: network.name,
|
|
52
|
+
// token: token.symbol,
|
|
53
|
+
// amount: result,
|
|
54
|
+
// request_time: new Date().toJSON(),
|
|
55
|
+
// decimals: Number(token?.decimals),
|
|
56
|
+
// isNativeCurrency: false
|
|
57
|
+
// }
|
|
58
|
+
// balances = [
|
|
59
|
+
// ...balances,
|
|
60
|
+
// balance
|
|
61
|
+
// ]
|
|
62
|
+
// }
|
|
63
|
+
// }
|
|
64
|
+
// catch (e) {
|
|
65
|
+
// console.log(e)
|
|
66
|
+
// }
|
|
67
|
+
// }
|
|
68
|
+
// return balances
|
|
69
|
+
// }
|
|
70
|
+
// }
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { Balance } from "../../../Models/Balance";
|
|
2
|
-
import { NetworkWithTokens } from "../../../Models/Network";
|
|
3
|
-
export declare class StarknetBalanceProvider {
|
|
4
|
-
supportsNetwork(network: NetworkWithTokens): boolean;
|
|
5
|
-
fetchBalance: (address: string, network: NetworkWithTokens) => Promise<Balance[] | undefined>;
|
|
6
|
-
}
|
|
@@ -1,45 +1,48 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
}
|
|
1
|
+
// import { Balance } from "../../../Models/Balance";
|
|
2
|
+
// import { NetworkWithTokens } from "../../../Models/Network";
|
|
3
|
+
// import formatAmount from "../../formatAmount";
|
|
4
|
+
// import Erc20Abi from '../../abis/ERC20.json'
|
|
5
|
+
// import KnownInternalNames from "../../knownIds";
|
|
6
|
+
// import { insertIfNotExists } from "./helpers";
|
|
7
|
+
// export class StarknetBalanceProvider {
|
|
8
|
+
// supportsNetwork(network: NetworkWithTokens): boolean {
|
|
9
|
+
// return (KnownInternalNames.Networks.StarkNetMainnet.includes(network.name) || KnownInternalNames.Networks.StarkNetGoerli.includes(network.name) || KnownInternalNames.Networks.StarkNetSepolia.includes(network.name))
|
|
10
|
+
// }
|
|
11
|
+
// fetchBalance = async (address: string, network: NetworkWithTokens) => {
|
|
12
|
+
// const {
|
|
13
|
+
// Contract,
|
|
14
|
+
// RpcProvider,
|
|
15
|
+
// uint256,
|
|
16
|
+
// } = await import("starknet");
|
|
17
|
+
// const { BigNumber } = await import("ethers");
|
|
18
|
+
// let balances: Balance[] = []
|
|
19
|
+
// if (!network?.tokens) return
|
|
20
|
+
// const provider = new RpcProvider({
|
|
21
|
+
// nodeUrl: network.node_url,
|
|
22
|
+
// });
|
|
23
|
+
// const tokens = insertIfNotExists(network.tokens || [], network.token)
|
|
24
|
+
// for (const token of tokens) {
|
|
25
|
+
// try {
|
|
26
|
+
// const erc20 = new Contract(Erc20Abi, token.contract!, provider);
|
|
27
|
+
// const balanceResult = await erc20.balanceOf(address);
|
|
28
|
+
// const balanceInWei = BigNumber.from(uint256.uint256ToBN(balanceResult.balance).toString()).toString();
|
|
29
|
+
// const balance = {
|
|
30
|
+
// network: network.name,
|
|
31
|
+
// token: token.symbol,
|
|
32
|
+
// amount: formatAmount(balanceInWei, token.decimals),
|
|
33
|
+
// request_time: new Date().toJSON(),
|
|
34
|
+
// decimals: token.decimals,
|
|
35
|
+
// isNativeCurrency: false,
|
|
36
|
+
// }
|
|
37
|
+
// balances = [
|
|
38
|
+
// ...balances,
|
|
39
|
+
// balance
|
|
40
|
+
// ]
|
|
41
|
+
// }
|
|
42
|
+
// catch (e) {
|
|
43
|
+
// console.log(e)
|
|
44
|
+
// }
|
|
45
|
+
// }
|
|
46
|
+
// return balances
|
|
47
|
+
// }
|
|
48
|
+
// }
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Balance } from "../../../Models/Balance";
|
|
2
|
-
import { Network, NetworkWithTokens, Token } from "../../../Models/Network";
|
|
3
|
-
export declare class TonBalanceProvider {
|
|
4
|
-
supportsNetwork(network: NetworkWithTokens): boolean;
|
|
5
|
-
fetchBalance: (address: string, network: NetworkWithTokens) => Promise<Balance[] | undefined>;
|
|
6
|
-
}
|
|
7
|
-
export declare const resolveBalance: ({ address, network, token }: {
|
|
8
|
-
network: Network;
|
|
9
|
-
token: Token;
|
|
10
|
-
address: string;
|
|
11
|
-
}) => Promise<{
|
|
12
|
-
network: string;
|
|
13
|
-
token: string;
|
|
14
|
-
amount: number;
|
|
15
|
-
request_time: string;
|
|
16
|
-
decimals: number;
|
|
17
|
-
isNativeCurrency: boolean;
|
|
18
|
-
} | null>;
|