Hedera
Search…
Token ID
Constructs a TokenId.
Constructor
Description
new TokenId(<shard>,<realm>,<token>)
Initializes the TokenId object
1
new TokenId()
Copied!

Methods

V2
V1
Method
Type
Description
TokenId.fromtString(<tokenId>)
String
Constructs a token ID from a String value
TokenId.fromSolidityAddress(<address>)
String
Constructs a token ID from a solidity address
TokenId.fromBytes(<bytes>)
byte[]
Constructs a token ID from bytes
Java
1
TokenId tokenId = new TokenId(0,0,5);
2
System.out.println(tokenId);
3
4
TokenId tokenIdFromString = TokenId.fromString("0.0.3");
5
System.out.println(tokenIdFromString);
6
7
//Version: 2.0.1
Copied!
JavaScript
1
const tokenId = new TokenId(0,0,5);
2
console.log(tokenId.toString());
3
4
const tokenIdFromString = TokenId.fromString("0.0.3");
5
console.log(tokenIdFromString.toString());
6
7
//Version 2.0.7
Copied!
Go
1
tokenId := hedera.TokenID {
2
Shard: 0,
3
Realm: 0,
4
Token: 5,
5
}
6
7
//v2.1.0
Copied!
Method
Type
Description
TokenId.fromtString(<tokenId>)
String
Constructs a token ID from a String value
TokenId.fromSolidityAddress(<address>)
String
Constructs a token ID from a solidity address
1
TokenId tokenId = TokenId.fromString("0.0.3");
2
System.out.println(tokenId);
3
//Version: 1.2.2
Copied!
1
const tokenId = new TokenId(0,0,5);
2
console.log(tokenId);
3
4
const tokenIdFromString = TokenId.fromString("0.0.3");
5
console.log(tokenIdFromString);
6
//Version 1.4.1
Copied!
Last modified 6d ago
Copy link
Contents
Methods