encodeRequired
(value: T) => Promise<Uint8Array>
Validate a value and return the bytes to store. Rejects a value the contract does not accept.
decodeRequired
(bytes: Uint8Array) => Promise<T>
Turn stored bytes back into a validated value. Rejects bytes the contract does not accept.
nameRequired
string
Contract name, nonempty and at most 1024 characters. A read requires the same name.
versionRequired
string
Contract version you choose, nonempty and at most 1024 characters. A read requires the same version, so change it when the format changes.
encodingRequired
"json" | "binary"
json for a defineJsonArtifact() contract, binary for a defineBinaryArtifact() contract. A read requires the same encoding.