Skip to content

Commit c2596fe

Browse files
committed
Properly type purchaseData as Record<string, unknown>
1 parent 9c2b0f7 commit c2596fe

File tree

4 files changed

+10
-11
lines changed

4 files changed

+10
-11
lines changed

.changeset/orange-files-admire.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"thirdweb": patch
3+
---
4+
5+
properly type purchaseData

packages/thirdweb/src/react/core/hooks/connection/ConnectButtonProps.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ export type PayUIOptions = Prettify<
117117
*
118118
* This details will be stored with the purchase and can be retrieved later via the status API or Webhook
119119
*/
120-
purchaseData?: object;
120+
purchaseData?: Record<string, unknown>;
121121

122122
/**
123123
* Callback to be called when the user successfully completes the purchase.

packages/thirdweb/src/react/core/hooks/transaction/useSendTransaction.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export type SendTransactionPayModalConfig =
6565
testMode?: boolean;
6666
preferredProvider?: FiatProvider;
6767
};
68-
purchaseData?: object;
68+
purchaseData?: Record<string, unknown>;
6969
/**
7070
* Callback to be called when the user successfully completes the purchase.
7171
*/

packages/thirdweb/src/react/web/ui/PayEmbed.tsx

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -363,9 +363,7 @@ export function PayEmbed(props: PayEmbedProps) {
363363
? ["card"]
364364
: ["crypto", "card"]
365365
}
366-
purchaseData={
367-
props.payOptions?.purchaseData as Record<string, unknown> | undefined
368-
}
366+
purchaseData={props.payOptions?.purchaseData}
369367
theme={theme}
370368
title={metadata?.name || "Buy"}
371369
tokenAddress={
@@ -390,9 +388,7 @@ export function PayEmbed(props: PayEmbedProps) {
390388
? ["crypto"]
391389
: ["crypto", "card"]
392390
}
393-
purchaseData={
394-
props.payOptions?.purchaseData as Record<string, unknown> | undefined
395-
}
391+
purchaseData={props.payOptions?.purchaseData}
396392
seller={props.payOptions.paymentInfo.sellerAddress as Address}
397393
theme={theme}
398394
tokenAddress={
@@ -414,9 +410,7 @@ export function PayEmbed(props: PayEmbedProps) {
414410
? ["crypto"]
415411
: ["crypto", "card"]
416412
}
417-
purchaseData={
418-
props.payOptions?.purchaseData as Record<string, unknown> | undefined
419-
}
413+
purchaseData={props.payOptions?.purchaseData}
420414
theme={theme}
421415
title={metadata?.name}
422416
transaction={props.payOptions.transaction}

0 commit comments

Comments
 (0)