From d7ea8e3aff5a2b174d42c4a2e5009fe9a97a7adb Mon Sep 17 00:00:00 2001 From: Aleksandr Kraiz Date: Thu, 21 Apr 2022 20:41:39 +0400 Subject: [PATCH] README update --- README.md | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index d152e36..87c1f6c 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,10 @@ # Orion Protocol SDK -## Install - -Before install SDK you need create Personal Access Token. - -1. Create PAT [here](https://github.com/settings/tokens): - 1. type any name (for example `READ_PACKAGES`) - 2. select scope `read:packages`) -2. At your machine go to `~` (your home directory, **not project!**) -3. Create or modify `.npmrc` file with content: +# Install +```console +npm i @orionprotocol/sdk ``` -//npm.pkg.github.com/:_authToken=YOUR_PAT -@orionprotocol:registry=https://npm.pkg.github.com/ -``` - -4. Save `.npmrc` file -5. Now you can install `@orionprotocol/sdk` as dependency in your package # Usage @@ -162,18 +150,17 @@ orionUnit.orionAggregator.ws.subscribe( services.orionAggregator.ws.SubscriptionType.SWAP_SUBSCRIBE, { payload: { - d: swapRequestId, + d: swapRequestId, // generated by client i: assetIn, // asset in o: assetOut, // asset out e: true, // true when type of swap is exactSpend, can be omitted (true bu default) - a: 5.62345343, + a: 5.62345343, // amount }, // Handle data update in your way callback: (swapInfo) => { switch (swapInfo.kind) { case "exactSpend": console.log(swapInfo.availableAmountOut); - break; case "exactReceive": console.log(swapInfo.availableAmountOut);