Skip to content
Closed
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 @@ -437,6 +437,12 @@ jobs:
working_directory: ~/web3-onboard-monorepo/packages/solid
steps:
- node-build-steps
build-foxwallet:
docker:
- image: cimg/node:16.14.2
working_directory: ~/web3-onboard-monorepo/packages/foxwallet
steps:
- node-build-steps

# Build staging/Alpha releases
build-staging-core:
Expand Down Expand Up @@ -709,6 +715,12 @@ jobs:
working_directory: ~/web3-onboard-monorepo/packages/solid
steps:
- node-staging-build-steps
build-staging-foxwallet:
docker:
- image: cimg/node:16.14.2
working_directory: ~/web3-onboard-monorepo/packages/foxwallet
steps:
- node-staging-build-steps

workflows:
version: 2
Expand Down Expand Up @@ -983,3 +995,9 @@ workflows:
<<: *deploy_production_filters
- build-staging-solid:
<<: *deploy_staging_filters
foxwallet:
jobs:
- build-foxwallet:
<<: *deploy_production_filters
- build-staging-foxwallet:
<<: *deploy_staging_filters
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ For full documentation, check out the README.md for each package or the [docs pa
- [Infinity Wallet](packages/infinity-wallet/README.md)
- [Frame](packages/frame/README.md)
- [Blocto](packages/blocto/README.md)
- [FoxWallet](packages/foxwallet/README.md)

**Hardware Wallets**

Expand Down
1 change: 1 addition & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"@web3-onboard/dcent": "^2.2.7",
"@web3-onboard/enkrypt": "^2.0.4",
"@web3-onboard/fortmatic": "^2.0.19",
"@web3-onboard/foxwallet": "^2.0.1",
"@web3-onboard/frame": "^2.0.2",
"@web3-onboard/frontier": "^2.0.4",
"@web3-onboard/gas": "^2.1.8",
Expand Down
50 changes: 50 additions & 0 deletions docs/src/routes/docs/[...4]wallets/[...9]foxwallet/+page.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
title: FoxWallet
---

# {$frontmatter.title}

Wallet module for connecting FoxWallet to web3-onboard

### Install

<Tabs values={['yarn', 'npm']}>
<TabPanel value="yarn">

```sh copy
yarn add @web3-onboard/foxwallet
```

</TabPanel>
<TabPanel value="npm">

```sh copy
npm install @web3-onboard/foxwallet
```

</TabPanel>
</Tabs>

## Usage

```typescript
import Onboard from '@web3-onboard/core'
import foxwalletModule from '@web3-onboard/foxwallet'

const foxwallet = foxwalletModule()

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

const connectedWallets = await onboard.connectWallet()
console.log(connectedWallets)
```

## Build Environments

For build env configurations and setups please see the Build Env section [here](/docs/modules/core#build-environments)
1 change: 1 addition & 0 deletions packages/demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"@web3-onboard/dcent": "^2.2.7",
"@web3-onboard/enkrypt": "^2.0.3",
"@web3-onboard/fortmatic": "^2.0.18",
"@web3-onboard/foxwallet": "^2.0.1",
"@web3-onboard/frame": "^2.0.2",
"@web3-onboard/frontier": "^2.0.3",
"@web3-onboard/gas": "^2.1.7",
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 @@ -34,6 +34,7 @@
import arcanaAuthModule from '@web3-onboard/arcana-auth'
import venlyModule from '@web3-onboard/venly'
import bitgetModule from '@web3-onboard/bitget'
import foxwalletModule from '@web3-onboard/foxwallet'
import {
recoverAddress,
arrayify,
Expand Down Expand Up @@ -169,6 +170,7 @@
const cedeStore = cedeStoreModule()
const blocto = bloctoModule()
const tallyho = tallyHoModule()
const foxwallet = foxwalletModule()

const trezorOptions = {
email: '[email protected]',
Expand Down Expand Up @@ -241,7 +243,8 @@
cedeStore,
arcanaAuth,
blocto,
venly
venly,
foxwallet
],
transactionPreview,
gas,
Expand Down
33 changes: 33 additions & 0 deletions packages/foxwallet/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# @web3-onboard/foxwallet

## Wallet module for connecting FoxWallet through web3-onboard

FoxWallet 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/foxwallet`

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

## Usage

```typescript
import Onboard from '@web3-onboard/core'
import foxwalletModule from '@web3-onboard/foxwallet'

const foxwallet = foxwalletModule()

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

const connectedWallets = await onboard.connectWallet()
console.log(connectedWallets)
```
67 changes: 67 additions & 0 deletions packages/foxwallet/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"name": "@web3-onboard/foxwallet",
"version": "2.0.1",
"description": "FoxWallet 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": [
"FoxWallet",
"Fox Wallet",
"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",
"Enkrypt"
],
"repository": {
"type": "git",
"url": "https://github.com/blocknative/web3-onboard.git",
"directory": "packages/foxwallet"
},
"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.3.3"
}
}
8 changes: 8 additions & 0 deletions packages/foxwallet/src/icon.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export default `
<svg width="100%" height="100%"
viewBox="0 0 40 40"
xmlns="http://www.w3.org/2000/svg"
fill="none">
<path fill="#fff" d="M0 0h28v28H0z"/><path fill="#fff" fill-rule="evenodd" d="M11.784 15.84a.792.792 0 0 0 .162.036s-.229.085-.702-.075c0 0-.353-.144-.619-.12-.308.028-.52.429-.52.429a.862.862 0 0 1 .192-.076c.21-.043.138-.007.138-.007s-.404.169-.431.32c-.007.037.106-.07.405-.06.366.012.684.224.815.26.269.071.653.087 1.006-.19 0 0 .326-.204.427-.581.026-.105.041-.212.046-.32a1.191 1.191 0 0 0-.029-.282s-.19.441-.89.667Z" clip-rule="evenodd"/><path fill="url(#a)" fill-rule="evenodd" d="M18.715 19.983a5.031 5.031 0 0 0 0-6.274l4.554-.501s.473 1.298.598 1.992c.016.089.044.268.044.268s-.706 1.715-1.79 2.657c-1.458 1.267-3.406 1.858-3.406 1.858ZM7.93 19.921l-1.746.323a9.247 9.247 0 0 1 .957-8.599l.112-.16 1.929 5.43-1.252 3.006Z" clip-rule="evenodd"/><path fill="url(#b)" fill-rule="evenodd" d="m14.245 8.781.016-.018c.047-.05 1.13-1.215-.161-3.188-.954-1.454-3.382-1.413-4.374-2.17.074.583.645 1.108.583 1.907a4.18 4.18 0 0 1-.147.778c-.118.456-.227.889-.063 1.739.127.662.43 1.146.898 1.437.536.332 1.278.405 2.04.198.51-.139.962-.395 1.208-.683Z" clip-rule="evenodd"/><path fill="url(#c)" fill-rule="evenodd" d="M15.861 7.93c.279-.48.332-1.04.16-1.662-.238-.868-.693-1.438-1.06-1.896-.114-.145-.223-.28-.31-.407a2.54 2.54 0 0 1-.422-1.746c-.443.318-1.294.919-1.839 1.559.787.377 1.4.788 1.887 1.529.828 1.262.815 2.282.657 2.915-.044.175.29.33.228.464a2.52 2.52 0 0 0 .7-.755Z" clip-rule="evenodd"/><path fill="url(#d)" fill-rule="evenodd" d="M21.894 13.175c-.925-.088-2.799-.316-2.799-.316-4.213-.235-6.604 1.03-8.41 2.684-1.393 1.384-2.634 4.972-2.634 4.972l-1.51-.082S7.024 19 7.579 17.96c.637-1.194.78-1.097.636-1.296-.674-.925-.99-1.653-1.26-3.209 0 0 .317.249.556.097 0 0-.544-.945-.628-1.964-.149-1.806.697-4.272.717-4.329-.008.026-.053.238.443.555.036-.15.073-.296.113-.438.175-.853.642-2.713 1.575-3.974 0 0 .522 1.823 1.834 2.65 2.553 1.61 4.151 1.62 4.151 1.62 3.607.403 5.147 2.172 5.147 2.172 2.588 2.792 4.94 2.766 4.94 2.766-.845.808-3.908.565-3.908.565ZM7.599 7.259v-.002.002Z" clip-rule="evenodd"/><path fill="url(#e)" fill-rule="evenodd" d="M25.845 12.61s-.367 2.032-2.291 2.268c0 0-6.978-.045-7.486 6.294l-.119 1.78-8.37-2.439s.79-2.691 2.514-4.852c0 0 2.93-4.14 11.28-3.049 0 0 .975.197 2.343.325 1.156.108 2.13-.327 2.13-.327Z" clip-rule="evenodd"/><path fill="#722B00" fill-rule="evenodd" d="M21.098 11.643s-1.813-.942-4.067-.853c0 0 1.226-.959 2.883-.724l1.184 1.577Z" clip-rule="evenodd"/><path fill="url(#f)" fill-rule="evenodd" d="M16.515 20.303s.59.407 1.526.19c0 0-1.513.878-4.7-.325 0 0-3.288-1.47-5.6-1.135-1.487.216-2.802 1.397-3.598 2.295-.961 1.087-.842.579 1.574.28.58-.072.246.093.246.093s-3.227 1.352-3.445 2.554c-.054.3.85-.547 3.235-.472 2.928.092 5.475 1.793 6.522 2.073 2.145.574 5.22.705 8.042-1.508 0 0 2.603-1.633 3.408-4.652.21-.837.333-1.694.368-2.556.043-1.124-.299-2.307-.299-2.307s-1.902 4.214-7.279 5.47Z" clip-rule="evenodd"/><defs><linearGradient id="a" x1="14.361" x2="14.725" y1="11.206" y2="20.244" gradientUnits="userSpaceOnUse"><stop stop-color="#DADB48"/><stop offset=".656" stop-color="#637621"/></linearGradient><linearGradient id="b" x1="14.731" x2="10.303" y1="6.996" y2="6.996" gradientUnits="userSpaceOnUse"><stop stop-color="#EC6F01"/><stop offset="1" stop-color="#F4B23D"/></linearGradient><linearGradient id="c" x1="15.102" x2="14.84" y1="7.192" y2="2.917" gradientUnits="userSpaceOnUse"><stop stop-color="#F4B33E"/><stop offset="1" stop-color="#FB6F1B"/></linearGradient><linearGradient id="d" x1="8.035" x2="23.609" y1="7.215" y2="13.366" gradientUnits="userSpaceOnUse"><stop stop-color="#FB6D1A"/><stop offset="1" stop-color="#F3B23E"/></linearGradient><linearGradient id="e" x1="9.671" x2="24.46" y1="19.648" y2="13.148" gradientUnits="userSpaceOnUse"><stop stop-color="#F3B63F"/><stop offset="1" stop-color="#FB701C"/></linearGradient><linearGradient id="f" x1="9.147" x2="21.951" y1="26.213" y2="18.23" gradientUnits="userSpaceOnUse"><stop stop-color="#EC6F00"/><stop offset="1" stop-color="#F4B33E"/></linearGradient></defs>
</svg>
`
36 changes: 36 additions & 0 deletions packages/foxwallet/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import type { WalletInit, EIP1193Provider } from '@web3-onboard/common'

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

return () => {
return {
label: 'FoxWallet',
getIcon: async () => (await import('./icon.js')).default,
getInterface: async () => {
const ethereumInjectionExists = window.hasOwnProperty('ethereum')

let provider: EIP1193Provider

// check if foxwallet is injected into window.ethereum
if (ethereumInjectionExists && window['ethereum'].isTrust) {
provider = window['ethereum']
} else if (window['foxwallet']) {
// directly use the window.foxwallet injection
provider = window['foxwallet']
} else {
// FoxWallet is not installed
// send user to install page
window.open('https://foxwallet.com/download', '_blank')
throw new Error('Please Install FoxWallet to use this wallet')
}

return {
provider
}
}
}
}
}

export default foxwallet
15 changes: 15 additions & 0 deletions packages/foxwallet/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"]
}
}