Skip to content

Commit f473fe6

Browse files
committed
update
1 parent 33c23e7 commit f473fe6

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

.changeset/silent-hats-melt.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+
Add erc20Value to buyFromListing transaction

packages/thirdweb/src/extensions/marketplace/direct-listings/write/buyFromListing.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ export function buyFromListing(
6666
? listing.pricePerToken * options.quantity
6767
: 0n,
6868
extraGas: 50_000n, // add extra gas to account for router call
69+
erc20Value: isNativeTokenAddress(listing.currencyContractAddress)
70+
? undefined
71+
: {
72+
amountWei: listing.pricePerToken * options.quantity,
73+
tokenAddress: listing.currencyContractAddress,
74+
},
6975
},
7076
};
7177
},

0 commit comments

Comments
 (0)