diff --git a/examples/react/app/layout.tsx b/examples/react/app/layout.tsx index 003360c..95b90c5 100644 --- a/examples/react/app/layout.tsx +++ b/examples/react/app/layout.tsx @@ -3,12 +3,7 @@ import './globals.css' import { Inter } from 'next/font/google' -const inter = Inter({ subsets: ['latin'] }) -export const metadata = { - title: 'Create Next App', - description: 'Generated by create next app', -} export default function RootLayout({ children, @@ -17,7 +12,7 @@ export default function RootLayout({ }) { return ( - {children} + {children} ) } diff --git a/examples/react/app/page.tsx b/examples/react/app/page.tsx index 27bf21d..e72e18a 100644 --- a/examples/react/app/page.tsx +++ b/examples/react/app/page.tsx @@ -20,9 +20,17 @@ const Home = () => { 'marlowe_core_to_json': (input: string) => marlowe?.marlowe_to_json(input) ?? "failed to initialize", 'cbor_datum_decoder': (input: string) => marlowe?.decode_cborhex_marlowe_plutus_datum(input) ?? "failed to initialize", 'cbor_redeemer_decoder': (input: string) => marlowe?.decode_marlowe_input_cbor_hex(input) ?? "failed to initialize", - 'json_to_marlowe': (input: string) => marlowe?.decode_marlowe_dsl_from_json(input) ?? "failed to initialize", + 'json_contract_to_marlowe': (input: string) => marlowe?.decode_marlowe_dsl_from_json(input) ?? "failed to initialize", + 'decode_marlowe_datum_or_redeemer': (input: string) => marlowe?.decode_marlowe_data_or_redeemer(input) ?? "failed to initialize", + 'json_datum_to_cbor': (input: string) => datum_json_to_cbor(input), + } + const datum_json_to_cbor = (input:string) => { + var machine = marlowe!.WASMMarloweStateMachine.from_datum_json(input); + let datum = machine.as_datum(); + return datum.to_cbor_hex(); + } const handleChange = (e: React.ChangeEvent) => { setSelectedMethod(e.target.value) @@ -67,7 +75,7 @@ const Home = () => {
-

Basic example app

+

marlowe-rs example app