Assets
Asset Metadata
Attach metadata to transactions using CIP standards
Asset Metadata
Transaction metadata lets you attach arbitrary data to transactions without affecting their execution. Evolution SDK supports attaching metadata through the attachMetadata operation, following Cardano CIP standards.
Common Metadata Labels
| Label | CIP | Purpose |
|---|---|---|
674n | CIP-20 | Transaction messages/comments |
721n | CIP-25 | NFT metadata |
777n | CIP-27 | Royalty information |
Attach a Message (CIP-20)
import { , , , } from "@evolution-sdk/evolution"
const = ({
: "preprod",
: { : "blockfrost", : "https://cardano-preprod.blockfrost.io/api/v0", : ..! },
: { : "seed", : ..!, : 0 }
})
declare const : .
const = await
.()
.({
: .("addr_test1vrm9x2dgvdau8vckj4duc89m638t8djmluqw5pdrFollw8qd9k63"),
: .(2_000_000n)
})
.({
: 674n,
:
})
.()
const = await .()
await .()Multiple Metadata Entries
Chain multiple attachMetadata calls for different labels:
import { , , , } from "@evolution-sdk/evolution"
const = ({
: "preprod",
: { : "blockfrost", : "https://cardano-preprod.blockfrost.io/api/v0", : ..! },
: { : "seed", : ..!, : 0 }
})
declare const : .
declare const : .
const = await
.()
.({
: .("addr_test1vrm9x2dgvdau8vckj4duc89m638t8djmluqw5pdrFollw8qd9k63"),
: .(2_000_000n)
})
.({ : 674n, : })
.({ : 721n, : })
.()Next Steps
- Assets Overview — Working with native assets
- Encoding — Data encoding formats