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.
Files changed (53) hide show
  1. package/README.md +8 -54
  2. package/dist/near-api-js.js +6657 -6326
  3. package/dist/near-api-js.min.js +259 -259
  4. package/lib/account.d.ts +59 -62
  5. package/lib/account.js +357 -281
  6. package/lib/account_creator.js +17 -4
  7. package/lib/account_multisig.d.ts +6 -17
  8. package/lib/account_multisig.js +339 -289
  9. package/lib/browser-connect.d.ts +1 -1
  10. package/lib/browser-connect.js +13 -2
  11. package/lib/browser-index.js +8 -3
  12. package/lib/common-index.d.ts +2 -2
  13. package/lib/common-index.js +7 -5
  14. package/lib/connect.d.ts +1 -1
  15. package/lib/connect.js +35 -24
  16. package/lib/connection.js +1 -1
  17. package/lib/contract.d.ts +3 -3
  18. package/lib/contract.js +29 -18
  19. package/lib/index.js +8 -3
  20. package/lib/key_stores/browser_local_storage_key_store.d.ts +4 -5
  21. package/lib/key_stores/browser_local_storage_key_store.js +57 -37
  22. package/lib/key_stores/in_memory_key_store.d.ts +5 -6
  23. package/lib/key_stores/in_memory_key_store.js +52 -32
  24. package/lib/key_stores/keystore.d.ts +3 -3
  25. package/lib/key_stores/keystore.js +3 -3
  26. package/lib/key_stores/merge_key_store.d.ts +3 -4
  27. package/lib/key_stores/merge_key_store.js +55 -35
  28. package/lib/key_stores/unencrypted_file_system_keystore.d.ts +5 -6
  29. package/lib/key_stores/unencrypted_file_system_keystore.js +86 -60
  30. package/lib/near.d.ts +15 -47
  31. package/lib/near.js +29 -38
  32. package/lib/providers/json-rpc-provider.d.ts +24 -29
  33. package/lib/providers/json-rpc-provider.js +226 -188
  34. package/lib/providers/provider.d.ts +14 -6
  35. package/lib/signer.js +41 -24
  36. package/lib/transaction.d.ts +6 -5
  37. package/lib/transaction.js +38 -25
  38. package/lib/utils/exponential-backoff.js +22 -11
  39. package/lib/utils/index.js +6 -2
  40. package/lib/utils/key_pair.js +6 -6
  41. package/lib/utils/rpc_errors.d.ts +0 -1
  42. package/lib/utils/rpc_errors.js +2 -23
  43. package/lib/utils/serialize.js +1 -0
  44. package/lib/utils/setup-node-fetch.js +1 -4
  45. package/lib/utils/web.js +42 -31
  46. package/lib/validators.js +1 -1
  47. package/lib/wallet-account.d.ts +39 -25
  48. package/lib/wallet-account.js +207 -167
  49. package/package.json +76 -80
  50. package/LICENSE-APACHE +0 -176
  51. package/lib/res/error_messages.d.ts +0 -64
  52. package/lib/utils/network.d.ts +0 -5
  53. package/lib/utils/network.js +0 -2
package/README.md CHANGED
@@ -1,64 +1,18 @@
1
- # near-api-js
1
+ # NEAR JavaScript API
2
2
 
3
- [![Build Status](https://travis-ci.com/near/near-api-js.svg?branch=master)](https://travis-ci.com/near/near-api-js)
4
- [![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod)](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
- A JavaScript/TypeScript library for development of DApps on the NEAR platform
5
+ ## Documentation
7
6
 
8
- # Documentation
7
+ - [Learn how to use](https://docs.near.org/tools/near-api-js/quick-reference) the library in your project
9
8
 
10
- [Read the TypeDoc API documentation](https://near.github.io/near-api-js/)
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
- # Examples
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.