Skip to content

Commit 45cba5b

Browse files
mcclurejtjackburrusDannyDelottsentilesdalMazyGio
authored
Include new mainnet fork changes (#1218)
* Fix convertToShares when StETH (#1169) * check if shares is pegged * move into variable * adds adjust slippage error (#1166) * Show effective short apr in preview (#1165) * show short apr after open * adds short apr after open * Rename label * updates per comments * Fix total values to include closed (#1175) * check if closed longs * fix total values for closed * remove console log * remove typecasting * move total variable * split into two hooks * moved is loading * adds enabled param * Migrate steth -> lidoShares conversion from sdk to frontend (#1176) * Remove conversions from ReadStethHyperdrive and ReadWriteStethHyperdrive * Create usePrepareSharesIn and usePrepareSharesOut * minor cleanup in aisle useAccruedYield * Update usePreviewOpenLong to prepare shares in * Update usePreviewCloseLong to prepare shares out * Update useMaxLong to prepare shares out * Update useCloseLong to prepare shares in * Update useOpenLong to prepare shares in * Update useAddLiquidity to prepare shares in * Update usePreviewAddLiquidity to prepare shares in * Update usePreviewRedeemWithdrawalShares to convert shares out * Update useRedeemWithdrawalShares to prepare shares in * Update useRemoveLiquidity to prepare shares in * Update usePreviewRemoveLiquidity to prepare shares in and out * Update useMaxShort to prepare shares out * Update useOpenShort to prepare shares in * Update usePreviewOpenShort to prepare shares out * Update useCloseShort to prepare shares in * Update usePreviewCloseShort to prepare shares out * Fix sign in prepareSharesOut * Remove unnecessary extra conversions that caused loss of precision * early return * color net short rate red/green (#1177) * anonymize ip (#1178) * Polish modal forms for all position types (#1181) * Upgrade to latest daisy * Add texture svgs * Darken backdrop on modals * Add size prop to LabelValue * Add size and horizontal props to Stat * Add modalHeader prop to Modal * Remove Well from TransactionPreview component * Add header to open long modal * Re-organize the OpenLongPreview, put market impact in daisy-collapse * Refactor to ModalHeader component * Fix layout shift on focus * Add xsmall size to Stat component * move getRemainingTimeLabel to own file * Refactor CloseLongForm and CloseLongModalButton to use new modal style * Create base component for CollapseSection * Refactor OpenShort * Refactor Close Short * Tweak stat size * Add '.00' if rate is a whole number * tweak spacing * Slightly dim the before text color for market impact * Refactor Add Liquidity modal * Refactor Remove liquidity form * Refactor withdrawal shares * Throw error in getSubheadingLabel utils * inline * Throw test error for rollbar (#1182) * throw test error * updates per comments * udpate footer links, adds icons (#1183) * remove unused tableheader on mobile (#1184) * Polish open and close position modals (#1188) * Fix gap when using stat without a label * Prevent wrapping by using condensed label * Simplify props to just what's used * Code cleanups * Polish Term Completed badges in close modals * Add docblock * adds error for total value (#1193) * Add gopher package and /bridge route (#1195) * add step to README * add bridge page * add gopher package * cleanup * Remove spark package (#1196) * give tos modal some breating room (#1198) * show insufficient balance second (#1199) * Add calcShortMarketValue to hyperdrive-wasm (#1167) Co-authored-by: MazyGio <[email protected]> * Display Negative Short APR/ROI in Red in Yield Stats (#1200) * Add VPN and Restricted Countries pages (#1201) * Add VPN page * Remove pasted code from trm message * Add restricted countries route * Fill out Bridge page with stats. (#1202) * add gopher dependency * move this to the consumer * use index for file names, ignore out dir * add hooks * add stats to bridge page. * update hooks to match repo style * flatten, use makeQueryKey * prevent error TS18003: No inputs were found in config file * Polish Preview Transaction sections in open position modals (#1203) * Polish tooltips in OpenLong and OpenShort previews * Remove bolding * Make the text color less bright on zeros when empty state in OpenLongPreview * Update tooltips and text brightness on OpenShortPreview * Cleanup layout in AddLiquidityPreview, fix active color on LP stat * Show market short rate by default in Open Short preview * Indent balances for easier scanning * Flip condition * Add Your Transactions table to market details (#1204) * Re-use type * Add Your Transaction table * Remove unused z index * Default to all transactions if no account connected * Add Gopher Stubs (#1207) * add gopher stubs * add comment * Navbar Cleanup (#1206) * updates connect button * version picker added * version picker cleanup * cleanup * updates per comments * add ui to switch to bridge modal (#1208) * add ui to switch to bridge modal * refactor OpenLongModal * add BridgeAssetsModal * allow multi modal mode * toggle between modal uis * put behind feature flag * capitalize DELV (#1209) * capitalize delv * cap github * Update repo to 1.0.12 (#1210) * Update artifacts to 1.0.12 * Update appconfig * Add missing field to 42069 config. * Fix SDK types * Update hyperwasm * Final fixes * Add link to v1.0.6 pools in version picker (#1212) * Add link to v1.0.6 pools in version picker" * Add link to v1.0.6 pools in version picker, remove version picker from behind feature flag * updates mainnet wagmi client (#1211) * Fix flag for Bridge UI (#1213) * Build mock app config for mainnet (#1214) Co-authored-by: Danny Delott <[email protected]> * adds new text (#1216) * Add mainnet appconfig (#1215) * Add registry address for mainnet and generation script * Build appconfig for mainnet * Bump husky version, use npx --------- Co-authored-by: Ryan Goree <[email protected]> * new fork appconfig (#1217) --------- Co-authored-by: Jack Burrus <[email protected]> Co-authored-by: Danny Delott <[email protected]> Co-authored-by: Matthew Brown <[email protected]> Co-authored-by: MazyGio <[email protected]> Co-authored-by: Ryan Goree <[email protected]> Co-authored-by: Danny Delott <[email protected]>
1 parent 2c3d221 commit 45cba5b

File tree

643 files changed

+120752
-103493
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

643 files changed

+120752
-103493
lines changed

Cargo.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/hyperdrive-trading/.env.sample

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,11 @@ VITE_CUSTOM_CHAIN_CHAIN_ID=
1414
VITE_CAPSULE_API_KEY=
1515
VITE_CAPSULE_ENV=
1616
#
17-
# Sepolia
17+
# Sepolia, or
1818
VITE_SEPOLIA_RPC_URL=
19+
#
20+
# Mainnet
21+
VITE_MAINNET_RPC_URL=
1922
##################################################
2023

2124
# Used to screen ineligible addresses.

apps/hyperdrive-trading/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ cd apps/hyperdrive-trading
4848

4949
### Run locally
5050

51+
First, copy the .env.sample to .env and you'll need to set the VITE_SEPOLIA_RPC_URL variable to an active rpc url.
52+
5153
Serve with hot reload at <http://localhost:5173>.
5254

5355
```bash

apps/hyperdrive-trading/package.json

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,62 +26,64 @@
2626
"gen:walletconnect": "bash ./scripts/generate-walletconnect.sh"
2727
},
2828
"dependencies": {
29+
"@delvtech/gopher": "*",
30+
"@delvtech/hyperdrive-viem": "^2.3.0",
2931
"@heroicons/react": "^2.0.16",
3032
"@hyperdrive/appconfig": "*",
31-
"@delvtech/hyperdrive-viem": "^2.3.0",
3233
"@rainbow-me/rainbowkit": "^2.0.0",
34+
"@rollbar/react": "^0.11.1",
3335
"@tanstack/react-query": "^4.29.12",
3436
"@tanstack/react-router": "^1.9.0",
3537
"@tanstack/react-table": "^8.10.3",
36-
"@types/lodash.sortby": "^4.7.9",
37-
"lodash.sortby": "^4.7.0",
3838
"@types/d3-format": "^3.0.4",
39+
"@types/lodash.sortby": "^4.7.9",
3940
"assert-never": "^1.2.1",
4041
"buffer": "^6.0.3",
4142
"calendar-link": "^2.6.0",
4243
"classnames": "^2.3.2",
4344
"d3-format": "^3.1.0",
44-
"daisyui": "^4.11.1",
45+
"daisyui": "^4.12.2",
4546
"dnum": "^2.9.0",
47+
"lodash.sortby": "^4.7.0",
4648
"process": "^0.11.10",
4749
"react": "^18.2.0",
4850
"react-dom": "^18.2.0",
4951
"react-helmet": "^6.1.0",
5052
"react-hot-toast": "^2.4.0",
5153
"react-loading-skeleton": "^3.3.1",
5254
"react-use": "^17.4.2",
53-
"viem": "^2.7.8",
54-
"@rollbar/react": "^0.11.1",
5555
"rollbar": "^2.26.4",
56+
"viem": "^2.7.8",
5657
"wagmi": "^2.5.12"
5758
},
5859
"devDependencies": {
5960
"@hyperdrive/eslint-config": "*",
6061
"@hyperdrive/prettier-config": "*",
6162
"@hyperdrive/tsconfig": "*",
63+
"@tanstack/eslint-plugin-query": "^5.28.11",
6264
"@tanstack/router-devtools": "^1.9.0",
6365
"@tanstack/router-vite-plugin": "^1.8.2",
64-
"@tanstack/eslint-plugin-query": "^5.28.11",
6566
"@types/react": "^18.0.9",
6667
"@types/react-dom": "^18.0.10",
6768
"@types/react-helmet": "^6.1.6",
6869
"@typescript-eslint/eslint-plugin": "^7.5.0",
6970
"@typescript-eslint/parser": "^7.5.0",
71+
"@usecapsule/rainbowkit-wallet": "^0.8.5",
7072
"@vitejs/plugin-react": "^3.1.0",
7173
"autoprefixer": "^10.4.13",
7274
"eslint-plugin-react": "^7.34.1",
7375
"eslint-plugin-react-hooks": "^4.6.0",
7476
"eslint-plugin-tailwindcss": "^3.15.1",
77+
"msw": "^2.3.1",
7578
"postcss": "^8.4.21",
7679
"prettier": "3.2.5",
7780
"prettier-plugin-organize-imports": "3.2.4",
7881
"prettier-plugin-tailwindcss": "^0.5.13",
79-
"vite-plugin-node-polyfills": "^0.21.0",
80-
"@usecapsule/rainbowkit-wallet": "^0.8.5",
8182
"tailwindcss": "^3.4.3",
8283
"tailwindcss-debug-screens": "2.2.1",
8384
"typescript": "^5.0.2",
8485
"vite": "^4.1.0",
86+
"vite-plugin-node-polyfills": "^0.21.0",
8587
"vite-tsconfig-paths": "^4.0.5",
8688
"vitest": "^0.28.5"
8789
}

apps/hyperdrive-trading/src/base/formatRate.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,8 @@ export function formatRate(rate: bigint, decimals = 18): string {
66
// the decimal, and format those to a percent, eg: 0.0499999999 * 100 = 4.99.
77
const truncatedAPR = +formatUnits(rate, decimals).slice(0, 10);
88
const formatted = `${Number((100 * truncatedAPR).toFixed(2)).toLocaleString()}`;
9+
if (formatted.indexOf(".") === -1) {
10+
return `${formatted}.00`;
11+
}
912
return formatted;
1013
}

apps/hyperdrive-trading/src/network/wagmiClient.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { cloudChain } from "src/chains/cloudChain";
1212
import { CreateWalletFn } from "src/wallets/CreateWalletFn";
1313
import { capsuleWallet } from "src/wallets/capsule";
1414
import { Transport } from "viem";
15-
import { foundry, sepolia } from "wagmi/chains";
15+
import { foundry, mainnet, sepolia } from "wagmi/chains";
1616

1717
const {
1818
VITE_LOCALHOST_NODE_RPC_URL,
@@ -21,6 +21,7 @@ const {
2121
VITE_CUSTOM_CHAIN_CHAIN_ID,
2222
VITE_WALLET_CONNECT_PROJECT_ID,
2323
VITE_SEPOLIA_RPC_URL,
24+
VITE_MAINNET_RPC_URL,
2425
} = import.meta.env;
2526

2627
export const chains: Chain[] = [];
@@ -62,6 +63,17 @@ if (VITE_SEPOLIA_RPC_URL) {
6263
}
6364
}
6465

66+
if (VITE_MAINNET_RPC_URL) {
67+
chains.push(mainnet);
68+
transports[mainnet.id] = http(VITE_MAINNET_RPC_URL);
69+
70+
// TODO: push this into the custom wallets for local and cloudchain once
71+
// capsule support is verified
72+
if (capsuleWallet) {
73+
customWallets.push(capsuleWallet);
74+
}
75+
}
76+
6577
export const wagmiConfig = getDefaultConfig({
6678
appName: "Hyperdrive",
6779
projectId: VITE_WALLET_CONNECT_PROJECT_ID || "0",

apps/hyperdrive-trading/src/public/delorean.svg

Lines changed: 18 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)