near-api-js 0.45.1 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -54
- package/dist/near-api-js.js +6657 -6326
- package/dist/near-api-js.min.js +259 -259
- package/lib/account.d.ts +59 -62
- package/lib/account.js +357 -281
- package/lib/account_creator.js +17 -4
- package/lib/account_multisig.d.ts +6 -17
- package/lib/account_multisig.js +339 -289
- package/lib/browser-connect.d.ts +1 -1
- package/lib/browser-connect.js +13 -2
- package/lib/browser-index.js +8 -3
- package/lib/common-index.d.ts +2 -2
- package/lib/common-index.js +7 -5
- package/lib/connect.d.ts +1 -1
- package/lib/connect.js +35 -24
- package/lib/connection.js +1 -1
- package/lib/contract.d.ts +3 -3
- package/lib/contract.js +29 -18
- package/lib/index.js +8 -3
- package/lib/key_stores/browser_local_storage_key_store.d.ts +4 -5
- package/lib/key_stores/browser_local_storage_key_store.js +57 -37
- package/lib/key_stores/in_memory_key_store.d.ts +5 -6
- package/lib/key_stores/in_memory_key_store.js +52 -32
- package/lib/key_stores/keystore.d.ts +3 -3
- package/lib/key_stores/keystore.js +3 -3
- package/lib/key_stores/merge_key_store.d.ts +3 -4
- package/lib/key_stores/merge_key_store.js +55 -35
- package/lib/key_stores/unencrypted_file_system_keystore.d.ts +5 -6
- package/lib/key_stores/unencrypted_file_system_keystore.js +86 -60
- package/lib/near.d.ts +15 -47
- package/lib/near.js +29 -38
- package/lib/providers/json-rpc-provider.d.ts +24 -29
- package/lib/providers/json-rpc-provider.js +226 -188
- package/lib/providers/provider.d.ts +14 -6
- package/lib/signer.js +41 -24
- package/lib/transaction.d.ts +6 -5
- package/lib/transaction.js +38 -25
- package/lib/utils/exponential-backoff.js +22 -11
- package/lib/utils/index.js +6 -2
- package/lib/utils/key_pair.js +6 -6
- package/lib/utils/rpc_errors.d.ts +0 -1
- package/lib/utils/rpc_errors.js +2 -23
- package/lib/utils/serialize.js +1 -0
- package/lib/utils/setup-node-fetch.js +1 -4
- package/lib/utils/web.js +42 -31
- package/lib/validators.js +1 -1
- package/lib/wallet-account.d.ts +39 -25
- package/lib/wallet-account.js +207 -167
- package/package.json +76 -80
- package/LICENSE-APACHE +0 -176
- package/lib/res/error_messages.d.ts +0 -64
- package/lib/utils/network.d.ts +0 -5
- package/lib/utils/network.js +0 -2
package/README.md
CHANGED
|
@@ -1,64 +1,18 @@
|
|
|
1
|
-
#
|
|
1
|
+
# NEAR JavaScript API
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
[](https://gitpod.io/#https://github.com/near/near-api-js)
|
|
3
|
+
NEAR JavaScript API is a complete library to interact with the NEAR blockchain. You can use it in the browser, or in Node.js runtime.
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
## Documentation
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
- [Learn how to use](https://docs.near.org/tools/near-api-js/quick-reference) the library in your project
|
|
9
8
|
|
|
10
|
-
|
|
9
|
+
- Read the [TypeDoc API](https://near.github.io/near-api-js/) documentation
|
|
11
10
|
|
|
12
|
-
|
|
11
|
+
- [Cookbook](https://github.com/near/near-api-js/blob/master/examples/cookbook/README.md) with common use cases
|
|
13
12
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
## [Quick Reference](https://github.com/near/near-api-js/blob/master/examples/quick-reference.md)
|
|
17
|
-
_(Cheat sheet / quick reference)_
|
|
18
|
-
|
|
19
|
-
## [Cookbook](https://github.com/near/near-api-js/blob/master/examples/cookbook/README.md)
|
|
20
|
-
_(Common use cases / more complex examples)_
|
|
21
|
-
|
|
22
|
-
---
|
|
23
|
-
|
|
24
|
-
# Contribute to this library
|
|
25
|
-
|
|
26
|
-
1. Install dependencies
|
|
27
|
-
|
|
28
|
-
yarn
|
|
29
|
-
|
|
30
|
-
2. Run continuous build with:
|
|
31
|
-
|
|
32
|
-
yarn build -- -w
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
# Publish
|
|
36
|
-
|
|
37
|
-
Prepare `dist` version by running:
|
|
38
|
-
|
|
39
|
-
yarn dist
|
|
40
|
-
|
|
41
|
-
When publishing to npm use [np](https://github.com/sindresorhus/np).
|
|
42
|
-
|
|
43
|
-
---
|
|
44
|
-
|
|
45
|
-
# Integration Test
|
|
46
|
-
|
|
47
|
-
Start the node by following instructions from [nearcore](https://github.com/nearprotocol/nearcore), then
|
|
48
|
-
|
|
49
|
-
yarn test
|
|
50
|
-
|
|
51
|
-
Tests use sample contract from `near-hello` npm package, see https://github.com/nearprotocol/near-hello
|
|
52
|
-
|
|
53
|
-
# Update error schema
|
|
54
|
-
|
|
55
|
-
Follow next steps:
|
|
56
|
-
|
|
57
|
-
1. [Change hash for the commit with errors in the nearcore](https://github.com/near/near-api-js/blob/master/fetch_error_schema.js#L8-L9)
|
|
58
|
-
2. Fetch new schema: `node fetch_error_schema.js`
|
|
59
|
-
3. `yarn build` to update `lib/**.js` files
|
|
13
|
+
- To quickly get started with integrating NEAR in a _web browser_, read our [Web Frontend integration](https://docs.near.org/develop/integrate/frontend) article.
|
|
60
14
|
|
|
61
15
|
# License
|
|
62
16
|
|
|
63
17
|
This repository is distributed under the terms of both the MIT license and the Apache License (Version 2.0).
|
|
64
|
-
See [LICENSE](LICENSE) and [LICENSE-APACHE](LICENSE-APACHE) for details.
|
|
18
|
+
See [LICENSE](https://github.com/near/near-api-js/blob/master/LICENSE) and [LICENSE-APACHE](https://github.com/near/near-api-js/blob/master/LICENSE-APACHE) for details.
|