File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed
packages/sdk/src/evm/core/classes Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @thirdweb-dev/sdk " : patch
3+ ---
4+
5+ Expose Transaction.populateTransaction()
Original file line number Diff line number Diff line change @@ -413,6 +413,12 @@ export class Transaction<
413413 * Get the signed transaction
414414 */
415415 async sign ( ) : Promise < string > {
416+ const populatedTx = await this . populateTransaction ( ) ;
417+ const signedTx = await this . contract . signer . signTransaction ( populatedTx ) ;
418+ return signedTx ;
419+ }
420+
421+ async populateTransaction ( ) : Promise < providers . TransactionRequest > {
416422 const gasOverrides = await this . getGasOverrides ( ) ;
417423 const overrides : CallOverrides = { ...gasOverrides , ...this . overrides } ;
418424
@@ -426,8 +432,7 @@ export class Transaction<
426432 overrides ,
427433 ) ;
428434 const populatedTx = await this . contract . signer . populateTransaction ( tx ) ;
429- const signedTx = await this . contract . signer . signTransaction ( populatedTx ) ;
430- return signedTx ;
435+ return populatedTx ;
431436 }
432437
433438 /**
@@ -845,7 +850,7 @@ export class DeployTransaction extends TransactionContext {
845850 return contractAddress ;
846851 }
847852
848- private async populateTransaction ( ) : Promise < providers . TransactionRequest > {
853+ public async populateTransaction ( ) : Promise < providers . TransactionRequest > {
849854 const gasOverrides = await this . getGasOverrides ( ) ;
850855 const overrides : CallOverrides = { ...gasOverrides , ...this . overrides } ;
851856
You can’t perform that action at this time.
0 commit comments