Skip to content

Commit

Permalink
Provide basic example of custom types (#17)
Browse files Browse the repository at this point in the history
* Provide basic example of custom types

* Update src/App.jsx
  • Loading branch information
JoshOrndorff authored and riusricardo committed Sep 4, 2019
1 parent 7411e1d commit 800bd2b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,18 @@ export default function App() {
const [accountLoaded, setaccountLoaded] = useState(false);
//const WS_PROVIDER = "ws://127.0.0.1:9944";
const WS_PROVIDER = 'wss://dev-node.substrate.dev:9944';
const TYPES = {};
//const TYPES = {"MyNumber": "u32"};
// More information on custom types
// https://github.com/polkadot-js/apps/blob/master/packages/app-settings/src/md/basics.md

useEffect(() => {
const provider = new WsProvider(WS_PROVIDER);

ApiPromise.create({ provider })
ApiPromise.create({
provider,
types: TYPES,
})
.then(api => {
setApi(api);
api.isReady.then(() => setApiReady(true));
Expand Down

0 comments on commit 800bd2b

Please sign in to comment.