@@ -10,7 +10,6 @@ import {
1010 iBotListV300Abi ,
1111 iCreditFacadeV300MulticallAbi ,
1212} from "../../abi/v300.js" ;
13- import { AbstractMigrateCreditAccountsService } from "../accountMigration/AbstractMigrateCreditAccountsService.js" ;
1413import type { CreditAccountData } from "../base/index.js" ;
1514import { SDKConstruct } from "../base/index.js" ;
1615import {
@@ -287,6 +286,7 @@ export abstract class AbstractCreditAccountService extends SDKConstruct {
287286 */
288287 public async getConnectedBots (
289288 accountsToCheck : Array < { creditAccount : Address ; creditManager : Address } > ,
289+ legacyMigrationBot : Address | undefined ,
290290 ) : Promise < {
291291 legacy : GetConnectedBotsResult ;
292292 legacyMigration : GetConnectedMigrationBotsResult ;
@@ -307,19 +307,16 @@ export abstract class AbstractCreditAccountService extends SDKConstruct {
307307 } ) ,
308308 allowFailure : true ,
309309 } ) ,
310- this . getActiveMigrationBots ( accountsToCheck ) ,
310+ this . getActiveMigrationBots ( accountsToCheck , legacyMigrationBot ) ,
311311 ] ) ;
312312
313313 return { legacy : resp , legacyMigration : migration } ;
314314 }
315315 private async getActiveMigrationBots (
316316 accountsToCheck : Array < { creditAccount : Address ; creditManager : Address } > ,
317+ legacyMigrationBot : Address | undefined ,
317318 ) {
318- const migrationBot =
319- AbstractMigrateCreditAccountsService . getMigrationBotAddress (
320- this . sdk . chainId ,
321- ) ;
322- if ( migrationBot ) {
319+ if ( legacyMigrationBot ) {
323320 const result = await this . client . multicall ( {
324321 contracts : accountsToCheck . map ( ca => {
325322 const cm = this . sdk . marketRegister . findCreditManager (
@@ -333,14 +330,14 @@ export abstract class AbstractCreditAccountService extends SDKConstruct {
333330 address : cm . creditFacade . botList ,
334331 functionName : "getBotStatus" ,
335332 args : isV300 ( cm . creditFacade . version )
336- ? [ migrationBot . botAddress , ca . creditManager , ca . creditAccount ]
337- : [ migrationBot . botAddress , ca . creditAccount ] ,
333+ ? [ legacyMigrationBot , ca . creditManager , ca . creditAccount ]
334+ : [ legacyMigrationBot , ca . creditAccount ] ,
338335 } as const ;
339336 } ) ,
340337 allowFailure : true ,
341338 } ) ;
342339
343- return { result, migrationBot } ;
340+ return { result, botAddress : legacyMigrationBot } ;
344341 }
345342
346343 return undefined ;
0 commit comments