@novasamatech/product-sdk 0.5.0 → 0.5.2
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 +5 -5
- package/dist/injectSpektrExtension.js +1 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -56,13 +56,13 @@ You can wrap your PAPI provider with Spektr provider to support redirecting requ
|
|
|
56
56
|
```diff
|
|
57
57
|
import { createClient, type PolkadotClient } from 'polkadot-api';
|
|
58
58
|
import { getWsProvider } from 'polkadot-api/ws-provider';
|
|
59
|
-
import {
|
|
59
|
+
import { createPapiProvider, WellKnownChain } from '@novasamatech/product-sdk';
|
|
60
60
|
|
|
61
61
|
function createPapiClient(): PolkadotClient {
|
|
62
62
|
const polkadotEndpoint = 'wss://...';
|
|
63
63
|
|
|
64
64
|
- const provider = getWsProvider(polkadotEndpoint);
|
|
65
|
-
+ const provider =
|
|
65
|
+
+ const provider = createPapiProvider({
|
|
66
66
|
+ chainId: WellKnownChain.polkadotRelay,
|
|
67
67
|
+ fallback: getWsProvider(polkadotEndpoint),
|
|
68
68
|
+ });
|
|
@@ -71,12 +71,12 @@ function createPapiClient(): PolkadotClient {
|
|
|
71
71
|
}
|
|
72
72
|
```
|
|
73
73
|
|
|
74
|
-
### Subscribing
|
|
74
|
+
### Subscribing connection status
|
|
75
75
|
|
|
76
76
|
```ts
|
|
77
|
-
import {
|
|
77
|
+
import { metaProvider } from '@novasamatech/product-sdk';
|
|
78
78
|
|
|
79
|
-
const unsubscribe =
|
|
79
|
+
const unsubscribe = metaProvider.subscribeConnectionStatus((status) => {
|
|
80
80
|
console.log('connection status changed', status);
|
|
81
81
|
});
|
|
82
82
|
```
|
|
@@ -18,6 +18,7 @@ export async function createExtensionEnableFactory(transport) {
|
|
|
18
18
|
return response.value.map(account => ({
|
|
19
19
|
name: account.name,
|
|
20
20
|
address: accountId.dec(account.publicKey),
|
|
21
|
+
type: 'sr25519',
|
|
21
22
|
}));
|
|
22
23
|
}, err => {
|
|
23
24
|
assertEnumVariant(err, 'v1', UNSUPPORTED_VERSION_ERROR);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@novasamatech/product-sdk",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.5.
|
|
4
|
+
"version": "0.5.2",
|
|
5
5
|
"description": "Polkadot product SDK: integrate and run your product inside Polkadot browser.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"repository": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"@polkadot-api/substrate-bindings": "^0.16.6",
|
|
31
31
|
"@polkadot-api/json-rpc-provider": "^0.0.4",
|
|
32
32
|
"@polkadot-api/json-rpc-provider-proxy": "^0.2.7",
|
|
33
|
-
"@novasamatech/host-api": "0.5.
|
|
33
|
+
"@novasamatech/host-api": "0.5.2"
|
|
34
34
|
},
|
|
35
35
|
"publishConfig": {
|
|
36
36
|
"access": "public"
|