UNPKG

@indigo-labs/indigo-sdk

Version:

Indigo SDK for interacting with Indigo endpoints via lucid-evolution

19 lines (16 loc) 657 B
import { TSchema, Data } from '@evolution-sdk/evolution'; import { DEFAULT_SCHEMA_OPTIONS } from '../../types/evolution-schema-options'; const VersionRecordDatumSchema = TSchema.Struct({ upgradeId: TSchema.Integer, /// Underlying representation of the following mapping: ValidatorHash -> UpgradePath upgradePaths: TSchema.Array( TSchema.Tuple([TSchema.ByteArray, TSchema.ByteArray]), ), }); export type VersionRecordDatum = typeof VersionRecordDatumSchema.Type; export function serialiseVersionRecordDatum(d: VersionRecordDatum): string { return Data.withSchema( VersionRecordDatumSchema, DEFAULT_SCHEMA_OPTIONS, ).toCBORHex(d); }