@xrpl-wallet-kit/adapter-ledger 0.1.15 → 0.1.17
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/README.md +74 -74
- package/package.json +57 -57
package/README.md
CHANGED
|
@@ -1,74 +1,74 @@
|
|
|
1
|
-
# @xrpl-wallet-kit/adapter-ledger
|
|
2
|
-
|
|
3
|
-
Ledger hardware wallet adapter for XRPL Wallet Kit.
|
|
4
|
-
|
|
5
|
-
This adapter connects to Ledger devices through WebHID or WebUSB, reads an XRPL account from the XRP app, and supports signed transaction flows for XRPL dApps.
|
|
6
|
-
|
|
7
|
-
## Capabilities
|
|
8
|
-
|
|
9
|
-
- `connect`
|
|
10
|
-
- `disconnect`
|
|
11
|
-
- `signTransaction`
|
|
12
|
-
- `signAndSubmit`
|
|
13
|
-
|
|
14
|
-
## Install
|
|
15
|
-
|
|
16
|
-
```bash
|
|
17
|
-
npm install @xrpl-wallet-kit/adapter-ledger
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
## Usage
|
|
21
|
-
|
|
22
|
-
```ts
|
|
23
|
-
import { createWalletKit } from "@xrpl-wallet-kit/client";
|
|
24
|
-
import { createLedgerAdapter } from "@xrpl-wallet-kit/adapter-ledger";
|
|
25
|
-
|
|
26
|
-
const kit = createWalletKit({
|
|
27
|
-
adapters: [createLedgerAdapter()]
|
|
28
|
-
});
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
## Runtime Notes
|
|
32
|
-
|
|
33
|
-
- Requires a browser with WebHID or WebUSB support.
|
|
34
|
-
- Requires a connected Ledger device with the XRP app open.
|
|
35
|
-
- Hardware wallets are explicit user-presence devices. `restoreSession()` returns `null` and does not silently reconnect after refresh.
|
|
36
|
-
- Default derivation path is `44'/144'/0'/0/0`.
|
|
37
|
-
- `signTransaction()` signs without submit.
|
|
38
|
-
- `signAndSubmit()` signs and submits when requested by the caller.
|
|
39
|
-
- `signTransaction()` supports XRPL multisigning when `SigningPubKey` is empty. It returns a signed blob plus the signer contribution under `raw.signer`/`raw.signedTx` for the dApp to combine with other signers.
|
|
40
|
-
- `signAndSubmit()` rejects multisign payloads with `UNSUPPORTED_METHOD`; the dApp must combine a quorum of signer contributions before submission.
|
|
41
|
-
- A custom `connectLedger` session must implement `signMultisignTransaction()` to opt into multisigning.
|
|
42
|
-
|
|
43
|
-
## Options
|
|
44
|
-
|
|
45
|
-
```ts
|
|
46
|
-
createLedgerAdapter({
|
|
47
|
-
accountIndex: 0,
|
|
48
|
-
derivationPath: "44'/144'/0'/0/0",
|
|
49
|
-
preferWebHID: true,
|
|
50
|
-
timeout: 60000
|
|
51
|
-
});
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
Use `connectLedger` in tests or custom integrations to inject a prebuilt Ledger session.
|
|
55
|
-
|
|
56
|
-
## Testing
|
|
57
|
-
|
|
58
|
-
Hardware transport should be mocked in unit tests. Manual smoke testing should cover:
|
|
59
|
-
|
|
60
|
-
- unsupported browser;
|
|
61
|
-
- device disconnected;
|
|
62
|
-
- device locked;
|
|
63
|
-
- XRP app not open;
|
|
64
|
-
- connect success;
|
|
65
|
-
- disconnect cleanup;
|
|
66
|
-
- `submit:false` signed transaction result;
|
|
67
|
-
- multisign sign-only contribution and malformed pre-populated `Signers` input;
|
|
68
|
-
- multisign submission fails closed;
|
|
69
|
-
- user rejection on device.
|
|
70
|
-
|
|
71
|
-
## Links
|
|
72
|
-
|
|
73
|
-
- Ledger: https://www.ledger.com
|
|
74
|
-
- XRPL Wallet Kit: https://github.com/XRPDomains/xrpl-wallet-kit
|
|
1
|
+
# @xrpl-wallet-kit/adapter-ledger
|
|
2
|
+
|
|
3
|
+
Ledger hardware wallet adapter for XRPL Wallet Kit.
|
|
4
|
+
|
|
5
|
+
This adapter connects to Ledger devices through WebHID or WebUSB, reads an XRPL account from the XRP app, and supports signed transaction flows for XRPL dApps.
|
|
6
|
+
|
|
7
|
+
## Capabilities
|
|
8
|
+
|
|
9
|
+
- `connect`
|
|
10
|
+
- `disconnect`
|
|
11
|
+
- `signTransaction`
|
|
12
|
+
- `signAndSubmit`
|
|
13
|
+
|
|
14
|
+
## Install
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install @xrpl-wallet-kit/adapter-ledger
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
import { createWalletKit } from "@xrpl-wallet-kit/client";
|
|
24
|
+
import { createLedgerAdapter } from "@xrpl-wallet-kit/adapter-ledger";
|
|
25
|
+
|
|
26
|
+
const kit = createWalletKit({
|
|
27
|
+
adapters: [createLedgerAdapter()]
|
|
28
|
+
});
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Runtime Notes
|
|
32
|
+
|
|
33
|
+
- Requires a browser with WebHID or WebUSB support.
|
|
34
|
+
- Requires a connected Ledger device with the XRP app open.
|
|
35
|
+
- Hardware wallets are explicit user-presence devices. `restoreSession()` returns `null` and does not silently reconnect after refresh.
|
|
36
|
+
- Default derivation path is `44'/144'/0'/0/0`.
|
|
37
|
+
- `signTransaction()` signs without submit.
|
|
38
|
+
- `signAndSubmit()` signs and submits when requested by the caller.
|
|
39
|
+
- `signTransaction()` supports XRPL multisigning when `SigningPubKey` is empty. It returns a signed blob plus the signer contribution under `raw.signer`/`raw.signedTx` for the dApp to combine with other signers.
|
|
40
|
+
- `signAndSubmit()` rejects multisign payloads with `UNSUPPORTED_METHOD`; the dApp must combine a quorum of signer contributions before submission.
|
|
41
|
+
- A custom `connectLedger` session must implement `signMultisignTransaction()` to opt into multisigning.
|
|
42
|
+
|
|
43
|
+
## Options
|
|
44
|
+
|
|
45
|
+
```ts
|
|
46
|
+
createLedgerAdapter({
|
|
47
|
+
accountIndex: 0,
|
|
48
|
+
derivationPath: "44'/144'/0'/0/0",
|
|
49
|
+
preferWebHID: true,
|
|
50
|
+
timeout: 60000
|
|
51
|
+
});
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Use `connectLedger` in tests or custom integrations to inject a prebuilt Ledger session.
|
|
55
|
+
|
|
56
|
+
## Testing
|
|
57
|
+
|
|
58
|
+
Hardware transport should be mocked in unit tests. Manual smoke testing should cover:
|
|
59
|
+
|
|
60
|
+
- unsupported browser;
|
|
61
|
+
- device disconnected;
|
|
62
|
+
- device locked;
|
|
63
|
+
- XRP app not open;
|
|
64
|
+
- connect success;
|
|
65
|
+
- disconnect cleanup;
|
|
66
|
+
- `submit:false` signed transaction result;
|
|
67
|
+
- multisign sign-only contribution and malformed pre-populated `Signers` input;
|
|
68
|
+
- multisign submission fails closed;
|
|
69
|
+
- user rejection on device.
|
|
70
|
+
|
|
71
|
+
## Links
|
|
72
|
+
|
|
73
|
+
- Ledger: https://www.ledger.com
|
|
74
|
+
- XRPL Wallet Kit: https://github.com/XRPDomains/xrpl-wallet-kit
|
package/package.json
CHANGED
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@xrpl-wallet-kit/adapter-ledger",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Ledger hardware wallet adapter for XRPL Wallet Kit.",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"type": "module",
|
|
7
|
-
"main": "./dist/index.js",
|
|
8
|
-
"types": "./dist/index.d.ts",
|
|
9
|
-
"exports": {
|
|
10
|
-
".": {
|
|
11
|
-
"types": "./dist/index.d.ts",
|
|
12
|
-
"import": "./dist/index.js"
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
"files": [
|
|
16
|
-
"dist",
|
|
17
|
-
"README.md"
|
|
18
|
-
],
|
|
19
|
-
"scripts": {
|
|
20
|
-
"build": "tsc -p tsconfig.json"
|
|
21
|
-
},
|
|
22
|
-
"dependencies": {
|
|
23
|
-
"@ledgerhq/errors": "^6.16.0",
|
|
24
|
-
"@ledgerhq/hw-app-xrp": "^6.28.0",
|
|
25
|
-
"@ledgerhq/hw-transport": "^6.28.0",
|
|
26
|
-
"@ledgerhq/hw-transport-webhid": "^6.28.0",
|
|
27
|
-
"@ledgerhq/hw-transport-webusb": "^6.28.0",
|
|
28
|
-
"@xrpl-wallet-kit/core": "0.1.
|
|
29
|
-
"buffer": "^6.0.3"
|
|
30
|
-
},
|
|
31
|
-
"peerDependencies": {
|
|
32
|
-
"xrpl": "^4.0.0 || ^5.0.0"
|
|
33
|
-
},
|
|
34
|
-
"devDependencies": {
|
|
35
|
-
"xrpl": "^4.0.0"
|
|
36
|
-
},
|
|
37
|
-
"publishConfig": {
|
|
38
|
-
"access": "public"
|
|
39
|
-
},
|
|
40
|
-
"repository": {
|
|
41
|
-
"type": "git",
|
|
42
|
-
"url": "git+https://github.com/XRPDomains/xrpl-wallet-kit.git"
|
|
43
|
-
},
|
|
44
|
-
"homepage": "https://github.com/XRPDomains/xrpl-wallet-kit#readme",
|
|
45
|
-
"bugs": {
|
|
46
|
-
"url": "https://github.com/XRPDomains/xrpl-wallet-kit/issues"
|
|
47
|
-
},
|
|
48
|
-
"keywords": [
|
|
49
|
-
"xrpl",
|
|
50
|
-
"wallet",
|
|
51
|
-
"wallet-adapter",
|
|
52
|
-
"wallet-kit",
|
|
53
|
-
"xrp-ledger",
|
|
54
|
-
"web3",
|
|
55
|
-
"adapter"
|
|
56
|
-
]
|
|
57
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@xrpl-wallet-kit/adapter-ledger",
|
|
3
|
+
"version": "0.1.17",
|
|
4
|
+
"description": "Ledger hardware wallet adapter for XRPL Wallet Kit.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist",
|
|
17
|
+
"README.md"
|
|
18
|
+
],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build": "tsc -p tsconfig.json"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@ledgerhq/errors": "^6.16.0",
|
|
24
|
+
"@ledgerhq/hw-app-xrp": "^6.28.0",
|
|
25
|
+
"@ledgerhq/hw-transport": "^6.28.0",
|
|
26
|
+
"@ledgerhq/hw-transport-webhid": "^6.28.0",
|
|
27
|
+
"@ledgerhq/hw-transport-webusb": "^6.28.0",
|
|
28
|
+
"@xrpl-wallet-kit/core": "0.1.17",
|
|
29
|
+
"buffer": "^6.0.3"
|
|
30
|
+
},
|
|
31
|
+
"peerDependencies": {
|
|
32
|
+
"xrpl": "^4.0.0 || ^5.0.0"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"xrpl": "^4.0.0"
|
|
36
|
+
},
|
|
37
|
+
"publishConfig": {
|
|
38
|
+
"access": "public"
|
|
39
|
+
},
|
|
40
|
+
"repository": {
|
|
41
|
+
"type": "git",
|
|
42
|
+
"url": "git+https://github.com/XRPDomains/xrpl-wallet-kit.git"
|
|
43
|
+
},
|
|
44
|
+
"homepage": "https://github.com/XRPDomains/xrpl-wallet-kit#readme",
|
|
45
|
+
"bugs": {
|
|
46
|
+
"url": "https://github.com/XRPDomains/xrpl-wallet-kit/issues"
|
|
47
|
+
},
|
|
48
|
+
"keywords": [
|
|
49
|
+
"xrpl",
|
|
50
|
+
"wallet",
|
|
51
|
+
"wallet-adapter",
|
|
52
|
+
"wallet-kit",
|
|
53
|
+
"xrp-ledger",
|
|
54
|
+
"web3",
|
|
55
|
+
"adapter"
|
|
56
|
+
]
|
|
57
|
+
}
|