Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
# Package managers:
node_modules/
npm-debug.log
package-lock.json
yarn-error.log

# Editors:
Expand Down
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
legacy-peer-deps=true
ignore-scripts=true
1 change: 0 additions & 1 deletion .yarnrc

This file was deleted.

15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Please see [index.js](./src/index.js) for the list of plugins in this repo. Thes
Fist, add this library to your project:

```sh
yarn add edge-exchange-plugins
npm install edge-exchange-plugins
```

### Node.js
Expand Down Expand Up @@ -42,7 +42,7 @@ The bundle located in `dist/edge-exchange-plugins.js` will automatically registe
<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,
If you want to debug this project, run `npm run start` to start a Webpack server,
and then adjust your script URL to http://localhost:8083/edge-exchange-plugins.js.

### React Native
Expand All @@ -58,7 +58,7 @@ import { pluginUri } from 'edge-exchange-plugins'
/>
```

To debug this project, run `yarn start` to start a Webpack server, and then use `debugUri` instead of `pluginUri`.
To debug this project, run `npm run start` to start a Webpack server, and then use `debugUri` instead of `pluginUri`.

## edge-react-gui

Expand All @@ -71,16 +71,15 @@ To test your exchange plugin, build the full application at [`edge-react-gui`](h
Clone this repo as a peer in the same directory as `edge-react-gui`. Then run

```sh
yarn
yarn prepare
npm run npm install prepare
```

From within the `edge-react-gui`

```sh
yarn updot edge-exchange-plugins
yarn prepare
yarn prepare.ios # For iPhone development
npm run updot edge-exchange-plugins
npm run prepare
npm run 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.
Expand Down
2 changes: 1 addition & 1 deletion convert.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ for x in $(find src test -name '*.js' | grep -v index.flow.js); do
rm $x
done

(cd ../../; yarn fix)
(cd ../../; npm run fix)
git add src
git rm convert.sh
git commit -m "x (cd packages/edge-login-ui-rn; ./convert.sh)" --no-verify
14 changes: 7 additions & 7 deletions docs/CHAIN_MAPPING_SYNCHRONIZERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export const makeYourPluginSynchronizer = (
mappingFilePath: getMappingFilePath(NAME),

// Fetches all supported chain codes from your provider's API.
// Called by `yarn mapctl sync-providers yourplugin`.
// Called by `npm run mapctl sync-providers yourplugin`.
async fetchChainCodes(): Promise<FetchChainCodeResult[]> {
const response = await fetch(YOURPLUGIN_API_URL, {
headers: {
Expand Down Expand Up @@ -144,7 +144,7 @@ Then add your key to `mapctlConfig.json` (not committed to git):
Fetch the latest chain data from your provider's API and create/update the source mapping:

```bash
yarn mapctl sync-providers yourplugin
npm run mapctl sync-providers yourplugin
```

This creates `scripts/mappings/yourpluginMappings.ts` (or updates it if it exists). The generated file looks like:
Expand All @@ -170,7 +170,7 @@ yourplugin.set('NEWCHAIN', null) // <-- New chains default to null
After updating source mappings, regenerate the inverted runtime mappings:

```bash
yarn mapctl update-mappings
npm run mapctl update-mappings
```

This generates `src/mappings/yourplugin.ts` which maps Edge plugin IDs → provider chain codes.
Expand All @@ -180,7 +180,7 @@ This generates `src/mappings/yourplugin.ts` which maps Edge plugin IDs → provi
When Edge adds support for a new blockchain:

```bash
yarn mapctl add-plugin mynewchain
npm run mapctl add-plugin mynewchain
```

This adds the plugin ID to `edgeCurrencyPluginIds.ts` and updates all generated mapping files in `src/mappings/` with `null` for the new plugin ID.
Expand Down Expand Up @@ -212,11 +212,11 @@ for each provider that supports this network.
To update mappings:
1. Edit scripts/mappings/<provider>Mappings.ts
2. Add mappings for provider chain codes that correspond to this plugin ID
3. Run: yarn mapctl update-mappings
3. Run: npm run mapctl update-mappings
======================================================================
```

Review the suggestions and update each provider's source mapping file (`scripts/mappings/<provider>Mappings.ts`) to map the matching chain codes to the new plugin ID, then run `yarn mapctl update-mappings` to regenerate the runtime mappings.
Review the suggestions and update each provider's source mapping file (`scripts/mappings/<provider>Mappings.ts`) to map the matching chain codes to the new plugin ID, then run `npm run mapctl update-mappings` to regenerate the runtime mappings.

## SwapSynchronizer Interface

Expand Down Expand Up @@ -260,5 +260,5 @@ See existing synchronizers for reference implementations:

**Missing chains after sync**: New chains are added with `null` values. Edit the source mapping to add the Edge plugin ID mapping.

**Runtime mapping not updated**: Run `yarn mapctl update-mappings` after editing source mappings
**Runtime mapping not updated**: Run `npm run mapctl update-mappings` after editing source mappings

6 changes: 3 additions & 3 deletions docs/CREATING_AN_EXCHANGE_PLUGIN.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ This guide walks you through creating a new exchange plugin for Edge. **Before s
### Development Environment

1. Clone `edge-exchange-plugins` as a peer to `edge-react-gui`
2. Install: `yarn && yarn prepare`
2. Install: `npm install && npm run prepare`
3. Review `src/swap/central/template.ts` as a complete example

## Plugin Types
Expand Down Expand Up @@ -256,8 +256,8 @@ Follow Edge conventions:

### Testing

1. Build: `yarn prepare`
2. In `edge-react-gui`: `yarn updot edge-exchange-plugins && yarn prepare`
1. Build: `npm run prepare`
2. In `edge-react-gui`: `npm run updot edge-exchange-plugins && npm run prepare`
3. Enable in `edge-react-gui/env.json`:
```json
{
Expand Down
Loading
Loading