@reef-knot/ledger-connector 4.1.4 → 4.3.0
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/dist/hid/connector.d.ts.map +1 -1
- package/dist/hid/connector.js +31 -0
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connector.d.ts","sourceRoot":"","sources":["../../src/hid/connector.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAErC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"connector.d.ts","sourceRoot":"","sources":["../../src/hid/connector.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAErC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACnD,eAAO,MAAM,WAAW,cAAc,CAAC;AACvC,eAAO,MAAM,IAAI,WAAW,CAAC;AAG7B,wBAAgB,kBAAkB,CAAC,EACjC,GAAG,EACH,YAAY,GACb,EAAE;IACD,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5B,YAAY,EAAE,KAAK,CAAC;CACrB,yGAwGA;yBA9Ge,kBAAkB"}
|
package/dist/hid/connector.js
CHANGED
|
@@ -90,6 +90,35 @@ function ledgerHIDConnector({
|
|
|
90
90
|
}
|
|
91
91
|
});
|
|
92
92
|
},
|
|
93
|
+
switchChain(_a) {
|
|
94
|
+
return __awaiter(this, arguments, void 0, function* ({
|
|
95
|
+
chainId
|
|
96
|
+
}) {
|
|
97
|
+
var _b;
|
|
98
|
+
const id = chainId.toString(16);
|
|
99
|
+
emitter.emit('change', {
|
|
100
|
+
chainId: Number(chainId)
|
|
101
|
+
});
|
|
102
|
+
return Promise.resolve((_b = chains.find(x => x.id === chainId)) !== null && _b !== void 0 ? _b : {
|
|
103
|
+
id: chainId,
|
|
104
|
+
name: `Chain ${id}`,
|
|
105
|
+
network: `${id}`,
|
|
106
|
+
nativeCurrency: {
|
|
107
|
+
decimals: 18,
|
|
108
|
+
name: 'Ether',
|
|
109
|
+
symbol: 'ETH'
|
|
110
|
+
},
|
|
111
|
+
rpcUrls: {
|
|
112
|
+
default: {
|
|
113
|
+
http: ['']
|
|
114
|
+
},
|
|
115
|
+
public: {
|
|
116
|
+
http: ['']
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
},
|
|
93
122
|
onDisconnect() {
|
|
94
123
|
// Is called when HID API emits 'disconnect' event for some reason.
|
|
95
124
|
// For example, the device was manually unplugged.
|
|
@@ -98,9 +127,11 @@ function ledgerHIDConnector({
|
|
|
98
127
|
},
|
|
99
128
|
onAccountsChanged() {
|
|
100
129
|
// NOOP
|
|
130
|
+
// HID Ledger cannot change account by itself
|
|
101
131
|
},
|
|
102
132
|
onChainChanged() {
|
|
103
133
|
// NOOP
|
|
134
|
+
// HID Ledger cannot change chain by itself
|
|
104
135
|
}
|
|
105
136
|
}));
|
|
106
137
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reef-knot/ledger-connector",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.3.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@types/w3c-web-hid": "^1.0.2",
|
|
36
|
-
"viem": ">=2.
|
|
37
|
-
"wagmi": ">=2.
|
|
36
|
+
"viem": ">=2.23",
|
|
37
|
+
"wagmi": ">=2.14",
|
|
38
38
|
"eslint-config-custom": "*"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
"tiny-invariant": "^1.2.0"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
|
-
"viem": ">=2.
|
|
60
|
-
"wagmi": ">=2.
|
|
59
|
+
"viem": ">=2.23",
|
|
60
|
+
"wagmi": ">=2.14",
|
|
61
61
|
"@tanstack/react-query": "^5.29.0"
|
|
62
62
|
}
|
|
63
63
|
}
|