[API Reference](../README.md) > [AccountService](../classes/AccountService.md)



# Class: AccountService


Watch for changes in the default account.

For more information, see [Account Changes](Configuration#accountchanges).

## Index

### Properties

* [AccountChangedEventTopic](AccountService.md#AccountChangedEventTopic)


### Methods

* [endAccountWatch](AccountService.md#endAccountWatch)
* [initiateAccountWatch](AccountService.md#initiateAccountWatch)
* [subscribeToAccountChanges](AccountService.md#subscribeToAccountChanges)



---
## Properties
<a id="AccountChangedEventTopic"></a>

### «Static» AccountChangedEventTopic

**●  AccountChangedEventTopic**:  *`string`*  = "AccountService.account.changed"

*Defined in accountService.ts:13*





___


## Methods
<a id="endAccountWatch"></a>

### «Static» endAccountWatch

► **endAccountWatch**(): `void`



*Defined in accountService.ts:69*



Turn off the system that watches for default account changes.




**Returns:** `void`





___

<a id="initiateAccountWatch"></a>

### «Static» initiateAccountWatch

► **initiateAccountWatch**(): `Promise`.<`void`>



*Defined in accountService.ts:27*



Initializes the system that watches for default account changes.

`initiateAccountWatch` is called automatically by Arc.js when you pass `true` for `watchForAccountChanges` to `InitializeArcJs`. You may also call it manually yourself.

Then you may request to be notified whenever the current account changes by calling [AccountService.subscribeToAccountChanges](/api/classes/AccountService#subscribeToAccountChanges)




**Returns:** `Promise`.<`void`>





___

<a id="subscribeToAccountChanges"></a>

### «Static» subscribeToAccountChanges

► **subscribeToAccountChanges**(callback: *`function`*): [IEventSubscription](../interfaces/IEventSubscription.md)



*Defined in accountService.ts:85*



Subscribe to be notified whenever the current account changes, like this:

    AccountService.subscribeToAccountChanges((account: Address) => { ... });


**Parameters:**

| Param | Type | Description |
| ------ | ------ | ------ |
| callback | `function`   |  - |





**Returns:** [IEventSubscription](../interfaces/IEventSubscription.md)
A subscription to the event.  Unsubscribe by calling `[theSubscription].unsubscribe()`.






___


