Expose types on JS console (#832)
This commit is contained in:
parent
c692a52898
commit
ecd30e3fee
@ -15,6 +15,7 @@ import snappy from 'snappyjs';
|
||||
import { withApi, withMulti } from '@polkadot/ui-api';
|
||||
import { Button, Dropdown, Editor } from '@polkadot/ui-app';
|
||||
import uiKeyring from '@polkadot/ui-keyring';
|
||||
import * as types from '@polkadot/types';
|
||||
import * as util from '@polkadot/util';
|
||||
import * as hashing from '@polkadot/util-crypto';
|
||||
|
||||
@ -36,6 +37,7 @@ type Injected = {
|
||||
global: null,
|
||||
hashing: typeof hashing,
|
||||
keyring: KeyringInstance | null,
|
||||
types: typeof types,
|
||||
util: typeof util,
|
||||
window: null
|
||||
};
|
||||
@ -177,6 +179,7 @@ class Playground extends React.PureComponent<Props, State> {
|
||||
keyring: isDevelopment
|
||||
? uiKeyring.keyring
|
||||
: null,
|
||||
types,
|
||||
util,
|
||||
window: null
|
||||
};
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
export default function makeWrapper (isDevelopment: boolean): string {
|
||||
const args = `api, hashing, ${isDevelopment ? 'keyring, ' : ''}util`;
|
||||
const args = `api, hashing, ${isDevelopment ? 'keyring, ' : ''}types, util`;
|
||||
|
||||
return `// All code is wrapped within an async closure,
|
||||
// allowing access to ${args}.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user