@xrpl-wallet-kit/adapter-crossmark 0.1.13 → 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.
- package/README.md +64 -64
- package/package.json +46 -46
package/README.md
CHANGED
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
# @xrpl-wallet-kit/adapter-crossmark
|
|
2
|
-
|
|
3
|
-
Crossmark adapter for XRPL Wallet Kit.
|
|
4
|
-
|
|
5
|
-
Crossmark is an XRPL browser extension wallet. This adapter wraps `@crossmarkio/sdk` and maps Crossmark connection, message signing, and transaction methods into 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-crossmark
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
## Usage
|
|
22
|
-
|
|
23
|
-
```ts
|
|
24
|
-
import { createWalletKit } from "@xrpl-wallet-kit/client";
|
|
25
|
-
import { createCrossmarkAdapter } from "@xrpl-wallet-kit/adapter-crossmark";
|
|
26
|
-
|
|
27
|
-
const kit = createWalletKit({
|
|
28
|
-
adapters: [createCrossmarkAdapter()]
|
|
29
|
-
});
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
When using `@xrpl-wallet-kit/client` defaults, Crossmark is already included.
|
|
33
|
-
|
|
34
|
-
## Runtime Notes
|
|
35
|
-
|
|
36
|
-
- Requires the Crossmark browser extension.
|
|
37
|
-
- Availability checks require the SDK install signal and `signInAndWait`.
|
|
38
|
-
- `connect()` uses Crossmark sign-in and returns the selected XRPL account.
|
|
39
|
-
- `restoreSession()` is passive-only. It reads the current SDK address from `sync.getAddress()` or the SDK session snapshot and restores only when it matches the stored session address.
|
|
40
|
-
- `restoreSession()` never calls `signInAndWait()` because sign-in opens an interactive wallet flow.
|
|
41
|
-
- `signAndSubmit()` chooses the Crossmark method by `methodHint` and normalizes transaction results with `normalizeTxResult()`.
|
|
42
|
-
- Provider-specific errors should still surface as rejected/canceled/timeout messages so the UI can recover cleanly.
|
|
43
|
-
|
|
44
|
-
## Auto Reconnect
|
|
45
|
-
|
|
46
|
-
Crossmark restore uses SDK state that is already available after reload. The adapter first checks `sync.getAddress()`, then falls back to the SDK session snapshot address. If neither address exists, or the address differs from the stored session, restore returns `null`.
|
|
47
|
-
|
|
48
|
-
This keeps Crossmark aligned with the core adapter contract: core manages storage and events, while the adapter proves whether the current wallet provider still owns the stored account. Interactive sign-in remains part of `connect()`, not `restoreSession()`.
|
|
49
|
-
|
|
50
|
-
## Testing
|
|
51
|
-
|
|
52
|
-
Pass a mock provider for isolated tests:
|
|
53
|
-
|
|
54
|
-
```ts
|
|
55
|
-
import { assertWalletAdapter } from "@xrpl-wallet-kit/core";
|
|
56
|
-
import { createCrossmarkAdapter } from "@xrpl-wallet-kit/adapter-crossmark";
|
|
57
|
-
|
|
58
|
-
assertWalletAdapter(createCrossmarkAdapter({ provider: mockCrossmark }));
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
## Links
|
|
62
|
-
|
|
63
|
-
- Crossmark: https://crossmark.io
|
|
64
|
-
- XRPL Wallet Kit: https://github.com/XRPDomains/xrpl-wallet-kit
|
|
1
|
+
# @xrpl-wallet-kit/adapter-crossmark
|
|
2
|
+
|
|
3
|
+
Crossmark adapter for XRPL Wallet Kit.
|
|
4
|
+
|
|
5
|
+
Crossmark is an XRPL browser extension wallet. This adapter wraps `@crossmarkio/sdk` and maps Crossmark connection, message signing, and transaction methods into 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-crossmark
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
import { createWalletKit } from "@xrpl-wallet-kit/client";
|
|
25
|
+
import { createCrossmarkAdapter } from "@xrpl-wallet-kit/adapter-crossmark";
|
|
26
|
+
|
|
27
|
+
const kit = createWalletKit({
|
|
28
|
+
adapters: [createCrossmarkAdapter()]
|
|
29
|
+
});
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
When using `@xrpl-wallet-kit/client` defaults, Crossmark is already included.
|
|
33
|
+
|
|
34
|
+
## Runtime Notes
|
|
35
|
+
|
|
36
|
+
- Requires the Crossmark browser extension.
|
|
37
|
+
- Availability checks require the SDK install signal and `signInAndWait`.
|
|
38
|
+
- `connect()` uses Crossmark sign-in and returns the selected XRPL account.
|
|
39
|
+
- `restoreSession()` is passive-only. It reads the current SDK address from `sync.getAddress()` or the SDK session snapshot and restores only when it matches the stored session address.
|
|
40
|
+
- `restoreSession()` never calls `signInAndWait()` because sign-in opens an interactive wallet flow.
|
|
41
|
+
- `signAndSubmit()` chooses the Crossmark method by `methodHint` and normalizes transaction results with `normalizeTxResult()`.
|
|
42
|
+
- Provider-specific errors should still surface as rejected/canceled/timeout messages so the UI can recover cleanly.
|
|
43
|
+
|
|
44
|
+
## Auto Reconnect
|
|
45
|
+
|
|
46
|
+
Crossmark restore uses SDK state that is already available after reload. The adapter first checks `sync.getAddress()`, then falls back to the SDK session snapshot address. If neither address exists, or the address differs from the stored session, restore returns `null`.
|
|
47
|
+
|
|
48
|
+
This keeps Crossmark aligned with the core adapter contract: core manages storage and events, while the adapter proves whether the current wallet provider still owns the stored account. Interactive sign-in remains part of `connect()`, not `restoreSession()`.
|
|
49
|
+
|
|
50
|
+
## Testing
|
|
51
|
+
|
|
52
|
+
Pass a mock provider for isolated tests:
|
|
53
|
+
|
|
54
|
+
```ts
|
|
55
|
+
import { assertWalletAdapter } from "@xrpl-wallet-kit/core";
|
|
56
|
+
import { createCrossmarkAdapter } from "@xrpl-wallet-kit/adapter-crossmark";
|
|
57
|
+
|
|
58
|
+
assertWalletAdapter(createCrossmarkAdapter({ provider: mockCrossmark }));
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Links
|
|
62
|
+
|
|
63
|
+
- Crossmark: https://crossmark.io
|
|
64
|
+
- XRPL Wallet Kit: https://github.com/XRPDomains/xrpl-wallet-kit
|
package/package.json
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@xrpl-wallet-kit/adapter-crossmark",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Crossmark 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
|
-
"@crossmarkio/sdk": "^0.4.0",
|
|
24
|
-
"@xrpl-wallet-kit/core": "0.1.
|
|
25
|
-
},
|
|
26
|
-
"publishConfig": {
|
|
27
|
-
"access": "public"
|
|
28
|
-
},
|
|
29
|
-
"repository": {
|
|
30
|
-
"type": "git",
|
|
31
|
-
"url": "git+https://github.com/XRPDomains/xrpl-wallet-kit.git"
|
|
32
|
-
},
|
|
33
|
-
"homepage": "https://github.com/XRPDomains/xrpl-wallet-kit#readme",
|
|
34
|
-
"bugs": {
|
|
35
|
-
"url": "https://github.com/XRPDomains/xrpl-wallet-kit/issues"
|
|
36
|
-
},
|
|
37
|
-
"keywords": [
|
|
38
|
-
"xrpl",
|
|
39
|
-
"wallet",
|
|
40
|
-
"wallet-adapter",
|
|
41
|
-
"wallet-kit",
|
|
42
|
-
"xrp-ledger",
|
|
43
|
-
"web3",
|
|
44
|
-
"adapter"
|
|
45
|
-
]
|
|
46
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@xrpl-wallet-kit/adapter-crossmark",
|
|
3
|
+
"version": "0.1.14",
|
|
4
|
+
"description": "Crossmark 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
|
+
"@crossmarkio/sdk": "^0.4.0",
|
|
24
|
+
"@xrpl-wallet-kit/core": "0.1.14"
|
|
25
|
+
},
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public"
|
|
28
|
+
},
|
|
29
|
+
"repository": {
|
|
30
|
+
"type": "git",
|
|
31
|
+
"url": "git+https://github.com/XRPDomains/xrpl-wallet-kit.git"
|
|
32
|
+
},
|
|
33
|
+
"homepage": "https://github.com/XRPDomains/xrpl-wallet-kit#readme",
|
|
34
|
+
"bugs": {
|
|
35
|
+
"url": "https://github.com/XRPDomains/xrpl-wallet-kit/issues"
|
|
36
|
+
},
|
|
37
|
+
"keywords": [
|
|
38
|
+
"xrpl",
|
|
39
|
+
"wallet",
|
|
40
|
+
"wallet-adapter",
|
|
41
|
+
"wallet-kit",
|
|
42
|
+
"xrp-ledger",
|
|
43
|
+
"web3",
|
|
44
|
+
"adapter"
|
|
45
|
+
]
|
|
46
|
+
}
|