Skip to content

Commit cd9ea69

Browse files
[SDK] Add erc20Value for makeOffer extension function (#6588)
1 parent dc892bd commit cd9ea69

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

.changeset/wicked-kings-joke.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 for makeOffer extension function

packages/thirdweb/src/extensions/marketplace/offers/write/makeOffer.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ export function makeOffer(options: BaseTransactionOptions<MakeOfferParams>) {
9494
}
9595
// otherwise determine the wrapped native token address for the chain
9696

97+
// TODO: auto wrap native tokens if the currency is a native token address
9798
// TODO: add known wrapped native token addresses for each chain on the chain config
9899

99100
const { getDeployedInfraContract } = await import(
@@ -128,6 +129,14 @@ export function makeOffer(options: BaseTransactionOptions<MakeOfferParams>) {
128129
tokenId: options.tokenId,
129130
totalPrice: normalizedPrice,
130131
},
132+
overrides: {
133+
erc20Value: isNativeTokenAddress(currency)
134+
? undefined
135+
: {
136+
tokenAddress: currency,
137+
amountWei: normalizedPrice,
138+
},
139+
},
131140
};
132141
},
133142
});

0 commit comments

Comments
 (0)