Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
@itheum/sdk-mx-data-nft
Advanced tools
This SDK is currently focused on interacting with the Itheum's Data NFT technology that's deployed to the MultiversX blockchain.
node@19.7X
npm install
/src
foldernpm run devtest
and work on the test.mjs file for live reloadnpm run build
dist
foldernpm i @itheum/sdk-mx-data-nft
SDK Docs
import { DataNft } from '@itheum/sdk-mx-data-nft';
DataNft.setNetworkConfig('devnet' | 'testnet' | 'mainnet');
// Can build a new DataNft object partially
const dataNft = new DataNft({
tokenIdentifier: 'tokenIdentifier',
tokenName: 'tokenName'
});
// Create a new DataNft object from API
const nonce = 1;
const nft = await DataNft.createFromApi(nonce);
// Create a new DataNft object from API Response
const response = await fetch('https://devnet-api.multiversx.com/address/nfts');
const dataNfts = [];
response.forEach(async (nft) => {
const data = await DataNft.createFromApiResponse(nft);
dataNfts.push(data);
});
// Retrives the DataNfts owned by a address
const address = 'address';
const dataNfts = [];
dataNfts = await DataNft.ownedByAddress(address);
// Retrives the DataNft message from marshal to sign
const dataNft = DataNft.createFromApi(nonce);
const message = await dataNft.messageToSign();
// Sign the message with a wallet
const signature = 'signature';
// Unlock the data inside the dataNft
dataNft.viewData(message, signature);
import { DataNftMinter } from '@itheum/sdk-mx-data-nft';
const dataNftMinter = new DataNftMinter('devnet' | 'testnet' | 'mainnet');
// View minter smart contract rewquirements
const requirements = await dataNftMinter.viewMinterRequirements('address');
// View contract pause state
const result = await dataNftMarket.viewContractPauseState();
// Create a mint transaction
const transaction = await dataNftMarket.mint(
new Address('erd1'),
'TEST-TOKEN',
'https://marshal.com',
'https://streamdata.com',
'https://previewdata',
15,
1000,
'Test Title',
'Test Description',
10
);
// Create a burn transaction
const transaction = await dataNftMarket.burn(
new Address('erd1'),
dataNftNonce,
quantityToBurn
);
import { DataNftMarket } from '@itheum/sdk-mx-data-nft';
const dataNftMarket = new DataNftMarket('devnet' | 'testnet' | 'mainnet');
// View requirements
const result = await dataNftMarket.viewRequirements();
// View address listed offers
const result = await dataNftMarket.viewAddressListedOffers(new Address(''));
// View address paged offers
const result = await dataNftMarket.viewAddressPagedOffers(
1,
10,
new Address('')
);
// View address total offers
const result = await dataNftMarket.viewAddressTotalOffers(new Address(''));
// View address cancelled offers
const result = await dataNftMarket.viewAddressCancelledOffers(new Address(''));
// View offers paged
const result = await dataNftMarket.viewPagedOffers(1, 10);
// View offers
const result = await dataNftMarket.viewOffers();
// View number of offers listed
const result = await dataNftMarket.viewNumberOfOffers();
// View contract pause state
const result = await dataNftMarket.viewContractPauseState();
// View last valid offer id
const result = await dataNftMarket.viewLastValidOfferId();
// Create addOffer transaction
const result = dataNftMarket.addOffer(new Address(''), '', 0, 0, '', 0, 0, 0);
// Create acceptOffer transaction
const result = dataNftMarket.acceptOffer(new Address(''), 0, 0, 0);
// Create cancelOffer transaction
const result = dataNftMarket.cancelOffer(new Address(''), 0);
// Create cancelOffer transaction without sending the funds back to the owner
const result = dataNftMarket.cancelOffer(new Address(''), 0, false);
// Create withdrawFromCancelledOffer transaction
const result = dataNftMarket.withdrawCancelledOffer(new Address(''), 0);
// Create changeOfferPrice transaction
const result = dataNftMarket.changeOfferPrice(new Address(''), 0, 0);
FAQs
SDK for Itheum's Data NFT Technology on MultiversX Blockchain
The npm package @itheum/sdk-mx-data-nft receives a total of 31 weekly downloads. As such, @itheum/sdk-mx-data-nft popularity was classified as not popular.
We found that @itheum/sdk-mx-data-nft demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.