@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.
- package/README.md +24 -25
- package/lib/index.browser.cjs.js +4583 -4238
- package/lib/index.browser.cjs.js.map +1 -1
- package/lib/index.browser.esm.js +4565 -4238
- package/lib/index.browser.esm.js.map +1 -1
- package/lib/index.cjs.js +7072 -3604
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.d.ts +3516 -2420
- package/lib/index.esm.js +7046 -3601
- package/lib/index.esm.js.map +1 -1
- package/lib/index.iife.js +22171 -27053
- package/lib/index.iife.js.map +1 -1
- package/lib/index.iife.min.js +8 -33
- package/lib/index.iife.min.js.map +1 -1
- package/lib/index.native.js +10407 -0
- package/lib/index.native.js.map +1 -0
- package/package.json +36 -36
- package/src/__forks__/browser/fetch-impl.ts +4 -0
- package/src/__forks__/react-native/fetch-impl.ts +4 -0
- package/src/account-data.ts +39 -0
- package/src/account.ts +20 -11
- package/src/bpf-loader.ts +2 -2
- package/src/connection.ts +2303 -635
- package/src/epoch-schedule.ts +1 -1
- package/src/errors.ts +41 -0
- package/src/fee-calculator.ts +2 -0
- package/src/fetch-impl.ts +13 -0
- package/src/index.ts +3 -10
- package/src/keypair.ts +20 -25
- package/src/layout.ts +45 -4
- package/src/loader.ts +3 -3
- package/src/message/account-keys.ts +79 -0
- package/src/message/compiled-keys.ts +165 -0
- package/src/message/index.ts +47 -0
- package/src/{message.ts → message/legacy.ts} +95 -40
- package/src/message/v0.ts +496 -0
- package/src/message/versioned.ts +36 -0
- package/src/nonce-account.ts +8 -4
- package/src/programs/address-lookup-table/index.ts +435 -0
- package/src/programs/address-lookup-table/state.ts +84 -0
- package/src/programs/compute-budget.ts +281 -0
- package/src/{ed25519-program.ts → programs/ed25519.ts} +6 -6
- package/src/programs/index.ts +7 -0
- package/src/{secp256k1-program.ts → programs/secp256k1.ts} +15 -16
- package/src/{stake-program.ts → programs/stake.ts} +7 -7
- package/src/{system-program.ts → programs/system.ts} +55 -18
- package/src/{vote-program.ts → programs/vote.ts} +137 -9
- package/src/publickey.ts +37 -79
- package/src/transaction/constants.ts +12 -0
- package/src/transaction/expiry-custom-errors.ts +48 -0
- package/src/transaction/index.ts +5 -0
- package/src/{transaction.ts → transaction/legacy.ts} +162 -67
- package/src/transaction/message.ts +140 -0
- package/src/transaction/versioned.ts +126 -0
- package/src/{util → utils}/assert.ts +0 -0
- package/src/utils/bigint.ts +43 -0
- package/src/{util → utils}/borsh-schema.ts +0 -0
- package/src/{util → utils}/cluster.ts +0 -0
- package/src/utils/ed25519.ts +46 -0
- package/src/utils/index.ts +5 -0
- package/src/utils/makeWebsocketUrl.ts +26 -0
- package/src/{util → utils}/promise-timeout.ts +0 -0
- package/src/utils/secp256k1.ts +18 -0
- package/src/utils/send-and-confirm-raw-transaction.ts +105 -0
- package/src/utils/send-and-confirm-transaction.ts +98 -0
- package/src/{util → utils}/shortvec-encoding.ts +0 -0
- package/src/{util → utils}/sleep.ts +0 -0
- package/src/{util → utils}/to-buffer.ts +0 -0
- package/src/validator-info.ts +4 -6
- package/src/vote-account.ts +1 -1
- package/src/agent-manager.ts +0 -44
- package/src/util/send-and-confirm-raw-transaction.ts +0 -46
- package/src/util/send-and-confirm-transaction.ts +0 -50
- 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
|
-
|
|
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
|
-
###
|
|
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
|
-
##
|
|
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
|
-
|
|
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
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
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,
|