@dynamic-labs/wallet-book 0.19.0-alpha.14 → 0.19.0-alpha.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,4 +1,6 @@
1
1
 
2
+ ## [0.19.0-alpha.15](https://github.com/dynamic-labs/DynamicAuth/compare/v0.19.0-alpha.14...v0.19.0-alpha.15) (2023-10-11)
3
+
2
4
  ## [0.19.0-alpha.14](https://github.com/dynamic-labs/DynamicAuth/compare/v0.19.0-alpha.13...v0.19.0-alpha.14) (2023-10-10)
3
5
 
4
6
 
package/README.md CHANGED
@@ -27,6 +27,12 @@ For example:
27
27
  firefoxId: 'argent-x',
28
28
  },
29
29
  name: 'Argent X',
30
+ injectedConfig: [
31
+ {
32
+ chain: 'EVM',
33
+ extensionLocators:
34
+ }
35
+ ]
30
36
  },
31
37
  ```
32
38
 
@@ -40,6 +46,34 @@ Required fields:
40
46
 
41
47
  Refer to `WalletRecordsSchema` for more schema options
42
48
 
49
+ ### Adding injected (browser extension) wallets
50
+
51
+ Similar to [adding first party wallets](#adding-first-party-wallet), we add another key, `injectedConfig` to the wallet object.
52
+
53
+ ```
54
+ ...
55
+ injectedConfig: [
56
+ {
57
+ chain: 'EVM',
58
+ extensionLocators: [
59
+ { flag: 'isOkxWallet', value: true },
60
+ { flag: 'isOkexWallet', value: true }
61
+ ],
62
+ windowLocations: ['okxwallet']
63
+ }
64
+ ],
65
+ name: 'OKX'
66
+ ```
67
+
68
+ #### Things to remember when adding a new wallet
69
+
70
+ - `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.
71
+ - 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.
72
+ - 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.
73
+ - 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.
74
+
75
+ Refver to `injectedConfigSchema` for the schema options
76
+
43
77
  ### Updating Wallet Connect Data
44
78
 
45
79
  - Download the data from : https://registry.walletconnect.org/data/wallets.json replace
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/wallet-book",
3
- "version": "0.19.0-alpha.14",
3
+ "version": "0.19.0-alpha.15",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/dynamic-labs/DynamicAuth.git",
@@ -26,7 +26,7 @@
26
26
  },
27
27
  "dependencies": {
28
28
  "zod": "3.21.4",
29
- "@dynamic-labs/logger": "0.19.0-alpha.14"
29
+ "@dynamic-labs/logger": "0.19.0-alpha.15"
30
30
  },
31
31
  "peerDependencies": {
32
32
  "react": "^17.0.2 || ^18.0.0",
@@ -10,13 +10,6 @@ export declare const walletConnectSourceData: Record<string, {
10
10
  universal: string | null;
11
11
  };
12
12
  sdks: string[];
13
- metadata: {
14
- shortName: string | null;
15
- colors: {
16
- primary: string | null;
17
- secondary: string | null;
18
- };
19
- };
20
13
  app: {
21
14
  android: string | null;
22
15
  ios: string | null;
@@ -44,12 +37,19 @@ export declare const walletConnectSourceData: Record<string, {
44
37
  injected_id: string;
45
38
  namespace: string;
46
39
  }[] | null;
40
+ metadata: {
41
+ shortName: string | null;
42
+ colors: {
43
+ primary: string | null;
44
+ secondary: string | null;
45
+ };
46
+ };
47
47
  slug: string;
48
48
  supported_standards: {
49
- title: string;
50
49
  id: string;
51
50
  standard_id: number;
52
51
  standard_prefix: string;
52
+ title: string;
53
53
  url: string;
54
54
  }[];
55
55
  updatedAt: string;