@solana/web3.js 0.0.0-next → 0.0.0-pr-29130

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 (74) hide show
  1. package/README.md +24 -25
  2. package/lib/index.browser.cjs.js +4583 -4238
  3. package/lib/index.browser.cjs.js.map +1 -1
  4. package/lib/index.browser.esm.js +4565 -4238
  5. package/lib/index.browser.esm.js.map +1 -1
  6. package/lib/index.cjs.js +7072 -3604
  7. package/lib/index.cjs.js.map +1 -1
  8. package/lib/index.d.ts +3516 -2420
  9. package/lib/index.esm.js +7046 -3601
  10. package/lib/index.esm.js.map +1 -1
  11. package/lib/index.iife.js +22171 -27053
  12. package/lib/index.iife.js.map +1 -1
  13. package/lib/index.iife.min.js +8 -33
  14. package/lib/index.iife.min.js.map +1 -1
  15. package/lib/index.native.js +10407 -0
  16. package/lib/index.native.js.map +1 -0
  17. package/package.json +36 -36
  18. package/src/__forks__/browser/fetch-impl.ts +4 -0
  19. package/src/__forks__/react-native/fetch-impl.ts +4 -0
  20. package/src/account-data.ts +39 -0
  21. package/src/account.ts +20 -11
  22. package/src/bpf-loader.ts +2 -2
  23. package/src/connection.ts +2303 -635
  24. package/src/epoch-schedule.ts +1 -1
  25. package/src/errors.ts +41 -0
  26. package/src/fee-calculator.ts +2 -0
  27. package/src/fetch-impl.ts +13 -0
  28. package/src/index.ts +3 -10
  29. package/src/keypair.ts +20 -25
  30. package/src/layout.ts +45 -4
  31. package/src/loader.ts +3 -3
  32. package/src/message/account-keys.ts +79 -0
  33. package/src/message/compiled-keys.ts +165 -0
  34. package/src/message/index.ts +47 -0
  35. package/src/{message.ts → message/legacy.ts} +95 -40
  36. package/src/message/v0.ts +496 -0
  37. package/src/message/versioned.ts +36 -0
  38. package/src/nonce-account.ts +8 -4
  39. package/src/programs/address-lookup-table/index.ts +435 -0
  40. package/src/programs/address-lookup-table/state.ts +84 -0
  41. package/src/programs/compute-budget.ts +281 -0
  42. package/src/{ed25519-program.ts → programs/ed25519.ts} +6 -6
  43. package/src/programs/index.ts +7 -0
  44. package/src/{secp256k1-program.ts → programs/secp256k1.ts} +15 -16
  45. package/src/{stake-program.ts → programs/stake.ts} +7 -7
  46. package/src/{system-program.ts → programs/system.ts} +55 -18
  47. package/src/{vote-program.ts → programs/vote.ts} +137 -9
  48. package/src/publickey.ts +37 -79
  49. package/src/transaction/constants.ts +12 -0
  50. package/src/transaction/expiry-custom-errors.ts +48 -0
  51. package/src/transaction/index.ts +5 -0
  52. package/src/{transaction.ts → transaction/legacy.ts} +162 -67
  53. package/src/transaction/message.ts +140 -0
  54. package/src/transaction/versioned.ts +126 -0
  55. package/src/{util → utils}/assert.ts +0 -0
  56. package/src/utils/bigint.ts +43 -0
  57. package/src/{util → utils}/borsh-schema.ts +0 -0
  58. package/src/{util → utils}/cluster.ts +0 -0
  59. package/src/utils/ed25519.ts +46 -0
  60. package/src/utils/index.ts +5 -0
  61. package/src/utils/makeWebsocketUrl.ts +26 -0
  62. package/src/{util → utils}/promise-timeout.ts +0 -0
  63. package/src/utils/secp256k1.ts +18 -0
  64. package/src/utils/send-and-confirm-raw-transaction.ts +105 -0
  65. package/src/utils/send-and-confirm-transaction.ts +98 -0
  66. package/src/{util → utils}/shortvec-encoding.ts +0 -0
  67. package/src/{util → utils}/sleep.ts +0 -0
  68. package/src/{util → utils}/to-buffer.ts +0 -0
  69. package/src/validator-info.ts +4 -6
  70. package/src/vote-account.ts +1 -1
  71. package/src/agent-manager.ts +0 -44
  72. package/src/util/send-and-confirm-raw-transaction.ts +0 -46
  73. package/src/util/send-and-confirm-transaction.ts +0 -50
  74. package/src/util/url.ts +0 -18
package/README.md CHANGED
@@ -1,4 +1,3 @@
1
- [![Build status][travis-image]][travis-url]
2
1
  [![codecov][codecov-image]][codecov-url]
3
2
  <br>
4
3
  [![npm][npm-image]][npm-url]
@@ -7,8 +6,6 @@
7
6
  [![semantic-release][semantic-release-image]][semantic-release-url]
8
7
  [![code-style-prettier][code-style-prettier-image]][code-style-prettier-url]
9
8
 
10
- [travis-image]: https://api.travis-ci.org/solana-labs/solana-web3.js.svg?branch=master
11
- [travis-url]: https://travis-ci.org/solana-labs/solana-web3.js
12
9
  [codecov-image]: https://codecov.io/gh/solana-labs/solana-web3.js/branch/master/graph/badge.svg
13
10
  [codecov-url]: https://codecov.io/gh/solana-labs/solana-web3.js
14
11
  [npm-image]: https://img.shields.io/npm/v/@solana/web3.js.svg?style=flat
@@ -23,7 +20,10 @@
23
20
 
24
21
  This is the Solana Javascript API built on the Solana [JSON RPC API](https://docs.solana.com/apps/jsonrpc-api)
25
22
 
26
- [Latest API Documentation](https://solana-labs.github.io/solana-web3.js/)
23
+ ## Documentation and examples
24
+
25
+ - [The Solana Cookbook](https://solanacookbook.com/) has extensive task-based documentation using this library.
26
+ - For more detail on individual functions, see the [latest API Documentation](https://solana-labs.github.io/solana-web3.js/)
27
27
 
28
28
  ## Installation
29
29
 
@@ -57,7 +57,7 @@ Install the latest Solana release from https://docs.solana.com/cli/install-solan
57
57
 
58
58
  **Use `solana-test-validator` from the latest Solana release**
59
59
 
60
- ### BPF program development
60
+ ### SBF program development
61
61
 
62
62
  **Use `cargo build-bpf` from the latest Solana release**
63
63
 
@@ -84,28 +84,23 @@ console.log(solanaWeb3);
84
84
  console.log(solanaWeb3);
85
85
  ```
86
86
 
87
- ## Examples
88
-
89
- Example scripts for the web3.js repo and native programs:
90
-
91
- - [Web3 Examples](https://github.com/solana-labs/solana/tree/master/web3.js/examples)
92
-
93
- Example scripts for the Solana Program Library:
94
-
95
- - [Token Program Examples](https://github.com/solana-labs/solana-program-library/tree/master/token/js/examples)
87
+ ## Compatibility
96
88
 
97
- ## Flow Support (Discontinued)
89
+ This library requires a JavaScript runtime that supports [`BigInt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) and the [exponentiation operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Exponentiation). Both are supported in the following runtimes:
98
90
 
99
- Flow types are no longer supported in new releases. The last release with Flow support is v1.37.2 and its
100
- [Flow library definition](https://flow.org/en/docs/libdefs/) is provided at
101
- https://unpkg.com/@solana/web3.js@v1.37.2/module.flow.js.
102
- Download the file and add the following line under the [libs] section of your project's `.flowconfig` to
103
- activate it:
104
-
105
- ```ini
106
- [libs]
107
- node_modules/@solana/web3.js/module.flow.js
108
- ```
91
+ - Browsers, by [release date](https://caniuse.com/bigint):
92
+ - Chrome: May 2018
93
+ - Firefox: July 2019
94
+ - Safari: September 2020
95
+ - Mobile Safari: September 2020
96
+ - Edge: January 2020
97
+ - Opera: June 2018
98
+ - Samsung Internet: April 2019
99
+ - Runtimes, [by version](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt):
100
+ - Deno: >=1.0
101
+ - Node: >=10.4.0
102
+ - React Native:
103
+ - \>=0.7.0 using the [Hermes](https://reactnative.dev/blog/2022/07/08/hermes-as-the-default) engine ([integration guide](https://solanacookbook.com/integrations/react-native.html#how-to-use-solana-web3-js-in-a-react-native-app)):
109
104
 
110
105
  ## Releases
111
106
 
@@ -116,6 +111,10 @@ Each Github release features a tarball containing API documentation and a
116
111
  minified version of the module suitable for direct use in a browser environment
117
112
  (`<script>` tag)
118
113
 
114
+ ## Contributing
115
+
116
+ If you have an issue to report or would like to contribute a pull request, please do so against the monorepo at https://github.com/solana-labs/solana. We are not able to merge pull requests into the mirror repo https://github.com/solana-labs/solana-web3.js and issues filed there may go unnoticed.
117
+
119
118
  ## Disclaimer
120
119
 
121
120
  All claims, content, designs, algorithms, estimates, roadmaps,