Module 10: Using Asset Transfer SDK: Part 1
Welcome to Module 10 of the Router Nitro Cookbook. This Module focuses on Utilizing the Asset Transfer SDK of Router Protocol. This SDK, available as an npm
Package, Streamlines Asset Swapping between Blockchains. By installing the Package and importing required Libraries, you can Seamlessly Transfer Assets across Different Blockchains.
Prior to diving into SDK usage, let’s establish our initial Environment and install all necessary Libraries and Tools.
To begin, open your preferred Code Editor. We’ll be using VS Code for this Tutorial. Next, ensure you have NodeJS
installed. You can Download it from here
Once NodeJS
is installed, verify its installation by running node -v
and npm -v
in your Terminal. After Confirming NodeJS is set up Properly, Open VS Code and proceed with the following Steps.
Create a Project Directory:
mkdir
Command and cd
to that directory -mkdir my-nitro-project
cd my-nitro-project
package.json
file, which will Manage your Project’s Dependencies, using Yarn -yarn init -y
yarn add -D typescript
yarn tsc --init
This creates a tsconfig.json
file at the Root of your Project. It defines Compiler Options for how TypeScript code will be Transpiled to JavaScript.
.ts
Extension (e.g., index.ts) -touch index.ts
NodeJS
can Execute it, you’ll use the ts-node Package for Development -Install ts-node
as a Development Dependency:
yarn add -D ts-node
yarn add @routerprotocol/asset-transfer-sdk-ts
Share your learnings on Twitter. Click here