Skip to content

Commit

Permalink
Merge pull request #24 from router-protocol/update/nitro-sdk
Browse files Browse the repository at this point in the history
update: sdk name
  • Loading branch information
abhisom2912 authored Apr 15, 2024
2 parents 2cebcad + 10e65ce commit eedb3d8
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,12 @@ await routerprotocol.initialize()

Change to -
```
import { Pathfinder, Env } from "@nitro/asset-transfer-js-sdk";
import { Pathfinder, Env } from "@routerprotocol/asset-transfer-sdk-ts";
const pathfinder = new Pathfinder(Env.Testnet, YOUR_WIDGET_ID);
```

Install new sdk with npm or yarn
`npm install @nitro/asset-transfer-js-sdk`
`npm install @routerprotocol/asset-transfer-sdk-ts`


2. Quote & Transaction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ const status = await pathfinder.getTransactionStatus(SRC_TXN_HASH);

Example has been provided below.
```jsx
import { Pathfinder, Network } from "@nitro/asset-transfer-js-sdk";
import { evmSignerFromPrivateKeyAndRpc } from "@nitro/asset-transfer-js-sdk/pathfinder/ChainClient/EvmChainClient";
import { PathFinder, Network } from "@routerprotocol/asset-transfer-sdk-ts";
import { evmSignerFromPrivateKeyAndRpc } from "@routerprotocol/asset-transfer-sdk-ts/pathfinder/ChainClient/EvmChainClient";

// initialize a Pathfinder instance
const YOUR_WIDGET_ID = 24; // get your unique sdk id by contacting us on Telegram
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ sidebar_position: 3
For executing the quote you need to have EvmSigner for evm chains, NearAccount for near and tronweb for Tron. You can create them using private keys rpc using the following functions or you can pass your own.

```jsx
import { evmSignerFromPrivateKeyAndRpc } from '@nitro/asset-transfer-js-sdk/pathfinder/ChainClient/EvmChainClient';
import { getTronWeb } from '@nitro/asset-transfer-js-sdk/pathfinder/ChainClient/TronChainClient';
import { nearSignerFromPrivateKey } from '@nitro/asset-transfer-js-sdk/pathfinder/ChainClient/NearChainClient';
import { evmSignerFromPrivateKeyAndRpc } from '@routerprotocol/asset-transfer-sdk-ts/pathfinder/ChainClient/EvmChainClient';
import { getTronWeb } from '@routerprotocol/asset-transfer-sdk-ts/pathfinder/ChainClient/TronChainClient';
import { nearSignerFromPrivateKey } from '@routerprotocol/asset-transfer-sdk-ts/pathfinder/ChainClient/NearChainClient';

const evmSigner = evmSignerFromPrivateKeyAndRpc(evmPrivateKey, EVM_RPC);
const tronSigner = getTronWeb(tronPrivateKey, TRON_RPC);
Expand All @@ -18,8 +18,8 @@ Below is how you can execute a transaction for various chain types.

### Standard EVM Chains
```jsx
import { Pathfinder, Network } from "@nitro/asset-transfer-js-sdk";
import { evmSignerFromPrivateKeyAndRpc } from "@nitro/asset-transfer-js-sdk/pathfinder/ChainClient/EvmChainClient";
import { PathFinder, Network } from "@routerprotocol/asset-transfer-sdk-ts";
import { evmSignerFromPrivateKeyAndRpc } from "@routerprotocol/asset-transfer-sdk-ts/pathfinder/ChainClient/EvmChainClient";

// initialize a Pathfinder instance
const YOUR_WIDGET_ID = 0; // get your unique sdk id by contacting us on Telegram
Expand Down Expand Up @@ -62,9 +62,9 @@ main();

### TRON
```jsx
import { Pathfinder, Network } from "@nitro/asset-transfer-js-sdk";
import { evmSignerFromPrivateKeyAndRpc } from "@nitro/asset-transfer-js-sdk/pathfinder/ChainClient/EvmChainClient";
import { getTronWeb } from "@nitro/asset-transfer-js-sdk/pathfinder/ChainClient/TronChainClient";
import { PathFinder, Network } from "@routerprotocol/asset-transfer-sdk-ts";
import { evmSignerFromPrivateKeyAndRpc } from "@routerprotocol/asset-transfer-sdk-ts/pathfinder/ChainClient/EvmChainClient";
import { getTronWeb } from "@routerprotocol/asset-transfer-sdk-ts/pathfinder/ChainClient/TronChainClient";

// initialize a Pathfinder instance
const YOUR_WIDGET_ID = 0; // get your unique sdk id by contacting us on Telegram
Expand Down Expand Up @@ -103,8 +103,8 @@ main();

### NEAR
```jsx
import { Pathfinder, Network } from "@nitro/asset-transfer-js-sdk";
import { nearSignerFromPrivateKey } from "@nitro/asset-transfer-js-sdk/pathfinder/ChainClient/NearChainClient";
import { PathFinder, Network } from "@routerprotocol/asset-transfer-sdk-ts";
import { nearSignerFromPrivateKey } from "@routerprotocol/asset-transfer-sdk-ts/pathfinder/ChainClient/NearChainClient";

// initialize a Pathfinder instance
const YOUR_WIDGET_ID = 0; // get your unique sdk id by contacting us on Telegram
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,26 @@ sidebar_position: 1
Install Nitro's Asset Transfer SDK into your JavaScript development environment by running the following command in your terminal:

```jsx
npm install @nitro/asset-transfer-js-sdk
npm install @routerprotocol/asset-transfer-sdk-ts
```

## Initialization

After installing the module, import and initialize it into your code:

```jsx
import { Pathfinder, Network } from "@nitro/asset-transfer-js-sdk";
import { PathFinder, Network } from "@routerprotocol/asset-transfer-sdk-ts";

const pathfinder = new Pathfinder(Network.Testnet, YOUR_WIDGET_ID);
const pathfinder = new PathFinder(Network.Testnet, YOUR_WIDGET_ID);
```

You can use Network.Testnet for mandara and Network.Mainnet for mainnet.

Example:

```jsx
import { Pathfinder, Network } from "@nitro/asset-transfer-js-sdk";
import { PathFinder, Network } from "@routerprotocol/asset-transfer-sdk-ts";

const YOUR_WIDGET_ID = 24 // get your unique sdk id by contacting us on Telegram
const pathfinder = new Pathfinder(Network.Testnet, YOUR_WIDGET_ID);
const pathfinder = new PathFinder(Network.Testnet, YOUR_WIDGET_ID);
```
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ and more fields.
Here's an example:
Getting a quote for transferring 10 USDT from Fuji to Mumbai:
```jsx
import { Pathfinder, Network } from "@nitro/asset-transfer-js-sdk";
import { PathFinder, Network } from "@routerprotocol/asset-transfer-sdk-ts";

// initialize a Pathfinder instance
const YOUR_WIDGET_ID = 0; // get your unique sdk id by contacting us on Telegram
Expand Down

0 comments on commit eedb3d8

Please sign in to comment.