Skip to content

Commit 259151c

Browse files
committed
[SDK] Add erc20Value to buyFromListing transaction
1 parent 33c23e7 commit 259151c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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)