@xrpl-wallet-kit/adapter-xrpl-snap 0.1.13 → 0.1.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.
Files changed (2) hide show
  1. package/README.md +60 -60
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1,60 +1,60 @@
1
- # @xrpl-wallet-kit/adapter-xrpl-snap
2
-
3
- MetaMask XRPL Snap adapter for XRPL Wallet Kit.
4
-
5
- This adapter uses the EIP-1193 `ethereum.request()` interface to install/invoke an XRPL Snap and expose it through the XRPL Wallet Kit adapter contract.
6
-
7
- ## Capabilities
8
-
9
- - `connect`
10
- - `signMessage`
11
- - `signAndSubmit`
12
- - `payments`
13
- - `nftOffers`
14
-
15
- ## Install
16
-
17
- ```bash
18
- npm install @xrpl-wallet-kit/adapter-xrpl-snap
19
- ```
20
-
21
- ## Usage
22
-
23
- ```ts
24
- import { createWalletKit } from "@xrpl-wallet-kit/client";
25
- import { createXrplSnapAdapter } from "@xrpl-wallet-kit/adapter-xrpl-snap";
26
-
27
- const kit = createWalletKit({
28
- adapters: [createXrplSnapAdapter()]
29
- });
30
- ```
31
-
32
- When using `@xrpl-wallet-kit/client` defaults, the XRPL Snap adapter is already included.
33
-
34
- ## Runtime Notes
35
-
36
- - Requires MetaMask with Snaps support.
37
- - `isAvailable()` verifies Snaps support with `wallet_getSnaps`; providers that expose `window.ethereum` but do not support Snaps are treated as unavailable.
38
- - When multiple browser wallets are installed, the adapter prefers a MetaMask provider from `window.ethereum.providers` or EIP-6963 before falling back to `window.ethereum`. EIP-6963 announcements are cached so MetaMask can still be selected when wallets such as OKX own `window.ethereum`.
39
- - Default snap id is `npm:xrpl-snap`.
40
- - `connect()` calls `wallet_requestSnaps` and then invokes the snap to fetch the XRPL account.
41
- - `signMessage()` uses a transaction-style proof flow because Snap message-signing support can vary.
42
- - `signAndSubmit()` invokes the snap and normalizes the result with `normalizeTxResult()`.
43
-
44
- If you see `the method wallet_requestSnaps does not exist/is not available`, the active provider is not a MetaMask Snaps-capable provider. Use MetaMask desktop with Snaps enabled, and check that another injected wallet such as OKX is not taking over `window.ethereum`.
45
-
46
- ## Testing
47
-
48
- Pass a mock EIP-1193 provider for isolated tests:
49
-
50
- ```ts
51
- import { assertWalletAdapter } from "@xrpl-wallet-kit/core";
52
- import { createXrplSnapAdapter } from "@xrpl-wallet-kit/adapter-xrpl-snap";
53
-
54
- assertWalletAdapter(createXrplSnapAdapter({ ethereum: mockEthereum }));
55
- ```
56
-
57
- ## Links
58
-
59
- - MetaMask Snaps: https://metamask.io/snaps/
60
- - XRPL Wallet Kit: https://github.com/XRPDomains/xrpl-wallet-kit
1
+ # @xrpl-wallet-kit/adapter-xrpl-snap
2
+
3
+ MetaMask XRPL Snap adapter for XRPL Wallet Kit.
4
+
5
+ This adapter uses the EIP-1193 `ethereum.request()` interface to install/invoke an XRPL Snap and expose it through the XRPL Wallet Kit adapter contract.
6
+
7
+ ## Capabilities
8
+
9
+ - `connect`
10
+ - `signMessage`
11
+ - `signAndSubmit`
12
+ - `payments`
13
+ - `nftOffers`
14
+
15
+ ## Install
16
+
17
+ ```bash
18
+ npm install @xrpl-wallet-kit/adapter-xrpl-snap
19
+ ```
20
+
21
+ ## Usage
22
+
23
+ ```ts
24
+ import { createWalletKit } from "@xrpl-wallet-kit/client";
25
+ import { createXrplSnapAdapter } from "@xrpl-wallet-kit/adapter-xrpl-snap";
26
+
27
+ const kit = createWalletKit({
28
+ adapters: [createXrplSnapAdapter()]
29
+ });
30
+ ```
31
+
32
+ When using `@xrpl-wallet-kit/client` defaults, the XRPL Snap adapter is already included.
33
+
34
+ ## Runtime Notes
35
+
36
+ - Requires MetaMask with Snaps support.
37
+ - `isAvailable()` verifies Snaps support with `wallet_getSnaps`; providers that expose `window.ethereum` but do not support Snaps are treated as unavailable.
38
+ - When multiple browser wallets are installed, the adapter prefers a MetaMask provider from `window.ethereum.providers` or EIP-6963 before falling back to `window.ethereum`. EIP-6963 announcements are cached so MetaMask can still be selected when wallets such as OKX own `window.ethereum`.
39
+ - Default snap id is `npm:xrpl-snap`.
40
+ - `connect()` calls `wallet_requestSnaps` and then invokes the snap to fetch the XRPL account.
41
+ - `signMessage()` uses a transaction-style proof flow because Snap message-signing support can vary.
42
+ - `signAndSubmit()` invokes the snap and normalizes the result with `normalizeTxResult()`.
43
+
44
+ If you see `the method wallet_requestSnaps does not exist/is not available`, the active provider is not a MetaMask Snaps-capable provider. Use MetaMask desktop with Snaps enabled, and check that another injected wallet such as OKX is not taking over `window.ethereum`.
45
+
46
+ ## Testing
47
+
48
+ Pass a mock EIP-1193 provider for isolated tests:
49
+
50
+ ```ts
51
+ import { assertWalletAdapter } from "@xrpl-wallet-kit/core";
52
+ import { createXrplSnapAdapter } from "@xrpl-wallet-kit/adapter-xrpl-snap";
53
+
54
+ assertWalletAdapter(createXrplSnapAdapter({ ethereum: mockEthereum }));
55
+ ```
56
+
57
+ ## Links
58
+
59
+ - MetaMask Snaps: https://metamask.io/snaps/
60
+ - XRPL Wallet Kit: https://github.com/XRPDomains/xrpl-wallet-kit
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xrpl-wallet-kit/adapter-xrpl-snap",
3
- "version": "0.1.13",
3
+ "version": "0.1.15",
4
4
  "description": "MetaMask XRPL Snap adapter for XRPL Wallet Kit.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -20,7 +20,7 @@
20
20
  "build": "tsc -p tsconfig.json"
21
21
  },
22
22
  "dependencies": {
23
- "@xrpl-wallet-kit/core": "0.1.13"
23
+ "@xrpl-wallet-kit/core": "0.1.15"
24
24
  },
25
25
  "publishConfig": {
26
26
  "access": "public"