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

add echooowallet #2187

Merged
merged 5 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
18 changes: 18 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,12 @@ jobs:
working_directory: ~/web3-onboard-monorepo/packages/particle-network
steps:
- node-build-steps
build-echooo:
docker:
- image: cimg/node:16.13.1
working_directory: ~/web3-onboard-monorepo/packages/echooo
steps:
- node-build-steps

# Build staging/Alpha releases
build-staging-core:
Expand Down Expand Up @@ -732,6 +738,12 @@ jobs:
working_directory: ~/web3-onboard-monorepo/packages/particle-network
steps:
- node-staging-build-steps
build-staging-echooo:
docker:
- image: cimg/node:16.13.1
working_directory: ~/web3-onboard-monorepo/packages/echooo
steps:
- node-staging-build-steps

workflows:
version: 2
Expand Down Expand Up @@ -1018,3 +1030,9 @@ workflows:
<<: *deploy_production_filters
- build-staging-particle:
<<: *deploy_staging_filters
echooo:
jobs:
- build-echooo:
<<: *deploy_production_filters
- build-staging-echooo:
<<: *deploy_staging_filters
3 changes: 2 additions & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"@web3-onboard/gas": "^2.1.8",
"@web3-onboard/gnosis": "^2.2.2",
"@web3-onboard/infinity-wallet": "^2.0.4",
"@web3-onboard/injected-wallets": "^2.10.16",
"@web3-onboard/injected-wallets": "^2.10.17-alpha.1",
"@web3-onboard/keepkey": "^2.3.7",
"@web3-onboard/keystone": "^2.3.7",
"@web3-onboard/ledger": "^2.6.0",
Expand All @@ -89,6 +89,7 @@
"@web3-onboard/xdefi": "^2.0.4",
"@web3-onboard/zeal": "^2.0.4",
"@web3-onboard/particle-network": "^2.0.1",
"@web3-onboard/echooo": "2.0.1-alpha.1",
"animejs": "^3.2.1",
"bnc-sdk": "^4.6.6",
"ethers": "^5.7.0",
Expand Down
6 changes: 5 additions & 1 deletion docs/src/lib/services/onboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ const intiOnboard = async (theme) => {
const { default: bitgetModule } = await import('@web3-onboard/bitget')
const { default: capsuleModule, Environment } = await import('@web3-onboard/capsule')
const { default: particleAuthModule } = await import('@web3-onboard/particle-network')
const { default: echoooModule } = await import('@web3-onboard/echooo')
const INFURA_ID = '8b60d52405694345a99bcb82e722e0af'

const injected = injectedModule()
Expand Down Expand Up @@ -142,6 +143,8 @@ const intiOnboard = async (theme) => {
appId: 'b1f0239a-edb0-41f9-b0f5-ab780bb02a9e'
})

const echooo = echoooModule()

return Onboard({
connect: { autoConnectAllPreviousWallet: true },
wallets: [
Expand Down Expand Up @@ -173,10 +176,11 @@ const intiOnboard = async (theme) => {
infinityWallet,
blocto,
capsule,
particle
particle,
// capsule

// venly
echooo
],
chains: [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,7 @@ const injected = injectedModule({
- Kayros - _Desktop_
- Lif3Wallet - _Mobile_
- StableWallet - _Mobile_
- Echooo - _Desktop & Mobile_

## Build Environments

Expand Down
46 changes: 46 additions & 0 deletions docs/src/routes/docs/[...4]wallets/[...36]echooo/+page.md
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)
```
3 changes: 2 additions & 1 deletion packages/demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"@web3-onboard/gas": "^2.1.7",
"@web3-onboard/gnosis": "^2.2.1",
"@web3-onboard/infinity-wallet": "^2.0.3",
"@web3-onboard/injected-wallets": "^2.10.16",
"@web3-onboard/injected-wallets": "^2.10.17-alpha.1",
"@web3-onboard/keepkey": "^2.3.8",
"@web3-onboard/keystone": "^2.3.8",
"@web3-onboard/ledger": "^2.6.0",
Expand All @@ -64,6 +64,7 @@
"@web3-onboard/xdefi": "^2.0.5",
"@web3-onboard/zeal": "^2.0.3",
"@web3-onboard/particle-network": "^2.0.1",
"@web3-onboard/echooo": "2.0.1-alpha.1",
Adamj1232 marked this conversation as resolved.
Show resolved Hide resolved
"vconsole": "^3.15.1"
},
"license": "MIT",
Expand Down
5 changes: 4 additions & 1 deletion packages/demo/src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import venlyModule from '@web3-onboard/venly'
import bitgetModule from '@web3-onboard/bitget'
import particleAuthModule from '@web3-onboard/particle-network'
import echoooModule from '@web3-onboard/echooo'
import capsuleModule, {
Environment,
OAuthMethod,
Expand Down Expand Up @@ -232,6 +233,7 @@
portalTextColor: '#ffffff'
}
})
const echooo = echoooModule()

const onboard = Onboard({
wallets: [
Expand Down Expand Up @@ -268,7 +270,8 @@
arcanaAuth,
blocto,
venly,
particle
particle,
echooo
],
// transactionPreview,
gas,
Expand Down
30 changes: 30 additions & 0 deletions packages/echooo/README.md
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)
```
69 changes: 69 additions & 0 deletions packages/echooo/package.json
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"
}
}
11 changes: 11 additions & 0 deletions packages/echooo/src/icon.ts

Large diffs are not rendered by default.

38 changes: 38 additions & 0 deletions packages/echooo/src/index.ts
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
7 changes: 7 additions & 0 deletions packages/echooo/src/types.ts
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
}
16 changes: 16 additions & 0 deletions packages/echooo/tsconfig.json
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"]
}
}
1 change: 1 addition & 0 deletions packages/injected/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ const onboard = Onboard({
- Kayros - _Desktop_
- Lif3Wallet - _Mobile_
- Zodiac Pilot - _Desktop_
- Echooo - _Desktop & Mobile_

## Filtering Wallets

Expand Down
2 changes: 1 addition & 1 deletion packages/injected/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web3-onboard/injected-wallets",
"version": "2.10.16",
"version": "2.10.17-alpha.1",
"description": "Injected wallet module for connecting browser extension and mobile wallets 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",
Expand Down
3 changes: 2 additions & 1 deletion packages/injected/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@ export const WALLET_NAMES: { [key: string]: string } = {
SubWallet: 'SubWallet',
kayros: 'Kayros',
foxwallet: "FoxWallet",
Lif3Wallet: 'Lif3 Wallet'
Lif3Wallet: 'Lif3 Wallet',
Echooo:'Echooo Wallet'
}
11 changes: 11 additions & 0 deletions packages/injected/src/icons/echooo.ts

Large diffs are not rendered by default.

Loading