Skip to content

Commit

Permalink
Onboard V2 Monorepo
Browse files Browse the repository at this point in the history
  • Loading branch information
lnbc1QWFyb24 committed Nov 16, 2021
1 parent 3334993 commit 2a8be94
Show file tree
Hide file tree
Showing 233 changed files with 12,249 additions and 17,698 deletions.
5 changes: 0 additions & 5 deletions .babelrc

This file was deleted.

18 changes: 0 additions & 18 deletions .eslintrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion .prettierrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ module.exports = {
tabWidth: 2,
arrowParens: 'avoid',
svelteSortOrder: 'options-scripts-styles-markup'
}
}
47 changes: 2 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,3 @@
# Onboard
# WIP Branch for Onboard V2

JavaScript library to easily onboard users to ethereum apps by enabling wallet selection, connection, wallet checks and real time state updates.

## Install

`npm install bnc-onboard`

## Quick Start

```javascript
import Onboard from 'bnc-onboard'
import Web3 from 'web3'

// set a variable to store instantiated web3
let web3

// head to blocknative.com to create a key
const BLOCKNATIVE_KEY = 'blocknative-api-key'

// the network id that your dapp runs on
const NETWORK_ID = 1

// initialize onboard
const onboard = Onboard({
dappId: BLOCKNATIVE_KEY,
networkId: NETWORK_ID,
subscriptions: {
wallet: wallet => {
// instantiate web3 when the user has selected a wallet
web3 = new Web3(wallet.provider)
console.log(`${wallet.name} connected!`)
}
}
})

// Prompt user to select a wallet
await onboard.walletSelect()

// Run wallet checks to make sure that user is ready to transact
await onboard.walletCheck()
```

## Documentation

For detailed documentation head to [docs.blocknative.com](https://docs.blocknative.com/onboard)
...documentation incoming
13 changes: 13 additions & 0 deletions ava.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module.exports = {
files: ["tests/**.test.ts"],
ignoredByWatcher: ["dist/**/*"],
cache: true,
concurrency: 2,
typescript: {
rewritePaths: {
"src/": "dist/",
},
compile: false,
},
require: ["ts-node/register/transpile-only"],
};
6 changes: 6 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"packages": ["packages/*"],
"npmClient": "yarn",
"useWorkspaces": true,
"version": "independent"
}
109 changes: 23 additions & 86 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,95 +1,32 @@
{
"name": "bnc-onboard",
"version": "1.35.4",
"description": "Onboard users to web3 by allowing them to select a wallet, get that wallet ready to transact and have access to synced wallet state.",
"keywords": [
"ethereum",
"web3",
"blocknative",
"wallet"
"name": "core",
"private": true,
"workspaces": [
"packages/*"
],
"main": "dist/cjs/onboard.js",
"module": "dist/esm/onboard.js",
"typings": "dist/src/onboard.d.ts",
"files": [
"dist"
],
"author": "Aaron Barnard <[email protected]>",
"repository": {
"type": "git",
"url": "https://github.com/blocknative/onboard"
},
"license": "MIT",
"scripts": {
"build": "rimraf dist && rollup -c && babel dist/cjs --out-dir dist/cjs && babel dist/esm --out-dir dist/esm",
"test": "echo \"TBD\" && exit 0",
"prepare": "npm run build",
"lint": "eslint 'src/**/*.ts' && prettier --check {'src/**/*.ts','src/**/*.svelte'}",
"lint:fix": "eslint 'src/**/*.ts' --fix",
"format": "prettier --write {'src/**/*.ts','src/**/*.svelte'}"
"build": "lerna exec yarn build",
"dev": "lerna exec --parallel -- yarn dev",
"test": "lerna exec yarn test",
"format": "prettier --write 'packages/**/*.ts'"
},
"devDependencies": {
"@babel/cli": "^7.7.0",
"@babel/core": "^7.5.5",
"@babel/preset-env": "^7.5.5",
"@pyoner/svelte-ts-preprocess": "^1.2.1",
"@rollup/plugin-image": "^2.0.4",
"@rollup/plugin-json": "^4.0.0",
"@rollup/plugin-node-resolve": "^7.1.1",
"@types/node": "^13.5.1",
"@typescript-eslint/eslint-plugin": "^2.30.0",
"@typescript-eslint/parser": "^2.30.0",
"babel-plugin-external-helpers": "^6.18.0",
"eslint": "^6.8.0",
"eslint-config-prettier": "^8.3.0",
"prettier": "^2.0.5",
"prettier-plugin-svelte": "^2.2.0",
"rimraf": "^3.0.0",
"rollup": "^1.27.5",
"rollup-plugin-svelte": "^6.1.1",
"rollup-plugin-typescript2": "0.21.0",
"svelte": "^3.12.1",
"svelte-i18n": "^1.1.2-beta",
"typescript": "^3.6.4"
"@ava/typescript": "^2.0.0",
"@swc/cli": "^0.1.51",
"@swc/core": "^1.2.92",
"@types/lodash.uniqby": "^4.7.6",
"@types/node": "^16.10.3",
"ava": "^3.15.0",
"browser-env": "^3.3.0",
"lerna": "^4.0.0",
"prettier": "^2.4.1",
"prettier-plugin-svelte": "^2.4.0",
"ts-node": "^10.2.1",
"typescript": "^4.4.3",
"window": "^4.2.7"
},
"dependencies": {
"@cvbb/eth-keyring": "^1.1.0",
"@ensdomains/ensjs": "^2.0.1",
"@ethereumjs/common": "^2.0.0",
"@ethereumjs/tx": "^3.0.0",
"@gnosis.pm/safe-apps-provider": "^0.5.0",
"@gnosis.pm/safe-apps-sdk": "^3.0.0",
"@keystonehq/eth-keyring": "0.9.0",
"@ledgerhq/hw-app-eth": "6.8.1",
"@ledgerhq/hw-transport-u2f": "^5.21.0",
"@ledgerhq/hw-transport-webusb": "6.7.0",
"@portis/web3": "^4.0.0",
"@shapeshiftoss/hdwallet-core": "^1.15.2",
"@shapeshiftoss/hdwallet-keepkey": "^1.15.2",
"@shapeshiftoss/hdwallet-keepkey-webusb": "^1.15.2",
"@toruslabs/torus-embed": "^1.10.11",
"@walletconnect/web3-provider": "^1.6.2",
"authereum": "^0.1.12",
"bignumber.js": "^9.0.0",
"bnc-sdk": "^3.4.1",
"bowser": "^2.10.0",
"eth-lattice-keyring": "^0.2.7",
"eth-provider": "^0.6.1",
"eth-sig-util": "^3.0.1",
"ethereumjs-tx": "^2.1.2",
"ethereumjs-util": "^7.0.3",
"fortmatic": "^2.2.1",
"hdkey": "^2.0.1",
"regenerator-runtime": "^0.13.7",
"trezor-connect": "^8.1.9",
"walletlink": "^2.2.6",
"web3-provider-engine": "^15.0.4"
},
"resolutions": {
"authereum/web3-utils/underscore": "^1.12.1",
"authereum/ethereum-private-key-to-address/meow/trim-newlines": "^3.0.1",
"authereum/ethers/elliptic": "^6.5.3",
"@portis/web3/pocket-js-core/axios": "^0.21.1",
"@shapeshiftoss/hdwallet-keepkey/bnb-javascript-sdk-nobroadcast/axios": "^0.21.1"
"ethers": "^5.4.7",
"joi": "^17.4.2"
}
}
3 changes: 3 additions & 0 deletions packages/@types/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
declare module '*.png'
declare module 'window'
declare const global: typeof globalThis & { window: CustomWindow }
13 changes: 13 additions & 0 deletions packages/common/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# @onboard/common

Utilities and helper method common to all wallets.

### Usage

createEIP1193Provider

Basic:

```typescript

```
24 changes: 24 additions & 0 deletions packages/common/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "@onboard/common",
"version": "0.0.1",
"description": "Resources common to all wallets",
"module": "dist/index.js",
"typings": "dist/index.d.ts",
"files": [
"dist",
"yarn.lock"
],
"scripts": {
"build": "tsc",
"dev": "tsc -w",
"test": "ava",
"prepare": "yarn build"
},
"license": "MIT",
"devDependencies": {
"typescript": "^4.4.4"
},
"dependencies": {
"@onboard/types": "^0.0.1"
}
}
Loading

0 comments on commit 2a8be94

Please sign in to comment.