Skip to content

[SDK] Fix: stringify bigint erc20Value in useTransactionDetails #7360

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fluffy-paws-slide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"thirdweb": patch
---

Fix setting explicit amount on TransactionWidget
33 changes: 14 additions & 19 deletions apps/playground-web/src/components/pay/transaction-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,25 +40,20 @@ export function PayTransactionPreview() {
});

return (
<>
<StyledConnectButton />
<div className="h-10" />
{account && (
<TransactionWidget
client={THIRDWEB_CLIENT}
theme={theme === "light" ? "light" : "dark"}
transaction={claimTo({
contract: nftContract,
quantity: 1n,
tokenId: 2n,
to: account?.address || "",
})}
title={nft?.metadata?.name}
description={nft?.metadata?.description}
image={nft?.metadata?.image}
/>
)}
</>
<TransactionWidget
client={THIRDWEB_CLIENT}
theme={theme === "light" ? "light" : "dark"}
transaction={claimTo({
contract: nftContract,
quantity: 1n,
tokenId: 2n,
to: account?.address || "",
})}
amount={100n}
title={nft?.metadata?.name}
description={nft?.metadata?.description}
image={nft?.metadata?.image}
/>
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"transaction-details",
transaction.to,
transaction.chain.id,
transaction.erc20Value,
transaction.erc20Value?.toString(),

Check warning on line 60 in packages/thirdweb/src/react/core/hooks/useTransactionDetails.ts

View check run for this annotation

Codecov / codecov/patch

packages/thirdweb/src/react/core/hooks/useTransactionDetails.ts#L60

Added line #L60 was not covered by tests
],
queryFn: async (): Promise<TransactionDetails> => {
// Create contract instance for metadata fetching
Expand Down
11 changes: 0 additions & 11 deletions packages/thirdweb/src/react/web/ui/Bridge/CheckoutWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,17 +198,6 @@ type UIOptionsResult =
* />
* ```
*
* ### Enable/Disable payment methods
*
* You can use `disableOnramps` to prevent the use of onramps in the widget.
*
* ```tsx
* <CheckoutWidget
* client={client}
* disableOnramps
* />
* ```
*
* ### Customize the UI
*
* You can customize the UI of the `CheckoutWidget` component by passing a custom theme object to the `theme` prop.
Expand Down
17 changes: 0 additions & 17 deletions packages/thirdweb/src/react/web/ui/Bridge/TransactionWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -201,23 +201,6 @@ type UIOptionsResult =
* />
* ```
*
* ### Enable/Disable payment methods
*
* You can use `disableOnramps` to prevent the use of onramps in the widget.
*
* ```tsx
* <TransactionWidget
* client={client}
* transaction={prepareTransaction({
* to: "0x...",
* chain: ethereum,
* client: client,
* value: toUnits("0.001", 18),
* })}
* disableOnramps
* />
* ```
*
* ### Customize the UI
*
* You can customize the UI of the `TransactionWidget` component by passing a custom theme object to the `theme` prop.
Expand Down
Loading