@xrpl-wallet-kit/adapter-dropfi 0.1.15 → 0.1.16

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.
Files changed (2) hide show
  1. package/README.md +96 -96
  2. package/package.json +45 -45
package/README.md CHANGED
@@ -1,96 +1,96 @@
1
- # @xrpl-wallet-kit/adapter-dropfi
2
-
3
- DropFi adapter for XRPL Wallet Kit.
4
-
5
- DropFi is an injected XRPL wallet provider. This adapter detects the provider, normalizes connection state, and maps message signing plus transaction submission into the XRPL Wallet Kit adapter contract.
6
-
7
- ## Capabilities
8
-
9
- - `connect`
10
- - `disconnect`
11
- - `signMessage`
12
- - `signAndSubmit`
13
- - `payments`
14
- - `nftOffers`
15
-
16
- ## Install
17
-
18
- ```bash
19
- npm install @xrpl-wallet-kit/adapter-dropfi
20
- ```
21
-
22
- ## Usage
23
-
24
- ```ts
25
- import { createWalletKit } from "@xrpl-wallet-kit/client";
26
- import { createDropFiAdapter } from "@xrpl-wallet-kit/adapter-dropfi";
27
-
28
- const kit = createWalletKit({
29
- adapters: [createDropFiAdapter()]
30
- });
31
- ```
32
-
33
- When using `@xrpl-wallet-kit/client` defaults, DropFi is already included.
34
-
35
- ## Runtime Notes
36
-
37
- - The adapter looks for DropFi in this order: an explicit `provider` option, `window.__xwk_dropfi`, `window.dropfi`, then the legacy `window.xrpl` namespace.
38
- - The legacy `window.xrpl` fallback is accepted only when it exposes DropFi-like wallet fields. This avoids treating the standard `xrpl.js` browser global as a wallet provider.
39
- - DropFi's official web injection script exposes `window.xrpl` with `connect`, `disconnect`, `signMessage`, `sendTransaction`, `switchNetwork`, `changeAccount`, `initialize`, and `isConnected`.
40
- - DropFi's official provider state includes `selectedAddress`, `connectedAccounts`, `selectedNetwork`, `network`, and `endpoint`.
41
- - DropFi emits provider events such as `xrpl_selectedAddress`, `xrpl_connectedAccounts`, `xrpl_selectedNetwork`, and `xrpl_disconnect`.
42
- - `connect()` supports provider initialization, passive account reads, and provider-driven connect flows.
43
- - `restoreSession()` is intentionally passive: it reads current provider state and restores only when the passive address matches the stored session address.
44
- - `isConnected() === false` is not treated as final during reload hydration when a matching passive address is already available.
45
- - `disconnect()` is best-effort and bounded by a timeout so stale provider cleanup does not block the app.
46
- - Transaction responses are normalized with `normalizeTxResult()`.
47
-
48
- ## Message Signing
49
-
50
- DropFi `signMessage(message)` signs the exact UTF-8 message string and returns a compact signature result:
51
-
52
- ```ts
53
- const result = await window.xrpl.signMessage(message);
54
- // { signature: string, publicKey: string }
55
- ```
56
-
57
- The adapter maps this to:
58
-
59
- ```ts
60
- {
61
- signatureKind: "signature",
62
- proof: result.signature,
63
- signature: result.signature,
64
- publicKey: result.publicKey,
65
- raw: result
66
- }
67
- ```
68
-
69
- `publicKey` is required. Server-side verification needs the original message string, the returned `signature`, and the returned `publicKey`. The server should convert the UTF-8 message to hex before calling `ripple-keypairs.verify(messageHex, signature, publicKey)`.
70
-
71
- Do not treat DropFi like GemWallet's `{ result: { signedMessage } }` shape. If DropFi returns no signature or no public key, the adapter raises `SIGN_REJECTED` so apps do not fall through to another signing method after the user has already seen a wallet prompt.
72
-
73
- ## Auto Reconnect
74
-
75
- DropFi can expose account state through multiple passive surfaces, including `selectedAddress`, connected account arrays, and address getters. The adapter uses those passive address signals to verify a stored session after reload.
76
-
77
- Some injected providers report `isConnected() === false` briefly while the extension is hydrating, even though the selected address is already available. For that reason, a matching passive address is the restore authority. A missing or mismatched address still returns `null`.
78
-
79
- `restoreSession()` does not call `connect()`, open wallet UI, or request user approval.
80
-
81
- ## Testing
82
-
83
- Pass a mock provider for isolated tests:
84
-
85
- ```ts
86
- import { assertWalletAdapter } from "@xrpl-wallet-kit/core";
87
- import { createDropFiAdapter } from "@xrpl-wallet-kit/adapter-dropfi";
88
-
89
- assertWalletAdapter(createDropFiAdapter({ provider: mockDropFi }));
90
- ```
91
-
92
- ## Links
93
-
94
- - DropFi web injection script: https://www.dropfi.app/docs/dropfi-web-injection-script
95
- - DropFi authentication with message hashing: https://www.dropfi.app/docs/authentication-with-message-hashing
96
- - XRPL Wallet Kit: https://github.com/XRPDomains/xrpl-wallet-kit
1
+ # @xrpl-wallet-kit/adapter-dropfi
2
+
3
+ DropFi adapter for XRPL Wallet Kit.
4
+
5
+ DropFi is an injected XRPL wallet provider. This adapter detects the provider, normalizes connection state, and maps message signing plus transaction submission into the XRPL Wallet Kit adapter contract.
6
+
7
+ ## Capabilities
8
+
9
+ - `connect`
10
+ - `disconnect`
11
+ - `signMessage`
12
+ - `signAndSubmit`
13
+ - `payments`
14
+ - `nftOffers`
15
+
16
+ ## Install
17
+
18
+ ```bash
19
+ npm install @xrpl-wallet-kit/adapter-dropfi
20
+ ```
21
+
22
+ ## Usage
23
+
24
+ ```ts
25
+ import { createWalletKit } from "@xrpl-wallet-kit/client";
26
+ import { createDropFiAdapter } from "@xrpl-wallet-kit/adapter-dropfi";
27
+
28
+ const kit = createWalletKit({
29
+ adapters: [createDropFiAdapter()]
30
+ });
31
+ ```
32
+
33
+ When using `@xrpl-wallet-kit/client` defaults, DropFi is already included.
34
+
35
+ ## Runtime Notes
36
+
37
+ - The adapter looks for DropFi in this order: an explicit `provider` option, `window.__xwk_dropfi`, `window.dropfi`, then the legacy `window.xrpl` namespace.
38
+ - The legacy `window.xrpl` fallback is accepted only when it exposes DropFi-like wallet fields. This avoids treating the standard `xrpl.js` browser global as a wallet provider.
39
+ - DropFi's official web injection script exposes `window.xrpl` with `connect`, `disconnect`, `signMessage`, `sendTransaction`, `switchNetwork`, `changeAccount`, `initialize`, and `isConnected`.
40
+ - DropFi's official provider state includes `selectedAddress`, `connectedAccounts`, `selectedNetwork`, `network`, and `endpoint`.
41
+ - DropFi emits provider events such as `xrpl_selectedAddress`, `xrpl_connectedAccounts`, `xrpl_selectedNetwork`, and `xrpl_disconnect`.
42
+ - `connect()` supports provider initialization, passive account reads, and provider-driven connect flows.
43
+ - `restoreSession()` is intentionally passive: it reads current provider state and restores only when the passive address matches the stored session address.
44
+ - `isConnected() === false` is not treated as final during reload hydration when a matching passive address is already available.
45
+ - `disconnect()` is best-effort and bounded by a timeout so stale provider cleanup does not block the app.
46
+ - Transaction responses are normalized with `normalizeTxResult()`.
47
+
48
+ ## Message Signing
49
+
50
+ DropFi `signMessage(message)` signs the exact UTF-8 message string and returns a compact signature result:
51
+
52
+ ```ts
53
+ const result = await window.xrpl.signMessage(message);
54
+ // { signature: string, publicKey: string }
55
+ ```
56
+
57
+ The adapter maps this to:
58
+
59
+ ```ts
60
+ {
61
+ signatureKind: "signature",
62
+ proof: result.signature,
63
+ signature: result.signature,
64
+ publicKey: result.publicKey,
65
+ raw: result
66
+ }
67
+ ```
68
+
69
+ `publicKey` is required. Server-side verification needs the original message string, the returned `signature`, and the returned `publicKey`. The server should convert the UTF-8 message to hex before calling `ripple-keypairs.verify(messageHex, signature, publicKey)`.
70
+
71
+ Do not treat DropFi like GemWallet's `{ result: { signedMessage } }` shape. If DropFi returns no signature or no public key, the adapter raises `SIGN_REJECTED` so apps do not fall through to another signing method after the user has already seen a wallet prompt.
72
+
73
+ ## Auto Reconnect
74
+
75
+ DropFi can expose account state through multiple passive surfaces, including `selectedAddress`, connected account arrays, and address getters. The adapter uses those passive address signals to verify a stored session after reload.
76
+
77
+ Some injected providers report `isConnected() === false` briefly while the extension is hydrating, even though the selected address is already available. For that reason, a matching passive address is the restore authority. A missing or mismatched address still returns `null`.
78
+
79
+ `restoreSession()` does not call `connect()`, open wallet UI, or request user approval.
80
+
81
+ ## Testing
82
+
83
+ Pass a mock provider for isolated tests:
84
+
85
+ ```ts
86
+ import { assertWalletAdapter } from "@xrpl-wallet-kit/core";
87
+ import { createDropFiAdapter } from "@xrpl-wallet-kit/adapter-dropfi";
88
+
89
+ assertWalletAdapter(createDropFiAdapter({ provider: mockDropFi }));
90
+ ```
91
+
92
+ ## Links
93
+
94
+ - DropFi web injection script: https://www.dropfi.app/docs/dropfi-web-injection-script
95
+ - DropFi authentication with message hashing: https://www.dropfi.app/docs/authentication-with-message-hashing
96
+ - XRPL Wallet Kit: https://github.com/XRPDomains/xrpl-wallet-kit
package/package.json CHANGED
@@ -1,45 +1,45 @@
1
- {
2
- "name": "@xrpl-wallet-kit/adapter-dropfi",
3
- "version": "0.1.15",
4
- "description": "DropFi 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
- "@xrpl-wallet-kit/core": "0.1.15"
24
- },
25
- "publishConfig": {
26
- "access": "public"
27
- },
28
- "repository": {
29
- "type": "git",
30
- "url": "git+https://github.com/XRPDomains/xrpl-wallet-kit.git"
31
- },
32
- "homepage": "https://github.com/XRPDomains/xrpl-wallet-kit#readme",
33
- "bugs": {
34
- "url": "https://github.com/XRPDomains/xrpl-wallet-kit/issues"
35
- },
36
- "keywords": [
37
- "xrpl",
38
- "wallet",
39
- "wallet-adapter",
40
- "wallet-kit",
41
- "xrp-ledger",
42
- "web3",
43
- "adapter"
44
- ]
45
- }
1
+ {
2
+ "name": "@xrpl-wallet-kit/adapter-dropfi",
3
+ "version": "0.1.16",
4
+ "description": "DropFi 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
+ "@xrpl-wallet-kit/core": "0.1.16"
24
+ },
25
+ "publishConfig": {
26
+ "access": "public"
27
+ },
28
+ "repository": {
29
+ "type": "git",
30
+ "url": "git+https://github.com/XRPDomains/xrpl-wallet-kit.git"
31
+ },
32
+ "homepage": "https://github.com/XRPDomains/xrpl-wallet-kit#readme",
33
+ "bugs": {
34
+ "url": "https://github.com/XRPDomains/xrpl-wallet-kit/issues"
35
+ },
36
+ "keywords": [
37
+ "xrpl",
38
+ "wallet",
39
+ "wallet-adapter",
40
+ "wallet-kit",
41
+ "xrp-ledger",
42
+ "web3",
43
+ "adapter"
44
+ ]
45
+ }