Skip to content

Commit ae91622

Browse files
Merge pull request #34 from developerfred/chore/milestone-review
Enable block explorer components
2 parents 7777744 + b85d6ac commit ae91622

File tree

8 files changed

+2204
-781
lines changed

8 files changed

+2204
-781
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"@babel/standalone": "^7.27.0",
1919
"@monaco-editor/react": "^4.7.0",
2020
"@polkadot-api/descriptors": "file:.papi/descriptors",
21+
"@polkadot-api/sdk-governance": "^0.3.1",
2122
"@polkadot/api": "^16.0.1",
2223
"@polkadot/extension-dapp": "^0.58.10",
2324
"@polkadot/keyring": "^13.5.1",

src/components/LivePreview/index.tsx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,17 @@ import React, {
1515
import { ErrorBoundary } from "react-error-boundary";
1616
import * as ts from "typescript";
1717
import type { Network } from "@/lib/types/network";
18-
import { MultiAddress, paseo, roc, wnd } from "@polkadot-api/descriptors";
18+
import { MultiAddress, paseo, wnd, ksm, acala, paseoassethub, popnetworkpaseo } from "@polkadot-api/descriptors";
1919
import { getWsProvider } from "polkadot-api/ws-provider/web";
2020
import { withPolkadotSdkCompat } from "polkadot-api/polkadot-sdk-compat";
2121
import { createClient } from "polkadot-api";
2222
import { useWallet } from '@/hooks/useWallet';
2323
import { useTheme } from "@/lib/theme/ThemeProvider";
2424
import { getInjectedExtensions, connectInjectedExtension } from "polkadot-api/pjs-signer";
25+
import { getSmProvider } from "polkadot-api/sm-provider";
26+
import { chainSpec } from "polkadot-api/chains/polkadot";
27+
import { startFromWorker } from "polkadot-api/smoldot/from-worker";
28+
import { createConvictionVotingSdk } from "@polkadot-api/sdk-governance";
2529

2630
const ALLOWED_MODULES: Record<string, unknown> = {
2731
react: React,
@@ -32,11 +36,14 @@ const ALLOWED_MODULES: Record<string, unknown> = {
3236
},
3337
"polkadot-api/ws-provider/web": { getWsProvider },
3438
"polkadot-api/polkadot-sdk-compat": { withPolkadotSdkCompat },
35-
"@polkadot-api/descriptors": { paseo, roc, wnd, MultiAddress },
39+
"@polkadot-api/descriptors": { paseo, ksm, acala, wnd, paseoassethub, MultiAddress, popnetworkpaseo },
3640
"polkadot-api": { createClient },
3741
"@/hooks/useWallet": { useWallet },
3842
"@/lib/theme/ThemeProvider": { useTheme },
39-
"polkadot-api/pjs-signer": { getInjectedExtensions, connectInjectedExtension }
43+
"polkadot-api/pjs-signer": { getInjectedExtensions, connectInjectedExtension },
44+
"polkadot-api/chains/polkadot": { getSmProvider, chainSpec },
45+
"polkadot-api/smoldot/from-worker": { startFromWorker },
46+
"@polkadot-api/sdk-governance": { createConvictionVotingSdk },
4047
};
4148

4249
const COMPILER_OPTIONS: ts.CompilerOptions = {
@@ -297,8 +304,7 @@ const evaluateComponent = (code: string, network?: Network) => {
297304
useLayoutEffect,
298305
useImperativeHandle,
299306
};
300-
301-
// Inject network data into the global scope
307+
302308
const networkCode = network ? `
303309
// Inject network data from props
304310
const __network__ = ${JSON.stringify(network)};

0 commit comments

Comments
 (0)