From f4cef322fceca1ef294e4120d1c97d662be48cd2 Mon Sep 17 00:00:00 2001 From: Jaden Date: Tue, 18 Jun 2024 15:08:45 -0400 Subject: [PATCH] feat: adding flow previewnet, fixing b3 icons --- package.json | 2 +- public/icons/b3-testnet-icon-dark.svg | 15 ++++++++++----- public/icons/b3-testnet-icon-light.svg | 15 ++++++++++----- public/icons/flow-previewnet-icon-dark.svg | 11 +++++++++++ public/icons/flow-previewnet-icon-light.svg | 14 ++++++++++++++ utils/chains.ts | 15 ++++++++++++++- utils/paymentTokens.ts | 11 +++++++++++ utils/wrappedContracts.ts | 1 + yarn.lock | 18 +++++++++--------- 9 files changed, 81 insertions(+), 21 deletions(-) create mode 100644 public/icons/flow-previewnet-icon-dark.svg create mode 100644 public/icons/flow-previewnet-icon-light.svg diff --git a/package.json b/package.json index 76d24b53b..c90967876 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "@radix-ui/react-toggle-group": "^1.0.1", "@radix-ui/react-tooltip": "1.0.6", "@rainbow-me/rainbowkit": "2.0.0", - "@reservoir0x/reservoir-kit-ui": "^2.5.21", + "@reservoir0x/reservoir-kit-ui": "^2.5.22", "@sentry/nextjs": "^7.85.0", "@tanstack/react-query": "5.20.2", "@types/uuid": "^9.0.1", diff --git a/public/icons/b3-testnet-icon-dark.svg b/public/icons/b3-testnet-icon-dark.svg index f3ba975fb..1da010980 100644 --- a/public/icons/b3-testnet-icon-dark.svg +++ b/public/icons/b3-testnet-icon-dark.svg @@ -1,10 +1,15 @@ - - - + + + + + - - + + + + + diff --git a/public/icons/b3-testnet-icon-light.svg b/public/icons/b3-testnet-icon-light.svg index 0c250e10b..8b7ebf8ff 100644 --- a/public/icons/b3-testnet-icon-light.svg +++ b/public/icons/b3-testnet-icon-light.svg @@ -1,10 +1,15 @@ - - - + + + + + - - + + + + + diff --git a/public/icons/flow-previewnet-icon-dark.svg b/public/icons/flow-previewnet-icon-dark.svg new file mode 100644 index 000000000..6c769f804 --- /dev/null +++ b/public/icons/flow-previewnet-icon-dark.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/public/icons/flow-previewnet-icon-light.svg b/public/icons/flow-previewnet-icon-light.svg new file mode 100644 index 000000000..532395f6f --- /dev/null +++ b/public/icons/flow-previewnet-icon-light.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/utils/chains.ts b/utils/chains.ts index e1d2bb9a2..043b6e2f5 100644 --- a/utils/chains.ts +++ b/utils/chains.ts @@ -501,6 +501,19 @@ export default [ apiKey: process.env.RESERVOIR_API_KEY, coingeckoId: 'ethereum', oracleBidsEnabled: true, - checkPollingInterval: reservoirChains.sei.checkPollingInterval, + checkPollingInterval: reservoirChains.b3Testnet.checkPollingInterval, + }, + { + ...customChains.flowPreviewnet, + name: 'Flow Previewnet', + lightIconUrl: '/icons/flow-previewnet-icon-light.svg', + darkIconUrl: '/icons/flow-previewnet-icon-dark.svg', + reservoirBaseUrl: reservoirChains.flowPreviewnet.baseApiUrl, + proxyApi: '/api/reservoir/flowPreviewnet', + routePrefix: 'flowPreviewnet', + apiKey: process.env.RESERVOIR_API_KEY, + coingeckoId: 'flow', + oracleBidsEnabled: true, + checkPollingInterval: reservoirChains.flowPreviewnet.checkPollingInterval, }, ] as ReservoirChain[] diff --git a/utils/paymentTokens.ts b/utils/paymentTokens.ts index b80c56f58..a94273008 100644 --- a/utils/paymentTokens.ts +++ b/utils/paymentTokens.ts @@ -710,4 +710,15 @@ export const chainPaymentTokensMap = { decimals: 18, }, ], + + // flow previewnet + 646: [ + { + chainId: 646, + address: zeroAddress, + symbol: 'FLOW', + name: 'Flow', + decimals: 18, + }, + ], } as Record diff --git a/utils/wrappedContracts.ts b/utils/wrappedContracts.ts index c78f1fc5d..7f471f41b 100644 --- a/utils/wrappedContracts.ts +++ b/utils/wrappedContracts.ts @@ -26,6 +26,7 @@ const wrappedContracts: Record = { 200901: '0xff204e2681a6fa0e2c3fade68a1b28fb90e4fc5f', // bitlayer 1329: '0xE30feDd158A2e3b13e9badaeABaFc5516e95e8C7', // sei 1993: '0x48a9b22b80f566e88f0f1dcc90ea15a8a3bae8a4', // b3 testnet + 646: '0x48a9b22b80f566e88f0f1dcc90ea15a8a3bae8a4', // flow previewnet } export default wrappedContracts diff --git a/yarn.lock b/yarn.lock index 60c8db6ee..a7c8ac024 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1895,10 +1895,10 @@ dependencies: merge-options "^3.0.4" -"@reservoir0x/reservoir-kit-ui@^2.5.21": - version "2.5.21" - resolved "https://registry.yarnpkg.com/@reservoir0x/reservoir-kit-ui/-/reservoir-kit-ui-2.5.21.tgz#8c00d7f293a65320013ddaf5c7ade6e5e1a7d87b" - integrity sha512-YcrJvMHjI/6WpPgRJMvUfdlbmDD+xQRp/MVOsT9kQg/HF7jxy0LGiPoT7+eJDtqE4o5wyf8fR2uzyjPRC69Grw== +"@reservoir0x/reservoir-kit-ui@^2.5.22": + version "2.5.22" + resolved "https://registry.yarnpkg.com/@reservoir0x/reservoir-kit-ui/-/reservoir-kit-ui-2.5.22.tgz#cb7b4877066187b91a3f7293bf9d02bd4dcbfc89" + integrity sha512-977RbjYUUphbgH279U8qi8iH7N0o61KS10g3JGET0KPnXe2EwbXFYkfvbB6c03wyl/ObNgr2CG0CtCG9ATq2uA== dependencies: "@fortawesome/fontawesome-svg-core" "^6.1.1" "@fortawesome/free-solid-svg-icons" "^6.1.1" @@ -1914,7 +1914,7 @@ "@radix-ui/react-toggle-group" "1.0.4" "@radix-ui/react-tooltip" "1.0.6" "@react-hookz/web" "^19.2.0" - "@reservoir0x/reservoir-sdk" "2.2.11" + "@reservoir0x/reservoir-sdk" "2.2.12" "@stitches/react" "1.3.1-1" dayjs "^1.11.4" flatpickr "^4.6.13" @@ -1922,10 +1922,10 @@ react-flatpickr "^3.10.13" swr "2.0.1" -"@reservoir0x/reservoir-sdk@2.2.11": - version "2.2.11" - resolved "https://registry.yarnpkg.com/@reservoir0x/reservoir-sdk/-/reservoir-sdk-2.2.11.tgz#03998a0f89e8252aa2100dccc6ed989dbf086bb3" - integrity sha512-/7Oh74vZVXxQQ9Y+nH9Y3BZhWL+oMbPGr2XzP4RyD8K4EUDX73xMCYjk2sC8DnxN+wjkaaKRLlAZIoSeBy8v+g== +"@reservoir0x/reservoir-sdk@2.2.12": + version "2.2.12" + resolved "https://registry.yarnpkg.com/@reservoir0x/reservoir-sdk/-/reservoir-sdk-2.2.12.tgz#9a376f3aa681f3a86a9996b8d0591cc8fea7a0c9" + integrity sha512-lnajlPhApyc2CET32K/KHgUZhXTA+/1Eq56Evg4VFCWUhChMOdCY3BEnkDNJg07l7azFGepttaa844Ah8JY2Mg== dependencies: axios "^1.6.7"