@xrpl-wallet-kit/adapter-otsu 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.
- package/README.md +113 -113
- package/package.json +47 -47
package/README.md
CHANGED
|
@@ -1,113 +1,113 @@
|
|
|
1
|
-
# @xrpl-wallet-kit/adapter-otsu
|
|
2
|
-
|
|
3
|
-
Otsu Wallet adapter for [XRPL Wallet Kit](https://github.com/XRPDomains/xrpl-wallet-kit).
|
|
4
|
-
|
|
5
|
-
Otsu is an MV3 browser extension wallet for the XRP Ledger. It supports mainnet, testnet, and devnet, and provides granular dApp permission scopes plus transaction simulation with risk scanning before user approval.
|
|
6
|
-
|
|
7
|
-
- **Extension inject:** `window.xrpl` with `isOtsu = true`
|
|
8
|
-
- **Networks:** mainnet · testnet · devnet
|
|
9
|
-
- **Capabilities:** connect · disconnect · signMessage · signTransaction · signAndSubmit
|
|
10
|
-
|
|
11
|
-
## Installation
|
|
12
|
-
|
|
13
|
-
```bash
|
|
14
|
-
npm install @xrpl-wallet-kit/adapter-otsu
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
## Usage
|
|
18
|
-
|
|
19
|
-
### With `createWalletKit` (recommended)
|
|
20
|
-
|
|
21
|
-
```ts
|
|
22
|
-
import { createWalletKit } from "@xrpl-wallet-kit/client";
|
|
23
|
-
import { createOtsuAdapter } from "@xrpl-wallet-kit/adapter-otsu";
|
|
24
|
-
|
|
25
|
-
const kit = createWalletKit({
|
|
26
|
-
adapters: [createOtsuAdapter()],
|
|
27
|
-
modal: true,
|
|
28
|
-
connectButton: "#connect-btn",
|
|
29
|
-
});
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
### With `WalletManager` directly
|
|
33
|
-
|
|
34
|
-
```ts
|
|
35
|
-
import { WalletManager } from "@xrpl-wallet-kit/core";
|
|
36
|
-
import { createOtsuAdapter } from "@xrpl-wallet-kit/adapter-otsu";
|
|
37
|
-
|
|
38
|
-
const manager = new WalletManager({
|
|
39
|
-
adapters: [createOtsuAdapter()],
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
const result = await manager.connect("otsu");
|
|
43
|
-
console.log("Connected:", result.account.address);
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
### Auto-reconnect
|
|
47
|
-
|
|
48
|
-
```ts
|
|
49
|
-
const kit = createWalletKit({
|
|
50
|
-
adapters: [createOtsuAdapter()],
|
|
51
|
-
autoReconnect: true,
|
|
52
|
-
storage: "localStorage",
|
|
53
|
-
});
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
`restoreSession` checks `provider.isConnected()` before attempting to restore; a disconnected or locked extension will cleanly return `null`.
|
|
57
|
-
|
|
58
|
-
## Provider injection
|
|
59
|
-
|
|
60
|
-
The adapter reads `window.xrpl.isOtsu`. No npm SDK dependency is required.
|
|
61
|
-
|
|
62
|
-
```ts
|
|
63
|
-
// Type declaration included in the package:
|
|
64
|
-
declare global {
|
|
65
|
-
interface Window {
|
|
66
|
-
xrpl?: OtsuProvider;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
## Testing
|
|
72
|
-
|
|
73
|
-
Pass a mock provider via `options.provider`:
|
|
74
|
-
|
|
75
|
-
```ts
|
|
76
|
-
import { OtsuAdapter, OtsuProvider } from "@xrpl-wallet-kit/adapter-otsu";
|
|
77
|
-
import { assertWalletAdapter } from "@xrpl-wallet-kit/core";
|
|
78
|
-
|
|
79
|
-
const mock: OtsuProvider = {
|
|
80
|
-
isOtsu: true,
|
|
81
|
-
isConnected: () => false,
|
|
82
|
-
connect: async () => ({ address: "rTest..." }),
|
|
83
|
-
disconnect: async () => {},
|
|
84
|
-
getAddress: async () => ({ address: "rTest..." }),
|
|
85
|
-
getNetwork: async () => ({ network: "testnet" }),
|
|
86
|
-
signTransaction: async (tx) => ({ tx_blob: "BLOB", hash: "HASH" }),
|
|
87
|
-
signAndSubmit: async (tx) => ({ tx_blob: "BLOB", hash: "HASH" }),
|
|
88
|
-
signMessage: async (msg) => ({ signature: "SIG" }),
|
|
89
|
-
on: () => {},
|
|
90
|
-
off: () => {},
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
const adapter = new OtsuAdapter({ provider: mock });
|
|
94
|
-
assertWalletAdapter(adapter); // throws if contract is violated
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
## Wire-up (coder leader)
|
|
98
|
-
|
|
99
|
-
> **Note:** This package is a standalone adapter. Wiring it into `@xrpl-wallet-kit/client` and `@xrpl-wallet-kit/browser` is the responsibility of the project maintainer.
|
|
100
|
-
|
|
101
|
-
Steps:
|
|
102
|
-
1. Add `{ "path": "./packages/adapters/otsu" }` to root `tsconfig.json` references.
|
|
103
|
-
2. Import `createOtsuAdapter` in `packages/client/src/index.ts` and add it to `createDefaultAdapters()`.
|
|
104
|
-
3. Add `"otsu"` to the `WalletKitAdapterId` union in `client/src/index.ts`.
|
|
105
|
-
4. Run `npm run build && npm run typecheck` from the repo root.
|
|
106
|
-
|
|
107
|
-
## Wallet homepage
|
|
108
|
-
|
|
109
|
-
https://github.com/RomThpt/otsu-wallet
|
|
110
|
-
|
|
111
|
-
## License
|
|
112
|
-
|
|
113
|
-
MIT
|
|
1
|
+
# @xrpl-wallet-kit/adapter-otsu
|
|
2
|
+
|
|
3
|
+
Otsu Wallet adapter for [XRPL Wallet Kit](https://github.com/XRPDomains/xrpl-wallet-kit).
|
|
4
|
+
|
|
5
|
+
Otsu is an MV3 browser extension wallet for the XRP Ledger. It supports mainnet, testnet, and devnet, and provides granular dApp permission scopes plus transaction simulation with risk scanning before user approval.
|
|
6
|
+
|
|
7
|
+
- **Extension inject:** `window.xrpl` with `isOtsu = true`
|
|
8
|
+
- **Networks:** mainnet · testnet · devnet
|
|
9
|
+
- **Capabilities:** connect · disconnect · signMessage · signTransaction · signAndSubmit
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install @xrpl-wallet-kit/adapter-otsu
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
### With `createWalletKit` (recommended)
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
import { createWalletKit } from "@xrpl-wallet-kit/client";
|
|
23
|
+
import { createOtsuAdapter } from "@xrpl-wallet-kit/adapter-otsu";
|
|
24
|
+
|
|
25
|
+
const kit = createWalletKit({
|
|
26
|
+
adapters: [createOtsuAdapter()],
|
|
27
|
+
modal: true,
|
|
28
|
+
connectButton: "#connect-btn",
|
|
29
|
+
});
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### With `WalletManager` directly
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
import { WalletManager } from "@xrpl-wallet-kit/core";
|
|
36
|
+
import { createOtsuAdapter } from "@xrpl-wallet-kit/adapter-otsu";
|
|
37
|
+
|
|
38
|
+
const manager = new WalletManager({
|
|
39
|
+
adapters: [createOtsuAdapter()],
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
const result = await manager.connect("otsu");
|
|
43
|
+
console.log("Connected:", result.account.address);
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Auto-reconnect
|
|
47
|
+
|
|
48
|
+
```ts
|
|
49
|
+
const kit = createWalletKit({
|
|
50
|
+
adapters: [createOtsuAdapter()],
|
|
51
|
+
autoReconnect: true,
|
|
52
|
+
storage: "localStorage",
|
|
53
|
+
});
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
`restoreSession` checks `provider.isConnected()` before attempting to restore; a disconnected or locked extension will cleanly return `null`.
|
|
57
|
+
|
|
58
|
+
## Provider injection
|
|
59
|
+
|
|
60
|
+
The adapter reads `window.xrpl.isOtsu`. No npm SDK dependency is required.
|
|
61
|
+
|
|
62
|
+
```ts
|
|
63
|
+
// Type declaration included in the package:
|
|
64
|
+
declare global {
|
|
65
|
+
interface Window {
|
|
66
|
+
xrpl?: OtsuProvider;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Testing
|
|
72
|
+
|
|
73
|
+
Pass a mock provider via `options.provider`:
|
|
74
|
+
|
|
75
|
+
```ts
|
|
76
|
+
import { OtsuAdapter, OtsuProvider } from "@xrpl-wallet-kit/adapter-otsu";
|
|
77
|
+
import { assertWalletAdapter } from "@xrpl-wallet-kit/core";
|
|
78
|
+
|
|
79
|
+
const mock: OtsuProvider = {
|
|
80
|
+
isOtsu: true,
|
|
81
|
+
isConnected: () => false,
|
|
82
|
+
connect: async () => ({ address: "rTest..." }),
|
|
83
|
+
disconnect: async () => {},
|
|
84
|
+
getAddress: async () => ({ address: "rTest..." }),
|
|
85
|
+
getNetwork: async () => ({ network: "testnet" }),
|
|
86
|
+
signTransaction: async (tx) => ({ tx_blob: "BLOB", hash: "HASH" }),
|
|
87
|
+
signAndSubmit: async (tx) => ({ tx_blob: "BLOB", hash: "HASH" }),
|
|
88
|
+
signMessage: async (msg) => ({ signature: "SIG" }),
|
|
89
|
+
on: () => {},
|
|
90
|
+
off: () => {},
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
const adapter = new OtsuAdapter({ provider: mock });
|
|
94
|
+
assertWalletAdapter(adapter); // throws if contract is violated
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Wire-up (coder leader)
|
|
98
|
+
|
|
99
|
+
> **Note:** This package is a standalone adapter. Wiring it into `@xrpl-wallet-kit/client` and `@xrpl-wallet-kit/browser` is the responsibility of the project maintainer.
|
|
100
|
+
|
|
101
|
+
Steps:
|
|
102
|
+
1. Add `{ "path": "./packages/adapters/otsu" }` to root `tsconfig.json` references.
|
|
103
|
+
2. Import `createOtsuAdapter` in `packages/client/src/index.ts` and add it to `createDefaultAdapters()`.
|
|
104
|
+
3. Add `"otsu"` to the `WalletKitAdapterId` union in `client/src/index.ts`.
|
|
105
|
+
4. Run `npm run build && npm run typecheck` from the repo root.
|
|
106
|
+
|
|
107
|
+
## Wallet homepage
|
|
108
|
+
|
|
109
|
+
https://github.com/RomThpt/otsu-wallet
|
|
110
|
+
|
|
111
|
+
## License
|
|
112
|
+
|
|
113
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@xrpl-wallet-kit/adapter-otsu",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Otsu Wallet adapter for XRPL Wallet Kit - MV3 browser extension wallet.",
|
|
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.
|
|
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
|
-
"otsu",
|
|
39
|
-
"wallet",
|
|
40
|
-
"wallet-adapter",
|
|
41
|
-
"wallet-kit",
|
|
42
|
-
"xrp-ledger",
|
|
43
|
-
"web3",
|
|
44
|
-
"browser-extension",
|
|
45
|
-
"mv3"
|
|
46
|
-
]
|
|
47
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@xrpl-wallet-kit/adapter-otsu",
|
|
3
|
+
"version": "0.1.14",
|
|
4
|
+
"description": "Otsu Wallet adapter for XRPL Wallet Kit - MV3 browser extension wallet.",
|
|
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
|
+
},
|
|
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
|
+
"otsu",
|
|
39
|
+
"wallet",
|
|
40
|
+
"wallet-adapter",
|
|
41
|
+
"wallet-kit",
|
|
42
|
+
"xrp-ledger",
|
|
43
|
+
"web3",
|
|
44
|
+
"browser-extension",
|
|
45
|
+
"mv3"
|
|
46
|
+
]
|
|
47
|
+
}
|