-
Notifications
You must be signed in to change notification settings - Fork 537
add echooowallet #2187
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
add echooowallet #2187
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
60341e1
add echooowallet
rqzrqh f792a0d
Merge branch 'develop' into feat/add-echooo
Adamj1232 9cc848f
update inject wallet,delete useless code
ClarkPgOne fce9ae6
Update packages/demo/package.json
Adamj1232 47d7325
Merge branch 'develop' into feat/add-echooo
Adamj1232 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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,46 @@ | ||
--- | ||
title: Echooo | ||
--- | ||
## Wallet module for connecting Echooo to web3-onboard | ||
|
||
See [Echooo Wallet Docs](https://www.echooo.xyz) | ||
|
||
## Install | ||
|
||
<Tabs values={['yarn', 'npm']}> | ||
`<TabPanel value="yarn">` | ||
|
||
```sh | ||
yarn add @web3-onboard/core @web3-onboard/echooo | ||
``` | ||
|
||
</TabPanel> | ||
<TabPanel value="npm"> | ||
|
||
```sh | ||
npm install @web3-onboard/core @web3-onboard/echooo | ||
``` | ||
|
||
</TabPanel> | ||
</Tabs> | ||
|
||
## Usage | ||
|
||
```typescript | ||
import Onboard from '@web3-onboard/core' | ||
import echoooWalletModule from '@web3-onboard/echooo' | ||
|
||
// initialize the module with options | ||
const echoooWallet = echoooWalletModule() | ||
|
||
const onboard = Onboard({ | ||
// ... other Onboard options | ||
wallets: [ | ||
echoooWallet | ||
//... other wallets | ||
] | ||
}) | ||
|
||
const connectedWallets = await onboard.connectWallet() | ||
console.log(connectedWallets) | ||
``` |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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,30 @@ | ||
# @web3-onboard/echooo | ||
|
||
## Wallet module for connecting Echooo Wallet to web3-onboard | ||
|
||
See [Echooo Wallet](https://www.echooo.xyz) | ||
|
||
### Install | ||
|
||
`npm i @web3-onboard/echooo` | ||
|
||
## Usage | ||
|
||
```typescript | ||
import Onboard from '@web3-onboard/core' | ||
import echoooWalletModule from '@web3-onboard/echooo' | ||
|
||
// initialize the module with options | ||
const echooo = echoooWalletModule() | ||
|
||
const onboard = Onboard({ | ||
// ... other Onboard options | ||
wallets: [ | ||
echooo | ||
//... other wallets | ||
] | ||
}) | ||
|
||
const connectedWallets = await onboard.connectWallet() | ||
console.log(connectedWallets) | ||
``` |
This file contains hidden or 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,69 @@ | ||
{ | ||
"name": "@web3-onboard/echooo", | ||
"version": "2.0.1-alpha.1", | ||
"description": "Echooo wallet module for connecting to Web3-Onboard. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported wallets, framework agnostic modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.", | ||
"keywords": [ | ||
"Ethereum", | ||
"Web3", | ||
"EVM", | ||
"dapp", | ||
"Multichain", | ||
"Wallet", | ||
"Transaction", | ||
"Provider", | ||
"Hardware Wallet", | ||
"Notifications", | ||
"React", | ||
"Svelte", | ||
"Vue", | ||
"Next", | ||
"Nuxt", | ||
"MetaMask", | ||
"Coinbase", | ||
"WalletConnect", | ||
"Ledger", | ||
"Trezor", | ||
"Connect Wallet", | ||
"Ethereum Hooks", | ||
"Blocknative", | ||
"Mempool", | ||
"pending", | ||
"confirmed", | ||
"Injected Wallet", | ||
"Crypto", | ||
"Crypto Wallet", | ||
"Echooo" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/blocknative/web3-onboard.git", | ||
"directory": "packages/core" | ||
}, | ||
"homepage": "https://onboard.blocknative.com", | ||
"bugs": "https://github.com/blocknative/web3-onboard/issues", | ||
"module": "dist/index.js", | ||
"browser": "dist/index.js", | ||
"main": "dist/index.js", | ||
"type": "module", | ||
"typings": "dist/index.d.ts", | ||
"files": [ | ||
"dist" | ||
], | ||
"scripts": { | ||
"build": "tsc", | ||
"dev": "tsc -w", | ||
"type-check": "tsc --noEmit" | ||
}, | ||
"license": "MIT", | ||
"devDependencies": { | ||
"@ethersproject/providers": "^5.5.0", | ||
"@types/lodash.uniqby": "^4.7.6", | ||
"@types/node": "^17.0.21", | ||
"ts-node": "^10.2.1", | ||
"typescript": "^4.5.5", | ||
"window": "^4.2.7" | ||
}, | ||
"dependencies": { | ||
"@web3-onboard/common": "^2.3.3" | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or 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,38 @@ | ||
import type { WalletInit, EIP1193Provider } from '@web3-onboard/common' | ||
import { CustomWindow } from './types.js' | ||
declare const window: CustomWindow | ||
|
||
function echooo(): WalletInit { | ||
if (typeof window === 'undefined') return () => null | ||
|
||
return () => { | ||
return { | ||
label: 'Echooo Wallet', | ||
getIcon: async () => (await import('./icon.js')).default, | ||
getInterface: async () => { | ||
const ethereumInjectionExists = window.hasOwnProperty('ethereum') | ||
|
||
let provider: EIP1193Provider | ||
|
||
// check if echooo wallet is injected into window.ethereum | ||
if (ethereumInjectionExists && window['ethereum'].isEchooo) { | ||
provider = window['ethereum'] | ||
} else if (window['echoooEth']) { | ||
// directly use the window.echoooEth injection | ||
provider = window['echoooEth'] | ||
} else { | ||
// Echooo Wallet extension is not installed | ||
// send user to install page | ||
window.open('https://www.echooo.xyz', '_blank') | ||
throw new Error('Please Install Echooo Wallet to use this wallet') | ||
} | ||
|
||
return { | ||
provider | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
export default echooo |
This file contains hidden or 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,7 @@ | ||
import { EIP1193Provider } from '@web3-onboard/common' | ||
export interface CustomWindow extends Window { | ||
ethereum: EIP1193Provider & { | ||
isEchooo?: boolean | ||
} | ||
echoooEth: EIP1193Provider | ||
} |
This file contains hidden or 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 @@ | ||
{ | ||
"extends": "../../tsconfig.json", | ||
"include": ["src/**/*"], | ||
|
||
"compilerOptions": { | ||
"outDir": "dist", | ||
"rootDir": "src", | ||
"declaration": true, | ||
"declarationDir": "dist", | ||
"allowSyntheticDefaultImports": true, | ||
"paths": { | ||
"*": ["./src/*", "./node_modules/*"] | ||
}, | ||
"typeRoots": ["node_modules/@types"] | ||
} | ||
} |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Large diffs are not rendered by default.
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.
Uh oh!
There was an error while loading. Please reload this page.