Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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 @@ -243,6 +243,12 @@ jobs:
working_directory: ~/web3-onboard-monorepo/packages/trezor
steps:
- node-build-steps
build-frontier:
docker:
- image: cimg/node:16.13.1
working_directory: ~/web3-onboard-monorepo/packages/frontier
steps:
- node-build-steps
build-walletconnect:
docker:
- image: cimg/node:16.13.1
Expand Down Expand Up @@ -425,6 +431,12 @@ jobs:
working_directory: ~/web3-onboard-monorepo/packages/trezor
steps:
- node-staging-build-steps
build-staging-frontier:
docker:
- image: cimg/node:16.13.1
working_directory: ~/web3-onboard-monorepo/packages/frontier
steps:
- node-staging-build-steps
build-staging-walletconnect:
docker:
- image: cimg/node:16.13.1
Expand Down Expand Up @@ -609,6 +621,12 @@ workflows:
<<: *deploy_production_filters
- build-staging-trezor:
<<: *deploy_staging_filters
frontier:
jobs:
- build-frontier:
<<: *deploy_production_filters
- build-staging-frontier:
<<: *deploy_staging_filters
walletconnect:
jobs:
- build-walletconnect:
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/BUG.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ body:
- "@web3-onboard/react"
- "@web3-onboard/torus"
- "@web3-onboard/trezor"
- "@web3-onboard/frontier"
- "@web3-onboard/vue"
- "@web3-onboard/walletconnect"
- "@web3-onboard/walletlink"
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ For full documentation, check out the README.md for each package or the [docs pa
- [TallyHo](packages/tallyho/README.md)
- [Enkrypt](packages/enkrypt/README.md)
- [Unstoppable Domains](packages/uauth/README.md)
- [Frontier](packages/frontier/README.md)

**Hardware Wallets**

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import web3authModule from '@web3-onboard/web3auth'
import dcentModule from '@web3-onboard/dcent'
import sequenceModule from '@web3-onboard/sequence'
import tallyHoModule from '@web3-onboard/tallyho'
import frontierModule from '@web3-onboard/frontier'

const INFURA_KEY = ''

Expand All @@ -44,6 +45,7 @@ const keepkey = keepkeyModule()
const gnosis = gnosisModule()
const sequence = sequenceModule()
const tally = tallyModule()
const frontier = frontierModule()

const trezorOptions = {
email: '[email protected]',
Expand All @@ -63,6 +65,7 @@ const wallets = [
keepkey,
sequence,
injected,
frontier,
tally,
ledger,
coinbase,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import web3authModule from '@web3-onboard/web3auth'
import dcentModule from '@web3-onboard/dcent'
import sequenceModule from '@web3-onboard/sequence'
import tallyHoModule from '@web3-onboard/tallyho'
import frontierModule from '@web3-onboard/frontier'

const INFURA_KEY = ''

Expand All @@ -43,6 +44,7 @@ const keepkey = keepkeyModule()
const gnosis = gnosisModule()
const sequence = sequenceModule()
const tally = tallyModule()
const frontier = frontierModule()

const trezorOptions = {
email: '[email protected]',
Expand All @@ -66,6 +68,7 @@ const wallets = [
ledger,
coinbase,
dcent,
frontier,
trezor,
walletConnect,
enkrypt,
Expand Down
2 changes: 1 addition & 1 deletion docs/src/lib/services/onboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const intiOnboard = async () => {
'openid wallet email:optional humanity_check:optional profile:optional social:optional'
}
const uauth = uauthModule(uauthOptions)

const magic = magicModule({
apiKey: 'pk_live_02207D744E81C2BA'
})
Expand Down
37 changes: 37 additions & 0 deletions docs/src/routes/docs/[...4]wallets/frontier.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Frontier

[Frontier](https://frontier.xyz/) is a Crypto, DeFi, and NFT wallet browser extension where you can send, store & invest in crypto assets across multiple chains. Explore DeFi in multiple ecosystems, collect and display NFTs, and browse all of Web3 from a single place.
For more information on Frontier, please refer to the [Frontier support](https://help.frontier.xyz/).

### Install

```sh copy
yarn add @web3-onboard/core @web3-onboard/frontier
```

or

```sh copy
npm install @web3-onboard/core @web3-onboard/frontier
```

## Usage

```typescript
import Onboard from '@web3-onboard/core'
import frontierModule from '@web3-onboard/frontier'

// initialize the module
const frontier = frontierModule()

const onboard = Onboard({
// ... other Onboard options
wallets: [
frontier
//... 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 @@ -27,10 +27,11 @@
"@web3-onboard/coinbase": "^2.1.4",
"@web3-onboard/transaction-preview": "^2.0.0",
"@web3-onboard/dcent": "^2.2.2",
"@web3-onboard/frontier": "^2.0.0-alpha.1",
"@web3-onboard/fortmatic": "^2.0.14",
"@web3-onboard/gas": "^2.1.3",
"@web3-onboard/gnosis": "^2.1.5",
"@web3-onboard/injected-wallets": "^2.6.0-alpha.2",
"@web3-onboard/injected-wallets": "^2.6.0-alpha.3",
"@web3-onboard/keepkey": "^2.3.2",
"@web3-onboard/keystone": "^2.3.2",
"@web3-onboard/ledger": "^2.4.1-alpha.1",
Expand Down
7 changes: 5 additions & 2 deletions packages/demo/src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import mewWalletModule from '@web3-onboard/mew-wallet'
import uauthModule from '@web3-onboard/uauth'
import phantomModule from '@web3-onboard/phantom'
import frontierModule from '@web3-onboard/frontier'
import {
recoverAddress,
arrayify,
Expand Down Expand Up @@ -127,6 +128,7 @@
const tallyho = tallyHoModule()
const zeal = zealModule()
const phantom = phantomModule()
const frontier = frontierModule()

const trezorOptions = {
email: '[email protected]',
Expand Down Expand Up @@ -158,8 +160,6 @@
const onboard = Onboard({
wallets: [
injected,
zeal,
web3auth,
ledger,
trezor,
walletConnect,
Expand All @@ -177,6 +177,9 @@
sequence,
tallyho,
uauth,
web3auth,
zeal,
frontier,
phantom
],
transactionPreview,
Expand Down
33 changes: 33 additions & 0 deletions packages/frontier/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# @web3-onboard/frontier

## Wallet module for connecting Frontier Wallet through web3-onboard

Frontier Wallet SDK wallet module for connecting to Web3-Onboard. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardized 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.

### Install

**NPM**
`npm i @web3-onboard/core @web3-onboard/frontier`

**Yarn**
`yarn add @web3-onboard/core @web3-onboard/frontier`

## Usage

```typescript
import Onboard from '@web3-onboard/core'
import frontierModule from '@web3-onboard/frontier'

const frontier = frontierModule()

const onboard = Onboard({
// ... other Onboard options
wallets: [
frontier
//... other wallets
]
})

const connectedWallets = await onboard.connectWallet()
console.log(connectedWallets)
```
64 changes: 64 additions & 0 deletions packages/frontier/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"name": "@web3-onboard/frontier",
"version": "2.0.0-alpha.1",
"description": "Frontier Wallet SDK wallet module for connecting to Web3-Onboard. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardized 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",
"Injected Wallet",
"Crypto",
"Crypto Wallet",
"Onboard",
"Frontier"
],
"repository": {
"type": "git",
"url": "https://github.com/blocknative/web3-onboard.git",
"directory": "packages/frontier"
},
"homepage": "https://www.blocknative.com/onboard",
"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": {
"@types/node": "^17.0.21",
"typescript": "^4.5.5"
},
"dependencies": {
"@web3-onboard/common": "^2.2.3"
}
}
6 changes: 6 additions & 0 deletions packages/frontier/src/icon.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default `
<svg width="100%" height="100%" viewBox="0 0 540 540" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="540" height="540" rx="150" fill="#CC703C"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M415 89L412.805 94.2931L405.58 111.228L400.784 122.148C364.367 203.998 336.036 242.844 305.923 242.844C288.568 242.844 278.298 238.3 265 227.634L261.162 224.468C251.595 216.451 247.566 214.48 238.363 214.48C233.566 214.48 224.983 220.06 214.122 233.084C202.859 246.589 190.508 266.541 177.234 292.821L175.998 295.28L305.191 295.286L289.105 325.584H168.462V450H133V89H415ZM364.731 119.309L168.46 119.298V239.609C191.976 202.58 214.322 183.989 238.363 183.989C257.054 183.989 268.067 188.766 281.962 199.885L285.926 203.152C294.858 210.636 298.3 212.353 305.923 212.353C314.352 212.353 336.674 180.192 364.731 119.309Z" fill="white"/>
</svg>
`
37 changes: 37 additions & 0 deletions packages/frontier/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import type { WalletInit, EIP1193Provider } from '@web3-onboard/common'
import { CustomWindow } from './types.js'
declare const window: CustomWindow

function frontier(): WalletInit {
if (typeof window === 'undefined') return () => null

return () => {
return {
label: 'Frontier',
getIcon: async () => (await import('./icon.js')).default,
getInterface: async () => {
const { createEIP1193Provider } = await import('@web3-onboard/common')
const ethereumInjectionExists = window.hasOwnProperty('ethereum')

let provider: EIP1193Provider

// check if frontier is injected into window.ethereum
if (ethereumInjectionExists && window['ethereum'].isFrontier) {
provider = createEIP1193Provider(window['ethereum'])
} else if (window['frontier']) {
// directly use the window.frontier injection
provider = createEIP1193Provider(window['frontier']['ethereum'])
} else {
// frontier extension is not installed
// send user to install page
window.open('https://frontier.xyz/browser-extension', '_blank')
throw new Error('Please Install Frontier to use this wallet')
}

return { provider }
}
}
}
}

export default frontier
9 changes: 9 additions & 0 deletions packages/frontier/src/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { EIP1193Provider } from '@web3-onboard/common'
export interface CustomWindow extends Window {
ethereum: EIP1193Provider & {
isFrontier?: boolean
}
frontier: {
ethereum: EIP1193Provider
}
}
15 changes: 15 additions & 0 deletions packages/frontier/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"extends": "../../tsconfig.json",
"include": ["src/**/*"],

"compilerOptions": {
"outDir": "dist",
"rootDir": "src",
"declaration": true,
"declarationDir": "dist",
"paths": {
"*": ["./src/*", "./node_modules/*"]
},
"typeRoots": ["node_modules/@types"]
}
}
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.6.0-alpha.2",
"version": "2.6.0-alpha.3",
"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
1 change: 1 addition & 0 deletions packages/injected/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ export const WALLET_NAMES: { [key: string]: string } = {
sequence: 'Sequence',
core: 'Core',
enkrypt: 'Enkrypt',
frontier: 'Frontier',
zerion: 'Zerion'
}
5 changes: 5 additions & 0 deletions packages/injected/src/icons/frontier.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export default `<svg width="100%" height="100%" viewBox="0 0 540 540" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="540" height="540" rx="150" fill="#CC703C"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M415 89L412.805 94.2931L405.58 111.228L400.784 122.148C364.367 203.998 336.036 242.844 305.923 242.844C288.568 242.844 278.298 238.3 265 227.634L261.162 224.468C251.595 216.451 247.566 214.48 238.363 214.48C233.566 214.48 224.983 220.06 214.122 233.084C202.859 246.589 190.508 266.541 177.234 292.821L175.998 295.28L305.191 295.286L289.105 325.584H168.462V450H133V89H415ZM364.731 119.309L168.46 119.298V239.609C191.976 202.58 214.322 183.989 238.363 183.989C257.054 183.989 268.067 188.766 281.962 199.885L285.926 203.152C294.858 210.636 298.3 212.353 305.923 212.353C314.352 212.353 336.674 180.192 364.731 119.309Z" fill="white"/>
</svg>
`
Loading