Skip to main content

Features

Outputs can have different features. This how to exaplains how to add them to an output.

Client in Wallet

If you are using a wallet you can always get the client by calling the client()/getClient()/get_client() method

Output Features

Different outputs can have different featues. This tables shows you which ouput has which features. You can find the output specs in TIP-018

OutputSenderMetadataImmutable MetadataTagImmutable Issuer
Basicxxx
Aliasxxxx
Foundryxx
NFTxxxxx

Code Example

The following example will:

  1. Create multiple NFT outputs with all possible features
sdk/examples/how_tos/outputs/features.rs
loading...

Expected Output

[
{
"type": 6,
"amount": "49300",
"nftId": "0x0000000000000000000000000000000000000000000000000000000000000000",
"unlockConditions": [
{
"type": 0,
"address": {
"type": 0,
"pubKeyHash": "0x7ffec9e1233204d9c6dce6812b1539ee96af691ca2e4d9065daa85907d33e5d3"
}
}
],
"features": [
{
"type": 0,
"address": {
"type": 0,
"pubKeyHash": "0x7ffec9e1233204d9c6dce6812b1539ee96af691ca2e4d9065daa85907d33e5d3"
}
}
]
},
{
"type": 6,
"amount": "49300",
"nftId": "0x0000000000000000000000000000000000000000000000000000000000000000",
"unlockConditions": [
{
"type": 0,
"address": {
"type": 0,
"pubKeyHash": "0x7ffec9e1233204d9c6dce6812b1539ee96af691ca2e4d9065daa85907d33e5d3"
}
}
],
"immutableFeatures": [
{
"type": 1,
"address": {
"type": 0,
"pubKeyHash": "0x7ffec9e1233204d9c6dce6812b1539ee96af691ca2e4d9065daa85907d33e5d3"
}
}
]
},
{
"type": 6,
"amount": "47500",
"nftId": "0x0000000000000000000000000000000000000000000000000000000000000000",
"unlockConditions": [
{
"type": 0,
"address": {
"type": 0,
"pubKeyHash": "0x7ffec9e1233204d9c6dce6812b1539ee96af691ca2e4d9065daa85907d33e5d3"
}
}
],
"features": [
{
"type": 2,
"data": "0x48656c6c6f2c20576f726c6421"
}
]
},
{
"type": 6,
"amount": "47500",
"nftId": "0x0000000000000000000000000000000000000000000000000000000000000000",
"unlockConditions": [
{
"type": 0,
"address": {
"type": 0,
"pubKeyHash": "0x7ffec9e1233204d9c6dce6812b1539ee96af691ca2e4d9065daa85907d33e5d3"
}
}
],
"immutableFeatures": [
{
"type": 2,
"data": "0x48656c6c6f2c20576f726c6421"
}
]
},
{
"type": 6,
"amount": "47400",
"nftId": "0x0000000000000000000000000000000000000000000000000000000000000000",
"unlockConditions": [
{
"type": 0,
"address": {
"type": 0,
"pubKeyHash": "0x7ffec9e1233204d9c6dce6812b1539ee96af691ca2e4d9065daa85907d33e5d3"
}
}
],
"features": [
{
"type": 3,
"tag": "0x48656c6c6f2c20576f726c6421"
}
]
}
]