Skip to content

Commit 3750a8b

Browse files
committed
tmp
1 parent 2984fc3 commit 3750a8b

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

apps/docs/src/components/test-zkapp.tsx

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
import { createStore } from "@mina-js/connect";
2-
import type { TransactionBody, TransactionPayload } from "@mina-js/utils/src";
2+
import type {
3+
Sendable,
4+
TransactionBody,
5+
TransactionPayload,
6+
ZkAppCommandTransactionInput,
7+
} from "@mina-js/utils/src";
38
import { useLocalStorage, useObjectState } from "@uidotdev/usehooks";
49
import bs58 from "bs58";
510
import { clsx } from "clsx";
@@ -256,7 +261,7 @@ export const TestZkApp = () => {
256261
const { result: accounts } = await provider.request({
257262
method: "mina_accounts",
258263
});
259-
const command = {
264+
const command: ZkAppCommandTransactionInput = {
260265
zkappCommand: {
261266
accountUpdates: [],
262267
memo: "E4YM2vTHhWEg66xpj52JErHUBU4pZ1yageL4TVDDpTTSsv8mK6YaH",
@@ -288,19 +293,18 @@ export const TestZkApp = () => {
288293
if (!provider) return;
289294
if (!results.mina_signTransaction) return;
290295
const signedTransaction = JSON.parse(results.mina_signTransaction);
296+
const transaction: Sendable =
297+
transactionType === TransactionType.ZKAPP
298+
? {
299+
input: signedTransaction.data,
300+
}
301+
: {
302+
input: signedTransaction.data,
303+
signature: signedTransaction.signature,
304+
};
291305
const { result } = await provider.request({
292306
method: "mina_sendTransaction",
293-
params: [
294-
transactionType === TransactionType.ZKAPP
295-
? {
296-
input: signedTransaction.data,
297-
}
298-
: {
299-
input: signedTransaction.data,
300-
signature: signedTransaction.signature,
301-
},
302-
"zkapp",
303-
],
307+
params: [transaction, transactionType],
304308
});
305309
setResults(() => ({
306310
mina_sendTransaction: JSON.stringify(result, undefined, "\t"),

0 commit comments

Comments
 (0)