@xrpl-wallet-kit/react 0.1.12 → 0.1.14

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 +83 -83
  2. package/package.json +48 -48
package/README.md CHANGED
@@ -1,83 +1,83 @@
1
- # @xrpl-wallet-kit/react
2
-
3
- React bindings for XRPL Wallet Kit.
4
-
5
- This package provides a provider, hooks, and a React `WalletButton` wrapper around the framework-agnostic wallet manager and UI.
6
-
7
- ## Install
8
-
9
- ```bash
10
- npm install @xrpl-wallet-kit/react @xrpl-wallet-kit/client
11
- ```
12
-
13
- ## Setup
14
-
15
- ```tsx
16
- import { createWalletKit } from "@xrpl-wallet-kit/client";
17
- import { WalletKitProvider, WalletButton } from "@xrpl-wallet-kit/react";
18
-
19
- const kit = createWalletKit({
20
- metadata: {
21
- name: "My XRPL App",
22
- description: "Wallet connection for My XRPL App",
23
- url: window.location.origin,
24
- icons: [`${window.location.origin}/icon.png`],
25
- },
26
- network: "mainnet",
27
- autoReconnect: true,
28
- walletConnectProjectId: import.meta.env.VITE_WALLETCONNECT_PROJECT_ID,
29
- ui: {
30
- accountPanel: {
31
- showBalance: true,
32
- showRecentTransactions: true,
33
- },
34
- toast: true,
35
- },
36
- });
37
-
38
- export function App() {
39
- return (
40
- <WalletKitProvider manager={kit.manager}>
41
- <WalletButton />
42
- </WalletKitProvider>
43
- );
44
- }
45
- ```
46
-
47
- ## Hooks
48
-
49
- ```tsx
50
- import {
51
- useWalletAccount,
52
- useWalletCapabilities,
53
- useWalletKit,
54
- useWalletSession,
55
- useWalletStatus,
56
- } from "@xrpl-wallet-kit/react";
57
-
58
- function AccountState() {
59
- const status = useWalletStatus();
60
- const account = useWalletAccount();
61
- const capabilities = useWalletCapabilities();
62
-
63
- return (
64
- <pre>
65
- {JSON.stringify({ status, account, capabilities }, null, 2)}
66
- </pre>
67
- );
68
- }
69
- ```
70
-
71
- Status values:
72
-
73
- - `disconnected`
74
- - `connecting`
75
- - `connected`
76
-
77
- The provider syncs connection, account, network, stale session, expired session, and transaction-related manager events so consumers re-render from wallet state changes.
78
-
79
- ## Notes
80
-
81
- - Create the wallet kit once at module scope or inside a stable app-level initializer.
82
- - Use `@xrpl-wallet-kit/client` for the default adapter/UI wiring.
83
- - Use `@xrpl-wallet-kit/core` directly only when building a custom integration.
1
+ # @xrpl-wallet-kit/react
2
+
3
+ React bindings for XRPL Wallet Kit.
4
+
5
+ This package provides a provider, hooks, and a React `WalletButton` wrapper around the framework-agnostic wallet manager and UI.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install @xrpl-wallet-kit/react @xrpl-wallet-kit/client
11
+ ```
12
+
13
+ ## Setup
14
+
15
+ ```tsx
16
+ import { createWalletKit } from "@xrpl-wallet-kit/client";
17
+ import { WalletKitProvider, WalletButton } from "@xrpl-wallet-kit/react";
18
+
19
+ const kit = createWalletKit({
20
+ metadata: {
21
+ name: "My XRPL App",
22
+ description: "Wallet connection for My XRPL App",
23
+ url: window.location.origin,
24
+ icons: [`${window.location.origin}/icon.png`],
25
+ },
26
+ network: "mainnet",
27
+ autoReconnect: true,
28
+ walletConnectProjectId: import.meta.env.VITE_WALLETCONNECT_PROJECT_ID,
29
+ ui: {
30
+ accountPanel: {
31
+ showBalance: true,
32
+ showRecentTransactions: true,
33
+ },
34
+ toast: true,
35
+ },
36
+ });
37
+
38
+ export function App() {
39
+ return (
40
+ <WalletKitProvider manager={kit.manager}>
41
+ <WalletButton />
42
+ </WalletKitProvider>
43
+ );
44
+ }
45
+ ```
46
+
47
+ ## Hooks
48
+
49
+ ```tsx
50
+ import {
51
+ useWalletAccount,
52
+ useWalletCapabilities,
53
+ useWalletKit,
54
+ useWalletSession,
55
+ useWalletStatus,
56
+ } from "@xrpl-wallet-kit/react";
57
+
58
+ function AccountState() {
59
+ const status = useWalletStatus();
60
+ const account = useWalletAccount();
61
+ const capabilities = useWalletCapabilities();
62
+
63
+ return (
64
+ <pre>
65
+ {JSON.stringify({ status, account, capabilities }, null, 2)}
66
+ </pre>
67
+ );
68
+ }
69
+ ```
70
+
71
+ Status values:
72
+
73
+ - `disconnected`
74
+ - `connecting`
75
+ - `connected`
76
+
77
+ The provider syncs connection, account, network, stale session, expired session, and transaction-related manager events so consumers re-render from wallet state changes.
78
+
79
+ ## Notes
80
+
81
+ - Create the wallet kit once at module scope or inside a stable app-level initializer.
82
+ - Use `@xrpl-wallet-kit/client` for the default adapter/UI wiring.
83
+ - Use `@xrpl-wallet-kit/core` directly only when building a custom integration.
package/package.json CHANGED
@@ -1,48 +1,48 @@
1
- {
2
- "name": "@xrpl-wallet-kit/react",
3
- "version": "0.1.12",
4
- "description": "React bindings and hooks 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.12",
24
- "@xrpl-wallet-kit/ui": "0.1.12"
25
- },
26
- "peerDependencies": {
27
- "react": ">=18"
28
- },
29
- "publishConfig": {
30
- "access": "public"
31
- },
32
- "repository": {
33
- "type": "git",
34
- "url": "git+https://github.com/XRPDomains/xrpl-wallet-kit.git"
35
- },
36
- "homepage": "https://github.com/XRPDomains/xrpl-wallet-kit#readme",
37
- "bugs": {
38
- "url": "https://github.com/XRPDomains/xrpl-wallet-kit/issues"
39
- },
40
- "keywords": [
41
- "xrpl",
42
- "wallet",
43
- "wallet-adapter",
44
- "wallet-kit",
45
- "xrp-ledger",
46
- "web3"
47
- ]
48
- }
1
+ {
2
+ "name": "@xrpl-wallet-kit/react",
3
+ "version": "0.1.14",
4
+ "description": "React bindings and hooks 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.14",
24
+ "@xrpl-wallet-kit/ui": "0.1.14"
25
+ },
26
+ "peerDependencies": {
27
+ "react": ">=18"
28
+ },
29
+ "publishConfig": {
30
+ "access": "public"
31
+ },
32
+ "repository": {
33
+ "type": "git",
34
+ "url": "git+https://github.com/XRPDomains/xrpl-wallet-kit.git"
35
+ },
36
+ "homepage": "https://github.com/XRPDomains/xrpl-wallet-kit#readme",
37
+ "bugs": {
38
+ "url": "https://github.com/XRPDomains/xrpl-wallet-kit/issues"
39
+ },
40
+ "keywords": [
41
+ "xrpl",
42
+ "wallet",
43
+ "wallet-adapter",
44
+ "wallet-kit",
45
+ "xrp-ledger",
46
+ "web3"
47
+ ]
48
+ }