-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Incorrect code used for this one. The following code:
const {
AccountId,
PrivateKey,
Client,
NftId,
TokenNftInfoQuery
} = require("@hashgraph/sdk"); // v2.46.0
async function main() {
let client;
try {
// Your account ID and private key from string value
const MY_ACCOUNT_ID = AccountId.fromString("<AccountId>");
const MY_PRIVATE_KEY = PrivateKey.fromStringECDSA("<PrivateKey>");
// Pre-configured client for test network (testnet)
client = Client.forTestnet();
//Set the operator with the account ID and private key
client.setOperator(MY_ACCOUNT_ID, MY_PRIVATE_KEY);
// Start your code here
const nftId = new NftId(new TokenId(0,0,2), 56562);
console.log("------------------------------ NFT ID ------------------------------ ");
console.log("NFT ID : ", nftId.toString());
} catch (error) {
console.error(error);
} finally {
if (client) client.close();
}
}
main();
This should be:
const {
AccountId,
PrivateKey,
Client,
NftId,
TokenId
} = require("@hashgraph/sdk"); // v2.46.0
async function main() {
let client;
try {
// Your account ID and private key from string value
const MY_ACCOUNT_ID = AccountId.fromString("<AccountID>");
const MY_PRIVATE_KEY = PrivateKey.fromStringECDSA("<PrivateKey>");
// Pre-configured client for test network (testnet)
client = Client.forTestnet();
//Set the operator with the account ID and private key
client.setOperator(MY_ACCOUNT_ID, MY_PRIVATE_KEY);
// Start your code here
const nftId = new NftId(new TokenId(0, 0, 2), 56562);
console.log("------------------------------ NFT ID ------------------------------ ");
console.log("NFT ID : ", nftId.toString());
} catch (error) {
console.error(error);
} finally {
if (client) client.close();
}
}
main();
Changes:
- Removed:
TokenNftInfoQuery - Added:
TokenId
Metadata
Metadata
Assignees
Labels
No labels