Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@dynamic-labs/wallet-book

Package Overview
Dependencies
Maintainers
2
Versions
537
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dynamic-labs/wallet-book

## Updating Wallet Book

  • 0.18.27
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

Wallet Book

Updating Wallet Book

  • Wallet Book

Adding First Party Wallet

Simply add an entry to firstPartyWalletsData in packages/wallet-book/src/build/sources/firstParty/index.ts and Compile & Publish

For example:

  argentx: {
    brand: {
      alt: 'Argent Wallet',
      primaryColor: '#FF875B',
      spriteId: 'argentx',
    },
    desktop: {
      chromeId: 'dlcobpjiigpikoobohmabehhmhfoodbb',
      firefoxId: 'argent-x',
    },
    name: 'Argent X',
  },

Required fields:

  • brand
    • alt
    • primaryColor
    • spriteId - The id used in the iconic svg
    • name

Refer to WalletRecordsSchema for more schema options

Adding injected (browser extension) wallets

Similar to adding first party wallets, we add another key, injectedConfig to the wallet object.

...
injectedConfig: [
  {
    chain: 'EVM',
    extensionLocators: [
      { flag: 'isOkxWallet', value: true },
      { flag: 'isOkexWallet', value: true }
    ],
    windowLocations: ['okxwallet']
  }
],
name: 'OKX'
Things to remember when adding a new wallet
  • IF the new wallet is also in wallletconnect.json: make sure that the key used in firstParty/index.ts is the same as the value from walletconnect.json as to inherit the properties from that wallet definition.
  • The value(s) in windowLocations map to window.<value from windowLocations>. i.e. okxwallet means window.okxwallet. The values can be a nested path that is dot delimited. If the wallet lives under window.ethereum or window.ethereum.providers, those window locations are imported by default.
  • For every extension locator you add for the new wallet, add the negation [{ flag: 'isOkxWallet', value: false }, ...] to the extensionLocators under the metamask key in firstParty.
  • If the new wallet is wallet connect enabled (exists in walletconnect.json), make sure to add: filterFromWalletConnect: true as a sibling to injectedConfig which will filter the wallet from the wallet connect connectors list and use wallet connect as fallback.

Refer to injectedConfigSchema for the schema options

Updating Wallet Connect Data

Adding overrides to WalletConnect

  • modify packages/wallet-book/src/build/sources/walletConnectOverrides/index.ts
  • Compile & Publish

Compile & Publish

The compiled json is stored in packages/wallet-book/wallet-book.json. When the file is updated and merged to main it will be published to S3 automatically.

Simply, make any changes that you need and:

  • run npx nx compile wallet-book
  • commit wallet-book.json
  • Open PR with changes and merge

FAQs

Package last updated on 19 Oct 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc