bmscis-arclib
Algorand library for processing ARC3 , AR19 and ARC69 NFTs.
Installation
Node.js
$ npm install algosdk
This package provides TypeScript types, but you will need TypeScript version 4.2 or higher to use them properly.
ES module
import bmscisArclib from 'bmscis-arclib';
// ...
Config
Config takes two values '0' for 'MainNet' and '1' for 'TestNet'
Fetch NFT
class NFT {
token: Token;
metadata: Metadata;
urlMimeType: string;
constructor(md: Metadata, token?: Token, urlMimeType?: string);
static fromAssetId(activeConf: number, assetId: number): Promise<NFT>;
static fromToken(activeConf: number, t: any): Promise<NFT>;
valid(): boolean;
name(): string;
id(): number;
mediaURL(activeConf: number, small: boolean): string;
}
import bmscisArclib from 'bmscis-arclib';
const nft = await bmscisArclib.NFT.fromAssetId(0, assetID);
Fetch NFD Name
Given a array of addresses, return their nft domain name if any.
lookUpNfdName(addresses: string[]): Promise<NftDomain[]>;
const domainNames = await bmscisArclib.lookUpNfdName([
'ANYY3RNQYW7UK6RNF2BFEJLE5ZRVJJIC3VLUKTABA43RVFAZK2OYGUASRQ',
'GIWOBE2ZR3ZO4DCMRZP3UKXC4RDAHQMWZCGGR2KAI7TTVX3G6NWCNRJWH4',
'K7XNCBUY6PS2DLBE3E6XA7KUJX4A3GA5KXDARAB3BIQJDL7WSCPX26HAYE',
'5KZKSGWEWL5ZYT7F24YZ5E4GLCHO2IFEFPPBLBLKS3PEFNL7WEF6TJRWIA',
'I77X4ESBWS4SE4NW5HPFWSVJARCXL7M424JWNW2F3VFJFA7E4BAI3EKF2U',
'4LNGXTQJV6ZORSLMHNPKU6IHTLJBVDHY6RFV5JMYLVRSGPIUE45XPYAJTE',
'2HYTI5GAB3WAJL5MZKQYUHZHYQJBEUD54OQNFZNBCPZXFPVDZOSCGUNORU',
'WHKQNOW2IKUJ4EPPQEOWXZ2N7SDZPLCZH2AM2GVOFI3VQETJETBQQ4PZBQ',
'5KZKSGWEWL5ZYT7F24YZ5E4GLCHO2IFEFPPBLBLKS3PEFNL7WEF6TJRWIA',
'B2HJI7OLWGBZ4LSTKSUR6GBHRKI3MCILQIZOX2L3YRLB74VDKW2NR2DRXE'
]);
GET ASSET BALANCE
Given an array of assets, return an AlgoAccount object.
interface AssetBalance {
amount: number;
assetID: number;
isFrozen: boolean;
}
interface AlgoAccount {
address: string;
amount: number;
minBalance: number;
assets: AssetBalance[];
}
const c = await bmscisArclib.algo.lookUpAccount(
0,
'OZUUPC2B6SKD4MHNFOHZAWOBCRGBBWH7QWZJ4GREGAM7Q43RBYNO6ILW5Q',
[1072765924, 1034854939, 387411719]
);