> For the complete documentation index, see [llms.txt](https://9cscan-tx0x.gitbook.io/chrono-wallet-nine-chronicles/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://9cscan-tx0x.gitbook.io/chrono-wallet-nine-chronicles/developer-guide/background.md).

# Background

Implements the background context of the chrome extension. This is where important data storage and operations are executed.

### API

A description of the `api/graphql.js` implementation.

This is used when inquiring data or creating a transaction through the Nine Chronicles nodes.\
The API is used for the following purposes.

* **To get the balance of the account.**
  * getBalance()
* **To get whether the account is active or not.**
  * getActivationStatus()
* **Transfer NCG & Bridge NCG**
  * unsingedTx()
  * attachSignature()
  * stageTx()
  * getTransactionStatus()

### STORAGE

A description of the `storage.js` implementation.

Storage stores user account names and lists, encrypted wallets, and more.

{% hint style="warning" %} <mark style="color:red;">Never save a user's password in storage.</mark>
{% endhint %}

* **set / get**
  * It is used for general data reading and storing.
* **secureSet / secureGet**
  * It is used to store wallet data.
  * Data stored through 'secureSet' can only be accessed by 'secureGet' not 'get'. secureSet can be accessed externally. However, secureGet cannot be accessed from outside and can only be accessed in the background project.
  * By separating the logic, signing tasks through wallet are executed only in the background context, and only the results are returned.

### WALLET

A description of the `wallet.js` implementation.

**Wallet operation uses ethers.js.**

All account-related operations are performed here.

* Account Creation and Restoration
* Export/Import private key
* Sign Message / Validate Message
  * used for SendNCG / BridgeNCG
