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

Capsule integration final #883

Open
wants to merge 63 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
80de7e4
initial commit - basic capsule int
storywithoutend Jun 10, 2024
2b8d819
Merge branch 'main' into capsule-integration
jlm0 Jul 30, 2024
197987c
chore: pnpm update
jlm0 Jul 30, 2024
d0c5b9d
fix capsule
jlm0 Jul 31, 2024
2e9d342
Merge branch 'main' into pr/786
LeonmanRolls Aug 23, 2024
95a1785
onramp
LeonmanRolls Aug 25, 2024
c25c67f
Update capsule rainbow
LeonmanRolls Sep 2, 2024
abce894
Merge branch 'main' of https://github.com/ensdomains/ens-app-v3 into …
LeonmanRolls Sep 2, 2024
fc317e9
Theme fix
LeonmanRolls Sep 23, 2024
6cd4116
dynamically load capsule wallet
LeonmanRolls Sep 25, 2024
0d36cef
fixes
TateB Sep 25, 2024
df18ce8
disable worker
TateB Sep 25, 2024
d1264aa
update deps
LeonmanRolls Oct 7, 2024
6f4228d
Merge branch 'main' of https://github.com/ensdomains/ens-app-v3 into …
LeonmanRolls Oct 20, 2024
03c25d6
check if wallet is capsule
LeonmanRolls Oct 21, 2024
c5d303e
Link to capsule wallet when connected with capsule
LeonmanRolls Oct 22, 2024
a6d1653
Update Pricing.tsx
LeonmanRolls Oct 22, 2024
26cbe06
Merge branch 'main' of https://github.com/ensdomains/ens-app-v3 into …
LeonmanRolls Oct 22, 2024
b183869
Remove hotfix
LeonmanRolls Oct 22, 2024
876dfe5
load capsule tests
LeonmanRolls Oct 23, 2024
372d4a8
Mock capsule rainbowkit
LeonmanRolls Oct 23, 2024
c2e6188
Fix types
LeonmanRolls Oct 24, 2024
cfc8c2d
Review fixes
LeonmanRolls Oct 24, 2024
fd240fd
Merge branch 'main' of https://github.com/ensdomains/ens-app-v3 into …
LeonmanRolls Oct 28, 2024
1e5bb32
bump versions
LeonmanRolls Oct 29, 2024
29dbece
Add api keys
LeonmanRolls Oct 29, 2024
8521a2a
bump version
LeonmanRolls Oct 29, 2024
1de130a
wip
LeonmanRolls Nov 1, 2024
de0f4f9
merge main
LeonmanRolls Dec 3, 2024
32101ea
grab network from subdomain
LeonmanRolls Dec 3, 2024
c4ec941
getChainFromUrl
LeonmanRolls Dec 3, 2024
1535ceb
Switch account action
LeonmanRolls Dec 5, 2024
356293c
handleSendTransaction
LeonmanRolls Dec 7, 2024
adedc98
Network notifications
LeonmanRolls Dec 13, 2024
ab4dc6f
Capsule priority fee
LeonmanRolls Dec 13, 2024
e016b8a
tests
LeonmanRolls Dec 15, 2024
c689266
tests
LeonmanRolls Dec 16, 2024
d5b39ff
NetworkNotifications utils tests
LeonmanRolls Dec 16, 2024
56a83d4
...
LeonmanRolls Jan 6, 2025
aecfc6d
Merge branch 'main' of https://github.com/ensdomains/ens-app-v3 into …
LeonmanRolls Jan 7, 2025
a246a9e
...
LeonmanRolls Jan 7, 2025
a2725f0
Unit tests
LeonmanRolls Jan 7, 2025
1b86df6
Transports fix
LeonmanRolls Jan 8, 2025
db59678
Fix capsule median gas fee calc func
LeonmanRolls Jan 9, 2025
cfaa56d
useRenew test fixes
LeonmanRolls Jan 9, 2025
2e10efa
Test fixes
LeonmanRolls Jan 9, 2025
a846847
Type fixes
LeonmanRolls Jan 9, 2025
8caf073
Test fixes
LeonmanRolls Jan 9, 2025
d1d7916
Merge branch 'main' of https://github.com/ensdomains/ens-app-v3 into …
LeonmanRolls Jan 9, 2025
051bfa9
...
LeonmanRolls Jan 9, 2025
2d32bfc
connect wallet working
LeonmanRolls Jan 12, 2025
7ed90d8
Don't send switchChain to wallet unnecessarily
LeonmanRolls Jan 13, 2025
86f3d28
holesky fix
LeonmanRolls Jan 13, 2025
32726be
...
LeonmanRolls Jan 13, 2025
50a4d27
Test fix
LeonmanRolls Jan 13, 2025
a510e6a
CI fix
LeonmanRolls Jan 13, 2025
557d1f1
stateful tests on holesky
LeonmanRolls Jan 13, 2025
d59437d
lint fix
LeonmanRolls Jan 13, 2025
e045ea4
e2e fix
LeonmanRolls Jan 13, 2025
ff83364
Default to holesky
LeonmanRolls Jan 13, 2025
a886587
Clean up comments
LeonmanRolls Jan 15, 2025
d06c9a5
Don't switch chain when using web3-headless-wallet
LeonmanRolls Jan 17, 2025
145530a
merge and fix build
LeonmanRolls Jan 17, 2025
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 .github/workflows/pages-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Cloudflare Pages
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
NEXT_PUBLIC_INTERCOM_ID: re9q5yti
NEXT_PUBLIC_CAPSULE_API_KEY_PROD: ${{ secrets.CAPSULE_API_KEY_PROD }}
NEXT_PUBLIC_DRPC_KEY: AnmpasF2C0JBqeAEzxVO8aTteiMlrW4R75hpDonbV6cR

on: [push]
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,5 @@ tsconfig.vitest-temp.json

.dev.vars

*yalc*
*yalc*
certificates
12 changes: 5 additions & 7 deletions e2e/specs/stateful/address.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,18 @@ import { expect } from '@playwright/test'

import { test } from '../../../playwright/index.js'

test('should allow user to connect', async ({ page, login }) => {
test('should allow user with primary name to connect', async ({ page, login }) => {
test.slow()
await page.goto('/')
await page.goto('/?chain=holesky')
await login.connect()

await page.getByTestId('header-profile').click()
await expect(page.getByText('Profile')).toBeVisible()
await page.getByTestId('header-profile').click()
await expect(page.getByText('Profile')).not.toBeVisible()
await expect(page.getByText('Disconnect')).toBeVisible()
})

test('should go to the address page', async ({ page, login }) => {
test.slow()
await page.goto('/')
await page.goto('/?chain=holesky')
await login.connect()

await page
Expand All @@ -30,7 +28,7 @@ test('should not show the profile if there is no primary name for the address',
login,
}) => {
test.slow()
await page.goto('/')
await page.goto('/?chain=holesky')
await login.connect()
await page
.getByPlaceholder('Search for a name')
Expand Down
10 changes: 5 additions & 5 deletions e2e/specs/stateful/dnsclaim.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ test.describe('Import DNSSEC name', () => {
page,
login,
}) => {
await page.goto('/notdnssec.com')
await page.goto('/notdnssec.com?chain=holesky')
await login.connect()

await page.getByTestId('onchain-radio').click()
Expand All @@ -21,7 +21,7 @@ test.describe('Import DNSSEC name', () => {
page,
login,
}) => {
await page.goto('/noenssubdomain.com')
await page.goto('/noenssubdomain.com?chain=holesky')
await login.connect()

await page.getByTestId('onchain-radio').click()
Expand All @@ -36,7 +36,7 @@ test.describe('Import DNSSEC name', () => {
page,
login,
}) => {
await page.goto('/noenssubdomain.com')
await page.goto('/noenssubdomain.com?chain=holesky')
await login.connect()

await page.getByTestId('offchain-radio').click()
Expand All @@ -50,7 +50,7 @@ test.describe('Import DNSSEC name', () => {
page,
login,
}) => {
await page.goto('/invalidensrecord.com')
await page.goto('/invalidensrecord.com?chain=holesky')
await login.connect()

await page.getByTestId('onchain-radio').click()
Expand All @@ -61,7 +61,7 @@ test.describe('Import DNSSEC name', () => {
})

test('should resolve .pw domains', async ({ page, login }) => {
await page.goto('/test.pw')
await page.goto('/test.pw?chain=holesky')
await login.connect()

await page.getByTestId('onchain-radio').click()
Expand Down
22 changes: 12 additions & 10 deletions e2e/specs/stateful/profile.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const profiles = [

test.describe('Profile', () => {
test('should allow user to connect', async ({ page, login }) => {
await page.goto('/')
await page.goto('/?chain=holesky')
await login.connect()

await page.getByTestId('header-profile').click()
Expand All @@ -90,19 +90,19 @@ test.describe('Profile', () => {
})

test('should show a warning if name is not supported', async ({ page }) => {
await page.goto('/name.nottld')
await page.goto('/name.nottld?chain=holesky')
await expect(page.getByText('This TLD is not supported')).toBeVisible({ timeout: 25000 })
})

test('should load emoji domain pages', async ({ page }) => {
await page.goto('/%E2%9D%A4%EF%B8%8F%E2%9D%A4%EF%B8%8F%E2%9D%A4%EF%B8%8F.eth')
await page.goto('/%E2%9D%A4%EF%B8%8F%E2%9D%A4%EF%B8%8F%E2%9D%A4%EF%B8%8F.eth?chain=holesky')
await expect(page.getByTestId('profile-snippet-name')).toContainText('❤️❤️❤️.eth', {
timeout: 25000,
})
})

test('should allow searching for emoji domain', async ({ page, login }) => {
await page.goto('/')
await page.goto('/?chain=holesky')
await login.connect()

await page.getByPlaceholder('Search for a name').fill('❤️❤️❤️❤️❤️❤️.eth')
Expand All @@ -114,7 +114,7 @@ test.describe('Profile', () => {

for (const profile of profiles) {
test(`should load profile for: ${profile.name}`, async ({ page, login }) => {
await page.goto('/')
await page.goto('/?chain=holesky')
await login.connect()

await page.getByPlaceholder('Search for a name').fill(profile.name)
Expand Down Expand Up @@ -233,20 +233,22 @@ test.describe('Profile', () => {
}

test('should decode an unknown label', async ({ page, login }) => {
await page.goto('/')
await page.goto('/?chain=holesky')
await login.connect()
// eslint-disable-next-line no-restricted-syntax
await page.goto('/[8df9cfc425ad5e1853259e1cef0a8d1d44591fbec8e3feb6f930d9dfacd5eff2].eth')
await page.goto(
// eslint-disable-next-line no-restricted-syntax
'/[8df9cfc425ad5e1853259e1cef0a8d1d44591fbec8e3feb6f930d9dfacd5eff2].eth?chain=holesky',
)
await expect(page.getByTestId('profile-snippet')).toContainText('wrapmebaby.eth', {
timeout: 25000,
})
})

test('should show wrapped DNS name warning', async ({ page, login }) => {
await page.goto('/')
await page.goto('/?chain=holesky')
await login.connect()

await page.goto('/wrappeddnsname.com')
await page.goto('/wrappeddnsname.com?chain=holesky')
await expect(page.getByTestId('profile-snippet')).toContainText('wrappeddnsname.com')
})
})
11 changes: 11 additions & 0 deletions next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@ const babelIncludeRegexes = [
* @type {import('next').NextConfig}
* */
const nextConfig = {
transpilePackages: [
'@usecapsule/rainbowkit',
'@usecapsule/rainbowkit-wallet',
'@usecapsule/core-components',
'@usecapsule/react-components',
'@usecapsule/react-sdk',
'@usecapsule/core-sdk',
'@usecapsule/web-sdk',
'@usecapsule/wagmi-v2-integration',
'@usecapsule/viem-v2-integration',
],
reactStrictMode: true,
compiler: {
styledComponents: true,
Expand Down
15 changes: 10 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"version": "0.1.123",
"scripts": {
"dev": "NODE_NO_WARNINGS=1 next dev",
"dev:https": "next-dev-https --https --qr --port 3000",
"dev:https": "next dev --experimental-https --port 443",
"dev:nlocal": "NEXT_PUBLIC_PROVIDER=http://localhost:8545 NEXT_PUBLIC_AVUP_ENDPOINT=http://localhost:8787 pnpm dev",
"dev:localname": "NEXT_PUBLIC_PROVIDER=\"http://$(\"hostname\"):8545\" && NEXT_PUBLIC_AVUP_ENDPOINT=\"http://$(\"hostname\"):8787\" && NEXT_PUBLIC_GRAPH_URI=\"http://$(\"hostname\"):8000/subgraphs/name/graphprotocol/ens\" && pnpm dev",
"dev:glocal": "rm -rf .next && NEXT_PUBLIC_GRAPH_URI=http://localhost:8000/subgraphs/name/graphprotocol/ens NEXT_PUBLIC_ETH_NODE=anvil pnpm dev:nlocal",
"dev:glocal": "SWC_CACHE=false rm -rf .next && NEXT_PUBLIC_GRAPH_URI=http://localhost:8000/subgraphs/name/graphprotocol/ens NEXT_PUBLIC_ETH_NODE=anvil pnpm dev:nlocal",
"dev:gonline": "NEXT_PUBLIC_GRAPH_URI=https://api.studio.thegraph.com/query/49574/ensholesky/version/latest pnpm dev",
"build": "next build",
"build:preview": "NEXT_PUBLIC_ENSJS_DEBUG=true next build --profile",
Expand Down Expand Up @@ -59,19 +59,22 @@
"@metamask/post-message-stream": "^6.1.2",
"@metamask/providers": "^14.0.2",
"@noble/hashes": "^1.3.2",
"@rainbow-me/rainbowkit": "2.1.2",
"@sentry/nextjs": "7.43.x",
"@sentry/nextjs": "^7.43.0",
"@splidejs/react-splide": "^0.7.12",
"@svgr/webpack": "^8.1.0",
"@tanstack/query-persist-client-core": "5.22.2",
"@tanstack/query-sync-storage-persister": "5.22.2",
"@tanstack/react-query": "5.22.2",
"@tanstack/react-query-devtools": "^5.59.0",
"@tanstack/react-query-persist-client": "5.22.2",
"@usecapsule/rainbowkit": "3.6.0",
"@usecapsule/rainbowkit-wallet": "1.6.0",
"@wagmi/core": "2.13.3",
"calendar-link": "^2.2.0",
"dequal": "2.0.3",
"dns-packet": "^5.4.0",
"form-data": "^4.0.0",
"glob": "^8.0.3",
"graphql-request": "5.1.0",
"i18next": "^21.9.1",
"i18next-browser-languagedetector": "^6.1.5",
Expand All @@ -81,6 +84,7 @@
"iso-639-1": "^2.1.15",
"markdown-to-jsx": "^7.1.7",
"next": "13.5.6",
"node-forge": "1.3.1",
"node-fetch": "^3.3.2",
"react": "*",
"react-confetti": "^6.1.0",
Expand Down Expand Up @@ -276,7 +280,8 @@
},
"patchedDependencies": {
"[email protected]": "patches/[email protected]",
"[email protected]": "patches/[email protected]"
"[email protected]": "patches/[email protected]",
"[email protected]": "patches/[email protected]"
}
},
"packageManager": "[email protected]"
Expand Down
36 changes: 36 additions & 0 deletions patches/[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
diff --git a/CHANGELOG.md b/CHANGELOG.md
deleted file mode 100644
index 27d0e3a0073c20adff764c71575e200d6ac23432..0000000000000000000000000000000000000000
diff --git a/flash/README.md b/flash/README.md
deleted file mode 100644
index 1576ebf1a99dab1462caa81c14240864ed1454cb..0000000000000000000000000000000000000000
diff --git a/flash/package.json b/flash/package.json
deleted file mode 100644
index 92689fa9b24e93a631d2b52572030d7e17ccb10f..0000000000000000000000000000000000000000
diff --git a/lib/rsa.js b/lib/rsa.js
index 5c73209f9a1c97c8f1e58bc2930426c4f580776a..fb4cdad07208d23c10dedbc1f39b1435a4539d65 100644
--- a/lib/rsa.js
+++ b/lib/rsa.js
@@ -1717,13 +1717,15 @@ function _generateKeyPair(state, options, callback) {

var opts = {
algorithm: {
- name: options.algorithm || 'PRIMEINC',
- options: {
- workers: options.workers || 2,
- workLoad: options.workLoad || 100,
- workerScript: options.workerScript
- }
- }
+ name: options.algorithm || "PRIMEINC",
+ options: options.workerScript
+ ? {
+ workers: options.workers || 2,
+ workLoad: options.workLoad || 100,
+ workerScript: options.workerScript,
+ }
+ : {},
+ },
};
if('prng' in options) {
opts.prng = options.prng;
8 changes: 2 additions & 6 deletions playwright/fixtures/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,11 @@ export class Login {
timeout: 15000,
})
// this isn't actually what the user experiences, just a quirk in headless-web3-provider
expect(this.wallet.getPendingRequestCount(Web3RequestKind.RequestPermissions)).toEqual(1)
await this.wallet.authorize(Web3RequestKind.RequestPermissions)
expect(this.wallet.getPendingRequestCount(Web3RequestKind.RequestPermissions)).toEqual(0)
await expect
.poll(() => this.wallet.getPendingRequestCount(Web3RequestKind.RequestAccounts))
.toEqual(1)
await this.wallet.authorize(Web3RequestKind.RequestAccounts)
const pendingRequests = await this.wallet.getPendingRequestCount()
expect(this.wallet.getPendingRequestCount(Web3RequestKind.RequestAccounts)).toEqual(0)
await expect(this.getProfileButton).toBeVisible()
await expect.poll(() => this.getProfileButton.isVisible()).toBe(true)
}

async switchTo(user: User) {
Expand Down
Loading
Loading