Skip to content

Commit

Permalink
Rename accoutAddress option of detectTokens to selectedAddress
Browse files Browse the repository at this point in the history
…for consistency
  • Loading branch information
MajorLift committed Feb 23, 2024
1 parent 08bc264 commit 38b1ee0
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions packages/assets-controllers/src/TokenDetectionController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ export class TokenDetectionController extends StaticIntervalPollingController<
}
await this.detectTokens({
networkClientId,
accountAddress: options.address,
selectedAddress: options.address,
});
}

Expand All @@ -457,7 +457,7 @@ export class TokenDetectionController extends StaticIntervalPollingController<
}: { selectedAddress?: string; networkClientId?: string } = {}) {
await this.detectTokens({
networkClientId,
accountAddress: selectedAddress,
selectedAddress,
});
this.setIntervalLength(DEFAULT_INTERVAL);
}
Expand All @@ -468,20 +468,21 @@ export class TokenDetectionController extends StaticIntervalPollingController<
*
* @param options - Options for token detection.
* @param options.networkClientId - The ID of the network client to use.
* @param options.accountAddress - the selectedAddress against which to detect for token balances.
* @param options.selectedAddress - the selectedAddress against which to detect for token balances.
*/
async detectTokens({
networkClientId,
accountAddress,
selectedAddress,
}: {
networkClientId?: NetworkClientId;
accountAddress?: string;
selectedAddress?: string;
} = {}): Promise<void> {
if (!this.isActive) {
return;
}

const addressAgainstWhichToDetect = accountAddress ?? this.#selectedAddress;
const addressAgainstWhichToDetect =
selectedAddress ?? this.#selectedAddress;
const {
chainId: chainIdAgainstWhichToDetect,
networkClientId: networkClientIdAgainstWhichToDetect,
Expand Down

0 comments on commit 38b1ee0

Please sign in to comment.