BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/aomi/runtime-tx-handler

runtime-tx-handler

aomi/runtime-tx-handler
FreeComponent

Executes wallet transaction and EIP-712 signing requests from the AI backend through the active wallet kit.

Install it

npx shadcn@latest add https://aomi.dev/r/runtime-tx-handler.json

Source

components/runtime-tx-handler.tsxaomi.dev/r/runtime-tx-handler.json · first 6 KB
1"use client";
2
3import { useEffect, useRef, useState } from "react";
4import { ShieldCheck } from "lucide-react";
5import { Connection as SolanaConnection } from "@solana/web3.js";
6import { normalizeSolanaCluster } from "@aomi-labs/client";
7import {
8 UserState,
9 appendFeeCallToPayload,
10 hydrateTxPayloadFromUserState,
11 parseChainId,
12 toViemSignMessageArgs,
13 toViemSignTypedDataArgs,
14 useAomiRuntime,
15 type WalletRequest,
16 type WalletTxPayload,
17} from "@aomi-labs/react";
18import { useAomiWalletKit } from "../lib/wallet-kit";
19import { walletDebug } from "../lib/wallet-kit/wallet-debug";
20import { Button } from "./ui/button";
21import {
22 Dialog,
23 DialogContent,
24 DialogDescription,
25 DialogFooter,
26 DialogHeader,
27 DialogTitle,
28} from "./ui/dialog";
29
30function hasHydratedCalls(payload: WalletTxPayload): boolean {
31 return Array.isArray(payload.calls) && payload.calls.length > 0;
32}
33
34function decodeBase64(value: string): Uint8Array {
35 if (typeof Buffer !== "undefined") {
36 return new Uint8Array(Buffer.from(value, "base64"));
37 }
38 return Uint8Array.from(atob(value), (char) => char.charCodeAt(0));
39}
40
41function toSimulationTransactions(payload: WalletTxPayload): Array<{
42 to: string;
43 value?: string;
44 data?: string;
45 label?: string;
46 chain_id?: number;
47}> {
48 if (Array.isArray(payload.calls) && payload.calls.length > 0) {
49 return payload.calls.map((call) => ({
50 to: call.to,
51 value: call.value,
52 data: call.data,
53 label: call.description,
54 chain_id: call.chainId,
55 }));
56 }
57
58 if (!payload.to) {
59 throw new Error("pending_transaction_missing_call_data");
60 }
61
62 return [
63 {
64 to: payload.to,
65 value: payload.value,
66 data: payload.data,
67 chain_id: payload.chainId,
68 },
69 ];
70}
71
72/**
73 * Invisible bridge component that processes wallet transaction and EIP-712
74 * signing requests from the AI backend through the active Aomi wallet kit.
75 *
76 * Auto-mounted inside AomiFrame.Root.
77 */
78export function RuntimeTxHandler() {
79 const {
80 user,
81 pendingWalletRequests,
82 startWalletRequest,
83 resolveWalletRequest,
84 rejectWalletRequest,
85 simulateBatchTransactions,
86 showNotification,
87 } = useAomiRuntime();
88 const adapter = useAomiWalletKit();
89 const { chainId: currentChainId } = adapter.identity;
90 const processingRef = useRef(false);
91 const [isSigningAa, setIsSigningAa] = useState(false);
92 const aaRequest =
93 pendingWalletRequests[0]?.kind === "aa_sign"
94 ? pendingWalletRequests[0]
95 : null;
96// … truncated

What it pulls in

npm packages

  • @aomi-labs/react
  • lucide-react

Other registry items

  • https://aomi.dev/r/aomi-wallet-kit.json
  • button
  • dialog

Files it writes

  • components/runtime-tx-handler.tsx

Facts

Registry
aomi
Type
registry:component
Access
Free
Files written
1
Licence
the repository states none
First indexed
2026-08-08
Last confirmed
yesterday

Go to the source

aomi.dev aomi-labs/aomi on GitHub Raw registry item This item as JSON

More from aomi

All 34 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
accordionaccordionaomiComponentsFree2 deps
alertalertaomiComponentsFree1 dep
aomi-frameaomi-frameaomiComponentsFree1 dep
aomi-para-provideraomi-para-provideraomiComponentsFree9 deps · 27 files
aomi-privy-provideraomi-privy-provideraomiComponentsFree7 deps · 15 files
aomi-wallet-kitaomi-wallet-kitaomiComponentsFree8 deps · 59 files
aomi-widgetaomi-widgetaomiComponentsFree2 deps
assistant-threadassistant-threadaomiComponentsFree6 deps · 23 files
BlockDex

Built by

Kynth Studios

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studios

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studios

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex