Update docs for plugin version 1.1.0 (#6)

This commit is contained in:
Kirill Fedoseev 2020-07-10 04:47:10 +07:00 committed by GitHub
parent 64536d9afa
commit 71e816b401
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 18 additions and 8 deletions

View File

@ -61,9 +61,11 @@ Exchange pairs examples:
#### TokenBridge Plugin
The [TokenBridge Burner Wallet 2 Plugin](https://github.com/poanetwork/tokenbridge/tree/develop/burner-wallet-plugin/tokenbridge-bw-exchange) provides some generic resources that can be used and extended:
- `ERC677Asset` - A representation of an Erc677 token
- `BridgeableERC20Asset` - A representation of an Erc20 token with a possibility of bridging it through token bridges.
- `NativeMediatorAsset` - Represents a native token that interacts with a Mediator extension.
- `Mediator` Pair - Represents an Exchange Pair that interacts with mediators extensions.
- `TokenBridgeGateway` - A gateway to operate with ETC, POA Sokol and POA Core networks.
- `MediatorErcToNative Pair` - Represents a modified Mediator Pair that interacts with a tokenbridge erc-to-native mediators contracts.
- `TokenBridgeGateway` - A gateway to operate with ETC, POA Sokol, POA Core and qDAI networks.
The asset `ERC677Asset` extends from `ERC20Asset` and overrides some methods:
@ -72,6 +74,10 @@ The asset `ERC677Asset` extends from `ERC20Asset` and overrides some methods:
- `getTx`: Overrides the logic to return the stored information about a transfer transaction to avoid errors on the information displayed.
The asset `BridgeableERC20Asset` extends from `ERC20Asset` and overrides some methods:
- `_send`: If the asset detects that receiver is a bridge/mediator contract and it has on of the supported bridge modes, the tokens are sent using `approve()` + `relayTokens`, otherwise, regular ERC20 `transfer()` is used.
The asset `NativeMediatorAsset` extends from the `NativeAsset` of the burner wallet core. It extends the functionality with the following method:
- `scanMediatorEvents`: Add logic to watch transfer from mediator contracts to the wallet account to display it in the activity list.
- `getTx`: Overrides the logic to return the stored information about a transfer transaction to avoid errors on the information displayed.
@ -87,10 +93,14 @@ Here are some details of the implemented methods:
- `detectExchangeBToAFinished`: Wait for events emitted by the mediator contract to detect the exchange finalization.
The pair `MediatorErcToNative` extend from `Mediator` as base. It overrides `estimateAtoB` and `estimateBtoA` to use a different manner of retrieving bridging fees that are specific for erc-to-native mediator.
The gateway `TokenBridgeGateway` extends from the `Gateway` class of the burner wallet core. It provides access from the wallet to the following networks:
- ETC
- POA Sokol
- POA Core
- qDAI
### Project structure
There are three main folders in the project:

View File

@ -11,7 +11,7 @@
},
"dependencies": {
"@burner-wallet/exchange": "^1.1.4",
"@poanet/tokenbridge-bw-exchange": "^0.0.3"
"@poanet/tokenbridge-bw-exchange": "^1.1.0"
},
"devDependencies": {
"typescript": "^3.5.2"

View File

@ -8,7 +8,7 @@
"@burner-wallet/exchange": "^1.1.4",
"@burner-wallet/metamask-plugin": "^1.0.1",
"@burner-wallet/modern-ui": "^1.0.7",
"@poanet/tokenbridge-bw-exchange": "^0.0.3",
"@poanet/tokenbridge-bw-exchange": "^1.1.0",
"@types/node": "12.0.4",
"@types/react": "16.8.19",
"@types/react-dom": "16.8.4",

View File

@ -8,7 +8,7 @@
"@burner-wallet/exchange": "^1.1.4",
"@burner-wallet/metamask-plugin": "^1.0.1",
"@burner-wallet/modern-ui": "^1.0.7",
"@poanet/tokenbridge-bw-exchange": "^0.0.3",
"@poanet/tokenbridge-bw-exchange": "^1.1.0",
"@types/node": "12.0.4",
"@types/react": "16.8.19",
"@types/react-dom": "16.8.4",

View File

@ -2358,10 +2358,10 @@
dependencies:
"@types/node" "^12.11.1"
"@poanet/tokenbridge-bw-exchange@^0.0.3":
version "0.0.3"
resolved "https://registry.yarnpkg.com/@poanet/tokenbridge-bw-exchange/-/tokenbridge-bw-exchange-0.0.3.tgz#0c51569461f221094bdc31307704ddf6e5d4332b"
integrity sha512-MiqABRZXGGLqjM0loWrwsDcEFwxoK08QS9UTrkrfOE7FBUpsskdTCZe0778FX5dvabvESZeY203wildCE6ppsg==
"@poanet/tokenbridge-bw-exchange@^1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@poanet/tokenbridge-bw-exchange/-/tokenbridge-bw-exchange-1.1.0.tgz#d6bbb547da93a1a995f43f624522b198cf260a27"
integrity sha512-cJiTzUMjnfg8xoC3iKmQ6fcbvy0sl1IV1VnjCbb4/krwlmycrxWMktAMzB0DYCJO0rzS87lhvFf9hVMsrCbWBg==
dependencies:
"@burner-wallet/assets" "^1.1.10"
"@burner-wallet/core" "^1.1.9"