-
-
Notifications
You must be signed in to change notification settings - Fork 203
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: Add keplr wallet support and shared utils package #1147
Closed
Closed
Changes from 9 commits
Commits
Show all changes
60 commits
Select commit
Hold shift + click to select a range
c5087d0
initial keplr set up
0xSero 5829861
move over keplr set up
0xSero 4fd666f
more set up
0xSero 60304a3
init
0xSero 0ec44d3
keplr extension install
0xSero 97091d6
selectors
0xSero 101c9ad
playwright keplr set up
0xSero a5a6762
build set up
0xSero e8d0bd8
prepare test
0xSero e1179ad
prepare test
0xSero b39afcd
set up cache
0xSero acdf38c
more cache more setup with pages
0xSero 68a6094
loading cache into browser for tests
0xSero 769344d
build cache and unlock wallet from keplr (;
0xSero 8d38cb2
clean up and port remaining functions
0xSero 500669d
Merge branch 'new-dawn' into feat/keplr-wallet
0xSero c5cec19
make dynamic
0xSero fd48092
hashing
0xSero 3cf42d9
s
0xSero 5baf24d
h
0xSero d02d242
made a new /utils package to handle shared utility functions, as the …
0xSero 76334cc
finish utils package
0xSero fb076ac
2
0xSero 5ed5ca2
figured out the pesky cache
0xSero af0855e
improve keplr set up
0xSero d2c807c
debug cypress
0xSero 8f6e1e4
add import test
0xSero 834d458
unlock for fixture (: keplr
0xSero b18ed70
copy
0xSero b897897
clean up selector and fix an input i broke, also finish first test case
0xSero 5671ba2
linting
0xSero 093385b
new test
0xSero 452498a
submitted keplr createWallet setup
0xSero 2d38d89
bunch of tests
0xSero 54b0b7c
hm
0xSero c962372
reject and accept access
0xSero 386ae15
hm
0xSero f40fdf2
hm
0xSero 138c7a1
Merge branch 'new-dawn' into feat/keplr-wallet
0xSero 850b037
auto sorty
0xSero 7991b42
v
0xSero 988f112
fix
0xSero 4a7f4e5
remove unnecessary test
0xSero e191940
clean up
0xSero d9b0332
Merge branch 'new-dawn' into feat/keplr-wallet
0xSero c10a1ff
clean up
0xSero 4e5d50a
more clean up
0xSero c48386b
fix
0xSero cf89cc9
fix and clean
0xSero 3d65aea
lint
0xSero 630298b
done
0xSero 1622f45
lint
0xSero 25559c8
remove unused
0xSero a0da307
Merge branch 'new-dawn' into feat/keplr-wallet
drptbl 7376f3e
update selectors, need to publish versions on NPM
0xSero 97a91fc
remove
0xSero 6f6c783
lint
0xSero e428447
test
0xSero 78d6de9
Merge branch 'new-dawn' into feat/keplr-wallet
0xSero 49257de
Merge branch 'new-dawn' into feat/keplr-wallet
0xSero File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { defineConfig } from 'cypress' | ||
import { installSynpress } from './src/cypress' | ||
|
||
export default defineConfig({ | ||
chromeWebSecurity: false, | ||
e2e: { | ||
baseUrl: 'http://localhost:9999', | ||
specPattern: 'test/cypress/**/*.cy.{js,jsx,ts,tsx}', | ||
supportFile: 'src/cypress/support/e2e.{js,jsx,ts,tsx}', | ||
fixturesFolder: 'src/cypress/fixtures', | ||
testIsolation: false, | ||
async setupNodeEvents(on, config) { | ||
return installSynpress(on, config) | ||
} | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
declare global { | ||
namespace NodeJS { | ||
interface ProcessEnv { | ||
CI: boolean | ||
HEADLESS: boolean | ||
} | ||
} | ||
} | ||
|
||
declare global { | ||
interface Window { | ||
ethereum: import('ethers').Eip1193Provider | ||
} | ||
|
||
// biome-ignore lint/suspicious/noExplicitAny: Web3Mock is a mock object | ||
const Web3Mock: any | ||
} | ||
|
||
export {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
"name": "@synthetixio/keplr", | ||
"version": "0.0.1-alpha.0", | ||
"type": "module", | ||
"exports": { | ||
"types": "./types/index.d.ts", | ||
"default": "./dist/index.js" | ||
}, | ||
"main": "./dist/index.js", | ||
"types": "./types/index.d.ts", | ||
"files": [ | ||
"dist", | ||
"src", | ||
"types" | ||
], | ||
"scripts": { | ||
"build": "pnpm run clean && pnpm run build:dist && pnpm run build:types", | ||
"build:dist": "tsup --tsconfig tsconfig.build.json", | ||
"build:types": "tsc --emitDeclarationOnly --project tsconfig.build.json", | ||
"clean": "rimraf dist types", | ||
"test": "vitest run", | ||
"test:coverage": "vitest run --coverage", | ||
"test:e2e:headful": "playwright test", | ||
"test:e2e:headless": "HEADLESS=true playwright test", | ||
"test:e2e:headless:ui": "HEADLESS=true playwright test --ui", | ||
"test:watch": "vitest watch", | ||
"types:check": "tsc --noEmit" | ||
}, | ||
"dependencies": { | ||
"@synthetixio/synpress-cache": "workspace:*", | ||
"@synthetixio/synpress-core": "workspace:*", | ||
"node-fetch": "3.3.2", | ||
"underscore": "1.13.6", | ||
"zod": "3.22.4" | ||
}, | ||
"devDependencies": { | ||
"@synthetixio/synpress-tsconfig": "workspace:*", | ||
"@types/node": "20.11.17", | ||
"@types/underscore": "1.11.15", | ||
"@vitest/coverage-v8": "1.2.2", | ||
"cypress": "13.9.0", | ||
"rimraf": "5.0.5", | ||
"tsup": "8.0.2", | ||
"typescript": "5.3.3", | ||
"vitest": "1.2.2" | ||
}, | ||
"peerDependencies": { | ||
"@playwright/test": "1.44.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { defineConfig, devices } from '@playwright/test' | ||
|
||
/** | ||
* See https://playwright.dev/docs/test-configuration. | ||
*/ | ||
export default defineConfig({ | ||
// Look for test files in the "test/e2e" directory, relative to this configuration file. | ||
testDir: './test/playwright', | ||
|
||
// We're increasing the timeout to 60 seconds to allow all traces to be recorded. | ||
// Sometimes it threw an error saying that traces were not recorded in the 30 seconds timeout limit. | ||
timeout: 60_000, | ||
|
||
// Run all tests in parallel. | ||
fullyParallel: true, | ||
|
||
// Fail the build on CI if you accidentally left test.only in the source code. | ||
forbidOnly: !!process.env.CI, | ||
|
||
// Fail all remaining tests on CI after the first failure. We want to reduce the feedback loop on CI to minimum. | ||
maxFailures: process.env.CI ? 1 : 0, | ||
|
||
// Opt out of parallel tests on CI since it supports only 1 worker. | ||
workers: process.env.CI ? 1 : undefined, | ||
|
||
// Concise 'dot' for CI, default 'html' when running locally. | ||
// See https://playwright.dev/docs/test-reporters. | ||
reporter: process.env.CI | ||
? [['html', { open: 'never', outputFolder: `playwright-report-${process.env.HEADLESS ? 'headless' : 'headful'}` }]] | ||
: 'html', | ||
|
||
// Shared settings for all the projects below. | ||
// See https://playwright.dev/docs/api/class-testoptions. | ||
use: { | ||
// We are using locally deployed MetaMask Test Dapp. | ||
baseURL: 'http://localhost:9999', | ||
|
||
// Collect all traces on CI, and only traces for failed tests when running locally. | ||
// See https://playwright.dev/docs/trace-viewer. | ||
trace: process.env.CI ? 'on' : 'retain-on-failure' | ||
}, | ||
|
||
// Configure projects for major browsers. | ||
projects: [ | ||
{ | ||
name: 'chromium', | ||
use: { ...devices['Desktop Chrome'] } | ||
} | ||
] | ||
}) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks the same as for the metamask - can be imported from one place for both?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I rolled back the utils package we can tackle this in a separate issue so that the package is self contained