From a84b2409a6a387186930052ee40da42d66cac893 Mon Sep 17 00:00:00 2001 From: gagdiez Date: Mon, 5 Aug 2024 15:17:52 +0200 Subject: [PATCH] added schema --- contract-ts/src/contract.ts | 4 ++++ contract-ts/src/model.ts | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/contract-ts/src/contract.ts b/contract-ts/src/contract.ts index a0d01d8..9c9bcb5 100644 --- a/contract-ts/src/contract.ts +++ b/contract-ts/src/contract.ts @@ -5,6 +5,10 @@ import { POINT_ONE, PostedMessage } from './model' class GuestBook { messages: Vector = new Vector("v-uid"); + static schema = { + 'messages': Vector + } + @call({ payableFunction: true }) // Public - Adds a new message. add_message({ text }: { text: string }) { diff --git a/contract-ts/src/model.ts b/contract-ts/src/model.ts index fc9cb59..f25f068 100644 --- a/contract-ts/src/model.ts +++ b/contract-ts/src/model.ts @@ -1,6 +1,12 @@ export const POINT_ONE = '100000000000000000000000'; export class PostedMessage { + static schema = { + 'premium': 'boolean', + 'sender': 'string', + 'text': 'string' + } + premium: boolean; sender: string; text: string;