# Creating the wallet

All these experiments and examples are expected to be tried out in ipython command shell. Start the command shell with `ipython`

Node is the chain with which you wish to interact.

```
node = "wss://elizabeth.peerplays.download/api"
```

`password = "password"`

`from peerplays import PeerPlays`

```
p = PeerPlays(node)
```

To create a new wallet

`p.newWallet(password)`

Unlock the wallet

`p.unlock(password)`

Add private key / keys

`p.wallet.addPrivateKey("5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3")`

## Additional Methods

`p.wallet.unlocked() #returns True if wallet is unlocked. Wallet needs to be unlocked to perform operations on the blockchain.`

`p.wallet.getAccounts() #Lists all the accounts associated with the private key.`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://community.peerplays.com/api/python-peerplays/creating-the-peerplays-wallet.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
