Unmarshal now provides a Software Development Kit (SDK) which will simplify the process of integrating Unmarshal APIs into a dApp’s backend. SDKs are essential for development of any software application and bring together a set of tools, libraries, and documentation in one installable package.
We’ve created a library that gives you access to the powerful Unmarshal Server backend from your JavaScript app.
Sign up for our APIs and data analytics tool here: console.unmarshal.io
Powerful & Intuitive Web3 SDK
We have reduced the amount of code needed to query a single endpoint by pre-defining a library for each instance. Once the SDK is imported by a developer, they will be able to input parameters such as “chain name”, “chain ID”, “contract address”, “transactions”, and so on, depending on the data that needs to be queried.
Our SDK is hosted on NPM, which is a widely used package manager trusted by millions of developers worldwide. Below is the link:-
https://www.npmjs.com/package/@unmarshal/sdk
Additional Functionalities provided
Say you have a contract and you want to know if it has interacted with more than a thousand wallets, Unmarshal SDK lets you set up an alerting and notification mechanism when this happens.
Unmarshal’s SDK is also capable of providing a serverless backend similar to lambda functions which can be triggered whenever a particular event, function or an action is triggered.
Importing the SDK
If you are new to Unmarshal, check the quickstart guide in the official docs on how to get started.
If you’re already familiar with Unmarshal and have your server set up, then follow along to connect your SDK:
1. Install Unmarshal
The easiest way to integrate the unmarshal SDK into your JavaScript project is through the npm module.
Install the package via npm:
npm install @unmarshal/sdk
or yarn
:
yarn add @unmarshal/sdk
Import unmarshal:
import Unmarshal, {Chain} from "@unmarshal/sdk";
2. Initialise unmarshal
After your dependency is added, you simply need to create a new Unmarshal instance by passing your auth key.
const unmarshal = new Unmarshal({
apiKey: "YOUR_API_KEY_GOES_HERE"
});
Usage
After initialisation you can use any Unmarshal functionalities as described in our extensive docs.
unmarshal.WalletApi
.getTokenBalances(Chain.ethereum, "demo.eth")
.then(({data}) => console.log(data))
Benefits of Using this SDK
Launch your dApps quicker!
- A predefined set of libraries will allow you to write queries with a single line of code.
- Reduce coding efforts by 60–70%
- SDK support is available in Golang, Javascript, and Typescript
- Systematic and organised code libraries
Code Samples
Here are some of the sample codes that are most commonly used, and how it would look when written with Unmarshal SDK.
Getting Token Balances
Transaction History of Asset
NFT Assets by Contract Address
About Unmarshal
Unmarshal is a Multi-chain Web 3.0 data network aiming to deliver granular, reliable & real-time data to dApps, DeFi protocols, NFTs, Metaverse and GameFi solutions. Unmarshal provides the easiest way to query Blockchain data from Ethereum, Polygon, BNB Chain, XDC Network, Avalanche, Fantom, Celo, Solana, Klaytn, Cronos, and Fuse Network. Unmarshal product suite consists of data indexers and transforming tools to power Web 3.0 applications on any chain while providing a latent view of transformed data.