File tree Expand file tree Collapse file tree 3 files changed +27
-16
lines changed
wallets/in-app/implementations/lib/core Expand file tree Collapse file tree 3 files changed +27
-16
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " thirdweb " : patch
3
+ ---
4
+
5
+ Fix legacy transactions with in-app wallets
Original file line number Diff line number Diff line change @@ -31,9 +31,7 @@ export async function uploadBatch<const TFiles extends UploadableFile[]>(
31
31
) ;
32
32
}
33
33
throw new Error (
34
- `Failed to upload files to IPFS - ${ res . status } - ${
35
- res . statusText
36
- } - ${ await res . text ( ) } `,
34
+ `Failed to upload files to IPFS - ${ res . status } - ${ res . statusText } ` ,
37
35
) ;
38
36
}
39
37
Original file line number Diff line number Diff line change @@ -178,23 +178,31 @@ export class InAppWallet {
178
178
params : undefined ,
179
179
} ) ;
180
180
const _signTransaction = async ( tx : SendTransactionOption ) => {
181
+ // biome-ignore lint/suspicious/noExplicitAny: ethers tx transformation
182
+ const transaction : Record < string , any > = {
183
+ to : tx . to ?? undefined ,
184
+ data : tx . data ,
185
+ value : tx . value ,
186
+ gasLimit : tx . gas ,
187
+ nonce : tx . nonce ,
188
+ chainId : tx . chainId ,
189
+ } ;
190
+ if ( tx . maxFeePerGas ) {
191
+ // ethers (in the iframe) rejects any type 0 trasaction with unknown keys
192
+ // TODO remove this once iframe is upgraded to v5
193
+ transaction . accessList = tx . accessList ;
194
+ transaction . maxFeePerGas = tx . maxFeePerGas ;
195
+ transaction . maxPriorityFeePerGas = tx . maxPriorityFeePerGas ;
196
+ transaction . type = 2 ;
197
+ } else {
198
+ transaction . gasPrice = tx . gasPrice ;
199
+ transaction . type = 0 ;
200
+ }
181
201
const { signedTransaction } =
182
202
await querier . call < SignTransactionReturnType > ( {
183
203
procedureName : "signTransaction" ,
184
204
params : {
185
- transaction : {
186
- to : tx . to ?? undefined ,
187
- data : tx . data ,
188
- value : tx . value ,
189
- gasLimit : tx . gas ,
190
- gasPrice : tx . gasPrice ,
191
- nonce : tx . nonce ,
192
- chainId : tx . chainId ,
193
- accessList : tx . accessList ,
194
- maxFeePerGas : tx . maxFeePerGas ,
195
- maxPriorityFeePerGas : tx . maxPriorityFeePerGas ,
196
- type : tx . maxFeePerGas ? 2 : 0 ,
197
- } ,
205
+ transaction,
198
206
chainId : tx . chainId ,
199
207
rpcEndpoint : `https://${ tx . chainId } .rpc.thirdweb.com` , // TODO (ew) shouldnt be needed
200
208
} ,
You can’t perform that action at this time.
0 commit comments