Pull in vuepress foir docs (as opposed to gitbook) (#742)
* Pull in latest @polkadot/dev, cleanup existing *.html * Cleanups (old gitbook interfaces) * Bump, WIP * Ready for testing * Update examples * Include source * Cleanup links * Adjust links * Add typedoc exclusions * Default classes from class files * Adjust imports * Adjust config * Re-add types split * Update links to substrate interfaces * Anchors for metadata * Adjust links * Restore HTML (to be deleted on CI) * Bump deps * Re-gen yarn.lock * Remove a in links * Adjust interfaces
This commit is contained in:
@@ -2,4 +2,4 @@
|
||||
|
||||
The following example shows how to instantiate a Polkadot API object and use it to connect to a node using ApiPromise.
|
||||
|
||||
[include](index.js)
|
||||
<<< @/docs/examples/promise/01_simple_connect/index.js
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
// @ts-check
|
||||
// Required imports
|
||||
const { ApiPromise } = require('@polkadot/api');
|
||||
const { WsProvider } = require('@polkadot/rpc-provider');
|
||||
const { ApiPromise, WsProvider } = require('@polkadot/api');
|
||||
|
||||
async function main () {
|
||||
// Initialise the provider to connect to the local node
|
||||
|
||||
@@ -11,8 +11,7 @@
|
||||
},
|
||||
|
||||
"dependencies": {
|
||||
"@polkadot/api": "^0.43.6",
|
||||
"@polkadot/rpc-provider": "^0.43.6"
|
||||
"@polkadot/api": "^0.45.14"
|
||||
},
|
||||
"devDependencies": {
|
||||
"rimraf": "^2.6.2"
|
||||
|
||||
@@ -5,4 +5,4 @@ It displays the block number every time a new block is seen by the node you are
|
||||
|
||||
NOTE: The example runs until you stop it with CTRL+C
|
||||
|
||||
[include](index.js)
|
||||
<<< @/docs/examples/promise/02_listen_to_blocks/index.js
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"start": "node index.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@polkadot/api": "^0.43.6"
|
||||
"@polkadot/api": "^0.45.14"
|
||||
},
|
||||
"devDependencies": {
|
||||
"rimraf": "^2.6.2"
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
|
||||
This example shows how to instantiate a Polkadot API object and use it to connect to a node and retrieve balance updates.
|
||||
|
||||
[include](index.js)
|
||||
<<< @/docs/examples/promise/03_listen_to_balance_change/index.js
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"start": "node index.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@polkadot/api": "^0.43.6"
|
||||
"@polkadot/api": "^0.45.14"
|
||||
},
|
||||
"devDependencies": {
|
||||
"rimraf": "^2.6.2"
|
||||
|
||||
@@ -4,4 +4,4 @@ This example shows how to subscribe to and later unsubscribe from listening to b
|
||||
|
||||
In this example we're calling the built-in unsubscribe() function after a timeOut of 20s to cleanup and unsubscribe from listening to updates.
|
||||
|
||||
[include](index.js)
|
||||
<<< @/docs/examples/promise/04_unsubscribe/index.js
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"start": "node index.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@polkadot/api": "^0.43.6"
|
||||
"@polkadot/api": "^0.45.14"
|
||||
},
|
||||
"devDependencies": {
|
||||
"rimraf": "^2.6.2"
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
|
||||
Many important variables are available through the storage API. This example shows how to call a few of those APIs.
|
||||
|
||||
[include](index.js)
|
||||
<<< @/docs/examples/promise/05_read_storage/index.js
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"start": "node index.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@polkadot/api": "^0.43.6"
|
||||
"@polkadot/api": "^0.45.14"
|
||||
},
|
||||
"devDependencies": {
|
||||
"rimraf": "^2.6.2"
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
|
||||
This sample shows how to create a transaction to make a transfer from one an account to another.
|
||||
|
||||
[include](index.js)
|
||||
<<< @/docs/examples/promise/06_make_transfer/index.js
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"start": "node index.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@polkadot/api": "^0.43.6"
|
||||
"@polkadot/api": "^0.45.14"
|
||||
},
|
||||
"devDependencies": {
|
||||
"rimraf": "^2.6.2"
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
|
||||
Query the system events and extract information from them. This example runs until exited via Ctrl-C
|
||||
|
||||
[include](index.js)
|
||||
<<< @/docs/examples/promise/08_system_events/index.js
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"start": "node index.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@polkadot/api": "^0.43.6"
|
||||
"@polkadot/api": "^0.45.14"
|
||||
},
|
||||
"devDependencies": {
|
||||
"rimraf": "^2.6.2"
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
|
||||
Display the events that occur during a transfer by sending a value to a random account
|
||||
|
||||
[include](index.js)
|
||||
<<< @/docs/examples/promise/09_transfer_events/index.js
|
||||
|
||||
@@ -30,7 +30,7 @@ async function main () {
|
||||
// create a new random recipient
|
||||
const recipient = keyring.addFromSeed(randomAsU8a(32)).address();
|
||||
|
||||
console.log('Sending', AMOUNT, 'from', alicePair.address(), 'to', recipient, 'with nonce', aliceNonce.toString());
|
||||
console.log('Sending', AMOUNT, 'from', alicePair.address(), 'to', recipient, 'with nonce', nonce.toString());
|
||||
|
||||
// Do the transfer and track the actual status
|
||||
api.tx.balances
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"start": "node index.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@polkadot/api": "^0.43.6"
|
||||
"@polkadot/api": "^0.45.14"
|
||||
},
|
||||
"devDependencies": {
|
||||
"rimraf": "^2.6.2"
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
|
||||
Performs a chain upgrade using the `sudo` module. This may brick your chain, so us it as an educational sample. (use `substrate --dev purge-chain` to remove DB and recover).
|
||||
|
||||
[include](index.js)
|
||||
<<< @/docs/examples/promise/10_upgrade_chain/index.js
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
// @ts-check
|
||||
// Import the API & Provider and some utility functions
|
||||
const { ApiPromise } = require('@polkadot/api');
|
||||
const { WsProvider } = require('@polkadot/rpc-provider');
|
||||
const { ApiPromise, WsProvider } = require('@polkadot/api');
|
||||
|
||||
// import the test keyring (already has dev keys for Alice, Bob, Charlie, Eve & Ferdie)
|
||||
const testKeyring = require('@polkadot/keyring/testing');
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"start": "node index.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@polkadot/api": "^0.43.6"
|
||||
"@polkadot/api": "^0.45.14"
|
||||
},
|
||||
"devDependencies": {
|
||||
"rimraf": "^2.6.2"
|
||||
|
||||
Reference in New Issue
Block a user