File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -801,13 +801,13 @@ export abstract class AbstractUtxoCoin
801801 /**
802802 * Sign a transaction with a custom signing function. Example use case is express external signer
803803 * @param customSigningFunction custom signing function that returns a single signed transaction
804- * @param signTransactionParams parameters for custom signing function. Includes txPrebuild and pubs (for legacy tx only).
804+ * @param signTransactionParams parameters for custom signing function. Includes txPrebuild and pubs
805805 *
806806 * @returns signed transaction as hex string
807807 */
808808 async signWithCustomSigningFunction < TNumber extends number | bigint > (
809809 customSigningFunction : UtxoCustomSigningFunction < TNumber > ,
810- signTransactionParams : { txPrebuild : TransactionPrebuild < TNumber > ; pubs ? : string [ ] }
810+ signTransactionParams : { txPrebuild : TransactionPrebuild < TNumber > ; pubs : string [ ] }
811811 ) : Promise < SignedTransaction > {
812812 const txHex = signTransactionParams . txPrebuild . txHex ;
813813 assert ( txHex , 'missing txHex parameter' ) ;
Original file line number Diff line number Diff line change @@ -613,7 +613,7 @@ export interface IBaseCoin {
613613 presignTransaction ( params : PresignTransactionOptions ) : Promise < PresignTransactionOptions > ;
614614 signWithCustomSigningFunction ?(
615615 customSigningFunction : CustomSigningFunction ,
616- signTransactionParams : { txPrebuild : TransactionPrebuild ; pubs ? : string [ ] }
616+ signTransactionParams : { txPrebuild : TransactionPrebuild ; pubs : string [ ] }
617617 ) : Promise < SignedTransaction > ;
618618 newWalletObject ( walletParams : any ) : IWallet ;
619619 feeEstimate ( params : FeeEstimateOptions ) : Promise < any > ;
Original file line number Diff line number Diff line change @@ -2194,7 +2194,11 @@ export class Wallet implements IWallet {
21942194
21952195 if ( _ . isFunction ( params . customSigningFunction ) ) {
21962196 if ( typeof this . baseCoin . signWithCustomSigningFunction === 'function' ) {
2197- return this . baseCoin . signWithCustomSigningFunction ( params . customSigningFunction , signTransactionParams ) ;
2197+ assert ( pubs , 'pubs are required for custom signing' ) ;
2198+ return this . baseCoin . signWithCustomSigningFunction ( params . customSigningFunction , {
2199+ ...signTransactionParams ,
2200+ pubs,
2201+ } ) ;
21982202 }
21992203 const keys = await this . baseCoin . keychains ( ) . getKeysForSigning ( { wallet : this } ) ;
22002204 const signTransactionParamsWithSeed = {
You can’t perform that action at this time.
0 commit comments