@@ -638,7 +638,8 @@ export default class WalletService {
638638 finalFee = TransactionGenerator . txFee ( txSize , feeRateInt )
639639 }
640640
641- const cellStatus = await core . rpc . getLiveCell ( withdrawingOutPoint , true )
641+ const sdkWithdrawingOutPoint = ConvertTo . toSdkOutPoint ( withdrawingOutPoint )
642+ const cellStatus = await core . rpc . getLiveCell ( sdkWithdrawingOutPoint , true )
642643 if ( cellStatus . status !== 'live' ) {
643644 throw new CellIsNotYetLive ( )
644645 }
@@ -689,9 +690,12 @@ export default class WalletService {
689690
690691 const outputs : Cell [ ] = [ output ]
691692
693+ const previousOutput = TypeConvert . toOutput ( cellStatus . cell . output )
692694 const input : Input = {
693695 previousOutput : withdrawingOutPoint ,
694696 since : minimalSince . toString ( ) ,
697+ lock : previousOutput . lock ,
698+ lockHash : LockUtils . computeScriptHash ( previousOutput . lock )
695699 }
696700
697701 return {
@@ -715,7 +719,7 @@ export default class WalletService {
715719 outputsData : outputs . map ( o => o . data || '0x' ) ,
716720 witnesses : [ ] ,
717721 witnessArgs : [ {
718- lock : '' ,
722+ lock : undefined ,
719723 inputType : '0x0000000000000000' ,
720724 outputType : undefined ,
721725 } ]
@@ -786,7 +790,7 @@ export default class WalletService {
786790 }
787791
788792 public signWitness = (
789- lock : string ,
793+ lock : string | undefined ,
790794 privateKey : string ,
791795 txHash : string ,
792796 inputType : string | undefined = undefined ,
@@ -797,10 +801,12 @@ export default class WalletService {
797801 inputType,
798802 outputType,
799803 }
800- return core . signWitnesses ( privateKey ) ( {
804+ const result = core . signWitnesses ( privateKey ) ( {
801805 transactionHash : txHash ,
802806 witnesses : [ witnessArg ]
803- } ) [ 0 ] as string
807+ } )
808+
809+ return result [ 0 ] as string
804810 }
805811
806812 // Derivate all child private keys for specified BIP44 paths.
0 commit comments