Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/shawntabrizi/polkadot-js-bundle

A standalone JS bundle that contains Polkadot{JS} libraries
https://github.com/shawntabrizi/polkadot-js-bundle

Last synced: about 1 month ago
JSON representation

A standalone JS bundle that contains Polkadot{JS} libraries

Awesome Lists containing this project

README

        

# polkadot-js-bundle

This project was used to create JS bundles for the [Polkadot JS APIs](https://github.com/polkadot-js/).

Polkadot{JS} [now supports official JS bundles](https://polkadot.js.org/docs/usage/FAQ/#i-would-like-to-use-browser-bundles-bypassing-the-compile-step), so this project is mostly deprecated.

This page just serves to show how you can use them.

Include the official Polkadot JS Bundles like so:

```js

```

Note that some bundles may require you to include other bundles. For example, to use `bundle-polkadot-api.js` you must include the other 3 bundles as well.

To access to the bundle within a JavaScript file, just do the following:

```js
// Just some random examples...
const { stringToHex, hexToString } = polkadotUtil;
const { blake2AsHex, xxhashAsHex } = polkadotUtilCrypto;
const { TypeRegistry, createType } = polkadotTypes;
const { WsProvider, ApiPromise } = polkadotApi;
const { Keyring } = polkadotKeyring;
```

See the [test page](https://shawntabrizi.github.io/polkadot-js-bundle) as a sanity check that things are working.