Skip to content

Commit

Permalink
feat: use getTokens endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
chybisov committed May 16, 2022
1 parent e49ff41 commit 5e4f86a
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 23 deletions.
4 changes: 2 additions & 2 deletions packages/wallet-management/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"module": "./index.ts",
"scripts": {},
"dependencies": {
"@ethersproject/experimental": "^5.6.0",
"@ethersproject/providers": "^5.6.5",
"@ethersproject/experimental": "^5.6.1",
"@ethersproject/providers": "^5.6.6",
"@walletconnect/ethereum-provider": "^1.7.8",
"@web3-react/coinbase-wallet": "^8.0.25-beta.0",
"@web3-react/core": "^8.0.22-beta.0",
Expand Down
8 changes: 4 additions & 4 deletions packages/widget/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@
"dependencies": {
"@emotion/react": "^11.9.0",
"@emotion/styled": "^11.8.1",
"@ethersproject/experimental": "^5.6.0",
"@ethersproject/providers": "^5.6.5",
"@ethersproject/experimental": "^5.6.1",
"@ethersproject/providers": "^5.6.6",
"@lifinance/sdk": "^1.0.0-beta.4",
"@lifinance/wallet-management": "0.1.0",
"@mui/icons-material": "^5.6.2",
"@mui/lab": "^5.0.0-alpha.81",
"@mui/material": "^5.7.0",
"big.js": "^6.1.1",
"i18next": "^21.8.1",
"i18next": "^21.8.2",
"react": "^18.1.0",
"react-dom": "^18.1.0",
"react-hook-form": "^7.31.1",
"react-i18next": "^11.16.9",
"react-query": "^4.0.0-beta.10",
"react-query": "^4.0.0-beta.12",
"react-resize-detector": "^7.0.0",
"react-router-dom": "^6.3.0",
"react-timer-hook": "^3.0.5",
Expand Down
4 changes: 2 additions & 2 deletions packages/widget/src/hooks/useTokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ export const useTokens = (selectedChainId: number) => {
isLoading,
isFetching,
} = useQuery(['tokens', selectedChainId], async () => {
const data = await LiFi.getPossibilities({ include: ['tokens'] });
return data.tokens?.filter((token) => token.chainId === selectedChainId);
const data = await LiFi.getTokens({ chains: [selectedChainId] });
return data.tokens?.[selectedChainId];
// .sort((a, b) => (a.symbol > b.symbol ? 1 : -1));
});
return {
Expand Down
55 changes: 40 additions & 15 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1392,10 +1392,10 @@
"@ethersproject/properties" "^5.6.0"
"@ethersproject/transactions" "^5.6.0"

"@ethersproject/experimental@^5.6.0":
version "5.6.0"
resolved "https://registry.yarnpkg.com/@ethersproject/experimental/-/experimental-5.6.0.tgz#c72ef00a79b746c522eb79736712169d71c55f64"
integrity sha512-lSEM/6t+BicbeyRxat5meoQhXZLoBEziVrxZqeCIhsPntvq4DlMobPBKXF0Iz3m0dMvl9uga7fHEO4YD9SgCgw==
"@ethersproject/experimental@^5.6.1":
version "5.6.1"
resolved "https://registry.yarnpkg.com/@ethersproject/experimental/-/experimental-5.6.1.tgz#8fe41a328d3bd39739c50eca7685baee208bedc6"
integrity sha512-xLtcIIcqBVFgAw3lED2zTil3yYp0kfkJtp8AzLGjKZHuLVtQCeD6d2mUAFYXdbJCiIrMfOsYuI+R366ydvHbJg==
dependencies:
"@ethersproject/web" "^5.6.0"
ethers "^5.6.0"
Expand Down Expand Up @@ -1487,7 +1487,7 @@
dependencies:
"@ethersproject/logger" "^5.6.0"

"@ethersproject/providers@5.6.5", "@ethersproject/providers@^5", "@ethersproject/providers@^5.6.5":
"@ethersproject/providers@5.6.5", "@ethersproject/providers@^5":
version "5.6.5"
resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.6.5.tgz#aefecf78459817a323452e05a16d56afcf807e27"
integrity sha512-TRS+c2Ud+cMpWodmGAc9xbnYRPWzRNYt2zkCSnj58nJoamBQ6x4cUbBeo0lTC3y+6RDVIBeJv18OqsDbSktLVg==
Expand All @@ -1512,6 +1512,31 @@
bech32 "1.1.4"
ws "7.4.6"

"@ethersproject/providers@^5.6.6":
version "5.6.6"
resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.6.6.tgz#1967149cb4557d253f8c176a44aabda155f228cd"
integrity sha512-6X6agj3NeQ4tgnvBMCjHK+CjQbz+Qmn20JTxCYZ/uymrgCEOpJtY9zeRxJIDsSi0DPw8xNAxypj95JMCsapUfA==
dependencies:
"@ethersproject/abstract-provider" "^5.6.0"
"@ethersproject/abstract-signer" "^5.6.0"
"@ethersproject/address" "^5.6.0"
"@ethersproject/basex" "^5.6.0"
"@ethersproject/bignumber" "^5.6.0"
"@ethersproject/bytes" "^5.6.0"
"@ethersproject/constants" "^5.6.0"
"@ethersproject/hash" "^5.6.0"
"@ethersproject/logger" "^5.6.0"
"@ethersproject/networks" "^5.6.0"
"@ethersproject/properties" "^5.6.0"
"@ethersproject/random" "^5.6.0"
"@ethersproject/rlp" "^5.6.0"
"@ethersproject/sha2" "^5.6.0"
"@ethersproject/strings" "^5.6.0"
"@ethersproject/transactions" "^5.6.0"
"@ethersproject/web" "^5.6.0"
bech32 "1.1.4"
ws "7.4.6"

"@ethersproject/random@5.6.0", "@ethersproject/random@^5.6.0":
version "5.6.0"
resolved "https://registry.yarnpkg.com/@ethersproject/random/-/random-5.6.0.tgz#1505d1ab6a250e0ee92f436850fa3314b2cb5ae6"
Expand Down Expand Up @@ -7681,10 +7706,10 @@ humanize-ms@^1.2.1:
dependencies:
ms "^2.0.0"

i18next@^21.8.1:
version "21.8.1"
resolved "https://registry.yarnpkg.com/i18next/-/i18next-21.8.1.tgz#44e083ade3dfe08c8099882c560d3c7294cdf679"
integrity sha512-uulZBD5kLME7Ucz8pFwpC7jXDjq4BHkio3b6GBw1ykXNHA8rIAk1S2t6zb2Ripf9OMetMkysiDRlPlCVqjvQeg==
i18next@^21.8.2:
version "21.8.2"
resolved "https://registry.yarnpkg.com/i18next/-/i18next-21.8.2.tgz#b2d9fd7feafc1a9929651c24a5c17ba703552bbc"
integrity sha512-H/oQvA/OXcqurXHemlyDwdIzr9GHYg5/xBuDeFXTXJGMOJFH0ke1wgbsDjFFk2noD4cJfzicVPpUtp39Z+OzgQ==
dependencies:
"@babel/runtime" "^7.17.2"

Expand Down Expand Up @@ -10950,16 +10975,16 @@ react-is@^18.0.0:
resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.1.0.tgz#61aaed3096d30eacf2a2127118b5b41387d32a67"
integrity sha512-Fl7FuabXsJnV5Q1qIOQwx/sagGF18kogb4gpfcG4gjLBWO0WDiiz1ko/ExayuxE7InyQkBLkxRFG5oxY6Uu3Kg==

react-query@^4.0.0-beta.10:
version "4.0.0-beta.10"
resolved "https://registry.yarnpkg.com/react-query/-/react-query-4.0.0-beta.10.tgz#a832b63996ae3e23b724b0abde627b0cb3441f7f"
integrity sha512-SfhgwYAxBpomAH9ywetMCm7yLfT1EZ9KGZF3TJZE4nmCcQqOfjMUZAjpxbjoHdUeOD9AkbX/4bPdV+EG83iskA==
react-query@^4.0.0-beta.12:
version "4.0.0-beta.12"
resolved "https://registry.yarnpkg.com/react-query/-/react-query-4.0.0-beta.12.tgz#479299c6691e55294e6481ee49131ac6aadf0a0e"
integrity sha512-PAeGKj/SlIvxShJVBbyKojUYUK78yK/W9nS9Uw78e40wjhuHiFMqbQWjtAQTBCbliZ5p1VkSHCAtpEVrr5GOvQ==
dependencies:
"@babel/runtime" "^7.17.9"
"@types/use-sync-external-store" "^0.0.3"
broadcast-channel "^3.4.1"
match-sorter "^6.0.2"
use-sync-external-store "^1.0.0"
use-sync-external-store "^1.1.0"

react-refresh@^0.13.0:
version "0.13.0"
Expand Down Expand Up @@ -12686,7 +12711,7 @@ uri-js@^4.2.2:
dependencies:
punycode "^2.1.0"

use-sync-external-store@1.1.0, use-sync-external-store@^1.0.0:
use-sync-external-store@1.1.0, use-sync-external-store@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/use-sync-external-store/-/use-sync-external-store-1.1.0.tgz#3343c3fe7f7e404db70f8c687adf5c1652d34e82"
integrity sha512-SEnieB2FPKEVne66NpXPd1Np4R1lTNKfjuy3XdIoPQKYBAFdzbzSZlSn1KJZUiihQLQC5Znot4SBz1EOTBwQAQ==
Expand Down

0 comments on commit 5e4f86a

Please sign in to comment.