Build an Alias Output
The following code example will:
- Create a
Client
which will connect to the Shimmer Testnet. - Create a
SecretManager
from a mnemonic. - Build an Alias output.
Code Example
- Rust
- Nodejs
- Python
- Java
Dotenv
This example uses dotenv, which is not safe to use in production environments.
client/examples/output/alias.rs
loading...
Run the Example
Run the example by running the following command:
cargo run --example alias --release
Dotenv
This example uses dotenv, which is not safe to use in production environments.
client/bindings/nodejs/examples/13_build_alias_output.ts
loading...
You can run the example by running the following command from the bindings/node/examples/
folder:
node dist/13_build_alias_output.js
Guide Coming Soon
This how to guide is not available in your language of choice at the moment. Please feel free to browse more examples which may suit your requirements.
client/bindings/java/examples/src/BuildAliasOutput.java
loading...
Expected Output
- Rust
- Nodejs
- Python
- Java
Alias(
AliasOutput {
amount: 59200,
native_tokens: NativeTokens(
BoxedSlicePrefix([]),
),
alias_id: AliasId(0x0000000000000000000000000000000000000000000000000000000000000000),
state_index: 0,
state_metadata: BoxedSlicePrefix([
104,
101,
108,
108,
111,
]),
foundry_counter: 0,
unlock_conditions: UnlockConditions(
BoxedSlicePrefix([
StateControllerAddress(
StateControllerAddressUnlockCondition(
Ed25519(
Ed25519Address(0x7ffec9e1233204d9c6dce6812b1539ee96af691ca2e4d9065daa85907d33e5d3),
),
),
),
GovernorAddress(
GovernorAddressUnlockCondition(
Ed25519(
Ed25519Address(0x7ffec9e1233204d9c6dce6812b1539ee96af691ca2e4d9065daa85907d33e5d3),
),
),
),
]),
),
features: Features(
BoxedSlicePrefix([
Sender(
SenderFeature(
Ed25519(
Ed25519Address(0x7ffec9e1233204d9c6dce6812b1539ee96af691ca2e4d9065daa85907d33e5d3),
),
),
),
Metadata(
MetadataFeature(0x68656c6c6f),
),
]),
),
immutable_features: Features(
BoxedSlicePrefix([
Issuer(
IssuerFeature(
Ed25519(
Ed25519Address(0x7ffec9e1233204d9c6dce6812b1539ee96af691ca2e4d9065daa85907d33e5d3),
),
),
),
Metadata(
MetadataFeature(0x68656c6c6f),
),
]),
),
},
)
{
"type": 4,
"amount": "59200",
"aliasId": "0x0000000000000000000000000000000000000000000000000000000000000000",
"stateIndex": 0,
"stateMetadata": "0x68656c6c6f",
"foundryCounter": 0,
"unlockConditions": [
{
"type": 4,
"address": {
"type": 0,
"pubKeyHash": "0x7ffec9e1233204d9c6dce6812b1539ee96af691ca2e4d9065daa85907d33e5d3"
}
},
{
"type": 5,
"address": {
"type": 0,
"pubKeyHash": "0x7ffec9e1233204d9c6dce6812b1539ee96af691ca2e4d9065daa85907d33e5d3"
}
}
],
"features": [
{
"type": 0,
"address": {
"type": 0,
"pubKeyHash": "0x7ffec9e1233204d9c6dce6812b1539ee96af691ca2e4d9065daa85907d33e5d3"
}
},
{
"type": 2,
"data": "0x68656c6c6f"
}
],
"immutableFeatures": [
{
"type": 1,
"address": {
"type": 0,
"pubKeyHash": "0x7ffec9e1233204d9c6dce6812b1539ee96af691ca2e4d9065daa85907d33e5d3"
}
},
{
"type": 2,
"data": "0x68656c6c6f"
}
]
}
Guide Coming Soon
This how to guide is not available in your language of choice at the moment. Please feel free to browse more examples which may suit your requirements.
{
"jsonObject": {
"type": 4,
"amount": "59200",
"aliasId": "0x0000000000000000000000000000000000000000000000000000000000000000",
"stateIndex": 0,
"stateMetadata": "0x68656c6c6f",
"foundryCounter": 0,
"unlockConditions": [
{
"type": 4,
"address": {
"type": 0,
"pubKeyHash": "0x7ffec9e1233204d9c6dce6812b1539ee96af691ca2e4d9065daa85907d33e5d3"
}
},
{
"type": 5,
"address": {
"type": 0,
"pubKeyHash": "0x7ffec9e1233204d9c6dce6812b1539ee96af691ca2e4d9065daa85907d33e5d3"
}
}
],
"features": [
{
"type": 0,
"address": {
"type": 0,
"pubKeyHash": "0x7ffec9e1233204d9c6dce6812b1539ee96af691ca2e4d9065daa85907d33e5d3"
}
},
{
"type": 2,
"data": "0x68656c6c6f"
}
],
"immutableFeatures": [
{
"type": 1,
"address": {
"type": 0,
"pubKeyHash": "0x7ffec9e1233204d9c6dce6812b1539ee96af691ca2e4d9065daa85907d33e5d3"
}
},
{
"type": 2,
"data": "0x68656c6c6f"
}
]
}
}