11<script lang =" ts" >
2- import BlockHashComponent from " $lib/components/model/BlockHashComponent.svelte"
32import ChainComponent from " $lib/components/model/ChainComponent.svelte"
43import ErrorComponent from " $lib/components/model/ErrorComponent.svelte"
54import HeightComponent from " $lib/components/model/HeightComponent.svelte"
65import PacketTracesComponent from " $lib/components/model/PacketTracesComponent.svelte"
7- import TransactionHashComponent from " $lib/components/model/TransactionHashComponent.svelte"
8- import DateTimeComponent from " $lib/components/ui/DateTimeComponent.svelte"
96import Label from " $lib/components/ui/Label.svelte"
107import LongMonoWord from " $lib/components/ui/LongMonoWord.svelte"
118import Skeleton from " $lib/components/ui/Skeleton.svelte"
129import * as AppRuntime from " $lib/runtime"
1310import { chains } from " $lib/stores/chains.svelte"
1411import { packetDetails } from " $lib/stores/packets.svelte"
12+ import ucs03Wasm from " $wasm/ucs03-zkgm-packet_bg.wasm?url"
1513import { getChain } from " @unionlabs/sdk/schema"
1614import * as Ucs03 from " @unionlabs/sdk/Ucs03"
15+ import { WasmTest } from " @unionlabs/sdk/WasmTest"
1716import { Effect , Option } from " effect"
1817import { pipe } from " effect/Function"
19- import { getOrUndefined } from " effect/Option"
2018import * as S from " effect/Schema"
21- import { fromHex } from " viem"
19+ import { fromHex , hexToBytes } from " viem"
2220import A from " ../ui/A.svelte"
2321
2422const sourceChain = $derived (
@@ -42,6 +40,25 @@ const destinationChain = $derived(
4240 ),
4341 ),
4442)
43+
44+ const wasmDetails = AppRuntime .runPromiseExit$ (() =>
45+ pipe (
46+ WasmTest ,
47+ Effect .andThen ((wasm ) =>
48+ pipe (
49+ packetDetails .data ,
50+ Effect .flatMap ((data ) =>
51+ pipe (
52+ data .data ,
53+ hexToBytes ,
54+ wasm .decodePacket ,
55+ )
56+ ),
57+ )
58+ ),
59+ Effect .provide (WasmTest .Default (ucs03Wasm )),
60+ )
61+ )
4562 </script >
4663
4764{#if Option .isSome (packetDetails .error )}
@@ -222,6 +239,11 @@ const destinationChain = $derived(
222239 <LongMonoWord class ="mt-2" >{packetDetails .data .value .data }</LongMonoWord >
223240 </div >
224241
242+ <div class =" p-4" >
243+ <Label >Raw Packet Data (WASM)</Label >
244+ <pre >{wasmDetails .current }</pre >
245+ </div >
246+
225247 {#if Option .isSome (packetDetails .data .value .acknowledgement )}
226248 <div class =" p-4" >
227249 <Label >Acknowledgement</Label >
0 commit comments