Union is a dynamic-size type. Serializing a union has two steps:
the union item record
Optional
the custom item type id record
// without custom idunion({ cafe: Uint8, bee: Uint8 })// with custom idunion({ cafe: Uint8, bee: Uint8 }, { cafe: 0xcafe, bee: 0xbee }) Copy
// without custom idunion({ cafe: Uint8, bee: Uint8 })// with custom idunion({ cafe: Uint8, bee: Uint8 }, { cafe: 0xcafe, bee: 0xbee })
Union is a dynamic-size type. Serializing a union has two steps: