From dfdb6689af9325289b3401aa1ea24f04f6af726a Mon Sep 17 00:00:00 2001 From: daria-github Date: Thu, 2 May 2024 18:43:01 -0700 Subject: [PATCH] update readme --- packages/client/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/client/README.md b/packages/client/README.md index 70bb035..ee463ca 100644 --- a/packages/client/README.md +++ b/packages/client/README.md @@ -49,13 +49,13 @@ const FRAME_URL = 'https://frames.xmtp.chat/'; const initialFrame = await readMetadata(FRAME_URL); -// Extract from above -const action = initialFrame.buttons['1'].action; -const target = initialFrame.buttons['1'].target; -const postUrl = initialFrame.buttons['1'].post_url; +// Extract current button from above at button index +const button = frameMetadata.frameInfo.buttons[`${buttonIndex}`]; + +const { action, target, postUrl } = button; // If this is a transaction frame, do the below steps -const isTransaction = action === 'tx' && target && postUrl; +const isTransactionFrame = action === 'tx'; // First, make a POST request to the `target` URL to fetch data about the transaction, with a signed frame action payload in the POST body including the address of the connected wallet in the `address` field. const transactionInfo: {