From 6b173977a61ac752fed801fb94b48fa15f49aafb Mon Sep 17 00:00:00 2001 From: Nur Fikri Date: Thu, 30 May 2024 20:34:50 +0700 Subject: [PATCH] fix(example): throw signing client --- example/starter/src/pages/send-token.tsx | 29 ++++++++++++------------ 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/example/starter/src/pages/send-token.tsx b/example/starter/src/pages/send-token.tsx index b24434bf..e8c7aa42 100644 --- a/example/starter/src/pages/send-token.tsx +++ b/example/starter/src/pages/send-token.tsx @@ -37,6 +37,7 @@ const SendToken = () => { const sendToken = async () => { try { + if (!signingClient) throw new Error("signingClient is not ready"); const result = await sendTokensAsync({ signingClient, recipientAddress: formData.recipientAddress, @@ -56,6 +57,10 @@ const SendToken = () => { description: ( { void navigator.clipboard.writeText(result.transactionHash); toast({ @@ -63,13 +68,9 @@ const SendToken = () => { title: "coppied transactionHash to clipboard", }); }} - bg="green.700" - py={1} px={2} + py={1} textAlign="left" - color="white" - borderRadius={4} - noOfLines={1} wordBreak="break-all" > Copy transactionHash: {result.transactionHash} @@ -85,24 +86,24 @@ const SendToken = () => { }; return ( - + Send Token {isConnected ? ( - + Coin + Recipient address setFormData({ ...formData, recipientAddress: event.currentTarget.value, }) } + type="text" /> Amount setFormData({ ...formData, amount: event.currentTarget.value, }) } + type="text" /> Memo setFormData({ ...formData, memo: event.currentTarget.value, }) } + type="text" /> -