Module 8 - Understanding Asset Transfer SDK - Part 1
Step 1: Setting up the Project
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:
-
Navigate to your Desired Workspace Directory and Create a new Directory for your Project using the
mkdir
Command andcd
to that directory - -
Initialize a
package.json
file, which will Manage your Project’s Dependencies, usingyarn
- -
Install TypeScript as a Development Dependency using
yarn
- -
Generate a Basic TypeScript Configuration file using the TypeScript Compiler -
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. -
Create a New file for your Application code with a
.ts
Extension (e.g., index.ts) - -
Since TypeScript Code needs to be Compiled to JavaScript before
NodeJS
can Execute it, you’ll use thets-node
Package for Development -Install
ts-node
as a Development Dependency: -
Install the Latest Version of Asset Transfer SDK -