MCPcopy Index your code
hub / github.com/coral-xyz/backpack

github.com/coral-xyz/backpack @0.10.1-latest-4

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.10.1-latest-4 ↗ · + Follow
2,634 symbols 6,920 edges 750 files 64 documented · 2%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Backpack Wallet Extension

<strong>gm</strong>







<a href="https://docs.xnfts.dev"><img alt="Tutorials" src="https://img.shields.io/badge/docs-tutorials-blueviolet" /></a>
<a href="https://discord.gg/RhKxgS8SaD"><img alt="Discord Chat" src="https://img.shields.io/badge/chat-discord-blueviolet" /></a>

Note

Please note that this repo is a checkpoint from our internal private repo. It does not reflect the current state of the Backpack extension repo at any given time, but is presented as a best efforts attempt to open source the wallet. We intend to move all development into the open source repo, but have some low priority maintenance cleanup before we get there. This repo is presented as to not let perfect be the enemy of good. And we intend to try to continuously checkpoint with each published version of the extension.

Developing Locally

https://user-images.githubusercontent.com/101902546/173857300-fc139113-0af5-46fc-baad-236a2ebf63f1.m4p

Pull the code

git clone git@github.com:coral-xyz/backpack.git
cd backpack

Temporary preliminary steps

Enable self-signed local SSL certs

Go to chrome://flags/#allow-insecure-localhost and enable the toggle, then restart chrome. Note: Please don't enable this if you don't know what you're doing. It will leave you vulnerable to exploits if left on. It is recommended to undo this step when you are done developing.

Environment variables

Install dependencies

yarn install

You can also optionally rename .env.example to .env and set your own variables.

Build all packages for production

yarn build

Start everything inside ./packages for development

yarn start

Note: In a fresh repo, you should run yarn build before yarn start.

Troubleshooting

If you run into issues with builds try running yarn clean and then start again.

Seeing WebSocket connection to 'wss://localhost:9997/ws' failed error messages in your console?

You need to install a SSL certificate for localhost as the one provided by webpack-dev-server is considered invalid. This step is optional as react-refresh will still function without it, but it's a good idea to try and fix this error because otherwise your browser will be making a lot of failed requests and webpack-dev-server might not be functioning to its full capabilities.

A relatively simple way of doing this is using mkcert

Instructions for how to install a trusted self-signed cert on macOS -

cd packages/app-extension
brew install mkcert
mkcert localhost
mkcert -install

Now the next time you run yarn start the errors should no longer appear.

Install the development version of the extension

Go to chrome://extensions, enable developer mode (top right) and drag the packages/app-extension/dev dir into the window. This version will have (Dev) in the title and supports live-reloading.

Not seeing the dev folder?

  • Do you have a stale node process running? Try to kill it all: killall -9 node and start over
  • Try running yarn start from within packages/app-extension while running yarn start from root. This should work.

Optionally install the built extension

If you want to try the production build of the extension, run yarn build and drag the packages/app-extension/build dir into chrome://extensions as above. This version won't have hot-reloading and local plugins won't be visible unless you also run yarn start

License

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion by you shall be licensed at the discretion of the repository maintainers without any additional terms or conditions.

Extension points exported contracts — how you extend this code

EIP1193Provider (Interface)
(no doc) [7 implementers]
packages/provider-core/src/provider-ethereum.ts
EIP1193Provider (Interface)
(no doc) [6 implementers]
packages/provider-injection/src/types.ts
BackgroundClient (Interface)
(no doc) [7 implementers]
packages/common/src/channel/app-ui.ts
KeyringFactory (Interface)
(no doc) [11 implementers]
packages/secure-background/src/keyring/types.ts
InputListProps (Interface)
(no doc)
packages/react-common/src/components/base/Inputs.tsx
paths (Interface)
(no doc)
packages/secure-ui/src/_types/Blowfish_OpenApi_v20230605.ts
CustomTypeOptions (Interface)
(no doc)
packages/i18n/src/types.d.ts
CustomWindow (Interface)
(no doc)
packages/background/src/browser.ts

Core symbols most depended-on inside this repo

toString
called by 246
packages/secure-background/src/keyring/ledger.ts
get
called by 167
packages/provider-injection/src/index.ts
request
called by 86
packages/common/src/channel/app-ui.ts
emit
called by 51
packages/provider-core/src/common/PrivateEventEmitter.ts
useNavigation
called by 48
packages/app-extension/src/components/common/Layout/NavStack.tsx
getLogger
called by 45
packages/common/src/logging.ts
safeClientResponse
called by 41
packages/secure-background/src/background-clients/safeClientResponse.ts
useBackgroundClient
called by 40
packages/recoil/src/hooks/client.tsx

Shape

Function 1,474
Method 850
Class 195
Interface 106
Enum 9

Languages

TypeScript100%

Modules by API surface

packages/background/src/backend/solana-connection.ts105 symbols
packages/background/src/backend/core.ts89 symbols
packages/background/src/frontend/server-ui.ts72 symbols
packages/secure-background/src/store/KeyringStore/KeyringStore.ts48 symbols
packages/secure-background/src/services/svm/keyring.ts40 symbols
packages/secure-background/src/services/evm/keyring.ts40 symbols
packages/react-common/src/components/Icon/index.tsx40 symbols
packages/secure-background/src/store/SecureStore.ts36 symbols
packages/provider-core/src/provider-solana.ts34 symbols
packages/background/src/backend/ethereum-connection.ts34 symbols
packages/secure-background/src/keyring/types.ts32 symbols
packages/app-extension/src/components/Unlocked/Swap.tsx31 symbols

For agents

$ claude mcp add backpack \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page