zan-sdk
v0.0.2
Published
ZAN official SDK
Readme
ZAN SDK
Introduction
ZAN SDK is a toolkit designed to simplify Web3 development. It provides a series of functions to help developers interact with blockchains more easily. Whether communicating with blockchain nodes or interacting with decentralized applications (DApps), ZAN SDK offers powerful support.
Features
- Blockchain Interaction: Simplifies communication with blockchain nodes.
- DApp Support: Provides seamless integration with decentralized applications.
Installation
Install ZAN SDK using npm:
npm install zan-sdkOr using yarn:
yarn add zan-sdkQuick Start
Here's a simple example showing how to use ZAN SDK to interact with Solana and Ethereum:
First, obtain the corresponding API Key from ZAN.
Solana
import { Solana } from 'zan-sdk';
const solana = new Solana({
endpoint: 'https://api.zan.top/node/v1/solana/mainnet/{YOUR API KEY}',
});
solana.connection.getBlockHeight().then((res) => console.log(res));ETH
import { Core } from 'zan-sdk';
const eth = new Core({
endpoint: 'https://api.zan.top/node/v1/eth/mainnet/{YOUR API KEY}',
});
eth.client.getBlockNumber().then((blockNumber) => {
console.log(blockNumber);
});ZAN Advanced API
import { Core } from 'zan-sdk';
const eth = new Core({
endpoint: 'https://api.zan.top/node/v1/eth/mainnet/{YOUR API KEY}',
});
eth.client
.zanGetNftMetadata({
contractAddress: '0xbd3531da5cf5857e7cfaa92426877b022e612cf8',
})
.then((metadata) => {
console.log(metadata);
});Documentation
For detailed documentation and usage guides, visit ZAN Documentation.
Contribution
Code contributions are welcome!
