@xrpl-wallet-kit/adapter-gemwallet 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 +71 -71
- package/package.json +46 -46
package/README.md
CHANGED
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
# @xrpl-wallet-kit/adapter-gemwallet
|
|
2
|
-
|
|
3
|
-
GemWallet adapter for XRPL Wallet Kit.
|
|
4
|
-
|
|
5
|
-
GemWallet is an XRPL browser extension wallet. This adapter wraps the `@gemwallet/api` package and normalizes account, message signing, payment, and NFT offer results 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-gemwallet
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
## Usage
|
|
22
|
-
|
|
23
|
-
```ts
|
|
24
|
-
import { createWalletKit } from "@xrpl-wallet-kit/client";
|
|
25
|
-
import { createGemWalletAdapter } from "@xrpl-wallet-kit/adapter-gemwallet";
|
|
26
|
-
|
|
27
|
-
const kit = createWalletKit({
|
|
28
|
-
adapters: [createGemWalletAdapter()]
|
|
29
|
-
});
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
When using `@xrpl-wallet-kit/client` defaults, GemWallet is already included.
|
|
33
|
-
|
|
34
|
-
## Runtime Notes
|
|
35
|
-
|
|
36
|
-
- Requires the GemWallet browser extension.
|
|
37
|
-
- Availability is detected with `provider.isInstalled()`.
|
|
38
|
-
- `connect()` reads the active extension address and network.
|
|
39
|
-
- `restoreSession()` is passive-only. It reads the current extension address with `getAddress()` and restores only when that address matches the stored session address.
|
|
40
|
-
- If GemWallet cannot provide a current address during restore, the adapter returns `null` instead of reviving the stored session blindly.
|
|
41
|
-
- `signAndSubmit()` routes by `methodHint`:
|
|
42
|
-
- `payment` -> `sendPayment`
|
|
43
|
-
- `createNFTOffer` -> `createNFTOffer`
|
|
44
|
-
- `acceptNFTOffer` -> `acceptNFTOffer`
|
|
45
|
-
- `cancelNFTOffer` -> `cancelNFTOffer`
|
|
46
|
-
- `burnNFT` or `NFTokenBurn` tx type -> `burnNFT`
|
|
47
|
-
- `trustSet`, `setTrustline`, `trustset`, or `TrustSet` tx type -> `setTrustline`
|
|
48
|
-
- GemWallet trust line APIs expect `limitAmount`, `qualityIn`, `qualityOut`, and `flags`, so the adapter maps XRPL `TrustSet` fields such as `LimitAmount`, `QualityIn`, `QualityOut`, and `Flags` into the provider's native payload format.
|
|
49
|
-
- Transaction responses are normalized with `normalizeTxResult()` so submitted hashes can drive lifecycle events and WalletToast.
|
|
50
|
-
|
|
51
|
-
## Auto Reconnect
|
|
52
|
-
|
|
53
|
-
GemWallet restore is intentionally conservative. The stored dApp session is not treated as proof that the extension is still connected. On reload, the adapter must read the active GemWallet address and compare it with the stored XRPL address.
|
|
54
|
-
|
|
55
|
-
`restoreSession()` does not call connect, open extension UI, ask the user to sign in, or submit any wallet request beyond passive address inspection. Normal stale or unavailable states return `null` so the manager can emit stale/expired session events and let the user reconnect manually.
|
|
56
|
-
|
|
57
|
-
## Testing
|
|
58
|
-
|
|
59
|
-
Pass a mock provider for isolated tests:
|
|
60
|
-
|
|
61
|
-
```ts
|
|
62
|
-
import { assertWalletAdapter } from "@xrpl-wallet-kit/core";
|
|
63
|
-
import { createGemWalletAdapter } from "@xrpl-wallet-kit/adapter-gemwallet";
|
|
64
|
-
|
|
65
|
-
assertWalletAdapter(createGemWalletAdapter({ provider: mockGemWallet }));
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
## Links
|
|
69
|
-
|
|
70
|
-
- GemWallet: https://gemwallet.app
|
|
71
|
-
- XRPL Wallet Kit: https://github.com/XRPDomains/xrpl-wallet-kit
|
|
1
|
+
# @xrpl-wallet-kit/adapter-gemwallet
|
|
2
|
+
|
|
3
|
+
GemWallet adapter for XRPL Wallet Kit.
|
|
4
|
+
|
|
5
|
+
GemWallet is an XRPL browser extension wallet. This adapter wraps the `@gemwallet/api` package and normalizes account, message signing, payment, and NFT offer results 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-gemwallet
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
import { createWalletKit } from "@xrpl-wallet-kit/client";
|
|
25
|
+
import { createGemWalletAdapter } from "@xrpl-wallet-kit/adapter-gemwallet";
|
|
26
|
+
|
|
27
|
+
const kit = createWalletKit({
|
|
28
|
+
adapters: [createGemWalletAdapter()]
|
|
29
|
+
});
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
When using `@xrpl-wallet-kit/client` defaults, GemWallet is already included.
|
|
33
|
+
|
|
34
|
+
## Runtime Notes
|
|
35
|
+
|
|
36
|
+
- Requires the GemWallet browser extension.
|
|
37
|
+
- Availability is detected with `provider.isInstalled()`.
|
|
38
|
+
- `connect()` reads the active extension address and network.
|
|
39
|
+
- `restoreSession()` is passive-only. It reads the current extension address with `getAddress()` and restores only when that address matches the stored session address.
|
|
40
|
+
- If GemWallet cannot provide a current address during restore, the adapter returns `null` instead of reviving the stored session blindly.
|
|
41
|
+
- `signAndSubmit()` routes by `methodHint`:
|
|
42
|
+
- `payment` -> `sendPayment`
|
|
43
|
+
- `createNFTOffer` -> `createNFTOffer`
|
|
44
|
+
- `acceptNFTOffer` -> `acceptNFTOffer`
|
|
45
|
+
- `cancelNFTOffer` -> `cancelNFTOffer`
|
|
46
|
+
- `burnNFT` or `NFTokenBurn` tx type -> `burnNFT`
|
|
47
|
+
- `trustSet`, `setTrustline`, `trustset`, or `TrustSet` tx type -> `setTrustline`
|
|
48
|
+
- GemWallet trust line APIs expect `limitAmount`, `qualityIn`, `qualityOut`, and `flags`, so the adapter maps XRPL `TrustSet` fields such as `LimitAmount`, `QualityIn`, `QualityOut`, and `Flags` into the provider's native payload format.
|
|
49
|
+
- Transaction responses are normalized with `normalizeTxResult()` so submitted hashes can drive lifecycle events and WalletToast.
|
|
50
|
+
|
|
51
|
+
## Auto Reconnect
|
|
52
|
+
|
|
53
|
+
GemWallet restore is intentionally conservative. The stored dApp session is not treated as proof that the extension is still connected. On reload, the adapter must read the active GemWallet address and compare it with the stored XRPL address.
|
|
54
|
+
|
|
55
|
+
`restoreSession()` does not call connect, open extension UI, ask the user to sign in, or submit any wallet request beyond passive address inspection. Normal stale or unavailable states return `null` so the manager can emit stale/expired session events and let the user reconnect manually.
|
|
56
|
+
|
|
57
|
+
## Testing
|
|
58
|
+
|
|
59
|
+
Pass a mock provider for isolated tests:
|
|
60
|
+
|
|
61
|
+
```ts
|
|
62
|
+
import { assertWalletAdapter } from "@xrpl-wallet-kit/core";
|
|
63
|
+
import { createGemWalletAdapter } from "@xrpl-wallet-kit/adapter-gemwallet";
|
|
64
|
+
|
|
65
|
+
assertWalletAdapter(createGemWalletAdapter({ provider: mockGemWallet }));
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Links
|
|
69
|
+
|
|
70
|
+
- GemWallet: https://gemwallet.app
|
|
71
|
+
- 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-gemwallet",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "GemWallet 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
|
-
"@gemwallet/api": "^3.7.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-gemwallet",
|
|
3
|
+
"version": "0.1.14",
|
|
4
|
+
"description": "GemWallet 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
|
+
"@gemwallet/api": "^3.7.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
|
+
}
|