solana-web3-community 1.0.2 → 1.0.4
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 +29 -15
- package/lib/index.browser.cjs.js.map +1 -0
- package/lib/index.browser.esm.js.map +1 -0
- package/lib/index.cjs.js +11 -148
- package/lib/index.cjs.js.map +1 -0
- package/lib/index.d.ts +4025 -0
- package/lib/index.esm.js +11 -213
- package/lib/index.esm.js.map +1 -0
- package/lib/index.iife.js.map +1 -0
- package/lib/index.iife.min.js.map +1 -0
- package/lib/index.native.js.map +1 -0
- package/package.json +20 -5
- 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 +55 -0
- package/src/blockhash.ts +4 -0
- package/src/bpf-loader-deprecated.ts +5 -0
- package/src/bpf-loader.ts +50 -0
- package/src/connection.ts +6961 -0
- package/src/epoch-schedule.ts +102 -0
- package/src/errors.ts +133 -0
- package/src/fee-calculator.ts +18 -0
- package/src/fetch-impl.ts +16 -0
- package/src/index.ts +24 -0
- package/src/instruction.ts +58 -0
- package/src/keypair.ts +102 -0
- package/src/layout.ts +188 -0
- package/src/loader.ts +267 -0
- 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/legacy.ts +323 -0
- package/src/message/v0.ts +513 -0
- package/src/message/versioned.ts +36 -0
- package/src/nonce-account.ts +82 -0
- package/src/programs/address-lookup-table/index.ts +438 -0
- package/src/programs/address-lookup-table/state.ts +84 -0
- package/src/programs/compute-budget.ts +281 -0
- package/src/programs/ed25519.ts +157 -0
- package/src/programs/index.ts +7 -0
- package/src/programs/secp256k1.ts +228 -0
- package/src/programs/stake.ts +952 -0
- package/src/programs/system.ts +1048 -0
- package/src/programs/vote.ts +586 -0
- package/src/publickey.ts +259 -0
- package/src/rpc-websocket.ts +75 -0
- package/src/sysvar.ts +37 -0
- package/src/timing.ts +23 -0
- 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/legacy.ts +970 -0
- package/src/transaction/message.ts +140 -0
- package/src/transaction/versioned.ts +127 -0
- package/src/utils/assert.ts +8 -0
- package/src/utils/bigint.ts +24 -0
- package/src/utils/borsh-schema.ts +38 -0
- package/src/utils/cluster.ts +35 -0
- package/src/utils/ed25519.ts +43 -0
- package/src/utils/guarded-array-utils.ts +34 -0
- package/src/utils/index.ts +5 -0
- package/src/utils/makeWebsocketUrl.ts +26 -0
- package/src/utils/promise-timeout.ts +14 -0
- package/src/utils/secp256k1.ts +11 -0
- package/src/utils/send-and-confirm-raw-transaction.ts +110 -0
- package/src/utils/send-and-confirm-transaction.ts +106 -0
- package/src/utils/shortvec-encoding.ts +28 -0
- package/src/utils/sleep.ts +4 -0
- package/src/utils/to-buffer.ts +11 -0
- package/src/validator-info.ts +108 -0
- package/src/vote-account.ts +236 -0
package/README.md
CHANGED
|
@@ -1,29 +1,43 @@
|
|
|
1
1
|
# solana-web3-community
|
|
2
2
|
|
|
3
|
-
Community-maintained Solana JavaScript API
|
|
3
|
+
Community-maintained Solana JavaScript API — stable, fast, backward compatible.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
|
-
|
|
7
6
|
```bash
|
|
8
7
|
npm install --save solana-web3-community
|
|
9
8
|
```
|
|
10
9
|
|
|
11
10
|
## Quick Start
|
|
12
|
-
|
|
13
11
|
```javascript
|
|
14
|
-
import { Connection, PublicKey } from 'solana-web3-community';
|
|
15
|
-
const conn = new Connection('
|
|
16
|
-
const
|
|
17
|
-
console.log(bal / 1e9, 'SOL');
|
|
12
|
+
import { Connection, PublicKey, Keypair, clusterApiUrl } from 'solana-web3-community';
|
|
13
|
+
const conn = new Connection(clusterApiUrl('mainnet-beta'));
|
|
14
|
+
const balance = await conn.getBalance(new PublicKey('YourKey'));
|
|
18
15
|
```
|
|
19
16
|
|
|
20
17
|
## Features
|
|
21
|
-
- Full Solana JSON RPC API
|
|
22
|
-
- WebSocket subscriptions
|
|
23
|
-
- Keypair management
|
|
24
|
-
- Transaction signing
|
|
25
|
-
- SPL Token support
|
|
26
|
-
- Node.js, browser, React Native
|
|
18
|
+
- **Full Solana JSON RPC API** — getBalance, getAccountInfo, sendTransaction, getBlockHeight
|
|
19
|
+
- **WebSocket subscriptions** — onAccountChange, onLogs, onProgramAccountChange
|
|
20
|
+
- **Keypair management** — generate, import, export
|
|
21
|
+
- **Transaction signing** — create, sign, send
|
|
22
|
+
- **SPL Token support** — transfer, mint, burn
|
|
23
|
+
- **Works everywhere** — Node.js, browser, React Native
|
|
24
|
+
|
|
25
|
+
## Why solana-web3-community?
|
|
26
|
+
- **solana web3 js alternative** — drop-in replacement for @solana/web3.js
|
|
27
|
+
- **solana javascript client** — full API compatibility
|
|
28
|
+
- **solana rpc connection** — built-in retry and rate limit handling
|
|
29
|
+
- **solana dapp development** — same API as official, better stability
|
|
30
|
+
- **solana blockchain javascript** — maintained by the community
|
|
31
|
+
|
|
32
|
+
## Migrate from @solana/web3.js
|
|
33
|
+
```javascript
|
|
34
|
+
// Before
|
|
35
|
+
import { Connection } from '@solana/web3.js';
|
|
36
|
+
// After
|
|
37
|
+
import { Connection } from 'solana-web3-community';
|
|
38
|
+
```
|
|
27
39
|
|
|
28
|
-
##
|
|
29
|
-
|
|
40
|
+
## Python Version
|
|
41
|
+
```bash
|
|
42
|
+
pip install solana-web3
|
|
43
|
+
```
|