Skip to content

Include new mainnet fork changes #1218

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

Merged
merged 35 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
118a1cf
Fix convertToShares when StETH (#1169)
jackburrus Jun 11, 2024
f715579
adds adjust slippage error (#1166)
jackburrus Jun 11, 2024
020f7bf
Show effective short apr in preview (#1165)
jackburrus Jun 11, 2024
d805c19
Fix total values to include closed (#1175)
jackburrus Jun 12, 2024
a03a479
Migrate steth -> lidoShares conversion from sdk to frontend (#1176)
DannyDelott Jun 13, 2024
60b02b8
color net short rate red/green (#1177)
jackburrus Jun 13, 2024
d66d0e5
anonymize ip (#1178)
jackburrus Jun 14, 2024
f596d79
Polish modal forms for all position types (#1181)
DannyDelott Jun 18, 2024
581c3e1
Throw test error for rollbar (#1182)
jackburrus Jun 18, 2024
8b5b9ab
udpate footer links, adds icons (#1183)
jackburrus Jun 18, 2024
7f429c7
remove unused tableheader on mobile (#1184)
jackburrus Jun 19, 2024
148ee81
Polish open and close position modals (#1188)
DannyDelott Jun 20, 2024
653f936
adds error for total value (#1193)
jackburrus Jun 20, 2024
bda893f
Add gopher package and /bridge route (#1195)
sentilesdal Jun 20, 2024
de6fa32
Remove spark package (#1196)
DannyDelott Jun 20, 2024
0942454
give tos modal some breating room (#1198)
jackburrus Jun 21, 2024
307f671
show insufficient balance second (#1199)
jackburrus Jun 21, 2024
af5be0c
Add calcShortMarketValue to hyperdrive-wasm (#1167)
DannyDelott Jun 24, 2024
2058fff
Display Negative Short APR/ROI in Red in Yield Stats (#1200)
DannyDelott Jun 24, 2024
ebc5728
Add VPN and Restricted Countries pages (#1201)
ryangoree Jun 24, 2024
0ca99fd
Fill out Bridge page with stats. (#1202)
sentilesdal Jun 25, 2024
5136603
Polish Preview Transaction sections in open position modals (#1203)
DannyDelott Jun 25, 2024
900d3c2
Add Your Transactions table to market details (#1204)
DannyDelott Jun 25, 2024
4fdd41e
Add Gopher Stubs (#1207)
sentilesdal Jun 26, 2024
d230394
Navbar Cleanup (#1206)
jackburrus Jun 26, 2024
21b6017
add ui to switch to bridge modal (#1208)
sentilesdal Jun 26, 2024
f2632b6
capitalize DELV (#1209)
jackburrus Jun 26, 2024
58468d2
Update repo to 1.0.12 (#1210)
ryangoree Jun 26, 2024
b89654e
Add link to v1.0.6 pools in version picker (#1212)
DannyDelott Jun 26, 2024
ee33af8
updates mainnet wagmi client (#1211)
jackburrus Jun 26, 2024
4268472
Fix flag for Bridge UI (#1213)
sentilesdal Jun 26, 2024
79bac63
Build mock app config for mainnet (#1214)
jackburrus Jun 26, 2024
c022268
adds new text (#1216)
jackburrus Jun 27, 2024
d8665b6
Add mainnet appconfig (#1215)
DannyDelott Jun 27, 2024
a5b4515
new fork appconfig (#1217)
mcclurejt Jun 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 6 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion apps/hyperdrive-trading/.env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@ VITE_CUSTOM_CHAIN_CHAIN_ID=
VITE_CAPSULE_API_KEY=
VITE_CAPSULE_ENV=
#
# Sepolia
# Sepolia, or
VITE_SEPOLIA_RPC_URL=
#
# Mainnet
VITE_MAINNET_RPC_URL=
##################################################

# Used to screen ineligible addresses.
Expand Down
2 changes: 2 additions & 0 deletions apps/hyperdrive-trading/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ cd apps/hyperdrive-trading

### Run locally

First, copy the .env.sample to .env and you'll need to set the VITE_SEPOLIA_RPC_URL variable to an active rpc url.

Serve with hot reload at <http://localhost:5173>.

```bash
Expand Down
20 changes: 11 additions & 9 deletions apps/hyperdrive-trading/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,62 +26,64 @@
"gen:walletconnect": "bash ./scripts/generate-walletconnect.sh"
},
"dependencies": {
"@delvtech/gopher": "*",
"@delvtech/hyperdrive-viem": "^2.3.0",
"@heroicons/react": "^2.0.16",
"@hyperdrive/appconfig": "*",
"@delvtech/hyperdrive-viem": "^2.3.0",
"@rainbow-me/rainbowkit": "^2.0.0",
"@rollbar/react": "^0.11.1",
"@tanstack/react-query": "^4.29.12",
"@tanstack/react-router": "^1.9.0",
"@tanstack/react-table": "^8.10.3",
"@types/lodash.sortby": "^4.7.9",
"lodash.sortby": "^4.7.0",
"@types/d3-format": "^3.0.4",
"@types/lodash.sortby": "^4.7.9",
"assert-never": "^1.2.1",
"buffer": "^6.0.3",
"calendar-link": "^2.6.0",
"classnames": "^2.3.2",
"d3-format": "^3.1.0",
"daisyui": "^4.11.1",
"daisyui": "^4.12.2",
"dnum": "^2.9.0",
"lodash.sortby": "^4.7.0",
"process": "^0.11.10",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-helmet": "^6.1.0",
"react-hot-toast": "^2.4.0",
"react-loading-skeleton": "^3.3.1",
"react-use": "^17.4.2",
"viem": "^2.7.8",
"@rollbar/react": "^0.11.1",
"rollbar": "^2.26.4",
"viem": "^2.7.8",
"wagmi": "^2.5.12"
},
"devDependencies": {
"@hyperdrive/eslint-config": "*",
"@hyperdrive/prettier-config": "*",
"@hyperdrive/tsconfig": "*",
"@tanstack/eslint-plugin-query": "^5.28.11",
"@tanstack/router-devtools": "^1.9.0",
"@tanstack/router-vite-plugin": "^1.8.2",
"@tanstack/eslint-plugin-query": "^5.28.11",
"@types/react": "^18.0.9",
"@types/react-dom": "^18.0.10",
"@types/react-helmet": "^6.1.6",
"@typescript-eslint/eslint-plugin": "^7.5.0",
"@typescript-eslint/parser": "^7.5.0",
"@usecapsule/rainbowkit-wallet": "^0.8.5",
"@vitejs/plugin-react": "^3.1.0",
"autoprefixer": "^10.4.13",
"eslint-plugin-react": "^7.34.1",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-tailwindcss": "^3.15.1",
"msw": "^2.3.1",
"postcss": "^8.4.21",
"prettier": "3.2.5",
"prettier-plugin-organize-imports": "3.2.4",
"prettier-plugin-tailwindcss": "^0.5.13",
"vite-plugin-node-polyfills": "^0.21.0",
"@usecapsule/rainbowkit-wallet": "^0.8.5",
"tailwindcss": "^3.4.3",
"tailwindcss-debug-screens": "2.2.1",
"typescript": "^5.0.2",
"vite": "^4.1.0",
"vite-plugin-node-polyfills": "^0.21.0",
"vite-tsconfig-paths": "^4.0.5",
"vitest": "^0.28.5"
}
Expand Down
3 changes: 3 additions & 0 deletions apps/hyperdrive-trading/src/base/formatRate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@ export function formatRate(rate: bigint, decimals = 18): string {
// the decimal, and format those to a percent, eg: 0.0499999999 * 100 = 4.99.
const truncatedAPR = +formatUnits(rate, decimals).slice(0, 10);
const formatted = `${Number((100 * truncatedAPR).toFixed(2)).toLocaleString()}`;
if (formatted.indexOf(".") === -1) {
return `${formatted}.00`;
}
return formatted;
}
14 changes: 13 additions & 1 deletion apps/hyperdrive-trading/src/network/wagmiClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,16 @@
import { CreateWalletFn } from "src/wallets/CreateWalletFn";
import { capsuleWallet } from "src/wallets/capsule";
import { Transport } from "viem";
import { foundry, sepolia } from "wagmi/chains";
import { foundry, mainnet, sepolia } from "wagmi/chains";

const {
VITE_LOCALHOST_NODE_RPC_URL,
VITE_CUSTOM_CHAIN_NODE_RPC_URL,
VITE_CUSTOM_CHAIN_ADDRESSES_URL,

Check warning on line 20 in apps/hyperdrive-trading/src/network/wagmiClient.ts

View workflow job for this annotation

GitHub Actions / verify (lint)

'VITE_CUSTOM_CHAIN_ADDRESSES_URL' is assigned a value but never used. Allowed unused vars must match /^unused/u
VITE_CUSTOM_CHAIN_CHAIN_ID,
VITE_WALLET_CONNECT_PROJECT_ID,
VITE_SEPOLIA_RPC_URL,
VITE_MAINNET_RPC_URL,
} = import.meta.env;

export const chains: Chain[] = [];
Expand Down Expand Up @@ -62,6 +63,17 @@
}
}

if (VITE_MAINNET_RPC_URL) {
chains.push(mainnet);
transports[mainnet.id] = http(VITE_MAINNET_RPC_URL);

// TODO: push this into the custom wallets for local and cloudchain once
// capsule support is verified
if (capsuleWallet) {
customWallets.push(capsuleWallet);
}
}

export const wagmiConfig = getDefaultConfig({
appName: "Hyperdrive",
projectId: VITE_WALLET_CONNECT_PROJECT_ID || "0",
Expand Down
18 changes: 18 additions & 0 deletions apps/hyperdrive-trading/src/public/delorean.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading