UNPKG

@indigo-labs/indigo-sdk

Version:

Indigo SDK for interacting with Indigo endpoints via lucid-evolution

18 lines (14 loc) 622 B
import { TSchema, Data } from '@evolution-sdk/evolution'; import { DEFAULT_SCHEMA_OPTIONS } from '../../types/evolution-schema-options'; export const CollectorRedeemerSchema = TSchema.Union( TSchema.Literal('Collect', { flatInUnion: true }), TSchema.Literal('DistributeToStakers', { flatInUnion: true }), TSchema.Literal('UpgradeVersion', { flatInUnion: true }), ); export type CollectorRedeemer = typeof CollectorRedeemerSchema.Type; export function serialiseCollectorRedeemer(r: CollectorRedeemer): string { return Data.withSchema( CollectorRedeemerSchema, DEFAULT_SCHEMA_OPTIONS, ).toCBORHex(r); }