2.0.6 • Published 6 days ago

@dynamic-labs/wallet-book v2.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
6 days ago

Wallet Book

Updating 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',
    injectedConfig: [
      {
        chain: 'EVM',
        extensionLocators:
      }
    ]
  },

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'

If you need to override any of the following functions: signMessage, getAddress, getSigner, isInstalledOnBrowser, etc...

  1. Create a file in the respective ethereum/src/injected/ or solana/src/injected/. The basic file should follow this form:
export class <NameOfConnector> extends InjectedWalletBase {
  override name = '<Name Here>';
  override walletConnectorFallback = true; // only specified on evm wallet connectors

  constructor(props: EthWalletConnectorOpts) {
    super(props);

    this.wallet = findWalletBookWallet(this.walletBook, this.key);
  }

  // override the methods you need below
  override async getAddress() {
    ...
  }
}
  1. Open fetchInjectedWalletConnectors.ts for the respective network package (etherem/solana/...) and add the new InjectedWalletBase class to injectedWalletOverrides and the key (normalized name) to the filterInjectedWalletKeyOverrides

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.

Checklist before submitting the PR:

: If this change adds a new file to the injected folder, add the wallet key to the walletBookFallbackList in packages/wallet-book/src/build/index.ts

: If the name is changing in walletbook, make sure that if there is no new file in the injected/ folder, you make sure at least the shortName normalizes down to the wallet key

myawesomenewwallet: {
  ...
  injectedConfig: { ... },
  shortName: 'My Awesome New Wallet', // maps down to the key if you lowercase and remove special characters and spaces
  name: 'Awesome Wallet' // this will be displayed in the wallet list and can be changed as long as the `shortName` normalizes to the key
}

NOTE:

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
2.1.0-alpha.12

7 days ago

2.1.0-alpha.11

7 days ago

2.1.0-alpha.13

6 days ago

2.0.6

6 days ago

2.1.0-alpha.10

9 days ago

2.1.0-alpha.9

9 days ago

1.4.11

13 days ago

2.0.5

13 days ago

2.1.0-alpha.8

13 days ago

2.1.0-alpha.7

14 days ago

2.0.4

15 days ago

2.1.0-alpha.6

15 days ago

1.4.10

16 days ago

2.1.0-alpha.5

16 days ago

2.1.0-alpha.4

16 days ago

2.1.0-alpha.3

16 days ago

2.0.3

17 days ago

1.4.9

19 days ago

1.4.8

21 days ago

2.0.2

20 days ago

2.0.1

21 days ago

2.1.0-alpha.2

20 days ago

2.1.0-alpha.1

20 days ago

2.0.0-alpha.32

24 days ago

2.0.0

24 days ago

2.1.0-alpha.0

24 days ago

1.4.7

27 days ago

2.0.0-alpha.31

28 days ago

2.0.0-alpha.30

28 days ago

1.4.6

30 days ago

2.0.0-alpha.29

29 days ago

2.0.0-alpha.28

30 days ago

2.0.0-alpha.27

30 days ago

2.0.0-alpha.26

1 month ago

1.4.5

1 month ago

1.4.4

1 month ago

2.0.0-alpha.25

1 month ago

2.0.0-alpha.24

1 month ago

2.0.0-alpha.23

1 month ago

1.4.3

1 month ago

2.0.0-alpha.22

1 month ago

1.4.2

1 month ago

1.4.1

2 months ago

1.4.0

2 months ago

2.0.0-alpha.21

2 months ago

2.0.0-alpha.19

2 months ago

2.0.0-alpha.20

2 months ago

2.0.0-alpha.18

2 months ago

2.0.0-alpha.17

2 months ago

2.0.0-alpha.16

2 months ago

2.0.0-alpha.15

2 months ago

2.0.0-alpha.14

2 months ago

2.0.0-alpha.13

2 months ago

2.0.0-alpha.11

2 months ago

2.0.0-alpha.12

2 months ago

2.0.0-alpha.10

2 months ago

1.3.1

2 months ago

2.0.0-alpha.9

2 months ago

1.2.1

2 months ago

2.0.0-alpha.7

2 months ago

2.0.0-alpha.8

2 months ago

1.3.0

2 months ago

1.2.0

2 months ago

1.1.5

2 months ago

2.0.0-alpha.6

2 months ago

2.0.0-alpha.4

3 months ago

2.0.0-alpha.5

3 months ago

1.1.4

3 months ago

1.1.3

3 months ago

2.0.0-alpha.3

3 months ago

1.1.2

3 months ago

2.0.0-alpha.0

3 months ago

2.0.0-alpha.1

3 months ago

2.0.0-alpha.2

3 months ago

1.1.1

3 months ago

1.2.0-alpha.1

3 months ago

1.2.0-alpha.0

3 months ago

1.1.0-alpha.26

3 months ago

1.1.0

3 months ago

1.1.0-alpha.25

3 months ago

1.1.0-alpha.19

3 months ago

1.1.0-alpha.22

3 months ago

1.1.0-alpha.21

3 months ago

1.1.0-alpha.20

3 months ago

1.1.0-alpha.24

3 months ago

1.1.0-alpha.23

3 months ago

1.0.9

3 months ago

1.1.0-alpha.15

3 months ago

1.1.0-alpha.18

3 months ago

1.1.0-alpha.17

3 months ago

1.1.0-alpha.16

3 months ago

1.0.8

3 months ago

1.0.7

4 months ago

1.1.0-alpha.14

4 months ago

1.1.0-alpha.13

4 months ago

1.1.0-phantom.0

4 months ago

1.1.0-alpha.12

4 months ago

1.0.6

4 months ago

1.1.0-alpha.11

4 months ago

1.0.5

4 months ago

1.1.0-alpha.10

4 months ago

1.0.4

4 months ago

1.1.0-alpha.9

4 months ago

1.1.0-alpha.8

4 months ago

1.0.3

4 months ago

1.1.0-alpha.7

4 months ago

1.1.0-alpha.6

4 months ago

1.1.0-alpha.5

5 months ago

1.1.0-alpha.4

5 months ago

1.1.0-alpha.3

5 months ago

1.0.2

5 months ago

0.19.7

5 months ago

1.1.0-alpha.2

5 months ago

1.1.0-alpha.1

5 months ago

1.1.0-alpha.0

5 months ago

1.0.1

5 months ago

0.19.6

5 months ago

0.18.100-viem.31

5 months ago

1.0.0

5 months ago

1.0.0-alpha.10

5 months ago

1.0.0-alpha.12

5 months ago

1.0.0-alpha.11

5 months ago

1.0.0-alpha.14

5 months ago

1.0.0-alpha.13

5 months ago

1.0.0-alpha.9

5 months ago

1.0.0-alpha.8

5 months ago

0.19.5

5 months ago

1.0.0-alpha.7

5 months ago

0.19.0-alpha.20

7 months ago

0.19.0-alpha.23

7 months ago

0.19.0-alpha.24

7 months ago

0.19.0-alpha.21

7 months ago

0.19.0-alpha.22

7 months ago

0.19.0-alpha.27

7 months ago

0.19.0-alpha.28

7 months ago

0.19.0-alpha.25

7 months ago

0.19.0-alpha.26

7 months ago

0.17.18

10 months ago

0.17.17

10 months ago

0.17.19

10 months ago

0.17.21

10 months ago

0.17.20

10 months ago

0.17.23

10 months ago

0.17.22

10 months ago

0.17.25

10 months ago

0.17.100-viem.4

10 months ago

0.17.24

10 months ago

0.17.100-viem.3

10 months ago

0.17.27

10 months ago

0.17.100-viem.2

10 months ago

0.17.26

10 months ago

0.18.9

9 months ago

0.17.100-viem.8

10 months ago

0.17.100-viem.7

10 months ago

0.17.100-viem.6

10 months ago

0.17.100-viem.5

10 months ago

0.17.100-viem.9

10 months ago

0.18.1

9 months ago

0.18.2

9 months ago

0.18.4

9 months ago

0.18.5

9 months ago

0.18.6

9 months ago

0.18.7

9 months ago

0.18.8

9 months ago

0.18.0-beta.32

9 months ago

0.17.29

10 months ago

0.18.0-beta.31

9 months ago

0.17.28

10 months ago

0.18.0-beta.30

9 months ago

0.18.0

9 months ago

0.17.32

9 months ago

0.17.31

9 months ago

0.17.34

9 months ago

0.17.33

9 months ago

0.17.30

9 months ago

0.18.0-beta.29

9 months ago

0.18.0-beta.28

9 months ago

0.18.100-viem.1

9 months ago

0.18.100-viem.0

9 months ago

0.18.100-viem.3

9 months ago

0.18.100-viem.2

9 months ago

0.18.100-viem.5

9 months ago

0.18.100-viem.4

9 months ago

0.18.100-viem.7

9 months ago

0.18.100-viem.6

9 months ago

0.18.100-viem.9

9 months ago

0.18.100-viem.8

9 months ago

0.18.0-RC.8

11 months ago

0.18.0-RC.9

10 months ago

1.0.0-alpha.6

5 months ago

1.0.0-alpha.5

5 months ago

1.0.0-alpha.4

5 months ago

1.0.0-alpha.3

5 months ago

1.0.0-alpha.1

6 months ago

1.0.0-alpha.0

6 months ago

0.18.0-RC.10

10 months ago

0.18.0-RC.11

10 months ago

0.18.0-RC.16

10 months ago

0.18.0-RC.17

10 months ago

0.18.0-RC.18

10 months ago

0.18.0-RC.19

10 months ago

0.18.0-RC.12

10 months ago

0.18.0-RC.13

10 months ago

0.18.0-RC.14

10 months ago

0.18.0-RC.15

10 months ago

0.18.0-RC.20

10 months ago

0.18.0-RC.21

10 months ago

0.18.0-RC.22

10 months ago

0.18.0-RC.27

9 months ago

0.18.0-RC.23

9 months ago

0.18.0-RC.24

9 months ago

0.18.0-RC.25

9 months ago

0.18.0-RC.26

9 months ago

0.18.11

8 months ago

0.18.100-viem.10

9 months ago

0.18.10

9 months ago

0.18.13

8 months ago

0.18.100-viem.12

8 months ago

0.18.12

8 months ago

0.18.100-viem.11

8 months ago

0.18.15

8 months ago

0.18.14

8 months ago

0.18.17

8 months ago

0.18.16

8 months ago

0.19.0

6 months ago

0.19.1

6 months ago

0.19.2

6 months ago

0.19.3

6 months ago

0.19.4

5 months ago

0.18.19

8 months ago

0.18.100-viem.18

8 months ago

0.18.18

8 months ago

0.18.100-viem.17

8 months ago

0.18.100-viem.19

8 months ago

0.18.100-viem.14

8 months ago

0.18.100-viem.13

8 months ago

0.18.100-viem.16

8 months ago

0.18.100-viem.15

8 months ago

0.18.22

7 months ago

0.18.21

7 months ago

0.18.24

7 months ago

0.18.23

7 months ago

0.18.26

7 months ago

0.18.25

7 months ago

0.18.28

6 months ago

0.18.27

7 months ago

0.18.20

8 months ago

0.19.0-alpha.8

8 months ago

0.19.0-alpha.7

8 months ago

0.19.0-alpha.6

9 months ago

0.19.0-alpha.5

9 months ago

0.19.0-alpha.9

8 months ago

0.18.29

6 months ago

0.18.100-viem.30

5 months ago

0.19.0-alpha.0

9 months ago

0.19.0-alpha.4

9 months ago

0.19.0-alpha.3

9 months ago

0.19.0-alpha.2

9 months ago

0.18.30

5 months ago

0.19.0-alpha.1

9 months ago

0.18.100-viem.21

7 months ago

0.18.100-viem.20

8 months ago

0.18.100-viem.23

7 months ago

0.18.100-viem.22

7 months ago

0.19.0-alpha.12

7 months ago

0.19.0-alpha.13

7 months ago

0.19.0-alpha.10

7 months ago

0.19.0-alpha.11

7 months ago

0.18.100-viem.29

6 months ago

0.19.0-alpha.16

7 months ago

0.18.100-viem.28

6 months ago

0.19.0-alpha.17

7 months ago

0.19.0-alpha.14

7 months ago

0.19.0-alpha.15

7 months ago

0.18.100-viem.25

7 months ago

0.18.100-viem.24

7 months ago

0.19.0-alpha.18

7 months ago

0.18.100-viem.27

7 months ago

0.19.0-alpha.19

7 months ago

0.18.100-viem.26

7 months ago

0.17.14

11 months ago

0.17.13

11 months ago

0.17.16

11 months ago

0.17.15

11 months ago

0.17.100-viem.1

11 months ago

0.17.12

11 months ago

0.17.11

11 months ago

0.18.0-RC.7

11 months ago

0.17.10

11 months ago

0.17.9

11 months ago

0.18.0-RC.6

11 months ago

0.17.8

11 months ago

0.18.0-RC.5

11 months ago

0.18.0-RC.4

11 months ago

0.18.0-RC.3

11 months ago

0.17.7

11 months ago

0.18.0-RC.2

11 months ago

0.17.6

11 months ago

0.17.5

11 months ago

0.17.4

11 months ago

0.17.3

11 months ago

0.18.0-RC.1

11 months ago

0.17.2

11 months ago

0.18.0-RC.0

11 months ago

0.17.1

11 months ago

0.17.0

11 months ago

0.0.20

11 months ago

0.17.0-RC.33

11 months ago

0.17.0-RC.32

11 months ago

0.17.0-RC.31

11 months ago

0.17.0-RC.30

11 months ago

0.17.0-RC.29

11 months ago

0.17.0-RC.28

11 months ago

0.17.0-RC.27

11 months ago

0.17.0-RC.26

11 months ago

0.17.0-RC.25

11 months ago

0.17.0-RC.24

11 months ago

0.0.19

11 months ago

0.0.18

11 months ago

0.0.17

11 months ago

0.0.16

12 months ago

0.0.15

1 year ago

0.0.14

1 year ago

0.0.13

1 year ago

0.0.12

1 year ago

0.0.11

1 year ago

0.0.10

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago