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 Infinity Wallet Connector #1540

Merged
merged 10 commits into from
Feb 27, 2023
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
22 changes: 20 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ aliases:
| grep version \
| head -1 \
| awk -F: '{ print $2 }' \
| sed 's/[",]//g');
| sed 's/[",]//g');
if [[ $PACKAGE_VERSION =~ "-alpha" ]];
then
echo true
Expand All @@ -50,7 +50,7 @@ aliases:
| grep version \
| head -1 \
| awk -F: '{ print $2 }' \
| sed 's/[",]//g');
| sed 's/[",]//g');
if [[ $PACKAGE_VERSION =~ "-alpha" ]];
then
echo true
Expand Down Expand Up @@ -363,6 +363,12 @@ jobs:
working_directory: ~/web3-onboard-monorepo/packages/xdefi
steps:
- node-build-steps
build-infinity-wallet:
docker:
- image: cimg/node:16.13.1
working_directory: ~/web3-onboard-monorepo/packages/infinity-wallet
steps:
- node-build-steps

# Build staging/Alpha releases
build-staging-core:
Expand Down Expand Up @@ -563,6 +569,12 @@ jobs:
working_directory: ~/web3-onboard-monorepo/packages/xdefi
steps:
- node-staging-build-steps
build-staging-infinity-wallet:
docker:
- image: cimg/node:16.13.1
working_directory: ~/web3-onboard-monorepo/packages/infinity-wallet
steps:
- node-staging-build-steps

workflows:
version: 2
Expand Down Expand Up @@ -765,3 +777,9 @@ workflows:
<<: *deploy_production_filters
- build-staging-xdefi:
<<: *deploy_staging_filters
infinity-wallet:
jobs:
- build-infinity-wallet:
<<: *deploy_production_filters
- build-staging-infinity-wallet:
<<: *deploy_staging_filters
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ For full documentation, check out the README.md for each package or the [docs pa
- [Unstoppable Domains](packages/uauth/README.md)
- [Frontier](packages/frontier/README.md)
- [XDEFI](packages/xdefi/README.md)
- [Infinity Wallet](packages/infinity-wallet/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 @@ -62,6 +62,7 @@
"@web3-onboard/fortmatic": "^2.0.14",
"@web3-onboard/gas": "^2.1.4",
"@web3-onboard/gnosis": "^2.1.6",
"@web3-onboard/infinity-wallet": "^2.0.0-alpha.1",
"@web3-onboard/injected-wallets": "^2.8.0-alpha.1",
"@web3-onboard/keepkey": "^2.3.3",
"@web3-onboard/keystone": "^2.3.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ Import the libraries and any wallets you would like to use. For this example, we
```js title="App.tsx"|copy
import { Web3OnboardProvider, init } from '@web3-onboard/react'
import injectedModule from '@web3-onboard/injected-wallets'
import infinityWalletModule from '@web3-onboard/infinity-wallet'
import fortmaticModule from '@web3-onboard/fortmatic'
import gnosisModule from '@web3-onboard/gnosis'
import injectedModule from '@web3-onboard/injected-wallets'
import keepkeyModule from '@web3-onboard/keepkey'
import keystoneModule from '@web3-onboard/keystone'
import ledgerModule from '@web3-onboard/ledger'
Expand Down Expand Up @@ -39,6 +39,7 @@ const fortmatic = fortmaticModule({
apiKey: 'apiKey'
})

const infinityWallet = infinityWalletModule()
const ledger = ledgerModule()
const keystone = keystoneModule()
const keepkey = keepkeyModule()
Expand All @@ -63,6 +64,7 @@ const enkrypt = enkryptModule()
const mewWallet = mewWalletModule()

const wallets = [
infinityWallet,
keepkey,
sequence,
injected,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ Import the libraries and any wallets you would like to use. For this example, we
```js title="onboard.js"|copy
import Onboard from '@web3-onboard/core'
import injectedModule from '@web3-onboard/injected-wallets'
import infinityWalletModule from '@web3-onboard/infinity-wallet'
import fortmaticModule from '@web3-onboard/fortmatic'
import gnosisModule from '@web3-onboard/gnosis'
import injectedModule from '@web3-onboard/injected-wallets'
import keepkeyModule from '@web3-onboard/keepkey'
import keystoneModule from '@web3-onboard/keystone'
import ledgerModule from '@web3-onboard/ledger'
Expand Down Expand Up @@ -39,6 +39,7 @@ const fortmatic = fortmaticModule({
apiKey: 'apiKey'
})

const infinityWallet = infinityWalletModule()
const ledger = ledgerModule()
const keystone = keystoneModule()
const keepkey = keepkeyModule()
Expand All @@ -63,6 +64,7 @@ const enkrypt = enkryptModule()
const mewWallet = mewWalletModule()

const wallets = [
infinityWallet,
keepkey,
sequence,
injected,
Expand Down
3 changes: 3 additions & 0 deletions docs/src/lib/services/onboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const intiOnboard = async (theme) => {
const { default: trezorModule } = await import('@web3-onboard/trezor')
const { default: ledgerModule } = await import('@web3-onboard/ledger')
const { default: walletConnectModule } = await import('@web3-onboard/walletconnect')
const { default: infinityWalletModule } = await import('@web3-onboard/infinity-wallet')
const { default: coinbaseModule } = await import('@web3-onboard/coinbase')
const { default: dcentModule } = await import('@web3-onboard/dcent')
const { default: portisModule } = await import('@web3-onboard/portis')
Expand All @@ -52,6 +53,7 @@ const intiOnboard = async (theme) => {
const INFURA_ID = '8b60d52405694345a99bcb82e722e0af'

const injected = injectedModule()
const infinityWallet = infinityWalletModule()
const coinbase = coinbaseModule()
const dcent = dcentModule()
const walletConnect = walletConnectModule()
Expand Down Expand Up @@ -112,6 +114,7 @@ const intiOnboard = async (theme) => {
torus,
sequence,
web3auth,
infinityWallet,
dcent,
enkrypt,
mewWallet,
Expand Down
49 changes: 49 additions & 0 deletions docs/src/routes/docs/[...4]wallets/infinitywallet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@

# Infinity Wallet

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

Infinity 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.

Checkout the official [Infinity Wallet page](https://infinitywallet.io/) for details.

## Install

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

```sh copy
yarn add @web3-onboard/core @web3-onboard/infinity-wallet
```

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

```sh copy
npm install @web3-onboard/core @web3-onboard/infinity-wallet
```

</TabPanel>
</Tabs>


## Usage

```typescript
import Onboard from '@web3-onboard/core'
import infinityWalletWalletModule from '@web3-onboard/infinity-wallet'

// initialize the module with options
const infinityWalletSDK = infinityWalletWalletModule()

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

const connectedWallets = await onboard.connectWallet()
console.log(connectedWallets)
```
2 changes: 1 addition & 1 deletion packages/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Install the core module:
If you would like to support all wallets, then you can install all of the wallet modules:

```bash
npm i @web3-onboard/coinbase @web3-onboard/fortmatic @web3-onboard/gnosis @web3-onboard/trust
npm i @web3-onboard/coinbase @web3-onboard/fortmatic @web3-onboard/gnosis @web3-onboard/infinity-wallet @web3-onboard/trust
@web3-onboard/injected-wallets @web3-onboard/keepkey @web3-onboard/keystone
@web3-onboard/ledger @web3-onboard/magic @web3-onboard/portis @web3-onboard/torus
@web3-onboard/trezor @web3-onboard/walletconnect @web3-onboard/web3auth
Expand Down
3 changes: 2 additions & 1 deletion packages/demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
"@web3-onboard/keepkey": "^2.3.3",
"@web3-onboard/keystone": "^2.3.3",
"@web3-onboard/ledger": "^2.4.2",
"@web3-onboard/injected-wallets": "^2.8.0",
"@web3-onboard/infinity-wallet": "^2.0.0-alpha.1",
"@web3-onboard/injected-wallets": "^2.8.1-alpha.1",
"@web3-onboard/magic": "^2.1.3",
"@web3-onboard/phantom": "^2.0.0-alpha.1",
"@web3-onboard/portis": "^2.1.3",
Expand Down
3 changes: 3 additions & 0 deletions packages/demo/src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import Onboard from '@web3-onboard/core'
import fortmaticModule from '@web3-onboard/fortmatic'
import gnosisModule from '@web3-onboard/gnosis'
import infinityWalletModule from '@web3-onboard/infinity-wallet'
import injectedModule, { ProviderLabel } from '@web3-onboard/injected-wallets'
import keepkeyModule from '@web3-onboard/keepkey'
import keystoneModule from '@web3-onboard/keystone'
Expand Down Expand Up @@ -125,6 +126,7 @@
})

const torus = torusModule()
const infinityWallet = infinityWalletModule()
const ledger = ledgerModule()
const keepkey = keepkeyModule()
const keystone = keystoneModule()
Expand Down Expand Up @@ -172,6 +174,7 @@
ledger,
trezor,
walletConnect,
infinityWallet,
trust,
enkrypt,
mewWallet,
Expand Down
35 changes: 35 additions & 0 deletions packages/infinity-wallet/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# @web3-onboard/infinity-wallet

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

Infinity 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.

Checkout the official [Infinity Wallet page](https://infinitywallet.io/) for details.

### Install

**NPM**
`npm i @web3-onboard/core @web3-onboard/infinity-wallet`

**Yarn**
`yarn add @web3-onboard/core @web3-onboard/infinity-wallet`

## Usage

```typescript
import Onboard from '@web3-onboard/core'
import infinityWalletModule from '@web3-onboard/infinity-wallet'

const infinityWallet = infinityWalletModule()

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

const connectedWallets = await onboard.connectWallet()
console.log(connectedWallets)
```
68 changes: 68 additions & 0 deletions packages/infinity-wallet/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"name": "@web3-onboard/infinity-wallet",
"version": "2.0.0-alpha.1",
"description": "Infinity 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",
"pending",
"confirmed",
"Injected Wallet",
"Crypto",
"Crypto Wallet",
"Enkrypt",
"Trust",
"Infinity Wallet"
],
"repository": {
"type": "git",
"url": "https://github.com/blocknative/web3-onboard.git",
"directory": "packages/infinity-wallet"
},
"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",
"@web3-onboard/common": "^2.2.3"
},
"dependencies": {
"@infinitywallet/infinity-connector": "^1.0.6"
}
}
40 changes: 40 additions & 0 deletions packages/infinity-wallet/src/icon.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
export default `
<svg id="6a72fcd0-0d44-4dab-90c9-9f00f3cee507" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 1025 1025">
<defs>
<linearGradient id="45475672-49df-4566-9864-e059953e0489" x1="512.5" y1="822.1848" x2="512.5" y2="83.02989" gradientTransform="matrix(1, 0, 0, -1, 0, 1026)" gradientUnits="userSpaceOnUse">
<stop offset="0" stop-color="#1d2643"/>
<stop offset="1" stop-color="#12142c"/>
</linearGradient>
<linearGradient id="89705bd8-5d52-4ccb-8416-b493e49c6ed0" x1="314.34968" y1="-1068.52222" x2="314.34968" y2="-16.22522" gradientTransform="translate(0 1240)" gradientUnits="userSpaceOnUse">
<stop offset="0.0051" stop-color="#00bfe1"/>
<stop offset="0.9651" stop-color="#2738ab"/>
</linearGradient>
<linearGradient id="881c29ae-8cdf-452b-a3a3-ccafe26b423a" x1="112.84971" y1="-699.45423" x2="180.64231" y2="-642.7547" gradientTransform="translate(-0.9371 1239.39001)" gradientUnits="userSpaceOnUse">
<stop offset="0.03489" stop-color="#1b1464"/>
<stop offset="1" stop-color="#1b1464" stop-opacity="0"/>
</linearGradient>
<linearGradient id="0a9f8b4a-e6d0-49cb-bba9-6718581fd934" x1="3312.09959" y1="1426.73219" x2="3279.80613" y2="1472.53029" gradientTransform="translate(3687.00146 2148.09302) rotate(180)" xlink:href="#881c29ae-8cdf-452b-a3a3-ccafe26b423a"/>
<linearGradient id="d64d06de-5a78-450a-b2cb-f347b7e0261c" x1="3403.10614" y1="1846.97355" x2="3427.34223" y2="1787.02116" gradientTransform="translate(3687.00146 2148.09302) rotate(180)" xlink:href="#881c29ae-8cdf-452b-a3a3-ccafe26b423a"/>
<linearGradient id="767effdd-9757-45c9-889b-d55cc58e27da" x1="713.15038" y1="-1068.52222" x2="713.15038" y2="-16.22522" xlink:href="#89705bd8-5d52-4ccb-8416-b493e49c6ed0"/>
<linearGradient id="117c2036-a6ca-446e-ab61-ef764011c22b" x1="2969.55896" y1="1237.6096" x2="3037.35157" y2="1294.3088" gradientTransform="translate(3885.13013 1722.65997) rotate(180)" xlink:href="#881c29ae-8cdf-452b-a3a3-ccafe26b423a"/>
<linearGradient id="e4025c29-3149-41c3-a9b9-ffe51aeb027d" x1="455.40052" y1="-510.30932" x2="423.10691" y2="-464.51128" gradientTransform="translate(197.1916 813.95709)" xlink:href="#881c29ae-8cdf-452b-a3a3-ccafe26b423a"/>
<linearGradient id="8bd33088-a5ba-4b3f-a3d5-3078c7aa4314" x1="546.3253" y1="-90.10641" x2="570.5612" y2="-150.0589" gradientTransform="translate(197.1916 813.95709)" xlink:href="#881c29ae-8cdf-452b-a3a3-ccafe26b423a"/>
</defs>
<rect width="1025" height="1025" rx="129.96175" ry="129.96175" style="fill: url(#45475672-49df-4566-9864-e059953e0489)"/>
<g>
<g>
<path d="M554.8,371.6a6.68819,6.68819,0,0,0-4.7-4.2,6.94673,6.94673,0,0,0-6.8,1.8L529,383.5l-2.4,2.4L413,272.9a110.20982,110.20982,0,0,0-155.5,0L95.8,434.8a111.0594,111.0594,0,0,0,0,156.2L257.7,752a110.08887,110.08887,0,0,0,155.4,0l36.8-36.8c4.8-4.8,10.6-11.4,13.8-20a45.7624,45.7624,0,0,0-5.6-41.8,37.2153,37.2153,0,0,0-5.5-6.4,46.29974,46.29974,0,0,0-64.9.3L347.9,687a17.472,17.472,0,0,1-8.7,4.8,15.63021,15.63021,0,0,1-9.4-.6,21.515,21.515,0,0,1-8.2-5.3L160.9,525a18.19363,18.19363,0,0,1-4.9-9,17.68251,17.68251,0,0,1,2.2-12.6l.9-1c1.9-1.9,162.3-162,163.7-163.4a17.5574,17.5574,0,0,1,9.3-4.9,18.41068,18.41068,0,0,1,3.3-.3,16.85074,16.85074,0,0,1,12.5,5.3L461.1,451.6l-5.7,5.7-11.1,11.3a6.94653,6.94653,0,0,0-1.8,6.8,6.68819,6.68819,0,0,0,4.2,4.7L549,492.6a16.22229,16.22229,0,0,0,16-16Z" style="fill: url(#89705bd8-5d52-4ccb-8416-b493e49c6ed0)"/>
<path d="M159.6,523.6c-4.6-5.2-5.5-14.2-1.4-20.3,0,0-53.2,58.1-27.6,122.3l33.7,33.5,49-81.5Z" style="opacity: 0.49000000953674316;isolation: isolate;fill: url(#881c29ae-8cdf-452b-a3a3-ccafe26b423a)"/>
<path d="M325.4,689.1c60,55.2,126.1,24.5,126.1,24.5s8.7-8,12.2-18.6c-8.9-4.3-73.4-50.5-73.4-50.5l-38.1,38.1C338.5,699.2,325.4,689.1,325.4,689.1Z" style="opacity: 0.49000000953674316;isolation: isolate;fill: url(#0a9f8b4a-e6d0-49cb-bba9-6718581fd934)"/>
<path d="M285.8,376.1s38.4-38.7,38.5-38.5c0,0,10.3-8.2,21.1-.7,0,0-63.9-52.6-132.2-19.6l-19.9,20Z" style="opacity: 0.49000000953674316;isolation: isolate;fill: url(#d64d06de-5a78-450a-b2cb-f347b7e0261c)"/>
</g>
<g>
<path d="M472.7,653.4a6.68822,6.68822,0,0,0,4.7,4.2,6.94672,6.94672,0,0,0,6.8-1.8l14.3-14.3,2.4-2.4L614.5,752A110.20987,110.20987,0,0,0,770,752L931.7,590.1a111.05946,111.05946,0,0,0,0-156.2l-161.9-161a110.08882,110.08882,0,0,0-155.4,0l-36.8,36.8c-4.8,4.8-10.6,11.4-13.8,20a45.76229,45.76229,0,0,0,5.6,41.8,37.21272,37.21272,0,0,0,5.5,6.4,46.29974,46.29974,0,0,0,64.9-.3l39.8-39.7a17.4722,17.4722,0,0,1,8.7-4.8,15.63017,15.63017,0,0,1,9.4.6,21.5153,21.5153,0,0,1,8.2,5.3l160.7,160.7a18.19377,18.19377,0,0,1,4.9,9,17.68212,17.68212,0,0,1-2.2,12.6l-.9,1c-1.9,1.9-162.3,162-163.7,163.4a17.55784,17.55784,0,0,1-9.3,4.9,18.41153,18.41153,0,0,1-3.3.3,16.85075,16.85075,0,0,1-12.5-5.3l-113.3-112,5.7-5.7,11.1-11.3a6.94673,6.94673,0,0,0,1.8-6.8,6.68829,6.68829,0,0,0-4.2-4.7l-102.2-12.5a16.22227,16.22227,0,0,0-16,16Z" style="fill: url(#767effdd-9757-45c9-889b-d55cc58e27da)"/>
<path d="M867.9,501.4c4.6,5.2,5.5,14.2,1.4,20.3,0,0,53.2-58.1,27.6-122.3l-33.7-33.5-49,81.5Z" style="opacity: 0.49000000953674316;isolation: isolate;fill: url(#117c2036-a6ca-446e-ab61-ef764011c22b)"/>
<path d="M702.1,335.9c-60-55.2-126.1-24.5-126.1-24.5s-8.7,8-12.2,18.6c8.9,4.3,73.4,50.5,73.4,50.5l38.1-38.1C689,325.8,702.1,335.9,702.1,335.9Z" style="opacity: 0.49000000953674316;isolation: isolate;fill: url(#e4025c29-3149-41c3-a9b9-ffe51aeb027d)"/>
<path d="M741.6,648.9s-38.4,38.7-38.5,38.5c0,0-10.3,8.2-21.1.7,0,0,63.9,52.6,132.2,19.6l19.9-20Z" style="opacity: 0.49000000953674316;isolation: isolate;fill: url(#8bd33088-a5ba-4b3f-a3d5-3078c7aa4314)"/>
</g>
</g>
</svg>

`
Loading