This library exports a collection of exchange-rate & swap plugins for use with edge-core-js
.
Please see index.js for the list of plugins in this repo. These are compatible with edge-core-js v0.19.37 or later.
Fist, add this library to your project:
yarn add edge-exchange-plugins
For Node.js, you should call addEdgeCorePlugins
to register these plugins with edge-core-js:
const { addEdgeCorePlugins, lockEdgeCorePlugins } = require('edge-core-js')
const plugins = require('edge-exchange-plugins')
addEdgeCorePlugins(plugins)
// Once you are done adding plugins, call this:
lockEdgeCorePlugins()
You can also add plugins individually if you want to be more picky:
addEdgeCorePlugins({
thorchain: plugins.thorchain
})
The bundle located in dist/edge-exchange-plugins.js
will automatically register itself with edge-core-js. Just serve the entire dist
directory along with your app, and then load the script:
<script src='https://example.com/app/dist/edge-exchange-plugins.js'>
If you want to debug this project, run yarn start
to start a Webpack server,
and then adjust your script URL to http://localhost:8083/edge-exchange-plugins.js.
This package will automatically install itself using React Native autolinking. To integrate the plugins with edge-core-js, add its URI to the context component:
import { pluginUri } from 'edge-exchange-plugins'
<MakeEdgeContext
pluginUris={[pluginUri]}
// Plus other props as required...
/>
To debug this project, run yarn start
to start a Webpack server, and then use debugUri
instead of pluginUri
.
To enable in edge-react-gui please make sure that the appropriate truthy value (can be object) is included into env.json
, and that the new env.json
values are updated on the server building and delivering the app. Since env.json
is gitignored, plugins may be enabled on your local dev environment but will not be enabled for develop
or master
(release) builds until the env.json
on that build server is updated to include the new plugin.
To test your exchange plugin, build the full application at edge-react-gui
. Follow the README there for instructions on building and running the app.
Clone this repo as a peer in the same directory as edge-react-gui
. Then run
yarn
yarn prepare
From within the edge-react-gui
yarn updot edge-exchange-plugins
yarn prepare
yarn prepare.ios # For iPhone development
Make appropriate changes to edge-react-gui
to include your plugin. Search edge-react-gui
for the string changelly
and make similar changes for your plugin.
You can then rebuild the edge-react-gui
app and run and test the plugin. To do a swap with your plugin, go to Settings > Exchange Settings, then disable all other exchanges but yours. Then tap the bottom right Exchange
button and try to do a swap. You'll of course need funds in your Edge account.
Please be aware that when considering merging pull requests for additional exchanges we require the following:
- Accompanying PR submitted to
edge-reports
that fetches transaction data to your exchange that is credited to Edge users - Rebase of your branch upon this repo's
master
branch. For more info: https://github.com/edx/edx-platform/wiki/How-to-Rebase-a-Pull-Request - Accompanying PR submitted to
edge-react-gui
that includes (but is not limited to) the following:- Small 64x64 pixel square logos with a white background
- 600x210 pixel horizontal logo for your exchange, with no empty space around the logo (we will add this programatically within the app