From 23847cf74a3ee5236b395529099a94002f25b1b0 Mon Sep 17 00:00:00 2001 From: Gerardo Nardelli Date: Wed, 25 Mar 2020 17:20:41 -0300 Subject: [PATCH 1/8] Add wetc bridge --- amb-mediator/src/AmbMediator.ts | 9 - basic-wallet/package.json | 2 +- basic-wallet/src/index.tsx | 13 +- lerna.json | 2 +- local-wallet/package.json | 2 +- local-wallet/src/index.tsx | 20 +- package.json | 2 +- .../package.json | 7 +- tokenbridge-plugin/src/assets/ERC677Asset.ts | 22 ++ tokenbridge-plugin/src/assets/Etc.ts | 7 + tokenbridge-plugin/src/assets/Wetc.ts | 8 + .../src/assets/abi/IERC677.json | 249 ++++++++++++++++++ tokenbridge-plugin/src/gateways/EtcGateway.ts | 7 + tokenbridge-plugin/src/index.ts | 6 + tokenbridge-plugin/src/pairs/Bridge.ts | 57 ++++ tokenbridge-plugin/src/pairs/TestnetBridge.ts | 12 + tokenbridge-plugin/src/pairs/WETCBridge.ts | 12 + .../tsconfig.json | 0 18 files changed, 404 insertions(+), 33 deletions(-) delete mode 100644 amb-mediator/src/AmbMediator.ts rename {amb-mediator => tokenbridge-plugin}/package.json (71%) create mode 100644 tokenbridge-plugin/src/assets/ERC677Asset.ts create mode 100644 tokenbridge-plugin/src/assets/Etc.ts create mode 100644 tokenbridge-plugin/src/assets/Wetc.ts create mode 100644 tokenbridge-plugin/src/assets/abi/IERC677.json create mode 100644 tokenbridge-plugin/src/gateways/EtcGateway.ts create mode 100644 tokenbridge-plugin/src/index.ts create mode 100644 tokenbridge-plugin/src/pairs/Bridge.ts create mode 100644 tokenbridge-plugin/src/pairs/TestnetBridge.ts create mode 100644 tokenbridge-plugin/src/pairs/WETCBridge.ts rename {amb-mediator => tokenbridge-plugin}/tsconfig.json (100%) diff --git a/amb-mediator/src/AmbMediator.ts b/amb-mediator/src/AmbMediator.ts deleted file mode 100644 index fcd7ad8..0000000 --- a/amb-mediator/src/AmbMediator.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { BurnerPluginContext, Plugin } from '@burner-wallet/types' - -export default class AmbMediator implements Plugin { - private pluginContext?: BurnerPluginContext - - initializePlugin(pluginContext: BurnerPluginContext) { - this.pluginContext = pluginContext - } -} diff --git a/basic-wallet/package.json b/basic-wallet/package.json index bb794cd..c661d20 100644 --- a/basic-wallet/package.json +++ b/basic-wallet/package.json @@ -11,7 +11,7 @@ "@types/react": "*", "@types/react-dom": "16.8.4", "@types/react-router-dom": "^4.3.3", - "amb-mediator": "^1.0.0", + "tokenbridge-plugin": "^1.0.0", "react": "^16.8.6", "react-dom": "^16.8.6", "react-scripts": "^3.2.0", diff --git a/basic-wallet/src/index.tsx b/basic-wallet/src/index.tsx index e342e64..e3f9bb9 100644 --- a/basic-wallet/src/index.tsx +++ b/basic-wallet/src/index.tsx @@ -1,21 +1,20 @@ import React from 'react' import ReactDOM from 'react-dom' -import { xdai, dai, eth } from '@burner-wallet/assets' import BurnerCore from '@burner-wallet/core' import { InjectedSigner, LocalSigner } from '@burner-wallet/core/signers' -import { InfuraGateway, InjectedGateway, XDaiGateway } from '@burner-wallet/core/gateways' -import Exchange, { Uniswap, XDaiBridge } from '@burner-wallet/exchange' +import { InfuraGateway, InjectedGateway } from '@burner-wallet/core/gateways' +import Exchange from '@burner-wallet/exchange' import ModernUI from '@burner-wallet/modern-ui' -// import MyPlugin from 'amb-mediator'; +import { etc, wetc, EtcGateway, WETCBridge } from 'tokenbridge-plugin' const core = new BurnerCore({ signers: [new InjectedSigner(), new LocalSigner()], - gateways: [new InjectedGateway(), new InfuraGateway(process.env.REACT_APP_INFURA_KEY), new XDaiGateway()], - assets: [xdai, dai, eth] + gateways: [new InjectedGateway(), new InfuraGateway(process.env.REACT_APP_INFURA_KEY), new EtcGateway()], + assets: [wetc, etc] }) const exchange = new Exchange({ - pairs: [new XDaiBridge(), new Uniswap('dai')] + pairs: [new WETCBridge()] }) const BurnerWallet = () => diff --git a/lerna.json b/lerna.json index c051bdb..7241ad8 100644 --- a/lerna.json +++ b/lerna.json @@ -2,7 +2,7 @@ "packages": [ "basic-wallet", "local-wallet", - "amb-mediator" + "tokenbridge-plugin" ], "npmClient": "yarn", "useWorkspaces": true, diff --git a/local-wallet/package.json b/local-wallet/package.json index b707954..a4afbc7 100644 --- a/local-wallet/package.json +++ b/local-wallet/package.json @@ -11,7 +11,7 @@ "@types/react": "16.8.19", "@types/react-dom": "16.8.4", "@types/react-router-dom": "^4.3.3", - "amb-mediator": "^1.0.0", + "tokenbridge-plugin": "^1.0.0", "react": "^16.8.6", "react-dom": "^16.8.6", "react-scripts": "^3.2.0", diff --git a/local-wallet/src/index.tsx b/local-wallet/src/index.tsx index cc72265..7b8d99b 100644 --- a/local-wallet/src/index.tsx +++ b/local-wallet/src/index.tsx @@ -5,30 +5,30 @@ import BurnerCore from '@burner-wallet/core' import { InjectedSigner, LocalSigner } from '@burner-wallet/core/signers' import { HTTPGateway } from '@burner-wallet/core/gateways' import ModernUI from '@burner-wallet/modern-ui' -import Exchange, { Uniswap, XDaiBridge } from '@burner-wallet/exchange' -// import MyPlugin from 'amb-mediator'; +import Exchange from '@burner-wallet/exchange' +import { TestnetBridge } from 'tokenbridge-plugin' const core = new BurnerCore({ signers: [new InjectedSigner(), new LocalSigner({ privateKey: process.env.REACT_APP_PK, saveKey: false })], - gateways: [new HTTPGateway('http://localhost:8545', '5777')], + gateways: [new HTTPGateway('https://sokol.poa.network', '77')], assets: [ new ERC20Asset({ - id: 'localerc20', - name: 'Local Token', - network: '5777', + id: 'wspoa', + name: 'WSPOA', + network: '42', // @ts-ignore address: process.env.REACT_APP_ERC20_ADDRESS }), new NativeAsset({ - id: 'geth', - name: 'Ganache ETH', - network: '5777' + id: 'spoa', + name: 'sokol', + network: '77' }) ] }) const exchange = new Exchange({ - pairs: [new XDaiBridge(), new Uniswap('dai')] + pairs: [new TestnetBridge()] }) const BurnerWallet = () => diff --git a/package.json b/package.json index 0da5ca9..4c5cafd 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "workspaces": [ "basic-wallet", "local-wallet", - "amb-mediator" + "tokenbridge-plugin" ], "devDependencies": { "@typescript-eslint/eslint-plugin": "^2.5.0", diff --git a/amb-mediator/package.json b/tokenbridge-plugin/package.json similarity index 71% rename from amb-mediator/package.json rename to tokenbridge-plugin/package.json index a8e6f12..0f0c889 100644 --- a/amb-mediator/package.json +++ b/tokenbridge-plugin/package.json @@ -1,9 +1,9 @@ { - "name": "amb-mediator", + "name": "tokenbridge-plugin", "version": "1.0.0", "license": "MIT", - "main": "dist/AmbMediator.js", - "types": "dist/AmbMediator.d.ts", + "main": "dist/index.js", + "types": "dist/index.d.ts", "scripts": { "build": "tsc", "start-basic": "tsc -w", @@ -11,6 +11,7 @@ }, "dependencies": { "@burner-wallet/assets": "^1.0.0", + "@burner-wallet/exchange": "^1.0.0", "@burner-wallet/types": "^1.0.6", "@types/react": "*" }, diff --git a/tokenbridge-plugin/src/assets/ERC677Asset.ts b/tokenbridge-plugin/src/assets/ERC677Asset.ts new file mode 100644 index 0000000..9bfa02b --- /dev/null +++ b/tokenbridge-plugin/src/assets/ERC677Asset.ts @@ -0,0 +1,22 @@ +import { ERC20Asset } from '@burner-wallet/assets' +import IERC677abi from './abi/IERC677.json' + +export default class ERC677Asset extends ERC20Asset { + constructor({ abi = IERC677abi, ...params }) { + // @ts-ignore + super({ abi, type: 'erc677', ...params }) + } + + // @ts-ignore + async _send({ from, to, value }) { + // @ts-ignore + const receipt = await this.getContract() + .methods.transferAndCall(to, value, '0x') + .send({ from }) + return { + ...receipt, + txHash: receipt.transactionHash, + id: `${receipt.transactionHash}-${receipt.events.Transfer.logIndex}` + } + } +} diff --git a/tokenbridge-plugin/src/assets/Etc.ts b/tokenbridge-plugin/src/assets/Etc.ts new file mode 100644 index 0000000..f604dc3 --- /dev/null +++ b/tokenbridge-plugin/src/assets/Etc.ts @@ -0,0 +1,7 @@ +import { NativeAsset } from '@burner-wallet/assets' + +export default new NativeAsset({ + id: 'etc', + name: 'ETC', + network: '61' +}) diff --git a/tokenbridge-plugin/src/assets/Wetc.ts b/tokenbridge-plugin/src/assets/Wetc.ts new file mode 100644 index 0000000..3faf0f5 --- /dev/null +++ b/tokenbridge-plugin/src/assets/Wetc.ts @@ -0,0 +1,8 @@ +import { default as ERC677Asset } from './ERC677Asset' + +export default new ERC677Asset({ + id: 'wetc', + name: 'WETC', + network: '1', + address: '0x86aabcc646f290b9fc9bd05ce17c3858d1511da1' +}) diff --git a/tokenbridge-plugin/src/assets/abi/IERC677.json b/tokenbridge-plugin/src/assets/abi/IERC677.json new file mode 100644 index 0000000..f979d61 --- /dev/null +++ b/tokenbridge-plugin/src/assets/abi/IERC677.json @@ -0,0 +1,249 @@ +[ + { + "constant": true, + "inputs": [], + "name": "name", + "outputs": [ + { + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_spender", + "type": "address" + }, + { + "name": "_value", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_from", + "type": "address" + }, + { + "name": "_to", + "type": "address" + }, + { + "name": "_value", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "decimals", + "outputs": [ + { + "name": "", + "type": "uint8" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_owner", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "name": "balance", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "symbol", + "outputs": [ + { + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_to", + "type": "address" + }, + { + "name": "_value", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_owner", + "type": "address" + }, + { + "name": "_spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "payable": true, + "stateMutability": "payable", + "type": "fallback" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "from", + "type": "address" + }, + { + "indexed": true, + "name": "to", + "type": "address" + }, + { + "indexed": false, + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "constant": false, + "inputs": [ + { + "name": "", + "type": "address" + }, + { + "name": "", + "type": "uint256" + }, + { + "name": "", + "type": "bytes" + } + ], + "name": "transferAndCall", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/tokenbridge-plugin/src/gateways/EtcGateway.ts b/tokenbridge-plugin/src/gateways/EtcGateway.ts new file mode 100644 index 0000000..27ad678 --- /dev/null +++ b/tokenbridge-plugin/src/gateways/EtcGateway.ts @@ -0,0 +1,7 @@ +import { HTTPGateway } from '@burner-wallet/core/gateways' + +export default class EtcGateway extends HTTPGateway { + constructor() { + super('https://www.ethercluster.com/etc', '61') + } +} diff --git a/tokenbridge-plugin/src/index.ts b/tokenbridge-plugin/src/index.ts new file mode 100644 index 0000000..c36b833 --- /dev/null +++ b/tokenbridge-plugin/src/index.ts @@ -0,0 +1,6 @@ +export { default as etc } from './assets/Etc' +export { default as wetc } from './assets/Wetc' +export { default as ERC677Asset } from './assets/ERC677Asset' +export { default as EtcGateway } from './gateways/EtcGateway' +export { default as WETCBridge } from './pairs/WETCBridge' +export { default as TestnetBridge } from './pairs/TestnetBridge' diff --git a/tokenbridge-plugin/src/pairs/Bridge.ts b/tokenbridge-plugin/src/pairs/Bridge.ts new file mode 100644 index 0000000..cc6ab75 --- /dev/null +++ b/tokenbridge-plugin/src/pairs/Bridge.ts @@ -0,0 +1,57 @@ +import { Pair } from '@burner-wallet/exchange' + +export interface ValueTypes { + value?: string + ether?: string +} + +export interface ExchangeParams extends ValueTypes { + account: string +} + +interface PairConstructor { + assetA: string + assetABridge: string + assetB: string + assetBBridge: string +} + +export default class Bridge extends Pair { + private readonly assetABridge: string + private readonly assetBBridge: string + + constructor({ assetA, assetABridge, assetB, assetBBridge }: PairConstructor) { + super({ assetA, assetB }) + this.assetABridge = assetABridge + this.assetBBridge = assetBBridge + } + + exchangeAtoB({ account, value, ether }: ExchangeParams) { + const _value = this._getValue({ value, ether }) + const etc = this.exchange.getAsset(this.assetA) + return etc.send({ + from: account, + value: _value, + to: this.assetABridge + }) + } + + exchangeBtoA({ account, value, ether }: ExchangeParams) { + const _value = this._getValue({ value, ether }) + + const wetc = this.exchange.getAsset(this.assetB) + return wetc.send({ + from: account, + value: _value, + to: this.assetBBridge + }) + } + + async estimateAtoB(value: ValueTypes) { + return this._getValue(value) + } + + async estimateBtoA(value: ValueTypes) { + return this._getValue(value) + } +} diff --git a/tokenbridge-plugin/src/pairs/TestnetBridge.ts b/tokenbridge-plugin/src/pairs/TestnetBridge.ts new file mode 100644 index 0000000..1fbb4f8 --- /dev/null +++ b/tokenbridge-plugin/src/pairs/TestnetBridge.ts @@ -0,0 +1,12 @@ +import Bridge from './Bridge' + +export default class TestnetBridge extends Bridge { + constructor() { + super({ + assetA: 'spoa', + assetABridge: '', + assetB: 'wspoa', + assetBBridge: '' + }) + } +} diff --git a/tokenbridge-plugin/src/pairs/WETCBridge.ts b/tokenbridge-plugin/src/pairs/WETCBridge.ts new file mode 100644 index 0000000..80a330e --- /dev/null +++ b/tokenbridge-plugin/src/pairs/WETCBridge.ts @@ -0,0 +1,12 @@ +import Bridge from './Bridge' + +export default class WETCBridge extends Bridge { + constructor() { + super({ + assetA: 'etc', + assetABridge: '0x073081832B4Ecdce79d4D6753565c85Ba4b3BeA9', + assetB: 'wetc', + assetBBridge: '0x0cB781EE62F815bdD9CD4c2210aE8600d43e7040' + }) + } +} diff --git a/amb-mediator/tsconfig.json b/tokenbridge-plugin/tsconfig.json similarity index 100% rename from amb-mediator/tsconfig.json rename to tokenbridge-plugin/tsconfig.json From 29f03b7f694600ee42cb1397209b0294d5212409 Mon Sep 17 00:00:00 2001 From: Gerardo Nardelli Date: Thu, 26 Mar 2020 15:36:28 -0300 Subject: [PATCH 2/8] Setup testnet wallet --- README.md | 50 ++++++++++++------- basic-wallet/.env.example | 1 + basic-wallet/package.json | 3 +- basic-wallet/src/index.tsx | 7 +-- local-wallet/.env.example | 2 + local-wallet/package.json | 6 +-- local-wallet/src/index.tsx | 30 +++++++---- tokenbridge-plugin/src/assets/Etc.ts | 3 +- tokenbridge-plugin/src/index.ts | 6 +-- tokenbridge-plugin/src/pairs/TestnetBridge.ts | 12 ----- yarn.lock | 9 ++++ 11 files changed, 78 insertions(+), 51 deletions(-) create mode 100644 basic-wallet/.env.example create mode 100644 local-wallet/.env.example delete mode 100644 tokenbridge-plugin/src/pairs/TestnetBridge.ts diff --git a/README.md b/README.md index 08217ed..5d0a0ad 100644 --- a/README.md +++ b/README.md @@ -1,28 +1,40 @@ -# Sample Burner Wallet 2 Plugin +# TokenBridge Burner Wallet 2 Plugin -This repo provides a boilerplate for building a new plugin for the Burner Wallet 2. +This plugin defines a Bridge trading pair to be used in the Exchange Plugin. -## Setup +Bridge trading pairs supported: +* ETC - WETC Bridge +### Usage + +```javascript +import { Etc, Wetc, EtcGateway, WETCBridge } from 'tokenbridge-plugin' + +const core = new BurnerCore({ + ... + gateways: [new EtcGateway(), new InfuraGateway(process.env.REACT_APP_INFURA_KEY)], + assets: [Etc, Wetc] +}) + +const exchange = new Exchange({ + pairs: [new WETCBridge()] +}) +``` + + +### Setup 1. Clone the repo 2. Run `yarn install`. This repo uses Lerna and Yarn Workspaces, so `yarn install` will install all dependencies and link modules in the repo -3. To connect to mainnet & most testnets, you'll need to provide an Infura key. Create a file - named `.env` in the `basic-wallet` folder and set the contents to `REACT_APP_INFURA_KEY=` -4. Run `yarn start-local` to start the wallet while connected to Ganache, or run `yarn start-basic` - to start the wallet connected to Mainnet & xDai +3. Run `yarn build` -## Renaming the plugin +### Run Burner Wallet with the plugin in Mainnet & Classic +1. Create `.env` file in `basic-wallet` folder and set `REACT_APP_INFURA_KEY=` +2. Run `yarn start-basic` to start the wallet connected to Mainnet & Classic and interact with the ETH - WETC Bridge. -To rename the plugin from "MyPlugin" to your own plugin name, you must update the following locations: +### Run Burner Wallet with the plugin in Sokol & Kovan +1. Create `.env` file in `local-wallet` folder and set `REACT_APP_INFURA_KEY=`. +Also, a private key can be set to start the wallet with the specified account `REACT_APP_PK=0x...` +2. Run `yarn start-local` to start the wallet connected to Sokol & Kovan and interact with a test bridge sPoa - sPoa20 +that works on top of the AMB bridge. -1. Rename the `my-plugin` directory -2. Change `my-plugin` in `lerna.json` and the root `package.json` -3. Change the name field in `package.json` in your plugin's `package.json` file -4. Rename `MyPlugin.ts` -5. Change `MyPlugin.js` and `MyPlugin.d.ts` in the plugin `package.json` file -6. Change the class name in the main plugin file -7. Change rename `my-plugin` dependency in `basic-wallet/package.json` & `local-wallet/package.json` -8. In `basic-wallet/src/index.tsx` and `local-wallet/src/index.tsx`, update the import - `import MyPlugin from 'my-plugin';` as well as the `new MyPlugin()` constructor. -9. Finally, run `yarn install` in the root to re-link the packages diff --git a/basic-wallet/.env.example b/basic-wallet/.env.example new file mode 100644 index 0000000..a9bc983 --- /dev/null +++ b/basic-wallet/.env.example @@ -0,0 +1 @@ +REACT_APP_INFURA_KEY= diff --git a/basic-wallet/package.json b/basic-wallet/package.json index c661d20..e391577 100644 --- a/basic-wallet/package.json +++ b/basic-wallet/package.json @@ -6,15 +6,16 @@ "@burner-wallet/assets": "^1.0.0", "@burner-wallet/core": "^1.0.3", "@burner-wallet/exchange": "^1.0.0", + "@burner-wallet/metamask-plugin": "^1.0.0", "@burner-wallet/modern-ui": "^1.0.5", "@types/node": "12.0.4", "@types/react": "*", "@types/react-dom": "16.8.4", "@types/react-router-dom": "^4.3.3", - "tokenbridge-plugin": "^1.0.0", "react": "^16.8.6", "react-dom": "^16.8.6", "react-scripts": "^3.2.0", + "tokenbridge-plugin": "^1.0.0", "typescript": "3.5.1" }, "scripts": { diff --git a/basic-wallet/src/index.tsx b/basic-wallet/src/index.tsx index e3f9bb9..e09ed09 100644 --- a/basic-wallet/src/index.tsx +++ b/basic-wallet/src/index.tsx @@ -5,18 +5,19 @@ import { InjectedSigner, LocalSigner } from '@burner-wallet/core/signers' import { InfuraGateway, InjectedGateway } from '@burner-wallet/core/gateways' import Exchange from '@burner-wallet/exchange' import ModernUI from '@burner-wallet/modern-ui' -import { etc, wetc, EtcGateway, WETCBridge } from 'tokenbridge-plugin' +import { Etc, Wetc, EtcGateway, WETCBridge } from 'tokenbridge-plugin' +import MetamaskPlugin from '@burner-wallet/metamask-plugin' const core = new BurnerCore({ signers: [new InjectedSigner(), new LocalSigner()], gateways: [new InjectedGateway(), new InfuraGateway(process.env.REACT_APP_INFURA_KEY), new EtcGateway()], - assets: [wetc, etc] + assets: [Wetc, Etc] }) const exchange = new Exchange({ pairs: [new WETCBridge()] }) -const BurnerWallet = () => +const BurnerWallet = () => ReactDOM.render(, document.getElementById('root')) diff --git a/local-wallet/.env.example b/local-wallet/.env.example new file mode 100644 index 0000000..521f04c --- /dev/null +++ b/local-wallet/.env.example @@ -0,0 +1,2 @@ +REACT_APP_INFURA_KEY= +REACT_APP_PK=0x diff --git a/local-wallet/package.json b/local-wallet/package.json index a4afbc7..66d3238 100644 --- a/local-wallet/package.json +++ b/local-wallet/package.json @@ -6,22 +6,22 @@ "@burner-wallet/assets": "^1.0.0", "@burner-wallet/core": "^1.0.3", "@burner-wallet/exchange": "^1.0.0", + "@burner-wallet/metamask-plugin": "^1.0.0", "@burner-wallet/modern-ui": "^1.0.5", "@types/node": "12.0.4", "@types/react": "16.8.19", "@types/react-dom": "16.8.4", "@types/react-router-dom": "^4.3.3", - "tokenbridge-plugin": "^1.0.0", "react": "^16.8.6", "react-dom": "^16.8.6", "react-scripts": "^3.2.0", + "tokenbridge-plugin": "^1.0.0", "typescript": "3.5.1", "web3": "1.0.0-beta.55" }, "scripts": { "start": "node ./scripts/run-local.js", - "start-local": "node ./scripts/run-local.js", - "start-wallet": "react-scripts start", + "start-local": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject" diff --git a/local-wallet/src/index.tsx b/local-wallet/src/index.tsx index 7b8d99b..4c7ed84 100644 --- a/local-wallet/src/index.tsx +++ b/local-wallet/src/index.tsx @@ -3,34 +3,46 @@ import ReactDOM from 'react-dom' import { NativeAsset, ERC20Asset } from '@burner-wallet/assets' import BurnerCore from '@burner-wallet/core' import { InjectedSigner, LocalSigner } from '@burner-wallet/core/signers' -import { HTTPGateway } from '@burner-wallet/core/gateways' +import { HTTPGateway, InfuraGateway, InjectedGateway } from '@burner-wallet/core/gateways' import ModernUI from '@burner-wallet/modern-ui' import Exchange from '@burner-wallet/exchange' -import { TestnetBridge } from 'tokenbridge-plugin' +import { Bridge } from 'tokenbridge-plugin' +import MetamaskPlugin from '@burner-wallet/metamask-plugin' const core = new BurnerCore({ signers: [new InjectedSigner(), new LocalSigner({ privateKey: process.env.REACT_APP_PK, saveKey: false })], - gateways: [new HTTPGateway('https://sokol.poa.network', '77')], + gateways: [ + new InjectedGateway(), + new HTTPGateway('https://sokol.poa.network', '77'), + new InfuraGateway(process.env.REACT_APP_INFURA_KEY) + ], assets: [ new ERC20Asset({ - id: 'wspoa', - name: 'WSPOA', + id: 'spoa20', + name: 'sPoa20', network: '42', // @ts-ignore - address: process.env.REACT_APP_ERC20_ADDRESS + address: '0x4ED310d1cEE1c34011641C4c1172a98Daa257381' }), new NativeAsset({ id: 'spoa', - name: 'sokol', + name: 'sPoa', network: '77' }) ] }) const exchange = new Exchange({ - pairs: [new TestnetBridge()] + pairs: [ + new Bridge({ + assetA: 'spoa', + assetABridge: '0x670d132aFa5bFd46177024a748E0CB4f963357dD', + assetB: 'spoa20', + assetBBridge: '0xA194F66d8c9DEE80424f8662C88E339Bce8BfCeA' + }) + ] }) -const BurnerWallet = () => +const BurnerWallet = () => ReactDOM.render(, document.getElementById('root')) diff --git a/tokenbridge-plugin/src/assets/Etc.ts b/tokenbridge-plugin/src/assets/Etc.ts index f604dc3..f9e79e0 100644 --- a/tokenbridge-plugin/src/assets/Etc.ts +++ b/tokenbridge-plugin/src/assets/Etc.ts @@ -3,5 +3,6 @@ import { NativeAsset } from '@burner-wallet/assets' export default new NativeAsset({ id: 'etc', name: 'ETC', - network: '61' + network: '61', + icon: 'https://user-images.githubusercontent.com/4614574/77648741-666cf800-6f47-11ea-8cb4-01b9db00c264.png' }) diff --git a/tokenbridge-plugin/src/index.ts b/tokenbridge-plugin/src/index.ts index c36b833..809c896 100644 --- a/tokenbridge-plugin/src/index.ts +++ b/tokenbridge-plugin/src/index.ts @@ -1,6 +1,6 @@ -export { default as etc } from './assets/Etc' -export { default as wetc } from './assets/Wetc' +export { default as Etc } from './assets/Etc' +export { default as Wetc } from './assets/Wetc' export { default as ERC677Asset } from './assets/ERC677Asset' export { default as EtcGateway } from './gateways/EtcGateway' export { default as WETCBridge } from './pairs/WETCBridge' -export { default as TestnetBridge } from './pairs/TestnetBridge' +export { default as Bridge } from './pairs/Bridge' diff --git a/tokenbridge-plugin/src/pairs/TestnetBridge.ts b/tokenbridge-plugin/src/pairs/TestnetBridge.ts deleted file mode 100644 index 1fbb4f8..0000000 --- a/tokenbridge-plugin/src/pairs/TestnetBridge.ts +++ /dev/null @@ -1,12 +0,0 @@ -import Bridge from './Bridge' - -export default class TestnetBridge extends Bridge { - constructor() { - super({ - assetA: 'spoa', - assetABridge: '', - assetB: 'wspoa', - assetBBridge: '' - }) - } -} diff --git a/yarn.lock b/yarn.lock index 4f1b199..b381913 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1113,6 +1113,15 @@ "@burner-wallet/types" "^1.0.0" "@types/react" "*" +"@burner-wallet/metamask-plugin@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@burner-wallet/metamask-plugin/-/metamask-plugin-1.0.0.tgz#282cbc838cc31b0c097891ff8b468dc6ff7982bf" + integrity sha512-nj/Zha8ONAWEVdN0Epz88PSm9HsHqkuu2HdOUxVM//JrTHWv+S6oJYRFTYrOncN5kqsL5cVNfyeu0k1nbW8eYw== + dependencies: + "@burner-wallet/types" "^1.0.0" + "@types/react" "*" + styled-components "^4.4.0" + "@burner-wallet/modern-ui@^1.0.5": version "1.0.5" resolved "https://registry.yarnpkg.com/@burner-wallet/modern-ui/-/modern-ui-1.0.5.tgz#9c19f2f313754cce94c66e9107e9b546a7a67f39" From 057878b0f2d15ab423e1b9c96969b036c55b8273 Mon Sep 17 00:00:00 2001 From: Gerardo Nardelli Date: Mon, 30 Mar 2020 11:26:08 -0300 Subject: [PATCH 3/8] Add Dockerfile --- Dockerfile | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5938392 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +FROM node:12 + +WORKDIR /plugin + +COPY package.json . +COPY lerna.json . +COPY yarn.lock . +COPY tsconfig.json . +COPY tokenbridge-plugin/package.json ./tokenbridge-plugin/ +COPY basic-wallet/package.json ./basic-wallet/ +COPY local-wallet/package.json ./local-wallet/ +RUN yarn install + +COPY ./tokenbridge-plugin ./tokenbridge-plugin +RUN yarn build + +COPY ./basic-wallet ./basic-wallet +COPY ./local-wallet ./local-wallet From df581799989808bba005645b18c6e949f9864759 Mon Sep 17 00:00:00 2001 From: Gerardo Nardelli Date: Thu, 2 Apr 2020 17:04:11 -0300 Subject: [PATCH 4/8] Update testnet mediator addresses --- local-wallet/src/index.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/local-wallet/src/index.tsx b/local-wallet/src/index.tsx index 4c7ed84..201a89b 100644 --- a/local-wallet/src/index.tsx +++ b/local-wallet/src/index.tsx @@ -18,11 +18,11 @@ const core = new BurnerCore({ ], assets: [ new ERC20Asset({ - id: 'spoa20', - name: 'sPoa20', + id: 'kspoa', + name: 'KsPoa', network: '42', // @ts-ignore - address: '0x4ED310d1cEE1c34011641C4c1172a98Daa257381' + address: '0xff94183659f549D6273349696d73686Ee1d2AC83' }), new NativeAsset({ id: 'spoa', @@ -36,9 +36,9 @@ const exchange = new Exchange({ pairs: [ new Bridge({ assetA: 'spoa', - assetABridge: '0x670d132aFa5bFd46177024a748E0CB4f963357dD', - assetB: 'spoa20', - assetBBridge: '0xA194F66d8c9DEE80424f8662C88E339Bce8BfCeA' + assetABridge: '0x867949C3F2f66D827Ed40847FaA7B3a369370e13', + assetB: 'kspoa', + assetBBridge: '0x99FB1a25caeB9c3a5Bf132686E2fe5e27BC0e2dd' }) ] }) From 116b3c44dc05703b04a800c1398c725ef05d1779 Mon Sep 17 00:00:00 2001 From: Gerardo Nardelli Date: Thu, 23 Apr 2020 13:46:08 -0300 Subject: [PATCH 5/8] Rename plugin --- Dockerfile | 4 ++-- README.md | 2 +- basic-wallet/package.json | 2 +- basic-wallet/src/index.tsx | 2 +- lerna.json | 2 +- local-wallet/package.json | 2 +- local-wallet/src/index.tsx | 2 +- {tokenbridge-plugin => my-plugin}/package.json | 2 +- {tokenbridge-plugin => my-plugin}/src/assets/ERC677Asset.ts | 0 {tokenbridge-plugin => my-plugin}/src/assets/Etc.ts | 0 {tokenbridge-plugin => my-plugin}/src/assets/Wetc.ts | 0 {tokenbridge-plugin => my-plugin}/src/assets/abi/IERC677.json | 0 {tokenbridge-plugin => my-plugin}/src/gateways/EtcGateway.ts | 0 {tokenbridge-plugin => my-plugin}/src/index.ts | 0 {tokenbridge-plugin => my-plugin}/src/pairs/Bridge.ts | 0 {tokenbridge-plugin => my-plugin}/src/pairs/WETCBridge.ts | 0 {tokenbridge-plugin => my-plugin}/tsconfig.json | 0 package.json | 4 ++-- 18 files changed, 11 insertions(+), 11 deletions(-) rename {tokenbridge-plugin => my-plugin}/package.json (92%) rename {tokenbridge-plugin => my-plugin}/src/assets/ERC677Asset.ts (100%) rename {tokenbridge-plugin => my-plugin}/src/assets/Etc.ts (100%) rename {tokenbridge-plugin => my-plugin}/src/assets/Wetc.ts (100%) rename {tokenbridge-plugin => my-plugin}/src/assets/abi/IERC677.json (100%) rename {tokenbridge-plugin => my-plugin}/src/gateways/EtcGateway.ts (100%) rename {tokenbridge-plugin => my-plugin}/src/index.ts (100%) rename {tokenbridge-plugin => my-plugin}/src/pairs/Bridge.ts (100%) rename {tokenbridge-plugin => my-plugin}/src/pairs/WETCBridge.ts (100%) rename {tokenbridge-plugin => my-plugin}/tsconfig.json (100%) diff --git a/Dockerfile b/Dockerfile index 5938392..cbe424e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,12 +6,12 @@ COPY package.json . COPY lerna.json . COPY yarn.lock . COPY tsconfig.json . -COPY tokenbridge-plugin/package.json ./tokenbridge-plugin/ +COPY my-plugin/package.json ./my-plugin/ COPY basic-wallet/package.json ./basic-wallet/ COPY local-wallet/package.json ./local-wallet/ RUN yarn install -COPY ./tokenbridge-plugin ./tokenbridge-plugin +COPY ./my-plugin ./my-plugin RUN yarn build COPY ./basic-wallet ./basic-wallet diff --git a/README.md b/README.md index 5d0a0ad..411a80b 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Bridge trading pairs supported: ### Usage ```javascript -import { Etc, Wetc, EtcGateway, WETCBridge } from 'tokenbridge-plugin' +import { Etc, Wetc, EtcGateway, WETCBridge } from 'my-plugin' const core = new BurnerCore({ ... diff --git a/basic-wallet/package.json b/basic-wallet/package.json index e391577..140d774 100644 --- a/basic-wallet/package.json +++ b/basic-wallet/package.json @@ -15,7 +15,7 @@ "react": "^16.8.6", "react-dom": "^16.8.6", "react-scripts": "^3.2.0", - "tokenbridge-plugin": "^1.0.0", + "my-plugin": "^1.0.0", "typescript": "3.5.1" }, "scripts": { diff --git a/basic-wallet/src/index.tsx b/basic-wallet/src/index.tsx index e09ed09..8abd982 100644 --- a/basic-wallet/src/index.tsx +++ b/basic-wallet/src/index.tsx @@ -5,7 +5,7 @@ import { InjectedSigner, LocalSigner } from '@burner-wallet/core/signers' import { InfuraGateway, InjectedGateway } from '@burner-wallet/core/gateways' import Exchange from '@burner-wallet/exchange' import ModernUI from '@burner-wallet/modern-ui' -import { Etc, Wetc, EtcGateway, WETCBridge } from 'tokenbridge-plugin' +import { Etc, Wetc, EtcGateway, WETCBridge } from 'my-plugin' import MetamaskPlugin from '@burner-wallet/metamask-plugin' const core = new BurnerCore({ diff --git a/lerna.json b/lerna.json index 7241ad8..c98394d 100644 --- a/lerna.json +++ b/lerna.json @@ -2,7 +2,7 @@ "packages": [ "basic-wallet", "local-wallet", - "tokenbridge-plugin" + "my-plugin" ], "npmClient": "yarn", "useWorkspaces": true, diff --git a/local-wallet/package.json b/local-wallet/package.json index 66d3238..2e1a7d8 100644 --- a/local-wallet/package.json +++ b/local-wallet/package.json @@ -15,7 +15,7 @@ "react": "^16.8.6", "react-dom": "^16.8.6", "react-scripts": "^3.2.0", - "tokenbridge-plugin": "^1.0.0", + "my-plugin": "^1.0.0", "typescript": "3.5.1", "web3": "1.0.0-beta.55" }, diff --git a/local-wallet/src/index.tsx b/local-wallet/src/index.tsx index 201a89b..09e3c42 100644 --- a/local-wallet/src/index.tsx +++ b/local-wallet/src/index.tsx @@ -6,7 +6,7 @@ import { InjectedSigner, LocalSigner } from '@burner-wallet/core/signers' import { HTTPGateway, InfuraGateway, InjectedGateway } from '@burner-wallet/core/gateways' import ModernUI from '@burner-wallet/modern-ui' import Exchange from '@burner-wallet/exchange' -import { Bridge } from 'tokenbridge-plugin' +import { Bridge } from 'my-plugin' import MetamaskPlugin from '@burner-wallet/metamask-plugin' const core = new BurnerCore({ diff --git a/tokenbridge-plugin/package.json b/my-plugin/package.json similarity index 92% rename from tokenbridge-plugin/package.json rename to my-plugin/package.json index 0f0c889..b53ad3d 100644 --- a/tokenbridge-plugin/package.json +++ b/my-plugin/package.json @@ -1,5 +1,5 @@ { - "name": "tokenbridge-plugin", + "name": "my-plugin", "version": "1.0.0", "license": "MIT", "main": "dist/index.js", diff --git a/tokenbridge-plugin/src/assets/ERC677Asset.ts b/my-plugin/src/assets/ERC677Asset.ts similarity index 100% rename from tokenbridge-plugin/src/assets/ERC677Asset.ts rename to my-plugin/src/assets/ERC677Asset.ts diff --git a/tokenbridge-plugin/src/assets/Etc.ts b/my-plugin/src/assets/Etc.ts similarity index 100% rename from tokenbridge-plugin/src/assets/Etc.ts rename to my-plugin/src/assets/Etc.ts diff --git a/tokenbridge-plugin/src/assets/Wetc.ts b/my-plugin/src/assets/Wetc.ts similarity index 100% rename from tokenbridge-plugin/src/assets/Wetc.ts rename to my-plugin/src/assets/Wetc.ts diff --git a/tokenbridge-plugin/src/assets/abi/IERC677.json b/my-plugin/src/assets/abi/IERC677.json similarity index 100% rename from tokenbridge-plugin/src/assets/abi/IERC677.json rename to my-plugin/src/assets/abi/IERC677.json diff --git a/tokenbridge-plugin/src/gateways/EtcGateway.ts b/my-plugin/src/gateways/EtcGateway.ts similarity index 100% rename from tokenbridge-plugin/src/gateways/EtcGateway.ts rename to my-plugin/src/gateways/EtcGateway.ts diff --git a/tokenbridge-plugin/src/index.ts b/my-plugin/src/index.ts similarity index 100% rename from tokenbridge-plugin/src/index.ts rename to my-plugin/src/index.ts diff --git a/tokenbridge-plugin/src/pairs/Bridge.ts b/my-plugin/src/pairs/Bridge.ts similarity index 100% rename from tokenbridge-plugin/src/pairs/Bridge.ts rename to my-plugin/src/pairs/Bridge.ts diff --git a/tokenbridge-plugin/src/pairs/WETCBridge.ts b/my-plugin/src/pairs/WETCBridge.ts similarity index 100% rename from tokenbridge-plugin/src/pairs/WETCBridge.ts rename to my-plugin/src/pairs/WETCBridge.ts diff --git a/tokenbridge-plugin/tsconfig.json b/my-plugin/tsconfig.json similarity index 100% rename from tokenbridge-plugin/tsconfig.json rename to my-plugin/tsconfig.json diff --git a/package.json b/package.json index 4c5cafd..6261bd2 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "amb-burner-wallet-plugin", + "name": "tokenbridge-burner-wallet-plugin-sample", "description": "Arbitrary message bridge Burner Wallet 2 plugin", "version": "1.0.0", "license": "GPL-3.0-only", @@ -14,7 +14,7 @@ "workspaces": [ "basic-wallet", "local-wallet", - "tokenbridge-plugin" + "my-plugin" ], "devDependencies": { "@typescript-eslint/eslint-plugin": "^2.5.0", From fa10f687a6b44eea943c5b1685a41bd9b2576cdd Mon Sep 17 00:00:00 2001 From: Gerardo Nardelli Date: Thu, 23 Apr 2020 14:35:16 -0300 Subject: [PATCH 6/8] Update project --- .github/workflows/main.yml | 33 --- Dockerfile | 6 +- README.md | 8 +- basic-wallet/.env.example | 1 - basic-wallet/.gitignore | 23 -- basic-wallet/package.json | 41 --- basic-wallet/public/manifest.json | 15 - basic-wallet/src/index.tsx | 23 -- lerna.json | 3 +- local-wallet/public/favicon.ico | Bin 3870 -> 0 bytes local-wallet/public/index.html | 38 --- local-wallet/src/react-app-env.d.ts | 1 - local-wallet/tsconfig.json | 25 -- my-plugin/package.json | 6 +- my-plugin/src/pairs/Bridge.ts | 4 +- package.json | 8 +- {local-wallet => wallet}/.env.example | 0 {local-wallet => wallet}/README.md | 0 {local-wallet => wallet}/package.json | 17 +- {basic-wallet => wallet}/public/favicon.ico | Bin {basic-wallet => wallet}/public/index.html | 0 {local-wallet => wallet}/public/manifest.json | 0 .../scripts/erc20bytecode.txt | 0 .../scripts/run-local-lib.js | 0 {local-wallet => wallet}/scripts/run-local.js | 0 {local-wallet => wallet}/src/index.tsx | 0 .../src/react-app-env.d.ts | 0 {basic-wallet => wallet}/tsconfig.json | 0 yarn.lock | 266 +++++++++++++----- 29 files changed, 210 insertions(+), 308 deletions(-) delete mode 100644 .github/workflows/main.yml delete mode 100644 basic-wallet/.env.example delete mode 100644 basic-wallet/.gitignore delete mode 100644 basic-wallet/package.json delete mode 100644 basic-wallet/public/manifest.json delete mode 100644 basic-wallet/src/index.tsx delete mode 100644 local-wallet/public/favicon.ico delete mode 100644 local-wallet/public/index.html delete mode 100644 local-wallet/src/react-app-env.d.ts delete mode 100644 local-wallet/tsconfig.json rename {local-wallet => wallet}/.env.example (100%) rename {local-wallet => wallet}/README.md (100%) rename {local-wallet => wallet}/package.json (70%) rename {basic-wallet => wallet}/public/favicon.ico (100%) rename {basic-wallet => wallet}/public/index.html (100%) rename {local-wallet => wallet}/public/manifest.json (100%) rename {local-wallet => wallet}/scripts/erc20bytecode.txt (100%) rename {local-wallet => wallet}/scripts/run-local-lib.js (100%) rename {local-wallet => wallet}/scripts/run-local.js (100%) rename {local-wallet => wallet}/src/index.tsx (100%) rename {basic-wallet => wallet}/src/react-app-env.d.ts (100%) rename {basic-wallet => wallet}/tsconfig.json (100%) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index dc4364d..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,33 +0,0 @@ -# This is a basic workflow to help you get started with Actions - -name: CI - -# Controls when the action will run. Triggers the workflow on push or pull request -# events but only for the master branch -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - # This workflow contains a single job called "build" - build: - # The type of runner that the job will run on - runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 - with: - node-version: '12.16' - - # Runs a set of commands using the runners shell - - name: yarn install, yarn lint, yarn build - run: | - yarn install - yarn lint - yarn build diff --git a/Dockerfile b/Dockerfile index cbe424e..026a0a7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,12 +7,10 @@ COPY lerna.json . COPY yarn.lock . COPY tsconfig.json . COPY my-plugin/package.json ./my-plugin/ -COPY basic-wallet/package.json ./basic-wallet/ -COPY local-wallet/package.json ./local-wallet/ +COPY wallet/package.json ./wallet/ RUN yarn install COPY ./my-plugin ./my-plugin RUN yarn build -COPY ./basic-wallet ./basic-wallet -COPY ./local-wallet ./local-wallet +COPY ./wallet ./wallet diff --git a/README.md b/README.md index 411a80b..0f9d471 100644 --- a/README.md +++ b/README.md @@ -28,13 +28,9 @@ const exchange = new Exchange({ all dependencies and link modules in the repo 3. Run `yarn build` -### Run Burner Wallet with the plugin in Mainnet & Classic -1. Create `.env` file in `basic-wallet` folder and set `REACT_APP_INFURA_KEY=` -2. Run `yarn start-basic` to start the wallet connected to Mainnet & Classic and interact with the ETH - WETC Bridge. - ### Run Burner Wallet with the plugin in Sokol & Kovan -1. Create `.env` file in `local-wallet` folder and set `REACT_APP_INFURA_KEY=`. +1. Create `.env` file in `wallet` folder and set `REACT_APP_INFURA_KEY=`. Also, a private key can be set to start the wallet with the specified account `REACT_APP_PK=0x...` -2. Run `yarn start-local` to start the wallet connected to Sokol & Kovan and interact with a test bridge sPoa - sPoa20 +2. Run `yarn start-wallet` to start the wallet connected to Sokol & Kovan and interact with a test bridge sPoa - sPoa20 that works on top of the AMB bridge. diff --git a/basic-wallet/.env.example b/basic-wallet/.env.example deleted file mode 100644 index a9bc983..0000000 --- a/basic-wallet/.env.example +++ /dev/null @@ -1 +0,0 @@ -REACT_APP_INFURA_KEY= diff --git a/basic-wallet/.gitignore b/basic-wallet/.gitignore deleted file mode 100644 index 4d29575..0000000 --- a/basic-wallet/.gitignore +++ /dev/null @@ -1,23 +0,0 @@ -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. - -# dependencies -/node_modules -/.pnp -.pnp.js - -# testing -/coverage - -# production -/build - -# misc -.DS_Store -.env.local -.env.development.local -.env.test.local -.env.production.local - -npm-debug.log* -yarn-debug.log* -yarn-error.log* diff --git a/basic-wallet/package.json b/basic-wallet/package.json deleted file mode 100644 index 140d774..0000000 --- a/basic-wallet/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "basic-wallet", - "version": "0.1.0", - "private": true, - "dependencies": { - "@burner-wallet/assets": "^1.0.0", - "@burner-wallet/core": "^1.0.3", - "@burner-wallet/exchange": "^1.0.0", - "@burner-wallet/metamask-plugin": "^1.0.0", - "@burner-wallet/modern-ui": "^1.0.5", - "@types/node": "12.0.4", - "@types/react": "*", - "@types/react-dom": "16.8.4", - "@types/react-router-dom": "^4.3.3", - "react": "^16.8.6", - "react-dom": "^16.8.6", - "react-scripts": "^3.2.0", - "my-plugin": "^1.0.0", - "typescript": "3.5.1" - }, - "scripts": { - "start": "react-scripts start", - "start-basic": "react-scripts start", - "build": "react-scripts build", - "test": "react-scripts test", - "eject": "react-scripts eject" - }, - "browserslist": { - "production": [ - ">0.2%", - "not dead", - "not op_mini all" - ], - "development": [ - "last 1 chrome version", - "last 1 firefox version", - "last 1 safari version" - ] - }, - "devDependencies": {} -} diff --git a/basic-wallet/public/manifest.json b/basic-wallet/public/manifest.json deleted file mode 100644 index 1f2f141..0000000 --- a/basic-wallet/public/manifest.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "short_name": "React App", - "name": "Create React App Sample", - "icons": [ - { - "src": "favicon.ico", - "sizes": "64x64 32x32 24x24 16x16", - "type": "image/x-icon" - } - ], - "start_url": ".", - "display": "standalone", - "theme_color": "#000000", - "background_color": "#ffffff" -} diff --git a/basic-wallet/src/index.tsx b/basic-wallet/src/index.tsx deleted file mode 100644 index 8abd982..0000000 --- a/basic-wallet/src/index.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import React from 'react' -import ReactDOM from 'react-dom' -import BurnerCore from '@burner-wallet/core' -import { InjectedSigner, LocalSigner } from '@burner-wallet/core/signers' -import { InfuraGateway, InjectedGateway } from '@burner-wallet/core/gateways' -import Exchange from '@burner-wallet/exchange' -import ModernUI from '@burner-wallet/modern-ui' -import { Etc, Wetc, EtcGateway, WETCBridge } from 'my-plugin' -import MetamaskPlugin from '@burner-wallet/metamask-plugin' - -const core = new BurnerCore({ - signers: [new InjectedSigner(), new LocalSigner()], - gateways: [new InjectedGateway(), new InfuraGateway(process.env.REACT_APP_INFURA_KEY), new EtcGateway()], - assets: [Wetc, Etc] -}) - -const exchange = new Exchange({ - pairs: [new WETCBridge()] -}) - -const BurnerWallet = () => - -ReactDOM.render(, document.getElementById('root')) diff --git a/lerna.json b/lerna.json index c98394d..291397e 100644 --- a/lerna.json +++ b/lerna.json @@ -1,7 +1,6 @@ { "packages": [ - "basic-wallet", - "local-wallet", + "wallet", "my-plugin" ], "npmClient": "yarn", diff --git a/local-wallet/public/favicon.ico b/local-wallet/public/favicon.ico deleted file mode 100644 index a11777cc471a4344702741ab1c8a588998b1311a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3870 zcma);c{J4h9>;%nil|2-o+rCuEF-(I%-F}ijC~o(k~HKAkr0)!FCj~d>`RtpD?8b; zXOC1OD!V*IsqUwzbMF1)-gEDD=A573Z-&G7^LoAC9|WO7Xc0Cx1g^Zu0u_SjAPB3vGa^W|sj)80f#V0@M_CAZTIO(t--xg= z!sii`1giyH7EKL_+Wi0ab<)&E_0KD!3Rp2^HNB*K2@PHCs4PWSA32*-^7d{9nH2_E zmC{C*N*)(vEF1_aMamw2A{ZH5aIDqiabnFdJ|y0%aS|64E$`s2ccV~3lR!u<){eS` z#^Mx6o(iP1Ix%4dv`t@!&Za-K@mTm#vadc{0aWDV*_%EiGK7qMC_(`exc>-$Gb9~W!w_^{*pYRm~G zBN{nA;cm^w$VWg1O^^<6vY`1XCD|s_zv*g*5&V#wv&s#h$xlUilPe4U@I&UXZbL z0)%9Uj&@yd03n;!7do+bfixH^FeZ-Ema}s;DQX2gY+7g0s(9;`8GyvPY1*vxiF&|w z>!vA~GA<~JUqH}d;DfBSi^IT*#lrzXl$fNpq0_T1tA+`A$1?(gLb?e#0>UELvljtQ zK+*74m0jn&)5yk8mLBv;=@}c{t0ztT<v;Avck$S6D`Z)^c0(jiwKhQsn|LDRY&w(Fmi91I7H6S;b0XM{e zXp0~(T@k_r-!jkLwd1_Vre^v$G4|kh4}=Gi?$AaJ)3I+^m|Zyj#*?Kp@w(lQdJZf4 z#|IJW5z+S^e9@(6hW6N~{pj8|NO*>1)E=%?nNUAkmv~OY&ZV;m-%?pQ_11)hAr0oAwILrlsGawpxx4D43J&K=n+p3WLnlDsQ$b(9+4 z?mO^hmV^F8MV{4Lx>(Q=aHhQ1){0d*(e&s%G=i5rq3;t{JC zmgbn5Nkl)t@fPH$v;af26lyhH!k+#}_&aBK4baYPbZy$5aFx4}ka&qxl z$=Rh$W;U)>-=S-0=?7FH9dUAd2(q#4TCAHky!$^~;Dz^j|8_wuKc*YzfdAht@Q&ror?91Dm!N03=4=O!a)I*0q~p0g$Fm$pmr$ zb;wD;STDIi$@M%y1>p&_>%?UP($15gou_ue1u0!4(%81;qcIW8NyxFEvXpiJ|H4wz z*mFT(qVx1FKufG11hByuX%lPk4t#WZ{>8ka2efjY`~;AL6vWyQKpJun2nRiZYDij$ zP>4jQXPaP$UC$yIVgGa)jDV;F0l^n(V=HMRB5)20V7&r$jmk{UUIe zVjKroK}JAbD>B`2cwNQ&GDLx8{pg`7hbA~grk|W6LgiZ`8y`{Iq0i>t!3p2}MS6S+ zO_ruKyAElt)rdS>CtF7j{&6rP-#c=7evGMt7B6`7HG|-(WL`bDUAjyn+k$mx$CH;q2Dz4x;cPP$hW=`pFfLO)!jaCL@V2+F)So3}vg|%O*^T1j>C2lx zsURO-zIJC$^$g2byVbRIo^w>UxK}74^TqUiRR#7s_X$e)$6iYG1(PcW7un-va-S&u zHk9-6Zn&>T==A)lM^D~bk{&rFzCi35>UR!ZjQkdSiNX*-;l4z9j*7|q`TBl~Au`5& z+c)*8?#-tgUR$Zd%Q3bs96w6k7q@#tUn`5rj+r@_sAVVLqco|6O{ILX&U-&-cbVa3 zY?ngHR@%l{;`ri%H*0EhBWrGjv!LE4db?HEWb5mu*t@{kv|XwK8?npOshmzf=vZA@ zVSN9sL~!sn?r(AK)Q7Jk2(|M67Uy3I{eRy z_l&Y@A>;vjkWN5I2xvFFTLX0i+`{qz7C_@bo`ZUzDugfq4+>a3?1v%)O+YTd6@Ul7 zAfLfm=nhZ`)P~&v90$&UcF+yXm9sq!qCx3^9gzIcO|Y(js^Fj)Rvq>nQAHI92ap=P z10A4@prk+AGWCb`2)dQYFuR$|H6iDE8p}9a?#nV2}LBCoCf(Xi2@szia7#gY>b|l!-U`c}@ zLdhvQjc!BdLJvYvzzzngnw51yRYCqh4}$oRCy-z|v3Hc*d|?^Wj=l~18*E~*cR_kU z{XsxM1i{V*4GujHQ3DBpl2w4FgFR48Nma@HPgnyKoIEY-MqmMeY=I<%oG~l!f<+FN z1ZY^;10j4M4#HYXP zw5eJpA_y(>uLQ~OucgxDLuf}fVs272FaMxhn4xnDGIyLXnw>Xsd^J8XhcWIwIoQ9} z%FoSJTAGW(SRGwJwb=@pY7r$uQRK3Zd~XbxU)ts!4XsJrCycrWSI?e!IqwqIR8+Jh zlRjZ`UO1I!BtJR_2~7AbkbSm%XQqxEPkz6BTGWx8e}nQ=w7bZ|eVP4?*Tb!$(R)iC z9)&%bS*u(lXqzitAN)Oo=&Ytn>%Hzjc<5liuPi>zC_nw;Z0AE3Y$Jao_Q90R-gl~5 z_xAb2J%eArrC1CN4G$}-zVvCqF1;H;abAu6G*+PDHSYFx@Tdbfox*uEd3}BUyYY-l zTfEsOqsi#f9^FoLO;ChK<554qkri&Av~SIM*{fEYRE?vH7pTAOmu2pz3X?Wn*!ROX ztd54huAk&mFBemMooL33RV-*1f0Q3_(7hl$<#*|WF9P!;r;4_+X~k~uKEqdzZ$5Al zV63XN@)j$FN#cCD;ek1R#l zv%pGrhB~KWgoCj%GT?%{@@o(AJGt*PG#l3i>lhmb_twKH^EYvacVY-6bsCl5*^~L0 zonm@lk2UvvTKr2RS%}T>^~EYqdL1q4nD%0n&Xqr^cK^`J5W;lRRB^R-O8b&HENO||mo0xaD+S=I8RTlIfVgqN@SXDr2&-)we--K7w= zJVU8?Z+7k9dy;s;^gDkQa`0nz6N{T?(A&Iz)2!DEecLyRa&FI!id#5Z7B*O2=PsR0 zEvc|8{NS^)!d)MDX(97Xw}m&kEO@5jqRaDZ!+%`wYOI<23q|&js`&o4xvjP7D_xv@ z5hEwpsp{HezI9!~6O{~)lLR@oF7?J7i>1|5a~UuoN=q&6N}EJPV_GD`&M*v8Y`^2j zKII*d_@Fi$+i*YEW+Hbzn{iQk~yP z>7N{S4)r*!NwQ`(qcN#8SRQsNK6>{)X12nbF`*7#ecO7I)Q$uZsV+xS4E7aUn+U(K baj7?x%VD!5Cxk2YbYLNVeiXvvpMCWYo=by@ diff --git a/local-wallet/public/index.html b/local-wallet/public/index.html deleted file mode 100644 index dd1ccfd..0000000 --- a/local-wallet/public/index.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - React App - - - -
- - - diff --git a/local-wallet/src/react-app-env.d.ts b/local-wallet/src/react-app-env.d.ts deleted file mode 100644 index 6431bc5..0000000 --- a/local-wallet/src/react-app-env.d.ts +++ /dev/null @@ -1 +0,0 @@ -/// diff --git a/local-wallet/tsconfig.json b/local-wallet/tsconfig.json deleted file mode 100644 index 0980b23..0000000 --- a/local-wallet/tsconfig.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "compilerOptions": { - "target": "es5", - "lib": [ - "dom", - "dom.iterable", - "esnext" - ], - "allowJs": true, - "skipLibCheck": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "strict": true, - "forceConsistentCasingInFileNames": true, - "module": "esnext", - "moduleResolution": "node", - "resolveJsonModule": true, - "isolatedModules": true, - "noEmit": true, - "jsx": "preserve" - }, - "include": [ - "src" - ] -} diff --git a/my-plugin/package.json b/my-plugin/package.json index b53ad3d..3ef8797 100644 --- a/my-plugin/package.json +++ b/my-plugin/package.json @@ -10,9 +10,9 @@ "start-local": "tsc -w" }, "dependencies": { - "@burner-wallet/assets": "^1.0.0", - "@burner-wallet/exchange": "^1.0.0", - "@burner-wallet/types": "^1.0.6", + "@burner-wallet/assets": "^1.1.10", + "@burner-wallet/exchange": "^1.1.2", + "@burner-wallet/types": "^1.0.8", "@types/react": "*" }, "devDependencies": { diff --git a/my-plugin/src/pairs/Bridge.ts b/my-plugin/src/pairs/Bridge.ts index cc6ab75..6937c7d 100644 --- a/my-plugin/src/pairs/Bridge.ts +++ b/my-plugin/src/pairs/Bridge.ts @@ -28,7 +28,7 @@ export default class Bridge extends Pair { exchangeAtoB({ account, value, ether }: ExchangeParams) { const _value = this._getValue({ value, ether }) - const etc = this.exchange.getAsset(this.assetA) + const etc = this.getExchange().getAsset(this.assetA) return etc.send({ from: account, value: _value, @@ -39,7 +39,7 @@ export default class Bridge extends Pair { exchangeBtoA({ account, value, ether }: ExchangeParams) { const _value = this._getValue({ value, ether }) - const wetc = this.exchange.getAsset(this.assetB) + const wetc = this.getExchange().getAsset(this.assetB) return wetc.send({ from: account, value: _value, diff --git a/package.json b/package.json index 6261bd2..badfa01 100644 --- a/package.json +++ b/package.json @@ -6,14 +6,12 @@ "private": true, "scripts": { "install": "lerna bootstrap", - "build": "lerna run --ignore local-wallet --ignore basic-wallet build", + "build": "lerna run --ignore wallet build", "lint": "eslint '*/**/*.{js,ts,tsx}'", - "start-basic": "lerna run --parallel start-basic", - "start-local": "lerna run --parallel start-local" + "start-wallet": "lerna run --parallel start-wallet" }, "workspaces": [ - "basic-wallet", - "local-wallet", + "wallet", "my-plugin" ], "devDependencies": { diff --git a/local-wallet/.env.example b/wallet/.env.example similarity index 100% rename from local-wallet/.env.example rename to wallet/.env.example diff --git a/local-wallet/README.md b/wallet/README.md similarity index 100% rename from local-wallet/README.md rename to wallet/README.md diff --git a/local-wallet/package.json b/wallet/package.json similarity index 70% rename from local-wallet/package.json rename to wallet/package.json index 2e1a7d8..c90e1e6 100644 --- a/local-wallet/package.json +++ b/wallet/package.json @@ -1,27 +1,26 @@ { - "name": "local-wallet", + "name": "wallet", "version": "0.1.0", "private": true, "dependencies": { - "@burner-wallet/assets": "^1.0.0", - "@burner-wallet/core": "^1.0.3", - "@burner-wallet/exchange": "^1.0.0", - "@burner-wallet/metamask-plugin": "^1.0.0", - "@burner-wallet/modern-ui": "^1.0.5", + "@burner-wallet/assets": "^1.1.10", + "@burner-wallet/core": "^1.1.9", + "@burner-wallet/exchange": "^1.1.2", + "@burner-wallet/metamask-plugin": "^1.0.1", + "@burner-wallet/modern-ui": "^1.0.7", "@types/node": "12.0.4", "@types/react": "16.8.19", "@types/react-dom": "16.8.4", "@types/react-router-dom": "^4.3.3", + "my-plugin": "^1.0.0", "react": "^16.8.6", "react-dom": "^16.8.6", "react-scripts": "^3.2.0", - "my-plugin": "^1.0.0", "typescript": "3.5.1", "web3": "1.0.0-beta.55" }, "scripts": { - "start": "node ./scripts/run-local.js", - "start-local": "react-scripts start", + "start-wallet": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject" diff --git a/basic-wallet/public/favicon.ico b/wallet/public/favicon.ico similarity index 100% rename from basic-wallet/public/favicon.ico rename to wallet/public/favicon.ico diff --git a/basic-wallet/public/index.html b/wallet/public/index.html similarity index 100% rename from basic-wallet/public/index.html rename to wallet/public/index.html diff --git a/local-wallet/public/manifest.json b/wallet/public/manifest.json similarity index 100% rename from local-wallet/public/manifest.json rename to wallet/public/manifest.json diff --git a/local-wallet/scripts/erc20bytecode.txt b/wallet/scripts/erc20bytecode.txt similarity index 100% rename from local-wallet/scripts/erc20bytecode.txt rename to wallet/scripts/erc20bytecode.txt diff --git a/local-wallet/scripts/run-local-lib.js b/wallet/scripts/run-local-lib.js similarity index 100% rename from local-wallet/scripts/run-local-lib.js rename to wallet/scripts/run-local-lib.js diff --git a/local-wallet/scripts/run-local.js b/wallet/scripts/run-local.js similarity index 100% rename from local-wallet/scripts/run-local.js rename to wallet/scripts/run-local.js diff --git a/local-wallet/src/index.tsx b/wallet/src/index.tsx similarity index 100% rename from local-wallet/src/index.tsx rename to wallet/src/index.tsx diff --git a/basic-wallet/src/react-app-env.d.ts b/wallet/src/react-app-env.d.ts similarity index 100% rename from basic-wallet/src/react-app-env.d.ts rename to wallet/src/react-app-env.d.ts diff --git a/basic-wallet/tsconfig.json b/wallet/tsconfig.json similarity index 100% rename from basic-wallet/tsconfig.json rename to wallet/tsconfig.json diff --git a/yarn.lock b/yarn.lock index b381913..1062390 100644 --- a/yarn.lock +++ b/yarn.lock @@ -171,6 +171,13 @@ dependencies: "@babel/highlight" "^7.0.0" +"@babel/code-frame@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.8.3.tgz#33e25903d7481181534e12ec0a25f16b6fcf419e" + integrity sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g== + dependencies: + "@babel/highlight" "^7.8.3" + "@babel/core@7.6.0": version "7.6.0" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.6.0.tgz#9b00f73554edd67bebc86df8303ef678be3d7b48" @@ -221,6 +228,16 @@ lodash "^4.17.13" source-map "^0.5.0" +"@babel/generator@^7.9.5": + version "7.9.5" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.9.5.tgz#27f0917741acc41e6eaaced6d68f96c3fa9afaf9" + integrity sha512-GbNIxVB3ZJe3tLeDm1HSn2AhuD/mVcyLDpgtLXa5tplmWrJdF/elxB56XNqCuD6szyNkDi6wuoKXln3QeBmCHQ== + dependencies: + "@babel/types" "^7.9.5" + jsesc "^2.5.1" + lodash "^4.17.13" + source-map "^0.5.0" + "@babel/helper-annotate-as-pure@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.0.0.tgz#323d39dd0b50e10c7c06ca7d7638e6864d8c5c32" @@ -291,6 +308,15 @@ "@babel/template" "^7.1.0" "@babel/types" "^7.0.0" +"@babel/helper-function-name@^7.9.5": + version "7.9.5" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.9.5.tgz#2b53820d35275120e1874a82e5aabe1376920a5c" + integrity sha512-JVcQZeXM59Cd1qanDUxv9fgJpt3NeKUaqBqUEvfmQ+BCOKq2xUgaWZW2hr0dkbyJgezYuplEoh5knmrnS68efw== + dependencies: + "@babel/helper-get-function-arity" "^7.8.3" + "@babel/template" "^7.8.3" + "@babel/types" "^7.9.5" + "@babel/helper-get-function-arity@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz#83572d4320e2a4657263734113c42868b64e49c3" @@ -298,6 +324,13 @@ dependencies: "@babel/types" "^7.0.0" +"@babel/helper-get-function-arity@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.8.3.tgz#b894b947bd004381ce63ea1db9f08547e920abd5" + integrity sha512-FVDR+Gd9iLjUMY1fzE2SR0IuaJToR4RkCDARVfsBBPSP53GEqSFjD8gNyxg246VUyc/ALRxFaAK8rVG7UT7xRA== + dependencies: + "@babel/types" "^7.8.3" + "@babel/helper-hoist-variables@^7.4.4": version "7.4.4" resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.4.4.tgz#0298b5f25c8c09c53102d52ac4a98f773eb2850a" @@ -386,6 +419,18 @@ dependencies: "@babel/types" "^7.4.4" +"@babel/helper-split-export-declaration@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.8.3.tgz#31a9f30070f91368a7182cf05f831781065fc7a9" + integrity sha512-3x3yOeyBhW851hroze7ElzdkeRXQYQbFIb7gLK1WQYsw2GWDay5gAJNw1sWJ0VFP6z5J1whqeXH/WCdCjZv6dA== + dependencies: + "@babel/types" "^7.8.3" + +"@babel/helper-validator-identifier@^7.9.0", "@babel/helper-validator-identifier@^7.9.5": + version "7.9.5" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.9.5.tgz#90977a8e6fbf6b431a7dc31752eee233bf052d80" + integrity sha512-/8arLKUFq882w4tWGj9JYzRpAlZgiWUJ+dtteNTDqrRBz9Iguck9Rn3ykuBDoUwh2TO4tSAJlrxDUOXWklJe4g== + "@babel/helper-wrap-function@^7.1.0": version "7.2.0" resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.2.0.tgz#c4e0012445769e2815b55296ead43a958549f6fa" @@ -414,11 +459,25 @@ esutils "^2.0.2" js-tokens "^4.0.0" +"@babel/highlight@^7.8.3": + version "7.9.0" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.9.0.tgz#4e9b45ccb82b79607271b2979ad82c7b68163079" + integrity sha512-lJZPilxX7Op3Nv/2cvFdnlepPXDxi29wxteT57Q965oc5R9v86ztx0jfxVrTcBk8C2kcPkkDa2Z4T3ZsPPVWsQ== + dependencies: + "@babel/helper-validator-identifier" "^7.9.0" + chalk "^2.0.0" + js-tokens "^4.0.0" + "@babel/parser@^7.0.0", "@babel/parser@^7.1.0", "@babel/parser@^7.4.3", "@babel/parser@^7.6.0", "@babel/parser@^7.6.3", "@babel/parser@^7.6.4": version "7.6.4" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.6.4.tgz#cb9b36a7482110282d5cb6dd424ec9262b473d81" integrity sha512-D8RHPW5qd0Vbyo3qb+YjO5nvUVRTXFLQ/FsDxJU2Nqz4uB5EnUN0ZQSEYpvTIbRuttig1XbHWU5oMeQwQSAA+A== +"@babel/parser@^7.8.6", "@babel/parser@^7.9.0": + version "7.9.4" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.9.4.tgz#68a35e6b0319bbc014465be43828300113f2f2e8" + integrity sha512-bC49otXX6N0/VYhgOMh4gnP26E9xnDZK3TmbNpxYzzz9BQLBosQwfyOe9/cXUU3txYhTzLCbcqd5c8y/OmCjHA== + "@babel/plugin-proposal-async-generator-functions@^7.2.0": version "7.2.0" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.2.0.tgz#b289b306669dce4ad20b0252889a15768c9d417e" @@ -1045,6 +1104,15 @@ "@babel/parser" "^7.6.0" "@babel/types" "^7.6.0" +"@babel/template@^7.8.3": + version "7.8.6" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.8.6.tgz#86b22af15f828dfb086474f964dcc3e39c43ce2b" + integrity sha512-zbMsPMy/v0PWFZEhQJ66bqjhH+z0JgMoBWuikXybgG3Gkd/3t5oQ1Rw2WQhnSrsOmsKXnZOx15tkC4qON/+JPg== + dependencies: + "@babel/code-frame" "^7.8.3" + "@babel/parser" "^7.8.6" + "@babel/types" "^7.8.6" + "@babel/traverse@^7.0.0", "@babel/traverse@^7.1.0", "@babel/traverse@^7.4.3", "@babel/traverse@^7.4.4", "@babel/traverse@^7.5.5", "@babel/traverse@^7.6.0", "@babel/traverse@^7.6.2", "@babel/traverse@^7.6.3": version "7.6.3" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.6.3.tgz#66d7dba146b086703c0fb10dd588b7364cec47f9" @@ -1060,6 +1128,21 @@ globals "^11.1.0" lodash "^4.17.13" +"@babel/traverse@^7.4.5": + version "7.9.5" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.9.5.tgz#6e7c56b44e2ac7011a948c21e283ddd9d9db97a2" + integrity sha512-c4gH3jsvSuGUezlP6rzSJ6jf8fYjLj3hsMZRx/nX0h+fmHN0w+ekubRrHPqnMec0meycA2nwCsJ7dC8IPem2FQ== + dependencies: + "@babel/code-frame" "^7.8.3" + "@babel/generator" "^7.9.5" + "@babel/helper-function-name" "^7.9.5" + "@babel/helper-split-export-declaration" "^7.8.3" + "@babel/parser" "^7.9.0" + "@babel/types" "^7.9.5" + debug "^4.1.0" + globals "^11.1.0" + lodash "^4.17.13" + "@babel/types@^7.0.0", "@babel/types@^7.2.0", "@babel/types@^7.3.0", "@babel/types@^7.4.0", "@babel/types@^7.4.4", "@babel/types@^7.5.5", "@babel/types@^7.6.0", "@babel/types@^7.6.3": version "7.6.3" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.6.3.tgz#3f07d96f854f98e2fbd45c64b0cb942d11e8ba09" @@ -1069,6 +1152,15 @@ lodash "^4.17.13" to-fast-properties "^2.0.0" +"@babel/types@^7.8.3", "@babel/types@^7.8.6", "@babel/types@^7.9.5": + version "7.9.5" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.9.5.tgz#89231f82915a8a566a703b3b20133f73da6b9444" + integrity sha512-XjnvNqenk818r5zMaba+sLQjnbda31UfUURv3ei0qPQw4u+j2jMyJ5b11y8ZHYTRSI3NnInQkkkRT4fLqqPdHg== + dependencies: + "@babel/helper-validator-identifier" "^7.9.5" + lodash "^4.17.13" + to-fast-properties "^2.0.0" + "@burner-wallet/assets@^1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@burner-wallet/assets/-/assets-1.0.0.tgz#fddd9ad7b4f3411c2a72bc838648b029f5aa7db2" @@ -1085,6 +1177,14 @@ isomorphic-fetch "^2.2.1" web3-utils "^1.2.2" +"@burner-wallet/assets@^1.1.10": + version "1.1.10" + resolved "https://registry.yarnpkg.com/@burner-wallet/assets/-/assets-1.1.10.tgz#2eb5b85ca5baf27aaddaf8240b459506bfba28a5" + integrity sha512-NU//Cy1IfiwrG5Sa/R3JiEYqGDemACyx2huod9ocppwfaCWMpSPIclJCvwKASEyE+uX1UJTRFeeUKEBZO6XWAQ== + dependencies: + isomorphic-fetch "^2.2.1" + web3-utils "^1.2.2" + "@burner-wallet/core@^1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@burner-wallet/core/-/core-1.0.0.tgz#caa15c34e9560e270ed5cffebd8c377789245e32" @@ -1095,7 +1195,7 @@ web3 "^1.2.2" web3-provider-engine "15.0.3" -"@burner-wallet/core@^1.0.3", "@burner-wallet/core@^1.1.7": +"@burner-wallet/core@^1.1.7": version "1.1.8" resolved "https://registry.yarnpkg.com/@burner-wallet/core/-/core-1.1.8.tgz#1f0688d7e56127d51f96aee55e74fdd9064260e2" integrity sha512-SQdTY1MUPs2jZrr66wSoFbuIx6TOmbir+No9IgwqFD+3ncoUCTYC19CdJVnnOwWiQh3gEw+VPxXyH+72guN62A== @@ -1105,27 +1205,39 @@ web3 "^1.2.2" web3-provider-engine "15.0.3" -"@burner-wallet/exchange@^1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@burner-wallet/exchange/-/exchange-1.0.0.tgz#a5a1ac11ff95d07965868095fa1a8dbe70200635" - integrity sha512-E3e3sxALyKXRhRUXQ4NuA9AM0oxJl/VijrkxzBA8gki2EC7620T0IuL4tveh4M+s6oSpL6ytQPgX+mZKErHE5g== +"@burner-wallet/core@^1.1.9": + version "1.1.9" + resolved "https://registry.yarnpkg.com/@burner-wallet/core/-/core-1.1.9.tgz#2543755a60bf61715bd20b8e12019ace88b8f9a6" + integrity sha512-KTuoPZL2Z5xg7E4iVY3/YIllO6QJLX1qYi+CaGRiEQcvcRMNT8hZFsFMQASPx6qZszPZUb6CxbhdQVJkPkWIbA== + dependencies: + "@burner-wallet/assets" "^1.1.0" + "@dmihal/tabookey-gasless" "^0.4.1" + web3 "^1.2.2" + web3-provider-engine "15.0.3" + +"@burner-wallet/exchange@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@burner-wallet/exchange/-/exchange-1.1.2.tgz#90d16606d42421bb6b5825b31ff12559dc62df62" + integrity sha512-ceEj0hvZV9/x1s2KqVOiRmmEGPS5EvrkyfRdxeNwm+34oOltNV6NKFYqYK2rtZ+yyhJqnSipJtbhpQpwQSxyoA== dependencies: "@burner-wallet/types" "^1.0.0" "@types/react" "*" + "@types/styled-components" "4.1.8" + styled-components "^5.0.1" -"@burner-wallet/metamask-plugin@^1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@burner-wallet/metamask-plugin/-/metamask-plugin-1.0.0.tgz#282cbc838cc31b0c097891ff8b468dc6ff7982bf" - integrity sha512-nj/Zha8ONAWEVdN0Epz88PSm9HsHqkuu2HdOUxVM//JrTHWv+S6oJYRFTYrOncN5kqsL5cVNfyeu0k1nbW8eYw== +"@burner-wallet/metamask-plugin@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@burner-wallet/metamask-plugin/-/metamask-plugin-1.0.1.tgz#52f86b30b663641070110393b0cdfce739cedd1c" + integrity sha512-vV5vwtBPb0mocBOd1UUzFhrh+8ezrEtRj2ggJnE/HOrZKOmvQn6wn/KpOfhxtzON7T6bu0wlzLbHY/3S97mS8w== dependencies: "@burner-wallet/types" "^1.0.0" "@types/react" "*" - styled-components "^4.4.0" + styled-components "^5.0.1" -"@burner-wallet/modern-ui@^1.0.5": - version "1.0.5" - resolved "https://registry.yarnpkg.com/@burner-wallet/modern-ui/-/modern-ui-1.0.5.tgz#9c19f2f313754cce94c66e9107e9b546a7a67f39" - integrity sha512-CefyGu3IQFebwGrf3epE5k7yjPtrdW+2EbCtYVZkc5nyKMrbAhshcqQW+FDdN80i13ton8q7YE9/3zQKICbvcw== +"@burner-wallet/modern-ui@^1.0.7": + version "1.0.7" + resolved "https://registry.yarnpkg.com/@burner-wallet/modern-ui/-/modern-ui-1.0.7.tgz#5ba6630844419e130c1ad8ea4f550a05685b58e8" + integrity sha512-yHI4O0cmZfqgB/82uS3BM0FtqNq7GUZgpyBNz0wMd6p/VrjzuaUGYA6lWndtoikaSBOVjE1dLUfwqV0Co+xO0Q== dependencies: "@burner-wallet/types" "^1.0.2" "@burner-wallet/ui-core" "^1.0.2" @@ -1138,10 +1250,11 @@ "@types/react-router-dom" "^4.3.4" "@types/styled-components" "4.1.8" clipboard "^2.0.4" + color "^3.1.2" ethereumjs-util "^6.1.0" qrcode.react "^0.9.3" react-qr-reader "^2.2.1" - styled-components "^4.4.0" + styled-components "^5.0.1" "@burner-wallet/types@^1.0.0": version "1.0.0" @@ -1154,7 +1267,7 @@ "@types/react-router-dom" "*" web3 "^1.2.2" -"@burner-wallet/types@^1.0.2", "@burner-wallet/types@^1.0.6": +"@burner-wallet/types@^1.0.2": version "1.0.6" resolved "https://registry.yarnpkg.com/@burner-wallet/types/-/types-1.0.6.tgz#44d24bd54ac3e172d61e01725b0ed012878ae0fb" integrity sha512-6g86fQdOVwB1anFrToSocxZqMyaROysTxeivvtPZW3lgShnvBcwfEjqlm9DdIlrCxPBmcQv3gUCCOumaudM8nA== @@ -1166,6 +1279,18 @@ i18next "^19.0.2" web3 "^1.2.2" +"@burner-wallet/types@^1.0.8": + version "1.0.8" + resolved "https://registry.yarnpkg.com/@burner-wallet/types/-/types-1.0.8.tgz#cd37196cd5fa93ffd0d3714a3a3a4ef133221659" + integrity sha512-UwGLVIxdQCZz+Vy8XUKfsQfWmn/Z6cA9E08B+oF+v3U9Lqcgw005agbxGTUmw6X9kXgtDQRWde5R3fo2Ze4CsQ== + dependencies: + "@burner-wallet/assets" "^1.0.0" + "@burner-wallet/core" "^1.0.0" + "@types/react" "*" + "@types/react-router-dom" "*" + i18next "^19.0.2" + web3 "^1.2.2" + "@burner-wallet/ui-core@^1.0.2": version "1.0.7" resolved "https://registry.yarnpkg.com/@burner-wallet/ui-core/-/ui-core-1.0.7.tgz#4277332d729a8197882c80e9266bb7732b6b9b54" @@ -1218,22 +1343,27 @@ web3-utils "^1.2.1" webpack-bundle-analyzer ">=3.3.2" -"@emotion/is-prop-valid@^0.8.1": - version "0.8.4" - resolved "https://registry.yarnpkg.com/@emotion/is-prop-valid/-/is-prop-valid-0.8.4.tgz#cf1dcfc1812c226f05e1ba53592eb6b51e734990" - integrity sha512-QBW8h6wVQgeQ55F52rNaprEJxtVR+/ScOP8/V1ScSpPzKqHdFB9QVqby0Z50sqS8mcaeIl5vR1vQpKwJbIS6NQ== +"@emotion/is-prop-valid@^0.8.8": + version "0.8.8" + resolved "https://registry.yarnpkg.com/@emotion/is-prop-valid/-/is-prop-valid-0.8.8.tgz#db28b1c4368a259b60a97311d6a952d4fd01ac1a" + integrity sha512-u5WtneEAr5IDG2Wv65yhunPSMLIpuKsbuOktRojfrEiEvRyC85LgPMZI63cr7NUqT8ZIGdSVg8ZKGxIug4lXcA== dependencies: - "@emotion/memoize" "0.7.3" + "@emotion/memoize" "0.7.4" -"@emotion/memoize@0.7.3": - version "0.7.3" - resolved "https://registry.yarnpkg.com/@emotion/memoize/-/memoize-0.7.3.tgz#5b6b1c11d6a6dddf1f2fc996f74cf3b219644d78" - integrity sha512-2Md9mH6mvo+ygq1trTeVp2uzAKwE2P7In0cRpD/M9Q70aH8L+rxMLbb3JCN2JoSWsV2O+DdFjfbbXoMoLBczow== - -"@emotion/unitless@^0.7.0": +"@emotion/memoize@0.7.4": version "0.7.4" - resolved "https://registry.yarnpkg.com/@emotion/unitless/-/unitless-0.7.4.tgz#a87b4b04e5ae14a88d48ebef15015f6b7d1f5677" - integrity sha512-kBa+cDHOR9jpRJ+kcGMsysrls0leukrm68DmFQoMIWQcXdr2cZvyvypWuGYT7U+9kAExUE7+T7r6G3C3A6L8MQ== + resolved "https://registry.yarnpkg.com/@emotion/memoize/-/memoize-0.7.4.tgz#19bf0f5af19149111c40d98bb0cf82119f5d9eeb" + integrity sha512-Ja/Vfqe3HpuzRsG1oBtWTHk2PGZ7GR+2Vz5iYGelAw8dx32K0y7PjVuxK6z1nMpZOqAFsRUPCkK1YjJ56qJlgw== + +"@emotion/stylis@^0.8.4": + version "0.8.5" + resolved "https://registry.yarnpkg.com/@emotion/stylis/-/stylis-0.8.5.tgz#deacb389bd6ee77d1e7fcaccce9e16c5c7e78e04" + integrity sha512-h6KtPihKFn3T9fuIrwvXXUOwlx3rfUvfZIcP5a6rh8Y7zjE3O06hT5Ss4S/YI1AYhuZ1kjaE/5EaOOI2NqSylQ== + +"@emotion/unitless@^0.7.4": + version "0.7.5" + resolved "https://registry.yarnpkg.com/@emotion/unitless/-/unitless-0.7.5.tgz#77211291c1900a700b8a78cfafda3160d76949ed" + integrity sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg== "@evocateur/libnpmaccess@^3.1.2": version "3.1.2" @@ -4290,7 +4420,7 @@ color-string@^1.5.2: color-name "^1.0.0" simple-swizzle "^0.2.2" -color@^3.0.0: +color@^3.0.0, color@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/color/-/color-3.1.2.tgz#68148e7f85d41ad7649c5fa8c8106f098d229e10" integrity sha512-vXTJhHebByxZn3lDvDJYw4lR5+uB3vuoHsuYA5AKuxRVn5wzzIfQKGLBmgdVRHKTJYeK5rvJcHnrd0Li49CFpg== @@ -4782,14 +4912,14 @@ css-select@^2.0.0: domutils "^1.7.0" nth-check "^1.0.2" -css-to-react-native@^2.2.2: - version "2.3.2" - resolved "https://registry.yarnpkg.com/css-to-react-native/-/css-to-react-native-2.3.2.tgz#e75e2f8f7aa385b4c3611c52b074b70a002f2e7d" - integrity sha512-VOFaeZA053BqvvvqIA8c9n0+9vFppVBAHCp6JgFTtTMU3Mzi+XnelJ9XC9ul3BqFzZyQ5N+H0SnwsWT2Ebchxw== +css-to-react-native@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/css-to-react-native/-/css-to-react-native-3.0.0.tgz#62dbe678072a824a689bcfee011fc96e02a7d756" + integrity sha512-Ro1yETZA813eoyUp2GDBhG2j+YggidUmzO1/v9eYBKR2EHVEniE2MI/NqpTQ954BMpTPZFsGNPm46qFB9dpaPQ== dependencies: camelize "^1.0.0" css-color-keywords "^1.0.0" - postcss-value-parser "^3.3.0" + postcss-value-parser "^4.0.2" css-tree@1.0.0-alpha.37: version "1.0.0-alpha.37" @@ -7429,6 +7559,13 @@ hmac-drbg@^1.0.0: minimalistic-assert "^1.0.0" minimalistic-crypto-utils "^1.0.1" +hoist-non-react-statics@^3.0.0: + version "3.3.2" + resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz#ece0acaf71d62c2969c2ec59feff42a4b1a85b45" + integrity sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw== + dependencies: + react-is "^16.7.0" + hoist-non-react-statics@^3.1.0: version "3.3.0" resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.0.tgz#b09178f0122184fb95acf525daaecb4d8f45958b" @@ -8260,11 +8397,6 @@ is-utf8@^0.2.0: resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" integrity sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI= -is-what@^3.3.1: - version "3.3.1" - resolved "https://registry.yarnpkg.com/is-what/-/is-what-3.3.1.tgz#79502181f40226e2d8c09226999db90ef7c1bcbe" - integrity sha512-seFn10yAXy+yJlTRO+8VfiafC+0QJanGLMPTBWLrJm/QPauuchy0UXh8B6H5o9VA8BAzk0iYievt6mNp6gfaqA== - is-windows@^1.0.0, is-windows@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" @@ -9547,11 +9679,6 @@ memdown@~3.0.0: ltgt "~2.2.0" safe-buffer "~5.1.1" -memoize-one@^5.0.0: - version "5.1.1" - resolved "https://registry.yarnpkg.com/memoize-one/-/memoize-one-5.1.1.tgz#047b6e3199b508eaec03504de71229b8eb1d75c0" - integrity sha512-HKeeBpWvqiVJD57ZUAsJNm71eHTykffzcLZVYWiVfQeI1rJtuEaS7hQiEpWfVVk18donPwJEcFKIkCmPJNOhHA== - memory-fs@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/memory-fs/-/memory-fs-0.4.1.tgz#3a9a20b8462523e447cfbc7e8bb80ed667bfc552" @@ -9599,13 +9726,6 @@ meow@^4.0.0: redent "^2.0.0" trim-newlines "^2.0.0" -merge-anything@^2.2.4: - version "2.4.1" - resolved "https://registry.yarnpkg.com/merge-anything/-/merge-anything-2.4.1.tgz#e9bccaec1e49ec6cb5f77ca78c5770d1a35315e6" - integrity sha512-dYOIAl9GFCJNctSIHWOj9OJtarCjsD16P8ObCl6oxrujAG+kOvlwJuOD9/O9iYZ9aTi1RGpGTG9q9etIvuUikQ== - dependencies: - is-what "^3.3.1" - merge-deep@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/merge-deep/-/merge-deep-3.0.2.tgz#f39fa100a4f1bd34ff29f7d2bf4508fbb8d83ad2" @@ -11737,7 +11857,7 @@ promzard@^0.3.0: dependencies: read "1" -prop-types@^15.5.4, prop-types@^15.6.0, prop-types@^15.6.2, prop-types@^15.7.2: +prop-types@^15.6.0, prop-types@^15.6.2, prop-types@^15.7.2: version "15.7.2" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5" integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ== @@ -13009,6 +13129,11 @@ shallow-clone@^3.0.0: dependencies: kind-of "^6.0.2" +shallowequal@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/shallowequal/-/shallowequal-1.1.0.tgz#188d521de95b9087404fd4dcb68b13df0ae4e7f8" + integrity sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ== + shebang-command@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" @@ -13600,23 +13725,20 @@ style-loader@1.0.0: loader-utils "^1.2.3" schema-utils "^2.0.1" -styled-components@^4.4.0: - version "4.4.1" - resolved "https://registry.yarnpkg.com/styled-components/-/styled-components-4.4.1.tgz#e0631e889f01db67df4de576fedaca463f05c2f2" - integrity sha512-RNqj14kYzw++6Sr38n7197xG33ipEOktGElty4I70IKzQF1jzaD1U4xQ+Ny/i03UUhHlC5NWEO+d8olRCDji6g== +styled-components@^5.0.1: + version "5.1.0" + resolved "https://registry.yarnpkg.com/styled-components/-/styled-components-5.1.0.tgz#2e3985b54f461027e1c91af3229e1c2530872a4e" + integrity sha512-0Qs2wEkFBXHFlysz6CV831VG6HedcrFUwChjnWylNivsx14MtmqQsohi21rMHZxzuTba063dEyoe/SR6VGJI7Q== dependencies: "@babel/helper-module-imports" "^7.0.0" - "@babel/traverse" "^7.0.0" - "@emotion/is-prop-valid" "^0.8.1" - "@emotion/unitless" "^0.7.0" + "@babel/traverse" "^7.4.5" + "@emotion/is-prop-valid" "^0.8.8" + "@emotion/stylis" "^0.8.4" + "@emotion/unitless" "^0.7.4" babel-plugin-styled-components ">= 1" - css-to-react-native "^2.2.2" - memoize-one "^5.0.0" - merge-anything "^2.2.4" - prop-types "^15.5.4" - react-is "^16.6.0" - stylis "^3.5.0" - stylis-rule-sheet "^0.0.10" + css-to-react-native "^3.0.0" + hoist-non-react-statics "^3.0.0" + shallowequal "^1.1.0" supports-color "^5.5.0" stylehacks@^4.0.0: @@ -13628,16 +13750,6 @@ stylehacks@^4.0.0: postcss "^7.0.0" postcss-selector-parser "^3.0.0" -stylis-rule-sheet@^0.0.10: - version "0.0.10" - resolved "https://registry.yarnpkg.com/stylis-rule-sheet/-/stylis-rule-sheet-0.0.10.tgz#44e64a2b076643f4b52e5ff71efc04d8c3c4a430" - integrity sha512-nTbZoaqoBnmK+ptANthb10ZRZOGC+EmTLLUxeYIuHNkEKcmKgXX1XWKkUBT2Ac4es3NybooPe0SmvKdhKJZAuw== - -stylis@^3.5.0: - version "3.5.4" - resolved "https://registry.yarnpkg.com/stylis/-/stylis-3.5.4.tgz#f665f25f5e299cf3d64654ab949a57c768b73fbe" - integrity sha512-8/3pSmthWM7lsPBKv7NXkzn2Uc9W7NotcwGNpJaa3k7WMM1XDCA4MgT5k/8BIexd5ydZdboXtU90XH9Ec4Bv/Q== - supports-color@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" From 107f984f75aa68213be65116f186e567d1825b5d Mon Sep 17 00:00:00 2001 From: Gerardo Nardelli Date: Thu, 23 Apr 2020 15:37:24 -0300 Subject: [PATCH 7/8] Define mediator pair and assets --- my-plugin/src/assets/Etc.ts | 8 -------- my-plugin/src/assets/Wetc.ts | 8 -------- my-plugin/src/assets/ksPOA.ts | 8 ++++++++ my-plugin/src/assets/sPOA.ts | 7 +++++++ my-plugin/src/gateways/EtcGateway.ts | 7 ------- my-plugin/src/index.ts | 9 +++------ my-plugin/src/pairs/KSPOABridge.ts | 12 ++++++++++++ my-plugin/src/pairs/WETCBridge.ts | 12 ------------ wallet/src/index.tsx | 27 +++------------------------ 9 files changed, 33 insertions(+), 65 deletions(-) delete mode 100644 my-plugin/src/assets/Etc.ts delete mode 100644 my-plugin/src/assets/Wetc.ts create mode 100644 my-plugin/src/assets/ksPOA.ts create mode 100644 my-plugin/src/assets/sPOA.ts delete mode 100644 my-plugin/src/gateways/EtcGateway.ts create mode 100644 my-plugin/src/pairs/KSPOABridge.ts delete mode 100644 my-plugin/src/pairs/WETCBridge.ts diff --git a/my-plugin/src/assets/Etc.ts b/my-plugin/src/assets/Etc.ts deleted file mode 100644 index f9e79e0..0000000 --- a/my-plugin/src/assets/Etc.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { NativeAsset } from '@burner-wallet/assets' - -export default new NativeAsset({ - id: 'etc', - name: 'ETC', - network: '61', - icon: 'https://user-images.githubusercontent.com/4614574/77648741-666cf800-6f47-11ea-8cb4-01b9db00c264.png' -}) diff --git a/my-plugin/src/assets/Wetc.ts b/my-plugin/src/assets/Wetc.ts deleted file mode 100644 index 3faf0f5..0000000 --- a/my-plugin/src/assets/Wetc.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { default as ERC677Asset } from './ERC677Asset' - -export default new ERC677Asset({ - id: 'wetc', - name: 'WETC', - network: '1', - address: '0x86aabcc646f290b9fc9bd05ce17c3858d1511da1' -}) diff --git a/my-plugin/src/assets/ksPOA.ts b/my-plugin/src/assets/ksPOA.ts new file mode 100644 index 0000000..87e83b3 --- /dev/null +++ b/my-plugin/src/assets/ksPOA.ts @@ -0,0 +1,8 @@ +import { default as ERC677Asset } from './ERC677Asset' + +export default new ERC677Asset({ + id: 'kspoa', + name: 'ksPOA', + network: '42', + address: '0xff94183659f549D6273349696d73686Ee1d2AC83' +}) diff --git a/my-plugin/src/assets/sPOA.ts b/my-plugin/src/assets/sPOA.ts new file mode 100644 index 0000000..98f2caf --- /dev/null +++ b/my-plugin/src/assets/sPOA.ts @@ -0,0 +1,7 @@ +import { NativeAsset } from '@burner-wallet/assets' + +export default new NativeAsset({ + id: 'spoa', + name: 'sPOA', + network: '77' +}) diff --git a/my-plugin/src/gateways/EtcGateway.ts b/my-plugin/src/gateways/EtcGateway.ts deleted file mode 100644 index 27ad678..0000000 --- a/my-plugin/src/gateways/EtcGateway.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { HTTPGateway } from '@burner-wallet/core/gateways' - -export default class EtcGateway extends HTTPGateway { - constructor() { - super('https://www.ethercluster.com/etc', '61') - } -} diff --git a/my-plugin/src/index.ts b/my-plugin/src/index.ts index 809c896..46bee61 100644 --- a/my-plugin/src/index.ts +++ b/my-plugin/src/index.ts @@ -1,6 +1,3 @@ -export { default as Etc } from './assets/Etc' -export { default as Wetc } from './assets/Wetc' -export { default as ERC677Asset } from './assets/ERC677Asset' -export { default as EtcGateway } from './gateways/EtcGateway' -export { default as WETCBridge } from './pairs/WETCBridge' -export { default as Bridge } from './pairs/Bridge' +export { default as sPOA } from './assets/sPOA' +export { default as ksPOA } from './assets/ksPOA' +export { default as KSPOABridge } from './pairs/KSPOABridge' diff --git a/my-plugin/src/pairs/KSPOABridge.ts b/my-plugin/src/pairs/KSPOABridge.ts new file mode 100644 index 0000000..381666f --- /dev/null +++ b/my-plugin/src/pairs/KSPOABridge.ts @@ -0,0 +1,12 @@ +import Bridge from './Bridge' + +export default class KSPOABridge extends Bridge { + constructor() { + super({ + assetA: 'spoa', + assetABridge: '0x867949C3F2f66D827Ed40847FaA7B3a369370e13', + assetB: 'kspoa', + assetBBridge: '0x99FB1a25caeB9c3a5Bf132686E2fe5e27BC0e2dd' + }) + } +} diff --git a/my-plugin/src/pairs/WETCBridge.ts b/my-plugin/src/pairs/WETCBridge.ts deleted file mode 100644 index 80a330e..0000000 --- a/my-plugin/src/pairs/WETCBridge.ts +++ /dev/null @@ -1,12 +0,0 @@ -import Bridge from './Bridge' - -export default class WETCBridge extends Bridge { - constructor() { - super({ - assetA: 'etc', - assetABridge: '0x073081832B4Ecdce79d4D6753565c85Ba4b3BeA9', - assetB: 'wetc', - assetBBridge: '0x0cB781EE62F815bdD9CD4c2210aE8600d43e7040' - }) - } -} diff --git a/wallet/src/index.tsx b/wallet/src/index.tsx index 09e3c42..26be7fe 100644 --- a/wallet/src/index.tsx +++ b/wallet/src/index.tsx @@ -1,12 +1,11 @@ import React from 'react' import ReactDOM from 'react-dom' -import { NativeAsset, ERC20Asset } from '@burner-wallet/assets' import BurnerCore from '@burner-wallet/core' import { InjectedSigner, LocalSigner } from '@burner-wallet/core/signers' import { HTTPGateway, InfuraGateway, InjectedGateway } from '@burner-wallet/core/gateways' import ModernUI from '@burner-wallet/modern-ui' import Exchange from '@burner-wallet/exchange' -import { Bridge } from 'my-plugin' +import { sPOA, ksPOA, KSPOABridge } from 'my-plugin' import MetamaskPlugin from '@burner-wallet/metamask-plugin' const core = new BurnerCore({ @@ -16,31 +15,11 @@ const core = new BurnerCore({ new HTTPGateway('https://sokol.poa.network', '77'), new InfuraGateway(process.env.REACT_APP_INFURA_KEY) ], - assets: [ - new ERC20Asset({ - id: 'kspoa', - name: 'KsPoa', - network: '42', - // @ts-ignore - address: '0xff94183659f549D6273349696d73686Ee1d2AC83' - }), - new NativeAsset({ - id: 'spoa', - name: 'sPoa', - network: '77' - }) - ] + assets: [sPOA, ksPOA] }) const exchange = new Exchange({ - pairs: [ - new Bridge({ - assetA: 'spoa', - assetABridge: '0x867949C3F2f66D827Ed40847FaA7B3a369370e13', - assetB: 'kspoa', - assetBBridge: '0x99FB1a25caeB9c3a5Bf132686E2fe5e27BC0e2dd' - }) - ] + pairs: [new KSPOABridge()] }) const BurnerWallet = () => From c02fc62ee86508b315b5b34dbbd1860e276612e5 Mon Sep 17 00:00:00 2001 From: Gerardo Nardelli Date: Fri, 24 Apr 2020 10:52:44 -0300 Subject: [PATCH 8/8] Add sUSD assets --- README.md | 72 +++++++++++++++++++----------- my-plugin/src/assets/ksPOA.ts | 8 ---- my-plugin/src/assets/sPOA.ts | 7 --- my-plugin/src/assets/sUSD.ts | 8 ++++ my-plugin/src/assets/xsUSD.ts | 8 ++++ my-plugin/src/index.ts | 6 +-- my-plugin/src/pairs/KSPOABridge.ts | 12 ----- my-plugin/src/pairs/SUSDBridge.ts | 13 ++++++ wallet/src/index.tsx | 16 +++---- 9 files changed, 85 insertions(+), 65 deletions(-) delete mode 100644 my-plugin/src/assets/ksPOA.ts delete mode 100644 my-plugin/src/assets/sPOA.ts create mode 100644 my-plugin/src/assets/sUSD.ts create mode 100644 my-plugin/src/assets/xsUSD.ts delete mode 100644 my-plugin/src/pairs/KSPOABridge.ts create mode 100644 my-plugin/src/pairs/SUSDBridge.ts diff --git a/README.md b/README.md index 0f9d471..46908d4 100644 --- a/README.md +++ b/README.md @@ -1,36 +1,58 @@ -# TokenBridge Burner Wallet 2 Plugin +# TokenBridge Burner Wallet 2 Plugin Sample -This plugin defines a Bridge trading pair to be used in the Exchange Plugin. +This sample plugin defines a mediator extension exchange pair to be used in the Exchange Plugin in the burner wallet. +It uses the resources from the `tokenbridge-plugin` package to define new assets and exchange pairs. -Bridge trading pairs supported: -* ETC - WETC Bridge +### Clone the sample repo +Clone the sample repo to create a plugin project that uses the TokenBridge plugin. This sample repo containes a ready to publish plugin for a ERC677 to ERC677 bridge extension, but you can later modify it to define your own resources. -### Usage +#### Project structure +There are two main folders in the project: +- `wallet` - is a burner wallet instance ready to test your plugin +- `my-plugin` - is the folder where the plugin code is located. To change the name of the plugin it is necessary to update the folder name `my-plugin` and all mentions to `my-plugin` to the new name of your plugin. -```javascript -import { Etc, Wetc, EtcGateway, WETCBridge } from 'my-plugin' +Inside `my-plugin` you can find the files that defines the resources to be exposed by the plugin to be used by the burner wallet in order to interact with the ERC677 to ERC677 bridge extension: +- `sUSD` - extends from `ERC677Asset` defined in `tokenbridge-plugin` +- `xsUSD` - extends from `ERC677Asset` defined in `tokenbridge-plugin` +- `SUSDBridge` - extends from `Mediator` defined in `tokenbridge-plugin` -const core = new BurnerCore({ - ... - gateways: [new EtcGateway(), new InfuraGateway(process.env.REACT_APP_INFURA_KEY)], - assets: [Etc, Wetc] -}) +You can extend or replace these resources based on your use case. -const exchange = new Exchange({ - pairs: [new WETCBridge()] -}) +### Install dependencies +Run `yarn install`. This repo uses Lerna and Yarn Workspaces, so `yarn install` will install all dependencies and link modules in the repo. + +### Build +To build the plugin package, from the root folder of project, you need to run the following command: +``` +yarn build ``` +### Test +The project includes a burner wallet instance where you can test the implementation of the plugin. For that, you have to make sure that the build step was performed and that the plugin resources you modified are correctly imported and used in the `src/index.tsx` file of the `wallet` folder. -### Setup -1. Clone the repo -2. Run `yarn install`. This repo uses Lerna and Yarn Workspaces, so `yarn install` will install - all dependencies and link modules in the repo -3. Run `yarn build` +1. Create `.env` file in `wallet` folder and set: +``` +REACT_APP_INFURA_KEY= +``` -### Run Burner Wallet with the plugin in Sokol & Kovan -1. Create `.env` file in `wallet` folder and set `REACT_APP_INFURA_KEY=`. -Also, a private key can be set to start the wallet with the specified account `REACT_APP_PK=0x...` -2. Run `yarn start-wallet` to start the wallet connected to Sokol & Kovan and interact with a test bridge sPoa - sPoa20 -that works on top of the AMB bridge. +2. To start the burner wallet instances run: +``` +yarn start-wallet +``` +### Publish to npm +In order to make the plugin accessible it needs to be published in the npm registry. For that, you can follow these steps: + +1. Create account in https://www.npmjs.com/ + +2. Go to `my-plugin` folder + +3. Run `yarn build`. Make sure it generates the `dist` folder + +4. Update `version` in `my-plugin/package.json` + +5. Run `yarn publish` and fill login information if required. +The prompt will ask for the new version, complete it with the version from `my-plugin/package.json` + + +More information in https://classic.yarnpkg.com/en/docs/publishing-a-package/ diff --git a/my-plugin/src/assets/ksPOA.ts b/my-plugin/src/assets/ksPOA.ts deleted file mode 100644 index 87e83b3..0000000 --- a/my-plugin/src/assets/ksPOA.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { default as ERC677Asset } from './ERC677Asset' - -export default new ERC677Asset({ - id: 'kspoa', - name: 'ksPOA', - network: '42', - address: '0xff94183659f549D6273349696d73686Ee1d2AC83' -}) diff --git a/my-plugin/src/assets/sPOA.ts b/my-plugin/src/assets/sPOA.ts deleted file mode 100644 index 98f2caf..0000000 --- a/my-plugin/src/assets/sPOA.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { NativeAsset } from '@burner-wallet/assets' - -export default new NativeAsset({ - id: 'spoa', - name: 'sPOA', - network: '77' -}) diff --git a/my-plugin/src/assets/sUSD.ts b/my-plugin/src/assets/sUSD.ts new file mode 100644 index 0000000..7fa77a9 --- /dev/null +++ b/my-plugin/src/assets/sUSD.ts @@ -0,0 +1,8 @@ +import { default as ERC677Asset } from './ERC677Asset' + +export default new ERC677Asset({ + id: 'susd', + name: 'sUSD', + network: '1', + address: '0x57Ab1E02fEE23774580C119740129eAC7081e9D3' +}) diff --git a/my-plugin/src/assets/xsUSD.ts b/my-plugin/src/assets/xsUSD.ts new file mode 100644 index 0000000..c9d0ab3 --- /dev/null +++ b/my-plugin/src/assets/xsUSD.ts @@ -0,0 +1,8 @@ +import { default as ERC677Asset } from './ERC677Asset' + +export default new ERC677Asset({ + id: 'xsusd', + name: 'xsUSD', + network: '100', + address: '0x4C36d2919e407f0Cc2Ee3c993ccF8ac26d9CE64e' +}) diff --git a/my-plugin/src/index.ts b/my-plugin/src/index.ts index 46bee61..8586c2a 100644 --- a/my-plugin/src/index.ts +++ b/my-plugin/src/index.ts @@ -1,3 +1,3 @@ -export { default as sPOA } from './assets/sPOA' -export { default as ksPOA } from './assets/ksPOA' -export { default as KSPOABridge } from './pairs/KSPOABridge' +export { default as xsUSD } from './assets/xsUSD' +export { default as sUSD } from './assets/sUSD' +export { default as SUSDBridge } from './pairs/SUSDBridge' diff --git a/my-plugin/src/pairs/KSPOABridge.ts b/my-plugin/src/pairs/KSPOABridge.ts deleted file mode 100644 index 381666f..0000000 --- a/my-plugin/src/pairs/KSPOABridge.ts +++ /dev/null @@ -1,12 +0,0 @@ -import Bridge from './Bridge' - -export default class KSPOABridge extends Bridge { - constructor() { - super({ - assetA: 'spoa', - assetABridge: '0x867949C3F2f66D827Ed40847FaA7B3a369370e13', - assetB: 'kspoa', - assetBBridge: '0x99FB1a25caeB9c3a5Bf132686E2fe5e27BC0e2dd' - }) - } -} diff --git a/my-plugin/src/pairs/SUSDBridge.ts b/my-plugin/src/pairs/SUSDBridge.ts new file mode 100644 index 0000000..106eb77 --- /dev/null +++ b/my-plugin/src/pairs/SUSDBridge.ts @@ -0,0 +1,13 @@ +import Bridge from './Bridge' +import { sUSD, xsUSD } from '../index' + +export default class SUSDBridge extends Bridge { + constructor() { + super({ + assetA: xsUSD.id, + assetABridge: '0xD9a3039cfC70aF84AC9E566A2526fD3b683B995B', + assetB: sUSD.id, + assetBBridge: '0x71F12d03E1711cb96E11E1A5c12Da7466699Db8D' + }) + } +} diff --git a/wallet/src/index.tsx b/wallet/src/index.tsx index 26be7fe..ac7d214 100644 --- a/wallet/src/index.tsx +++ b/wallet/src/index.tsx @@ -2,26 +2,22 @@ import React from 'react' import ReactDOM from 'react-dom' import BurnerCore from '@burner-wallet/core' import { InjectedSigner, LocalSigner } from '@burner-wallet/core/signers' -import { HTTPGateway, InfuraGateway, InjectedGateway } from '@burner-wallet/core/gateways' +import { XDaiGateway, InfuraGateway, InjectedGateway } from '@burner-wallet/core/gateways' import ModernUI from '@burner-wallet/modern-ui' import Exchange from '@burner-wallet/exchange' -import { sPOA, ksPOA, KSPOABridge } from 'my-plugin' import MetamaskPlugin from '@burner-wallet/metamask-plugin' +import { sUSD, xsUSD, SUSDBridge } from 'my-plugin' const core = new BurnerCore({ signers: [new InjectedSigner(), new LocalSigner({ privateKey: process.env.REACT_APP_PK, saveKey: false })], - gateways: [ - new InjectedGateway(), - new HTTPGateway('https://sokol.poa.network', '77'), - new InfuraGateway(process.env.REACT_APP_INFURA_KEY) - ], - assets: [sPOA, ksPOA] + gateways: [new InjectedGateway(), new XDaiGateway(), new InfuraGateway(process.env.REACT_APP_INFURA_KEY)], + assets: [sUSD, xsUSD] }) const exchange = new Exchange({ - pairs: [new KSPOABridge()] + pairs: [new SUSDBridge()] }) -const BurnerWallet = () => +const BurnerWallet = () => ReactDOM.render(, document.getElementById('root'))