Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

V20 merge #645

Merged
merged 93 commits into from
Jan 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
dcaa667
add get_scheduled_transactions to eosjs
conr2d Apr 12, 2019
0bc28e9
add get_scheduled_transactions test
conr2d Apr 12, 2019
e2045ab
Merge pull request #534 from conr2d/get-scheduled-transactions
jeffreyssmith2nd Apr 13, 2019
1956b66
Handle context-free data
tbfleming Apr 15, 2019
8ca3a69
Merge pull request #535 from EOSIO/context-free
tbfleming Apr 16, 2019
3f2d241
context-free actions
tbfleming Apr 19, 2019
e34c16e
Merge pull request #536 from EOSIO/context-free-actions
tbfleming Apr 22, 2019
240501e
wa pub key
tbfleming Apr 30, 2019
a56a8bc
wa
tbfleming Apr 30, 2019
7043c7a
Merge remote-tracking branch 'origin/develop' into wa-experiment
tbfleming Apr 30, 2019
b4dd59e
Add support for send_transaction JSON RPC
conr2d May 2, 2019
488dd46
wa
tbfleming May 2, 2019
b8aeb30
wa
tbfleming May 3, 2019
0acd10e
wa
tbfleming May 6, 2019
eae6a47
Update README.md
josephjguerra May 29, 2019
6f4bb5c
Merge pull request #552 from EOSIO/readme-rider
josephjguerra May 29, 2019
4292225
changing truthy check to typeof number check
Jun 7, 2019
d10e3c5
removing unneccessary spread transaction parameter for tapos check
Jun 7, 2019
1fed0be
Merge pull request #556 from EOSIO/fix-tapos-check
tbfleming Jun 7, 2019
14522af
removing duplicate interface for send_transaction
Jul 3, 2019
9ee5235
Merge pull request #545 from conr2d/support-send_transaction
Jul 3, 2019
618ee58
trimmed off final slash with regex and added extra slash to construct…
Jul 3, 2019
cea185c
Merge pull request #562 from EOSIO/fix-trailing-slash-bug
Jul 5, 2019
271f9f7
adding resolutions for nested dependency vulnerabilities
Jul 5, 2019
31c7337
adds webhook
Jul 12, 2019
3a05744
removes webhook
Jul 12, 2019
733d7de
adds webhook
Jul 12, 2019
01c0035
adds repo-specific webhook url
Jul 12, 2019
cbcef42
Merge pull request #566 from EOSIO/jerstern/add-webhook
Jul 15, 2019
b82741e
Update README.md
thekevinbrown Jul 16, 2019
65d1869
Minor bugfix for missing commas in example json
kdmukai Jul 16, 2019
e4d6240
Minor fixes for invalid example json
kdmukai Jul 16, 2019
8ad58dd
Merge remote-tracking branch 'origin/develop' into wa-experiment
tbfleming Aug 7, 2019
ea1634f
Merge remote-tracking branch 'origin/dependency-update' into wa-exper…
tbfleming Aug 8, 2019
6070a2e
WebAuthnSignatureProvider
tbfleming Aug 8, 2019
d85dbee
Merge pull request #577 from EOSIO/wa-experiment
tbfleming Aug 8, 2019
81d2323
Replace eosjs-ecc with elliptic
tbfleming Aug 8, 2019
7a79d3f
Use fc's definition of 'canonical'
tbfleming Aug 9, 2019
bf7cf57
typo
tbfleming Aug 9, 2019
3d6c39c
Merge pull request #579 from EOSIO/elliptic2
tbfleming Aug 9, 2019
4a27bf1
Merge pull request #569 from kdmukai/patch-1
Aug 12, 2019
9487f32
Merge pull request #568 from thekevinbrown/patch-2
Aug 12, 2019
d62b6c8
replace get_block with get_block_header_state
UMU618 Aug 14, 2019
36cc5e0
updating types for new interfaces and tapos calculations based on get…
Aug 14, 2019
11fbd89
Merge pull request #582 from meet-one/develop
Aug 14, 2019
1612cdc
initial commit of documentation directory stucture.
sjkelleyjr Aug 22, 2019
e089d35
Bump mixin-deep from 1.3.1 to 1.3.2
dependabot[bot] Aug 28, 2019
2b2e331
Merge pull request #586 from EOSIO/dependabot/npm_and_yarn/mixin-deep…
Aug 29, 2019
2b84c4a
adding fallback for get_block_header_state
Aug 29, 2019
0d900fa
switching to multiline imports since types put it over character limit
Aug 29, 2019
c632c60
first draft of content in new doc structure
sjkelleyjr Sep 2, 2019
8519d6a
updating to use try/catch in all cases instead of conditional statement
Sep 3, 2019
a53eecb
Merge pull request #587 from EOSIO/get-block-header-fallback
Sep 4, 2019
ee17ee5
Update module names and update docs.json
Sep 5, 2019
b88f251
abstracting out the reading and writing disclaimer in docs/basic-usag…
sjkelleyjr Sep 6, 2019
735da1c
finishing how-to guide docs
sjkelleyjr Sep 15, 2019
e4d82d3
updating the networking changing how-to
sjkelleyjr Sep 16, 2019
9161eab
adding deprecation notice to get transaction how-to, re-wording how-t…
sjkelleyjr Sep 22, 2019
af1dc82
fixing small typos/filename formatting, adding the introduction and t…
sjkelleyjr Sep 29, 2019
252e749
Setup functions for Priv/Pub keys to be converted into and out of Ell…
Oct 3, 2019
eab325f
Rework how priv/pub keys are instantiated and add sig/verify functions
Oct 7, 2019
36f599d
get all tests working again
Oct 9, 2019
24a22a9
adding comments and cleaning up code for PR
Oct 9, 2019
2b0ca58
adding optional arg to pass in an ecurve
Oct 9, 2019
27905cc
Merge pull request #597 from EOSIO/refactorFormatConverters
GreenBusDriver Oct 15, 2019
584b10f
fix carriage return
dskvr Oct 21, 2019
c2cc6d0
rename basic-usage.md page to index.md because it's a child of basic-…
dskvr Oct 21, 2019
af47366
Merge pull request #588 from EOSIO/docs/starter
dskvr Nov 9, 2019
e7a0106
fixing signing
Nov 12, 2019
3ba42f2
fixing a test
Nov 12, 2019
cd2fb09
Merge pull request #605 from EOSIO/fixingSignMethod
GreenBusDriver Nov 12, 2019
5432e91
* fix hash() misuse
UMU618 Nov 14, 2019
40d5ed5
bugfix. Changing wasmFilePath to wasmHexString in full code example
sjkelleyjr Nov 18, 2019
d9079b3
adding arg to default to the proper config
Oct 4, 2019
5efa057
added license, version, and build passing badges
Oct 16, 2019
74c12f3
adding npm packge img
Oct 16, 2019
0a4d65a
PR feedback about badge arrangement
Oct 16, 2019
b5aef9d
removing babel-cli removes need for babel-polyfill
Oct 16, 2019
7fd6f84
Merge pull request #622 from EOSIO/v20.0-prepToMerge
GreenBusDriver Dec 5, 2019
a61e5ff
Merge pull request #609 from EOSIO/deployBugFix
dskvr Dec 6, 2019
58b81b6
fixing recovery param
Dec 3, 2019
f9082b3
Merge pull request #626 from EOSIO/cleanupForRelease
jlamarr22 Dec 9, 2019
081c990
bump version
Dec 9, 2019
2f859a0
Merge pull request #627 from EOSIO/bump
jlamarr22 Dec 9, 2019
0b35351
bump
Dec 9, 2019
67ee21f
Merge pull request #628 from EOSIO/bump
jlamarr22 Dec 9, 2019
84916d2
Accept number equal to 1 or 0 while checking data type of bool.
terrylks Dec 6, 2019
e2c667e
Merge pull request #629 from EOSIO/accept-1-and-0
jlamarr22 Dec 11, 2019
b3eb443
Elliptic p256 compatibility support (#634)
Jan 3, 2020
ccbd83e
JsonToRawAbi, inverse of rawAbiToJson (#641)
Jan 3, 2020
7938e1a
Merge pull request #606 from UMU618/develop
Jan 3, 2020
665196d
Merge develop in to v20.0
Jan 16, 2020
e98f15a
Add eosjs-ecc as dev dependency since there are tests that depend on it
Jan 16, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@ deploy:
on:
tags: true
condition: $TRAVIS_IS_LATEST_TAG = true # sourced from ./scripts/is_latest.sh
notifications:
webhooks:
secure: bBIpgJmtb4WbXgGTD71INlC7LqscHKOWZMiBmRtkUD1X9fjNzgNVKsjf4ZlTWpq9YtKFox0bAWjS00feRYlHZZal5tZEt9wRKJbkZEgnCa32YF2YOng0Q5JxoIBskH0SSUf/qocwjPmYQu+2Y3Y9KoLoV2C72qedGgSrrMmLWSVPA91tyqPl4gOU0HS6/9KU1QNf7Uv0v7Fo10+V+JwQC03MoC2+1dkz799LuUr2SmmN3JuLWSXl9KIq7CCF7wkcqzq1vMk176mmEH1/26InNXKLXIW/MqIjMfkZq4j+IjW+JbuWz/Qh3EY+rbQAMT+++tIYHNsh2wZppvAAPjf4vqO3m9Q4WBB2KbL6EDvE/ySDURxLzZl618u8WUbJh2o61k0R0rxPPl6yFdkl9jXV48IVTHEDYHkgghtLSSENMUmjK8kshA2qreG79Mj2l2jicZ5Vn7jv4iORQHS0PUXg4ouds+5dY0SPm9aLIop6f9WD0mcQFP9mEfagWA6EnGUxTPFQDQmNVGkpZk2afYNAT4LbOd8wrqDTsNWXRvA3QLLOiqBbhajY17Fvrh24ecJ79TERABLscFkYtke8Xx2K/lKg/T10TZuaL9VbTg4rKrD+59OTZev6JlNdGG8FR31SuJK8Ds3zmiyojCoCay54BDUbmZ0STJ1/6ocUvFka0YE=
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,21 @@ The official distribution package can be found at [npm](https://www.npmjs.com/pa

`yarn add eosjs`

### Using with Typescript

In order to get access to the `TextEncoding` and `TextDecoding` types, you need to add `@types/text-encoding` as a dev dependency:
`yarn add --dev @types/text-encoding`

If you're using Node (not a browser) then you'll also need to make sure the `dom` lib is referenced in your `tsconfig.json`:

```
{
"compilerOptions": {
"lib": [..., "dom"]
}
}
```

### Browser Distribution

Clone this repository locally then run `yarn build-web`. The browser distribution will be located in `dist-web` and can be directly copied into your project repository. The `dist-web` folder contains minified bundles ready for production, along with source mapped versions of the library for debugging. For full browser usage examples, [see the documentation](https://eosio.github.io/eosjs/guides/1.-Browsers.html).
Expand Down Expand Up @@ -124,4 +139,6 @@ try {

## Important

See LICENSE for copyright and license terms. Block.one makes its contribution on a voluntary basis as a member of the EOSIO community and is not responsible for ensuring the overall performance of the software or any related applications. We make no representation, warranty, guarantee or undertaking in respect of the software or any related documentation, whether expressed or implied, including but not limited to the warranties or merchantability, fitness for a particular purpose and noninfringement. In no event shall we be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or documentation or the use or other dealings in the software or documentation. Any test results or performance figures are indicative and will not reflect performance under all conditions. Any reference to any third party or third-party product, service or other resource is not an endorsement or recommendation by Block.one. We are not responsible, and disclaim any and all responsibility and liability, for your use of or reliance on any of these resources. Third-party resources may be updated, changed or terminated at any time, so the information here may be out of date or inaccurate.
See LICENSE for copyright and license terms. Block.one makes its contribution on a voluntary basis as a member of the EOSIO community and is not responsible for ensuring the overall performance of the software or any related applications. We make no representation, warranty, guarantee or undertaking in respect of the software or any related documentation, whether expressed or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall we be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or documentation or the use or other dealings in the software or documentation. Any test results or performance figures are indicative and will not reflect performance under all conditions. Any reference to any third party or third-party product, service or other resource is not an endorsement or recommendation by Block.one. We are not responsible, and disclaim any and all responsibility and liability, for your use of or reliance on any of these resources. Third-party resources may be updated, changed or terminated at any time, so the information here may be out of date or inaccurate. Any person using or offering this software in connection with providing software, goods or services to third parties shall advise such third parties of these license terms, disclaimers and exclusions of liability. Block.one, EOSIO, EOSIO Labs, EOS, the heptahedron and associated logos are trademarks of Block.one.

Wallets and related components are complex software that require the highest levels of security. If incorrectly built or used, they may compromise users’ private keys and digital assets. Wallet applications and related components should undergo thorough security evaluations before being used. Only experienced developers should work with this software.
46 changes: 46 additions & 0 deletions docs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"name": "eosjs",
"generators": [
{
"name": "collate_markdown",
"options": {
"docs_dir": "docs"
}
},
{
"name": "typedoc",
"options": {
"theme": "markdown",
"exclude": ["**/index*","**/*.test.ts","**/rpc-web*"],
"ignoreCompilerErrors": true,
"includeDeclarations": false,
"excludeExternals": true,
"excludeProtected": true,
"excludePrivate": true,
"typescript": {
"include": [
"src/**/*.js"
]
}
}
}
],
"filters": [
{
"name": "search_replace",
"options": {
"search": "numeric.md#",
"replace": "#",
"filepattern": "numeric.md"
}
},
{
"name": "search_replace",
"options": {
"search": "serialize.md#",
"replace": "#",
"filepattern": "serialize.md"
}
}
]
}
8 changes: 8 additions & 0 deletions docs/00_introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
`eosjs` is a Javascript library which provides an API for integrating with EOSIO-based blockchains using the [EOSIO Nodeos RPC API](https://developers.eos.io/eosio-nodeos/reference). The documentation for `eosjs` is structured in the following way:

* [Installation](02_installation.md) explains how to install `eosjs` using `npm` or `yarn`.
* [Basic Usage](basic-usage/) provides information related to importing `eosjs` in various Javascript environments. The [basic-usage](basic-usage/03_basic-usage.md) document specifically provides brief explanations of the components provided by `eosjs` as well as their typical use cases.
* [FAQ](faq/) provides answers to frequently asked questions surrounding the `eosjs` software.
* [How-To Guides](how-to-guides/) provides how-tos on everything from getting block information to proposing and signing multi-sig transactions.
* [Troubleshooting](troubleshooting/) provides possible exceptions encountered when developing with `eosjs` and their most common causes.
* [Technical Overview](01_technical-overview.md) provides a high-level overview of how `eosjs` works.
23 changes: 23 additions & 0 deletions docs/01_technical-overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
As stated in the [introduction](00_introduction.md), `eosjs` integrates with EOSIO-based blockchains using the [EOSIO Nodeos RPC API](https://developers.eos.io/eosio-nodeos/reference).

In general, there are two objects that are used to interact with a blockchain via `eosjs`: the `JsonRpc` object, and the `Api` object.

## JsonRpc
The `JsonRpc` object is typically used when signing is not necessary. Some examples include [getting block information](how-to-guides/00_how-to-get-block-information.md), [getting transaction information](how-to-guides/02_how-to-get-transaction-information.md), or [getting table information](how-to-guides/09_how-to-get-table-information.md).

The requests made by the `JsonRpc` object will either use a built-in `fetch` library, or [the `fetch` library passed in by the user](basic-usage/01_commonjs.md) to issue requests to the endpoint specified when instantiating the `JsonRpc` object. When the various methods ([get_abi](https://github.com/EOSIO/eosjs/blob/master/src/eosjs-jsonrpc.ts#L66), [get_account](https://github.com/EOSIO/eosjs/blob/master/src/eosjs-jsonrpc.ts#L71), [get_block_header_state](https://github.com/EOSIO/eosjs/blob/master/src/eosjs-jsonrpc.ts#L76), etc) of the `JsonRpc` object are invoked, the calls are delegated to the `JsonRpc` object's [fetch function](https://github.com/EOSIO/eosjs/blob/master/src/eosjs-jsonrpc.ts#L42-L63), which in turn, delegate the requests to the `fetch` library.

## Api
The `Api` object is typically used when transacting on an EOSIO-based blockchain. Some examples include [staking](how-to-guides/03_how-to-stake.md), [creating an account](how-to-guides/05_how-to-create-an-account.md), or [proposing multi-sig transactions](how-to-guides/13_how-to-propose-a-multisig-transaction.md).

The typical use of the `Api` object is to call its [`transact` method](https://github.com/EOSIO/eosjs/blob/master/src/eosjs-api.ts#L214-L254). This method performs a number of steps depending on the input passed to it:

* The `transact` method first checks if the **chainId** was set in the `Api` constructor, and if not, uses the [`JsonRpc` object's](#jsonrpc) [`get_info`](https://github.com/EOSIO/eosjs/blob/master/src/eosjs-jsonrpc.ts#L101) method to retrieve the **chainId**.
* The `transact` method then checks if the `blocksBehind` and `expiration` fields are set and well-formed in the [optional configuration object, as specified in *How to Submit a Transaction*](how-to-guides/01_how-to-submit-a-transaction.md#).
* If so, the block *blocksBehind* the head block retrieved from [`JsonRpc`'s `get_info`](https://github.com/EOSIO/eosjs/blob/master/src/eosjs-jsonrpc.ts#L101) is set as the reference block and the transaction header is serialized using this reference block and the `expiration` field.
* The `transact` method then checks if the appropriate TAPOS fields are present in the transaction ([they can either be specified directly in the transaction or in the optional configuration object](how-to-guides/01_how-to-submit-a-transaction.md#)) and throws an Error if not.
* The necessary `abi`s for a transaction are then retrieved for the case when `transact` is expected to sign the transaction.
* The `actions` are serialized using the `eosjs-serialize` `ser` object.
* The entire transaction is then [serialized](https://github.com/EOSIO/eosjs/blob/master/src/eosjs-api.ts#L154-L166), also using the `eosjs-serialize` `ser` object.
* The transaction is then optionally signed, using the `signatureProvider`, the previously retrieved `abi`s, the private keys of the `signatureProvider`, and the `chainId`.
* The transaction is then optionally broadcasted using `JsonRpc`'s [`push_transaction`](https://github.com/EOSIO/eosjs/blob/master/src/eosjs-jsonrpc.ts#L187).
9 changes: 9 additions & 0 deletions docs/02_installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
`eosjs` can be installed via [`yarn`](https://yarnpkg.com/en/)
```javascript
yarn add eosjs
```

or [`npm`](https://www.npmjs.com/)
```javascript
npm install eosjs
```
178 changes: 0 additions & 178 deletions docs/2.-Transaction-Examples.md

This file was deleted.

Loading