Commit Graph
24 Commits
Author SHA1 Message Date
Jaco Greeff 4329c0a411 Add polkadot-types-from-{chain,defs} (#1766)
* Add polkadot-types-from-{chain,defs}

* Generate scripts working

* User types generation docs

* Rebuild with new comment line
2020-01-29 15:51:23 +01:00
Jaco Greeff b24fe30a40 Split merge docs gen into sep process (#1482)
* Split merge docs gen into sep process

* Update doc refs
2019-10-12 16:00:22 +02:00
Jaco GreeffandThibaut Sardan 55fb391465 Things I wish I knew... (#1374)
* Make a start

* Intro

* Installation

* Flatten

* Move METHODS_*.md to substrate/*.md

* Basics

* Apply suggestions from code review

Co-Authored-By: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>

* Substrate links

* Create

* api.consts

* Typo

* Typo, ms -> md

* types.basics (SIP)

* Type basics

* api.consts jumps to api.query

* Start to api.query

* Basic queries

* Point starting to actual overview

* api.rpc

* Derive detour

* Query subs & query multi

* Apply suggestions from code review

Co-Authored-By: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>

* typo

* Query extras

* Basic transactions

* Misplaced ,

* keyring WIP

* Keyring wrap-up

* Subs SIP

* tx subs more WIP

* tx subs

* Small types cleanups

* Apply suggested changes from @JoshOrndorff

* Clarify naked await

* tx wrapping WIP

* Wrap api.wrap

* TS placeholder

* [WIP] markers for not-started

* Clarifying comments

* Additional clarifications

* types.extend... well, extended...

* Remove *nix

* Warp up TypeScript... it is it (for now)

* Some small text clarifications

* Some cleanups

* Cleanups, typos

* keyring cleanups

* Cleanups

* Wrap

* api.wrap wrapped... hopefully

* typos

* Registration typos

* typescript typos, hope I caught most...
2019-09-11 17:32:34 +02:00
Axel Chalon 0196829a48 Add metadata constants to scripts/MetadataMd (#1131)
* Add metadata constants to scripts/MetadataMd

* Use name instead of prefix for Extrinsics

Since the js api uses the name and not the prefix (api.tx.name.xx)
and finality_tracker doesn't have a prefix

* Lint
2019-07-16 22:55:03 +02:00
Jaco Greeff 0157f0b2e2 Cleanup old docs/ (now on gh-pages branch) (#747) 2019-02-28 17:22:42 +01:00
Jaco Greeff d86b9c8b55 Update type documentation links (#734)
* Update type documentation links

* Add derived types
2019-02-22 13:30:15 +01:00
Stefanie Doll 2433d8d1fc WIP: Sd 569 docs add and fix apirx examples (#600)
* Docs: Fixed keyring examples

* Docs: Added Rx examples

* [Docs] Added timeout to showcase unsubscribe method in ApiPromise

* [Docs] Added timeout to showcase unsubscribe method in ApiPromise

* [Docs] Added comments to read_storage example

* [Docs] Renamed "transfer_dots' to a more generic 'make_transfer' since it's not only DOT's

* [Docs] ApiRx examples for simple_connect, listen_to_blocks (incl. unsubscribe), listen_to_balance_change and read_storage

* [Docs] changed back keyring import syntax to require

* [Docs] Removed provider from read storage example

* [Docs] ApiRx "make transfer" example

* [Docs] ApiRx "system events" example

* [Docs] ApiRx "transfer events" example

* [Docs] Removed unused utility functions import

* [Docs] ApiRx 'upgrade chain' example

* [Docs] removed generated html files

* [Docs] Ficed wrong Readme of listen to blocks example

* [Docs added missing import]

* [Docs] Removed unsubscribe() example from 'listen to blocks'

* [Docs] Added Unsubscribe example for ApiPromise and ApiRx

* [Docs] Added links to summary

* [Docs] Removed duplicate info/comment from 04_unsubscribe

* [Docs] Fixed wording

* [Docs] Log actual transaction status in "make_transfer"

* [Docs] Changed author name

* [Docs] Log actual transaction status in "make_transfer"

* [Docs] changed headline of make_transfer example README's

* [Docs] changed status.value to status.asFinalised

* [Docs] Removed auto-generated html

* [Docs] Changed all occurances of status.value.toHex() to status.asFinalised.toHex()

* [Docs] Remove call to nonce observable from signAndSend examples

* [Docs] Use RxJs' zip() operator instead of 'await Promise.all()'

* [Docs] Remove call to nonce observable from 'upgrade_chain' example

* [Docs] Changed author

* [Docs] Changed wording of balance change example

* [Docs] smaller code-review fixes

* [Docs] Fix Rx read_storage example

* [Docs] use pairwise together with startWith in the Rx balance_change example

* [Docs] Wording & little less code

* [Docs] Added whitespace

* [Docs] Use switchMap instead fo subscribe inside subscribe syntax

* [Docs] Fixed import syntax for RxJs examples

* [Docs] removed provider

* [Docs] WIP read storage make-over

* [Docs] update Rx read_storage

* [Docs] Read storage example with piped switchMap()

* [Docs] Turn null into observable

* [Docs] Read storage example added 2nd version using tap()

* [Docs] fixed name typo

* [Docs] removed tap() example
2019-01-22 11:47:27 +01:00
Jaco Greeff 07d61397d5 Upgrade example with real wasm (via sudo now) (#562)
* Upgrade test with real wasm

* Update upgrade sample to use sudo
2019-01-10 11:37:51 +01:00
Jaco Greeff 7658399800 Add examples for upgradeKey & transfer events (#542)
* Add examples for upgradeKey & transfer events

* Remove CI-generated file

* Update pcakage.json for examples
2019-01-07 18:05:22 +01:00
Jaco Greeff 69f68509ef Expand with all currently known RPC methods 2018-12-07 12:30:09 +01:00
Jaco Greeff b52a86eab0 Fix types documentation links (#445)
* Fix types documentation links

* Adjust CSS selector

* Don't include Summary in the README
2018-12-06 12:11:56 +01:00
Jaco Greeff 6cab9be9c8 Document @polkadot/types (#430)
* Start with codec descriptions

* Base codec types have definitions...

* Base interface defintions

* Descriptions for all type classes

* Link to types docs

* Remove stray template block

* Typos

* Hash -> H256 in description
2018-12-03 11:23:18 +01:00
Jaco Greeff 0e6d138b1f Events example (#426)
* Bump example deps

* System events example

* Example comments

* Link to example in docs

* Typo in own surname, tsk, tsk...

* Update README.md
2018-11-29 18:04:47 +01:00
Jaco Greeff 1b12c0094b Generate Event metadata docs (#316)
* Generate Event metadata docs

* Update MetadataMd.ts
2018-10-18 16:32:50 +02:00
Luke Schoen 4748e8c87f docs: Relates to #193. Generate Substrate Interface methods in API docs for RPC, Storage, and Extrinsics from Metadata (#265)
* docs: Relates to #193. Generate Methods in API docs to Substrate Interfaces Extrinsics and Storage from Metadata

* Steps to generate Gitbook:
```
yarn run build:methodsdoc;
yarn run build;
yarn gitbook serve;
```

* Allows generating a docs/METHODS_STORAGE.md and docs/METHODS_EXTRINSICS.md files by running `yarn run build:methodsdoc`
  * Note: The script runs `node packages/types/src/MetadataMdWrapper.js`, which uses Babel.js to transpile the TypeScript file MetadataMd.ts into JavaScript as MetadataMd.js by using the babel-plugin-module-resolver dependency that has been added to package.json. It runs MetadataMd.js, which parses a hard-coded copy of a Metadata response from the Substrate Node, and then generates the two aforementioned Markdown files to be included in the Gitbook.
  * Important Note: DO NOT run `./node_modules/.bin/tsc packages/types/src/MetadataMd.ts; node packages/types/src/MetadataMd.js;`, as doing so may incorrectly transpile other TypeScript files, and will give errors like `TypeError: bn_js_1.default is not a constructor` when you run your unit tests.

* Added links that work when you go to http://localhost:4000/api/ and click the "api" link on the side menu
  * Note: This was achieved by first adding the links in packages/api/README.md (i.e. `[Extrinsics (Substrate Interface)](../METHODS_EXTRINSICS.md)`). Note that the links could also be `METHODS_EXTRINSICS.html` and it would still work. It is VERY important to add links to these Markdown files in docs/SUMMARY.md (i.e. `[Storage](METHODS_STORAGE.md)`), as Gitbook generates HTML files in the same docs/ directory (i.e. it generates docs/METHODS_STORAGE.html) for any links provided in that file, and when you run `yarn run build; yarn gitbook serve` it will put a copy of those HTML files in the _book directory so it can be accessed in the browser.

* Replaces PR #249 and #255 from jg-meta-md from jg-meta-md-luke branches

* feat: Add script to generate decoded JSON file of the Metadata. Remove test.

* Summary:
  * Running `yarn run build:decodedjson` will generate packages/types/src/Metadata.decoded.json from the Metadata in the Metadata.rpc.ts file.

* docs: Manually add RPC Substrate Interface API docs including author, chain, state, system

* docs: Append Storage Substrate methods to Storage Methods. Add consistent styling. Add descriptions

* Add Description at top of Substrate Interface page for RPC, Extrinsics, and Storage in API docs

* Add styling to Substrate Interface page for Extrinsics and Storage, including:
  * ▸ symbol before each method
  * bold method names
  * adding Summary label and only showing the summary label if a summary exists
  * adding a horizonal line between each section of methods

* Fix by adding new line after description when there is one in Extrinscis and Storage

* Manually creating a markdown file containing storage.substrate methods METHODS_STORAGE_SUBSTRATE.md, and then reading from the file and appending it to the bottom of the METHODS_STORAGE.md file that is generated, since the storage.substrate methods are not available from the Metadata.

* Fix by reading and writing to file using UTF8 instead of ASCII so symbols appear correctly

* Updating docs/METHODS_RPC.md and adding a horizontal line before the first section of methods

* docs: Fix Readme file step numbering

* docs: Generate the Substrate Interface Markdown files first when run yarn run build

* refactor: Move babel register config into shared file

* refactor: Use shared function to overcome codeclimate error

* fix: Reword description of RPC methodsto address review comment

* docs: Rename to Runtime Node Interfaces to address review comment

* docs: Rename to Runtime Node Interface in api Readme to address review comment

* docs: Fix minor typos

* docs: Fixes #117 providing Readme ref to jsonrpc docs

* fix: Remove preceding whitespace

* docs: Rename so RPC is not referred to as an interface of the runtime

* docs: Refer to Storage Substrate methods as always available to runtime implementation

* test: Restore the test that was unnecessary deleted

* Move scripts into packages/types/src/scripts

* docs: Add script to generate RPC interface docs

* fix: Fix TSlint error where element had any time due to no index signature

* refactor: Restore code back to normal instead of bowing to codeclimate whims

* refactor: Declare meaningful variables to make more readable

* docs: Show .subscribe when it is isSubscription method
2018-10-12 21:15:01 +02:00
Jaco Greeff 64c5868110 Round out ApiPromise examples (#263)
* Return value from array on subscription

* Add final round of examples

* Use padEnd instead of spaces...

* Small cleanups
2018-10-12 14:52:37 +02:00
Jaco Greeff 8fafedcf00 Extend examples for ApiPromise (#261)
* examples-rpc -> examples/rpc

* 01-simple-connect

* 02-chain-newHead

* Subscriptions only return value
2018-10-12 11:19:35 +02:00
Jaco Greeff 2b88a8f43c Expand API documentation (#259)
* Expand API documentation

* Cleanups

* Structuring

* Checks & cleanups
2018-10-11 20:56:42 +02:00
Jaco Greeff a4fc2c51e8 API documentation (#253)
* Remove badges from READMEs (used inside docs)

* Expand intro

* Intro and examples for ApiRx

* examples -> examples-rpc

* Update intros with expanded example

* Don't nest subscriptions
2018-10-11 15:27:00 +02:00
Jaco Greeff bcf06cdbfd Add api/promise (#251)
* Add api/promise

* Observable -> Promise

* super(extrinsic)

* Add ApiPromise to docs
2018-10-11 12:00:12 +02:00
Luke Schoen 82baafbe32 fix: Fixes #244. Adds correct link to RpcRx markdown file so RpcRx links in API docs work (#245) 2018-10-11 09:34:14 +02:00
Jaco Greeff 7180f8958e @polkadot/api/rx (#233)
* api-rx (new)

* Update SubmittableExtrinsic.ts

* Update types.d.ts

* Update index.ts

* Retrieve genesisHash

* extrinsics -> tx, state -> st

* Update index.ts

* Type cleanup

* Update index.ts

* Update index.ts

* Update index.ts

* Sign returns SubmittableExtrinsic

* Example cleanup

* Move to api-rx package

* Add connected/disconnected events

* Expand storage creation

* isReady/isConnected

* Add static create

* Cleanup docs

* Cleanups

* ReplaySubjects

* Basic tests

* Add runtimeVersion

* Test for version, meta & hash

* Package location

* Expand README

* 2 ways of init

* whenReady -> isReady

* api-rx -> api/rx

* Namings
2018-10-10 20:18:48 +02:00
Jaco Greeff 4344f33de8 First stage renames, rpc-{core,provider,rx} (#220)
* Docs renames (& removal for re-gen)

* Rename api, api-provider & api-rx

* Apoi -> Rpc, RxApi -> RpcRx (classes)

* Add .nodoc

* Bump version

* Link updates (summary)

* Cleanup deleted (master version)

* Deleted re-instated

* More... ;)

* Types...

* Revert .nodoc
2018-10-10 10:01:34 +02:00
Jaco Greeff 4854379424 Gitbook rendering updates (#159)
* Add .nodoc for in-flux packages

* Start with clean-slate for re-generation

* Update with working (although manual) config
2018-09-19 16:14:37 +02:00