@@ -71,7 +71,6 @@ function isMigratedAddress(wallet: IWallet, currentAddress: string): boolean {
7171interface VerifyCustomChangeAddressOptions {
7272 coin : AbstractUtxoCoin ;
7373 customChangeKeys : HandleVerifyAddressErrorOptions [ 'customChangeKeys' ] ;
74- addressType : HandleVerifyAddressErrorOptions [ 'addressType' ] ;
7574 addressDetails : HandleVerifyAddressErrorOptions [ 'addressDetails' ] ;
7675 currentAddress : HandleVerifyAddressErrorOptions [ 'currentAddress' ] ;
7776}
@@ -82,10 +81,10 @@ interface VerifyCustomChangeAddressOptions {
8281 * @return {boolean }
8382 */
8483async function verifyCustomChangeAddress ( params : VerifyCustomChangeAddressOptions ) : Promise < boolean > {
85- const { coin, customChangeKeys, addressType , addressDetails, currentAddress } = params ;
84+ const { coin, customChangeKeys, addressDetails, currentAddress } = params ;
8685 try {
8786 return await coin . verifyAddress (
88- _ . extend ( { addressType } , addressDetails , {
87+ _ . extend ( { } , addressDetails , {
8988 keychains : customChangeKeys ,
9089 address : currentAddress ,
9190 } )
@@ -106,7 +105,6 @@ interface HandleVerifyAddressErrorOptions {
106105 customChangeKeys ?: CustomChangeOptions [ 'keys' ] ;
107106 coin : AbstractUtxoCoin ;
108107 addressDetails ?: any ;
109- addressType ?: string ;
110108 considerMigratedFromAddressInternal ?: boolean ;
111109}
112110
@@ -118,7 +116,6 @@ async function handleVerifyAddressError({
118116 customChangeKeys,
119117 coin,
120118 addressDetails,
121- addressType,
122119 considerMigratedFromAddressInternal,
123120} : HandleVerifyAddressErrorOptions ) : Promise < HandleVerifyAddressErrorResponse > {
124121 // Todo: name server-side errors to avoid message-based checking [BG-5124]
@@ -137,7 +134,7 @@ async function handleVerifyAddressError({
137134 // attempt to verify address using custom change address keys if the wallet has that feature enabled
138135 if (
139136 customChangeKeys &&
140- ( await verifyCustomChangeAddress ( { coin, addressDetails, addressType , currentAddress, customChangeKeys } ) )
137+ ( await verifyCustomChangeAddress ( { coin, addressDetails, currentAddress, customChangeKeys } ) )
141138 ) {
142139 // address is valid against the custom change keys. Mark address as not external
143140 // and request signature verification for the custom change keys
@@ -239,7 +236,6 @@ export async function parseOutput({
239236 const addressDetailsVerification : AddressVerificationData = verification ?. addresses ?. [ currentAddress ] ?? { } ;
240237 debug ( 'Parsing address details for %s' , currentAddress ) ;
241238 let currentAddressDetails = undefined ;
242- let currentAddressType : string | undefined = undefined ;
243239 const RECIPIENT_THRESHOLD = 1000 ;
244240 try {
245241 // In the case of PSBTs, we can already determine the internal/external status of the output addresses
@@ -256,7 +252,6 @@ export async function parseOutput({
256252 // can just return the current output as is without contacting the server.
257253 if ( isWalletOutput ( currentOutput ) ) {
258254 const res = await coin . isWalletAddress ( {
259- addressType : AbstractUtxoCoin . inferAddressType ( { chain : currentOutput . chain } ) || undefined ,
260255 keychains : keychainArray ,
261256 address : currentAddress ,
262257 chain : currentOutput . chain ,
@@ -305,10 +300,9 @@ export async function parseOutput({
305300 } ) ;
306301 // verify that the address is on the wallet. verifyAddress throws if
307302 // it fails to correctly rederive the address, meaning it's external
308- currentAddressType = AbstractUtxoCoin . inferAddressType ( addressDetails ) || undefined ;
309303 currentAddressDetails = addressDetails ;
310304 await coin . verifyAddress (
311- _ . extend ( { addressType : currentAddressType } , addressDetails , {
305+ _ . extend ( { } , addressDetails , {
312306 keychains : keychainArray ,
313307 address : currentAddress ,
314308 } )
@@ -331,7 +325,6 @@ export async function parseOutput({
331325 txParams,
332326 customChangeKeys : customChange && customChange . keys ,
333327 addressDetails : currentAddressDetails ,
334- addressType : currentAddressType ,
335328 considerMigratedFromAddressInternal : verification . considerMigratedFromAddressInternal ,
336329 } )
337330 ) ;
0 commit comments