Expose types on JS console (#832)

This commit is contained in:
Jaco Greeff 2019-03-23 12:42:02 +01:00 committed by GitHub
parent c692a52898
commit ecd30e3fee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -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
};

View File

@ -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}.