@pollar/stellar-wallets-kit-adapter 0.10.0 → 0.10.1
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 +13 -20
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -61,14 +61,10 @@ matching adapter that was already built.
|
|
|
61
61
|
> single resolver for `walletAdapter`. SSR-safe: returns `[]` when there is no
|
|
62
62
|
> `window`. Requires `@pollar/core@^0.10.0` / `@pollar/react@^0.10.0`.
|
|
63
63
|
>
|
|
64
|
-
>
|
|
65
|
-
> `
|
|
66
|
-
>
|
|
67
|
-
>
|
|
68
|
-
> **0.8.0** — `network` is **required**. The previous `Networks.TESTNET`
|
|
69
|
-
> default was removed because the kit is a global singleton, and silently
|
|
70
|
-
> picking testnet for the consumer risked signing real-looking transactions
|
|
71
|
-
> on the wrong chain. Pass `Networks.TESTNET` or `Networks.PUBLIC` explicitly.
|
|
64
|
+
> `connect()` resolves to `{ address }` only, and `network` is **required** (no
|
|
65
|
+
> `Networks.TESTNET` default) — the kit is a global singleton, so silently
|
|
66
|
+
> picking testnet risks signing real-looking transactions on the wrong chain.
|
|
67
|
+
> Pass `Networks.TESTNET` or `Networks.PUBLIC` explicitly.
|
|
72
68
|
|
|
73
69
|
## Default wallets
|
|
74
70
|
|
|
@@ -130,7 +126,7 @@ Trimming the default list (e.g. only Freighter + Albedo for a SEP-43 dapp) works
|
|
|
130
126
|
```ts
|
|
131
127
|
interface StellarWalletsKitAdapterOptions {
|
|
132
128
|
/**
|
|
133
|
-
* Stellar network used for signing. **Required**
|
|
129
|
+
* Stellar network used for signing. **Required** — the kit is a
|
|
134
130
|
* global singleton, so the network must be chosen explicitly to avoid
|
|
135
131
|
* cross-chain signing accidents.
|
|
136
132
|
*/
|
|
@@ -206,14 +202,14 @@ re-runs in the browser.
|
|
|
206
202
|
|
|
207
203
|
The adapter implements `WalletAdapter` from `@pollar/core`:
|
|
208
204
|
|
|
209
|
-
| `WalletAdapter` method | Kit call
|
|
210
|
-
| ---------------------------- |
|
|
205
|
+
| `WalletAdapter` method | Kit call |
|
|
206
|
+
| ---------------------------- | ---------------------------------------------------------------------- |
|
|
211
207
|
| `isAvailable()` | `refreshSupportedWallets()` then check the wallet's `isAvailable` flag |
|
|
212
|
-
| `connect()` | `setWallet(id)` > `fetchAddress()`
|
|
213
|
-
| `disconnect()` | `StellarWalletsKit.disconnect()`
|
|
214
|
-
| `getPublicKey()` | `StellarWalletsKit.getAddress()`
|
|
215
|
-
| `signTransaction(xdr, opts)` | `setWallet(id)` > `signTransaction(xdr, opts)`
|
|
216
|
-
| `signAuthEntry(xdr, opts)` | `setWallet(id)` > `signAuthEntry(xdr, opts)`
|
|
208
|
+
| `connect()` | `setWallet(id)` > `fetchAddress()` |
|
|
209
|
+
| `disconnect()` | `StellarWalletsKit.disconnect()` |
|
|
210
|
+
| `getPublicKey()` | `StellarWalletsKit.getAddress()` |
|
|
211
|
+
| `signTransaction(xdr, opts)` | `setWallet(id)` > `signTransaction(xdr, opts)` |
|
|
212
|
+
| `signAuthEntry(xdr, opts)` | `setWallet(id)` > `signAuthEntry(xdr, opts)` |
|
|
217
213
|
|
|
218
214
|
`setWallet` is called before every signing/connect operation so a single
|
|
219
215
|
`StellarWalletsKit.init({ modules })` covers many wallets. `stellarWalletsKitAdapters()`
|
|
@@ -278,10 +274,7 @@ import { MyCustomAdapter } from './my-custom-adapter';
|
|
|
278
274
|
|
|
279
275
|
new PollarClient({
|
|
280
276
|
apiKey: 'your-api-key',
|
|
281
|
-
walletAdapters: [
|
|
282
|
-
...stellarWalletsKitAdapters({ network: Networks.PUBLIC }),
|
|
283
|
-
new MyCustomAdapter(),
|
|
284
|
-
],
|
|
277
|
+
walletAdapters: [...stellarWalletsKitAdapters({ network: Networks.PUBLIC }), new MyCustomAdapter()],
|
|
285
278
|
});
|
|
286
279
|
```
|
|
287
280
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pollar/stellar-wallets-kit-adapter",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.1",
|
|
4
4
|
"description": "Stellar Wallets Kit adapter for @pollar/core — plug additional wallet modules (xBull, Lobstr, WalletConnect, hardware wallets…) into Pollar without bundling them into @pollar/core.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"@creit.tech/stellar-wallets-kit": "^2.0.0",
|
|
35
|
-
"@pollar/core": "^0.10.
|
|
35
|
+
"@pollar/core": "^0.10.1"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@pollar/core": "^0.10.
|
|
38
|
+
"@pollar/core": "^0.10.1"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@creit.tech/stellar-wallets-kit": "^2.3.0",
|