-
Notifications
You must be signed in to change notification settings - Fork 535
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added mdBook, expanded Block interfaces.
- Loading branch information
1 parent
76e76d1
commit 61bd169
Showing
30 changed files
with
527 additions
and
125 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
book |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[book] | ||
authors = ["Marko Petrlic"] | ||
language = "en" | ||
multilingual = false | ||
src = "src" | ||
title = "Avail JS SDK Cookbook" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Summary | ||
|
||
- [Overview](./overview.md) | ||
- [Blocks](./blocks.md) | ||
- [Block Hashes](./block_hashes.md) | ||
- [Block Abstraction](./block_abstraction.md) | ||
- [Questions](./questions.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
# Block Abstraction | ||
|
||
## Transactions | ||
|
||
### Via SDK | ||
|
||
```ts | ||
{{#include ./code/block_abstraction.ts:16:19}} | ||
``` | ||
|
||
```ts | ||
{{#include ./code/block_abstraction.ts:23:25}} | ||
``` | ||
|
||
```ts | ||
{{#include ./code/block_abstraction.ts:27:34}} | ||
``` | ||
|
||
```ts | ||
{{#include ./code/block_abstraction.ts:36:38}} | ||
``` | ||
|
||
```ts | ||
{{#include ./code/block_abstraction.ts:40:42}} | ||
``` | ||
|
||
### Via Free functions | ||
|
||
```ts | ||
{{#include ./code/block_abstraction.ts:46:49}} | ||
``` | ||
|
||
```ts | ||
{{#include ./code/block_abstraction.ts:51:58}} | ||
``` | ||
|
||
```ts | ||
{{#include ./code/block_abstraction.ts:60:62}} | ||
``` | ||
|
||
```ts | ||
{{#include ./code/block_abstraction.ts:64:66}} | ||
``` | ||
|
||
## Data Submissions | ||
|
||
### Via SDK | ||
|
||
```ts | ||
{{#include ./code/block_abstraction.ts:70:72}} | ||
``` | ||
|
||
```ts | ||
{{#include ./code/block_abstraction.ts:74:81}} | ||
``` | ||
|
||
```ts | ||
{{#include ./code/block_abstraction.ts:83:90}} | ||
``` | ||
|
||
```ts | ||
{{#include ./code/block_abstraction.ts:92:94}} | ||
``` | ||
|
||
### Via Free functions | ||
|
||
```ts | ||
{{#include ./code/block_abstraction.ts:98:100}} | ||
``` | ||
|
||
```ts | ||
{{#include ./code/block_abstraction.ts:102:109}} | ||
``` | ||
|
||
```ts | ||
{{#include ./code/block_abstraction.ts:111:118}} | ||
``` | ||
|
||
```ts | ||
{{#include ./code/block_abstraction.ts:120:122}} | ||
``` | ||
|
||
### Data Submission Structure | ||
|
||
```ts | ||
{{#include ./code/block_abstraction.ts:124:144}} | ||
``` | ||
|
||
## Full Example | ||
|
||
```ts | ||
{{#include ./code/block_abstraction.ts}} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# Block Hashes | ||
|
||
## Fetching Block Hash | ||
|
||
```ts | ||
{{#include ./code/fetch_block_hash.ts:7:9}} | ||
``` | ||
|
||
```ts | ||
{{#include ./code/fetch_block_hash.ts:11:13}} | ||
``` | ||
|
||
```ts | ||
{{#include ./code/fetch_block_hash.ts:15:19}} | ||
``` | ||
|
||
```ts | ||
{{#include ./code/fetch_block_hash.ts:21:28}} | ||
``` | ||
|
||
### Full Example | ||
|
||
```ts | ||
{{#include ./code/fetch_block_hash.ts}} | ||
``` | ||
|
||
## Conversion | ||
|
||
### From Hex String to H256 (BlockHash) | ||
|
||
```ts | ||
{{#include ./code/block_hash_conversion.ts:7:15}} | ||
``` | ||
|
||
```ts | ||
{{#include ./code/block_hash_conversion.ts:17:19}} | ||
``` | ||
|
||
```ts | ||
{{#include ./code/block_hash_conversion.ts:21:28}} | ||
``` | ||
|
||
```ts | ||
{{#include ./code/block_hash_conversion.ts:30:32}} | ||
``` | ||
|
||
```ts | ||
{{#include ./code/block_hash_conversion.ts:39:44}} | ||
``` | ||
|
||
```ts | ||
{{#include ./code/block_hash_conversion.ts:46:51}} | ||
``` | ||
|
||
### From H256 (BlockHash) to Hex String | ||
|
||
```ts | ||
{{#include ./code/block_hash_conversion.ts:34:37}} | ||
``` | ||
|
||
### Full Example | ||
|
||
```ts | ||
{{#include ./code/block_hash_conversion.ts}} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Blocks | ||
|
||
Make sure that you have already read [Polkadot JS docs](https://polkadot.js.org/docs/api/cookbook/blocks) about Blocks. | ||
Here we will cover only the additional abstraction that was added on top of existing polkadot js objects. |
Oops, something went wrong.