Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: wire-up rfox staking #6925

Merged
merged 94 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
2b9e72b
staking components
reallybeard May 14, 2024
991181e
add staking components
reallybeard May 15, 2024
bba059a
fix translation
reallybeard May 15, 2024
b8b7948
move files around
reallybeard May 15, 2024
8a0db0f
Merge branch 'develop' into WEB-6738
reallybeard May 15, 2024
2e85097
Revert "move files around"
reallybeard May 15, 2024
8a47fd3
revert
reallybeard May 15, 2024
7b825ea
Revert "revert"
reallybeard May 15, 2024
babcc15
idfk
reallybeard May 15, 2024
8b733f4
rename folders
reallybeard May 15, 2024
4589be6
remove the older folders
reallybeard May 15, 2024
167e701
Update StakeInput.tsx
reallybeard May 15, 2024
ada2d7d
translations
reallybeard May 15, 2024
c9d200a
use already defined translations
reallybeard May 15, 2024
7b15060
update others
reallybeard May 15, 2024
fc18587
Update AddressSelection.tsx
reallybeard May 15, 2024
169573c
[skip ci] wip: wire-up rfox staking
gomesalexandre May 15, 2024
59e4ed7
feat: don't display gas row when approval required
gomesalexandre May 15, 2024
8e0d3d4
[skip ci] feat: more todo
gomesalexandre May 15, 2024
7cd8674
[skip ci] fix: derp
gomesalexandre May 15, 2024
fbb0bb1
Merge remote-tracking branch 'origin/develop' into feat_wire_up_rfox_…
gomesalexandre May 15, 2024
78237fa
[skip ci] fix: forgotten mergefix
gomesalexandre May 15, 2024
a68bcd9
[skip ci] fix: and another one
gomesalexandre May 15, 2024
28d0514
feat: abi types inference in wagmi
gomesalexandre May 15, 2024
c6fc998
Merge branch 'develop' into feat_wire_up_rfox_staking_1
gomesalexandre May 16, 2024
3a1be8d
feat: disable when no runeAddress
gomesalexandre May 16, 2024
b8a8c6c
feat: add thorchain validateAddress
gomesalexandre May 16, 2024
35ce474
feat: wire-up validation
gomesalexandre May 16, 2024
2058255
feat: approve
gomesalexandre May 16, 2024
34565f5
feat: actual approve
gomesalexandre May 16, 2024
c8c5ca8
fix: i'm derp
gomesalexandre May 16, 2024
40a89ec
feat: she works
gomesalexandre May 16, 2024
ac243f4
fix: types
gomesalexandre May 16, 2024
1f35e70
feat: use constant
gomesalexandre May 16, 2024
db6e89f
feat: more cleanup
gomesalexandre May 16, 2024
1875020
feat: tackle many TODOs
gomesalexandre May 16, 2024
0fc7343
fix: generatedAssetData.json workaround
gomesalexandre May 16, 2024
bb89458
feat: regen asset data
gomesalexandre May 16, 2024
31eda2e
feat: implement form validation in TradeAmountInput
gomesalexandre May 17, 2024
6505601
Merge remote-tracking branch 'origin/develop' into feat_wire_up_rfox_…
gomesalexandre May 17, 2024
6c3b12e
feat: regen assetData
gomesalexandre May 17, 2024
2b659a8
feat: fox on arb market-data monkey patch
gomesalexandre May 17, 2024
4f8ba1c
feat: monkey-patch for now vs. regenerating all
gomesalexandre May 17, 2024
d955784
feat: nullish access of control when in the context of an undefined form
gomesalexandre May 17, 2024
42662ae
fix: shit
gomesalexandre May 17, 2024
aa2f3a9
feat: input display either approval or actual stake fees
gomesalexandre May 17, 2024
7adc540
feat: improve loading stateroos
gomesalexandre May 17, 2024
3c49953
feat: don't fire queries when amount invalid
gomesalexandre May 17, 2024
77471f5
feat: improve loading states some more
gomesalexandre May 17, 2024
46be5df
feat: share of pool percentage
gomesalexandre May 17, 2024
8f3d830
feat: cleanup useless mutation
gomesalexandre May 17, 2024
18d3e3b
feat: actually revert mutation to benefit from loading states
gomesalexandre May 17, 2024
78d3407
feat: leverage form some more
gomesalexandre May 17, 2024
d9a7583
feat: bump viem and wagmi to latest
gomesalexandre May 17, 2024
7f85132
feat: move stakeFees to getFees
gomesalexandre May 17, 2024
1621fff
feat: move getFees into react-queries
gomesalexandre May 17, 2024
d4c5400
fix: wallet doesn't serialize in JSON derp
gomesalexandre May 17, 2024
ec216b2
fix: types
gomesalexandre May 17, 2024
1b430e8
feat: pass validation down
gomesalexandre May 17, 2024
b4e9ef5
feat: last cleanup
gomesalexandre May 17, 2024
b9a9776
feat: share of pool at confirm step
gomesalexandre May 17, 2024
4cfe379
feat: cleanup TODO
gomesalexandre May 17, 2024
11d5951
feat: remove comment
gomesalexandre May 17, 2024
40b5b57
fix: only show recent transactions from connected wallet (#6938)
kaladinlight May 17, 2024
e914b43
chore: use effective coalesing for selector cache keys and download b…
woodenfurniture May 17, 2024
c23bc60
feat: form-based fee balance validation
gomesalexandre May 20, 2024
adc9912
feat: invalidate queries on from change
gomesalexandre May 20, 2024
ad1cf5f
fix: user share of pool
gomesalexandre May 20, 2024
42e372c
Merge remote-tracking branch 'origin/develop' into feat_wire_up_rfox_…
gomesalexandre May 20, 2024
22ad71b
Merge remote-tracking branch 'origin/develop' into feat_wire_up_rfox_…
gomesalexandre May 20, 2024
ca7ee8e
Merge branch 'develop' into feat_wire_up_rfox_staking_1
gomesalexandre May 21, 2024
98b7203
fix: user share of pool
gomesalexandre May 20, 2024
acce670
Merge remote-tracking branch 'origin/develop' into feat_wire_up_rfox_…
gomesalexandre May 21, 2024
794a515
feat: rm todo
gomesalexandre May 21, 2024
e1eb627
feat: cherry-pick renaming bits from unstaking PR
gomesalexandre May 21, 2024
1a1c9de
feat: cherry-pick cleanup bits from unstaking PR
gomesalexandre May 21, 2024
bb94069
fix: types
gomesalexandre May 21, 2024
4aaee89
Merge remote-tracking branch 'origin/develop' into feat_wire_up_rfox_…
gomesalexandre May 22, 2024
df3531f
fix: types after mergefix
gomesalexandre May 22, 2024
492c65f
feat: fallback controller to unrug change address current view-layer
gomesalexandre May 22, 2024
b5b8d3d
fix: hydrate FOX market data in StakingInput
gomesalexandre May 23, 2024
cdf3dfe
feat: pass cryptoAmount in too in TradeAmountInput
gomesalexandre May 23, 2024
86611b4
fix: tradeamountinput add missing prefix for crypto as opposite curre…
gomesalexandre May 23, 2024
8196a79
fix: missing interpolation in translation
gomesalexandre May 23, 2024
bbacc30
fix: use stakingInfo vs. balanceOf for user balanceOf
gomesalexandre May 23, 2024
df5d6f2
feat: rm debug logs
gomesalexandre May 23, 2024
4f537d5
feat: add toast
gomesalexandre May 23, 2024
1e14154
feat: add isTransitioning
gomesalexandre May 23, 2024
402a38d
Merge remote-tracking branch 'origin/develop' into feat_wire_up_rfox_…
gomesalexandre May 23, 2024
46e22b5
feat: add base to wagmi-config
gomesalexandre May 23, 2024
8bd523b
feat: clearer naming
gomesalexandre May 23, 2024
4e5a3f6
feat: conventional event-handler naming
gomesalexandre May 23, 2024
1e92047
feat: omit undefined param in sendStakeTx and rename to handleStake
gomesalexandre May 23, 2024
1123e2f
Merge remote-tracking branch 'origin/develop' into feat_wire_up_rfox_…
gomesalexandre May 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@
"uuid": "^9.0.0",
"vaul": "^0.9.0",
"viem": "^1.16.6",
"wagmi": "1.4.13",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah we're bringing this back, no reason to reinvent the wheel when reading data in components - wagmi is just a wrapper around react-query and we would write ours, not so well optimized anyway, using viem.

Since wagmi wraps react-query and uses our viem client under the hood, that's literally the same we would write, but better. Nothing crazy huge either: https://bundlephobia.com/package/[email protected]

Note: this is the last v1 before wagmi published v2 which has viem v2 as a dependency, meaning we'd also have to bump viem to v2. Initially went with that and this is nothing super bad to tackle, but this PR is probably not the place for it so staying at v1 for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually bumped viem and wagmi to latest, tackled all type errors and renames following breaking change. Now bundle is actually twice smaller 🎉

"web-vitals": "^2.1.4"
},
"devDependencies": {
Expand Down
2 changes: 2 additions & 0 deletions packages/caip/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ export const arbitrumNovaAssetId: AssetId = 'eip155:42170/slip44:60'

export const foxOnGnosisAssetId: AssetId =
'eip155:100/erc20:0x21a42669643f45bc0e086b8fc2ed70c23d67509d'
export const foxOnArbitrumOneAssetId: AssetId =
'eip155:42161/erc20:0xf929de51d91c77e42f5090069e0ad7a09e513c73'
export const foxAssetId: AssetId = 'eip155:1/erc20:0xc770eefad204b5180df6a14ee197d99d808ee52d'
export const foxatarAssetId: AssetId =
'eip155:137/erc721:0x2e727c425a11ce6b8819b3004db332c12d2af2a2'
Expand Down
26 changes: 15 additions & 11 deletions src/AppProviders.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { Provider as ReduxProvider } from 'react-redux'
import { HashRouter } from 'react-router-dom'
import { PersistGate } from 'redux-persist/integration/react'
import { ScrollToTop } from 'Routes/ScrollToTop'
import { WagmiConfig } from 'wagmi'
import { ChatwootWidget } from 'components/ChatWoot'
import { AppProvider } from 'context/AppProvider/AppContext'
import { BrowserRouterProvider } from 'context/BrowserRouterProvider/BrowserRouterProvider'
Expand All @@ -27,6 +28,7 @@ import { KeepKeyProvider } from 'context/WalletProvider/KeepKeyProvider'
import { WalletProvider } from 'context/WalletProvider/WalletProvider'
import { getMixPanel } from 'lib/mixpanel/mixPanelSingleton'
import { MixPanelEvent } from 'lib/mixpanel/types'
import { wagmiConfig } from 'lib/wagmi-config'
import { ErrorPage } from 'pages/ErrorPage/ErrorPage'
import { SplashScreen } from 'pages/SplashScreen/SplashScreen'
import { persistor, store } from 'state/store'
Expand Down Expand Up @@ -71,17 +73,19 @@ export function AppProviders({ children }: ProvidersProps) {
<WalletConnectV2Provider>
<KeepKeyProvider>
<ErrorBoundary FallbackComponent={ErrorPage} onError={handleError}>
<QueryClientProvider>
<ModalProvider>
<TransactionsProvider>
<AppProvider>
<FoxEthProvider>
<DefiManagerProvider>{children}</DefiManagerProvider>
</FoxEthProvider>
</AppProvider>
</TransactionsProvider>
</ModalProvider>
</QueryClientProvider>
<WagmiConfig config={wagmiConfig}>
<QueryClientProvider>
<ModalProvider>
<TransactionsProvider>
<AppProvider>
<FoxEthProvider>
<DefiManagerProvider>{children}</DefiManagerProvider>
</FoxEthProvider>
</AppProvider>
</TransactionsProvider>
</ModalProvider>
</QueryClientProvider>
</WagmiConfig>
</ErrorBoundary>
</KeepKeyProvider>
</WalletConnectV2Provider>
Expand Down
Loading