Build a Foundry Output
The following code example will:
- Create a
Client
which will connect to the Shimmer Testnet. - Create a
SecretManager
from a mnemonic. - Build a Foundry output.
Code Example
- Rust
- Nodejs
- Python
- Java
Dotenv
This example uses dotenv, which is not safe to use in production environments.
client/examples/output/foundry.rs
loading...
Run the Example
Run the example by running the following command:
cargo run --example foundry --release
Dotenv
This example uses dotenv, which is not safe to use in production environments.
client/bindings/nodejs/examples/14_build_foundry_output.ts
loading...
You can run the example by running the following command from the bindings/node/examples/
folder:
node dist/14_build_foundry_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/BuildFoundryOutput.java
loading...
Expected Output
- Rust
- Nodejs
- Python
- Java
Transaction with new alias output sent: https://api.testnet.shimmer.network/api/core/v2/blocks/0x6f10bd7234c7958992d9b0df269234f01afa96aecb6b5ed04f26786811640df7
Transaction with foundry output sent: https://api.testnet.shimmer.network/api/core/v2/blocks/0xbcf2281c2557106426f7f622051ab8de233a430df48b38a826a863eeb9ee187e
Transaction with native tokens burnt sent: https://api.testnet.shimmer.network/api/core/v2/blocks/0x924a2385cddfffe1f46c1460160121b28c40a19e0e8011e04c7c2fe8d1d80ccd
{
type: 5,
amount: '1000000',
serialNumber: 0,
tokenScheme: {
type: 0,
mintedTokens: '0xa',
meltedTokens: '0x0',
maximumSupply: '0xa'
},
unlockConditions: [ { type: 6, address: [Object] } ]
}
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.
{
"type": 5,
"amount": "59800",
"nativeTokens": [
{
"id": "0x081e6439529b020328c08224b43172f282cb16649d50c891fa156365323667e47a0100000000",
"amount": "0x32"
}
],
"serialNumber": 1,
"tokenScheme": {
"type": 0,
"mintedTokens": "0x32",
"meltedTokens": "0x0",
"maximumSupply": "0x64"
},
"unlockConditions": [
{
"type": 6,
"address": {
"type": 8,
"aliasId": "0xa5c28d5baa951de05e375fb19134ea51a918f03acc2d0cee011a42b298d3effa"
}
}
]
}