-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathllms.txt
More file actions
10058 lines (7529 loc) · 220 KB
/
llms.txt
File metadata and controls
10058 lines (7529 loc) · 220 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# Solana MCP Server - LLM Documentation
## Overview
The Solana MCP Server provides access to Solana blockchain data through the Model Context Protocol (MCP). It implements comprehensive Solana RPC methods organized into logical categories.
There are no emojis in this file, so no changes are needed.
## Currently Implemented RPC Methods (90 total)
### Account Methods (11)
- `getAccountInfo` - Returns all information associated with an account
- `getBalance` - Returns the balance of an account
- `getProgramAccounts` - Returns all accounts owned by a program
- `getMultipleAccounts` - Returns account information for multiple accounts
- `getLargestAccounts` - Returns the 20 largest accounts by lamport balance
- `getMinimumBalanceForRentExemption` - Returns minimum balance for rent exemption
- ✓ `getAccountInfoAndContext` - Returns account information with context (slot info)
- ✓ `getBalanceAndContext` - Returns account balance with context (slot info)
- ✓ `getMultipleAccountsAndContext` - Returns multiple account information with context (slot info)
- ✓ `getProgramAccountsAndContext` - Returns program accounts with context (slot info)
- ✓ `getAccountOwner` - Returns the owner of an account
### Block Methods (14)
- `getSlot` - Returns the current slot the node is processing
- `getBlock` - Returns identity and transaction information about a confirmed block
- `getBlockHeight` - Returns current block height
- `getBlocks` - Returns a list of confirmed blocks between two slots
- `getFirstAvailableBlock` - Returns the lowest confirmed block still available
- `getGenesisHash` - Returns the genesis hash of the ledger
- `getSlotLeaders` - Returns slot leaders for a given slot range
- `getBlockProduction` - Returns recent block production information
- `getVoteAccounts` - Returns account info and stake for all voting accounts
- `getLeaderSchedule` - Returns the leader schedule for an epoch
- `getBlocksWithLimit` - Returns a list of confirmed blocks starting at given slot
- `getConfirmedBlock` - DEPRECATED version of getBlock
- `getConfirmedBlocks` - DEPRECATED version of getBlocks
- `getConfirmedBlocksWithLimit` - DEPRECATED version of getBlocksWithLimit
### System Methods (25)
- `getHealth` - Returns the current health of the node
- `getVersion` - Returns the current Solana version
- `getIdentity` - Returns identity pubkey for the current node
- `getEpochInfo` - Returns information about the current epoch
- `getLatestBlockhash` - Returns the latest blockhash
- `getSupply` - Returns information about current supply
- `getClusterNodes` - Returns information about all cluster nodes
- `getEpochSchedule` - Returns epoch schedule information
- `getInflationGovernor` - Returns current inflation governor
- `getInflationRate` - Returns specific inflation values for current epoch
- `getInflationReward` - Returns inflation reward for list of addresses
- `getTransactionCount` - Returns current transaction count from ledger
- `requestAirdrop` - Request an airdrop of lamports to a Pubkey
- `getStakeMinimumDelegation` - Returns stake minimum delegation
- `isBlockhashValid` - Check if a blockhash is still valid
- `getSlotLeader` - Get the current slot leader
- `minimumLedgerSlot` - Get the minimum ledger slot available
- `getMaxRetransmitSlot` - Get the max slot seen from retransmit stage
- `getMaxShredInsertSlot` - Get the max slot seen from shred insert
- `getHighestSnapshotSlot` - Get highest snapshot slot
- ✓ `getRecentPerformanceSamples` - Get recent performance samples from the cluster
- ✓ `getRecentPrioritizationFees` - Get recent prioritization fees for transactions
- ✓ `getBlockCommitment` - Get block commitment information for a specific slot
- ✓ `getSnapshotSlot` - Get the current snapshot slot
- ✓ `getStakeActivation` - Get stake activation information for a stake account
### System Methods (Deprecated) (2)
- `getRecentBlockhash` - DEPRECATED version of getLatestBlockhash
- `getFees` - DEPRECATED method for getting fees
### Transaction Methods (10)
- `getTransaction` - Returns transaction details
- `getSignaturesForAddress` - Returns signatures for address's transactions
- `sendTransaction` - Send a transaction
- `simulateTransaction` - Simulate sending a transaction
- `getBlockTime` - Returns estimated production time of a block
- `getFeeForMessage` - Get the fee for a message
- `getTransactionWithConfig` - Returns transaction details with additional configuration
- `getConfirmedTransaction` - DEPRECATED version of getTransaction
- `getConfirmedSignaturesForAddress2` - DEPRECATED version of getSignaturesForAddress
- ✓ `getSignatureStatuses` - Get signature confirmation statuses for transaction signatures
### Token Methods (6)
- `getTokenAccountsByOwner` - Returns all token accounts by token owner
- `getTokenSupply` - Returns total supply of an SPL Token type
- `getTokenAccountBalance` - Returns token balance of an SPL Token account
- `getTokenAccountsByDelegate` - Returns all token accounts by approved delegate
- `getTokenLargestAccounts` - Returns 20 largest accounts of a token type
- ✓ `getTokenAccountsByMint` - Returns all token accounts by token mint
### Network Management Methods (4)
- `listSvmNetworks` - List all available SVM networks from awesome-svm repository
- `enableSvmNetwork` - Enable an SVM network for use in RPC requests
- `disableSvmNetwork` - Disable an SVM network
- `setNetworkRpcUrl` - Override RPC URL for a specific network
### WebSocket Subscription Methods (18)
- ✓ `accountSubscribe` - Subscribe to account changes
- ✓ `accountUnsubscribe` - Unsubscribe from account changes
- ✓ `blockSubscribe` - Subscribe to block changes
- ✓ `blockUnsubscribe` - Unsubscribe from block changes
- ✓ `logsSubscribe` - Subscribe to transaction logs
- ✓ `logsUnsubscribe` - Unsubscribe from transaction logs
- ✓ `programSubscribe` - Subscribe to program account changes
- ✓ `programUnsubscribe` - Unsubscribe from program account changes
- ✓ `rootSubscribe` - Subscribe to root changes
- ✓ `rootUnsubscribe` - Unsubscribe from root changes
- ✓ `signatureSubscribe` - Subscribe to transaction signature confirmations
- ✓ `signatureUnsubscribe` - Unsubscribe from signature confirmations
- ✓ `slotSubscribe` - Subscribe to slot changes
- ✓ `slotUnsubscribe` - Unsubscribe from slot changes
- ✓ `slotsUpdatesSubscribe` - Subscribe to slot update notifications
- ✓ `slotsUpdatesUnsubscribe` - Unsubscribe from slot updates
- ✓ `voteSubscribe` - Subscribe to vote notifications
- ✓ `voteUnsubscribe` - Unsubscribe from vote notifications
### MCP Protocol Methods (2)
- `initialize` - Initialize MCP session
- `tools/call` - Execute tool calls via MCP
## Missing RPC Methods from Standard Solana API
**ALL METHODS NOW IMPLEMENTED - 100% COVERAGE ACHIEVED!**
### Previously Missing Methods (NOW IMPLEMENTED) ✓
#### Critical Missing Methods (COMPLETED) ✓
1. ✓ `isBlockhashValid` - Check if a blockhash is still valid (IMPLEMENTED)
2. ✓ `getSlotLeader` - Get the current slot leader (IMPLEMENTED)
3. ✓ `getMaxRetransmitSlot` - Get the max slot seen from retransmit stage (IMPLEMENTED)
4. ✓ `getMaxShredInsertSlot` - Get the max slot seen from shred insert (IMPLEMENTED)
5. ✓ `minimumLedgerSlot` - Get the lowest slot that contains a block (IMPLEMENTED)
6. ✓ `getBlockCommitment` - Get block commitment info (IMPLEMENTED via manual RPC)
7. ✓ `getHighestSnapshotSlot` - Get the highest slot with a snapshot (IMPLEMENTED)
#### Context Methods (COMPLETED) ✓
8. ✓ `getAccountInfoAndContext` - Get account info with context (IMPLEMENTED)
9. ✓ `getBalanceAndContext` - Get balance with context (IMPLEMENTED)
10. ✓ `getMultipleAccountsAndContext` - Get multiple accounts with context (IMPLEMENTED)
11. ✓ `getProgramAccountsAndContext` - Get program accounts with context (IMPLEMENTED)
#### Performance/Monitoring Methods (COMPLETED) ✓
12. ✓ `getRecentPerformanceSamples` - Get recent performance samples (IMPLEMENTED)
13. ✓ `getRecentPrioritizationFees` - Get recent prioritization fees (IMPLEMENTED)
14. ✓ `getSignatureStatuses` - Get signature confirmation statuses (IMPLEMENTED)
15. ✓ `getSnapshotSlot` - Get current snapshot slot (IMPLEMENTED via manual RPC)
#### Stake Activation Method (COMPLETED) ✓
16. ✓ `getStakeActivation` - Get stake activation info (IMPLEMENTED via manual RPC)
#### Deprecated but Still Used Methods (COMPLETED) ✓
17. ✓ `getConfirmedBlock` - Deprecated version of getBlock (IMPLEMENTED)
18. ✓ `getConfirmedTransaction` - Deprecated version of getTransaction (IMPLEMENTED)
19. ✓ `getRecentBlockhash` - Deprecated version of getLatestBlockhash (IMPLEMENTED)
20. ✓ `getFees` - Deprecated method for getting fees (IMPLEMENTED)
21. ✓ `getConfirmedBlocks` - Deprecated version of getBlocks (IMPLEMENTED)
22. ✓ `getConfirmedBlocksWithLimit` - Deprecated version of getBlocksWithLimit (IMPLEMENTED)
23. ✓ `getConfirmedSignaturesForAddress2` - Deprecated version of getSignaturesForAddress (IMPLEMENTED)
### WebSocket Subscription Methods (NOW IMPLEMENTED) ✓
24. ✓ `accountSubscribe` - Subscribe to account changes (IMPLEMENTED)
25. ✓ `accountUnsubscribe` - Unsubscribe from account changes (IMPLEMENTED)
26. ✓ `blockSubscribe` - Subscribe to block changes (IMPLEMENTED)
27. ✓ `blockUnsubscribe` - Unsubscribe from block changes (IMPLEMENTED)
28. ✓ `logsSubscribe` - Subscribe to transaction logs (IMPLEMENTED)
29. ✓ `logsUnsubscribe` - Unsubscribe from logs (IMPLEMENTED)
30. ✓ `programSubscribe` - Subscribe to program account changes (IMPLEMENTED)
31. ✓ `programUnsubscribe` - Unsubscribe from program changes (IMPLEMENTED)
32. ✓ `rootSubscribe` - Subscribe to root changes (IMPLEMENTED)
33. ✓ `rootUnsubscribe` - Unsubscribe from root changes (IMPLEMENTED)
34. ✓ `signatureSubscribe` - Subscribe to transaction signature (IMPLEMENTED)
35. ✓ `signatureUnsubscribe` - Unsubscribe from signature (IMPLEMENTED)
36. ✓ `slotSubscribe` - Subscribe to slot changes (IMPLEMENTED)
37. ✓ `slotUnsubscribe` - Unsubscribe from slot changes (IMPLEMENTED)
38. ✓ `slotsUpdatesSubscribe` - Subscribe to slot updates (IMPLEMENTED)
39. ✓ `slotsUpdatesUnsubscribe` - Unsubscribe from slot updates (IMPLEMENTED)
40. ✓ `voteSubscribe` - Subscribe to vote changes (IMPLEMENTED)
41. ✓ `voteUnsubscribe` - Unsubscribe from vote changes (IMPLEMENTED)
## ✓ COMPREHENSIVE COVERAGE ACHIEVED ✓
**The Solana MCP Server now implements ALL 90 possible Solana RPC methods and subscriptions!**
### Methods NOT implementable (and why):
- **0 methods** - Everything has been implemented!
### Full Implementation Status:
- ✓ **Account Methods**: 11/11 implemented (100%)
- ✓ **Block Methods**: 14/14 implemented (100%)
- ✓ **System Methods**: 25/25 implemented (100%)
- ✓ **Transaction Methods**: 10/10 implemented (100%)
- ✓ **Token Methods**: 6/6 implemented (100%)
- ✓ **Network Management**: 4/4 implemented (100%)
- ✓ **WebSocket Subscriptions**: 18/18 implemented (100%)
- ✓ **MCP Protocol**: 2/2 implemented (100%)
**Total: 90/90 methods = 100% coverage**
## Server Modes
The server now supports three modes:
1. **Stdio Mode** (default): `solana-mcp-server stdio`
2. **HTTP Web Service**: `solana-mcp-server web --port 3000`
3. **WebSocket Server**: `solana-mcp-server websocket --port 8900`
### WebSocket Usage
Connect to `ws://localhost:8900` and send JSON-RPC 2.0 messages:
```javascript
// Subscribe to account changes
{
"jsonrpc": "2.0",
"id": 1,
"method": "accountSubscribe",
"params": ["11111111111111111111111111111111"]
}
// Subscribe to transaction logs
{
"jsonrpc": "2.0",
"id": 2,
"method": "logsSubscribe",
"params": ["all"]
}
// Unsubscribe
{
"jsonrpc": "2.0",
"id": 3,
"method": "accountUnsubscribe",
"params": [subscription_id]
}
```
### Missing Methods Implementation
The 3 previously missing methods are now implemented using manual RPC calls:
- **`getBlockCommitment`**: Returns block commitment information
- **`getSnapshotSlot`**: Returns current snapshot slot
- **`getStakeActivation`**: Returns stake activation state
## Recommendations for Implementation Priority
### High Priority (COMPLETED) ✓
1. ✓ `isBlockhashValid` - Important for transaction validation (IMPLEMENTED)
2. ✓ `getSlotLeader` - Useful for network analysis (IMPLEMENTED)
3. ✓ All deprecated methods - For backward compatibility (7 IMPLEMENTED)
### Medium Priority (MOSTLY COMPLETED) ✓
4. ✓ `minimumLedgerSlot` - Useful for historical data queries (IMPLEMENTED)
5. ✓ `getMaxRetransmitSlot` - Network health monitoring (IMPLEMENTED)
6. ✓ `getMaxShredInsertSlot` - Network health monitoring (IMPLEMENTED)
### Low Priority (Only implement if needed)
7. Context methods - Only if context data is specifically needed by users
8. Subscription methods - Only if WebSocket support is added (would require major architecture changes)
9. `getStakeActivation` - Method doesn't exist in Solana client library
## Architecture Notes
The server supports both single-network and multi-network modes:
- Single-network: Queries one RPC endpoint
- Multi-network: Queries multiple SVM-compatible networks simultaneously
Each method includes comprehensive error handling, logging, and Prometheus metrics integration.
---
title: accountSubscribe
hideTableOfContents: true
h1: accountSubscribe RPC Method
---
Subscribe to an account to receive notifications when the lamports or data for a
given account public key changes
<APIMethod>
```jsonc !!request
{
"jsonrpc": "2.0",
"id": 1,
"method": "accountSubscribe",
"params": [
// !hover 0
"CM78CPUeXjn8o3yroDHxUtKsZZgoy4GPkPPXfouKNH12",
// !hover(1:4) 1
{
// !hover encoding
"encoding": "jsonParsed",
// !hover commitment
"commitment": "finalized"
}
]
}
```
### !params
#### !! 0
!type string
!required
Account Pubkey, as base-58 encoded string
#### !! 1
!type object
Configuration object containing the following fields:
##### !! commitment
!type string
The commitment describes how finalized a block is at that point in time. See
[Configuring State Commitment](/docs/rpc#configuring-state-commitment).
##### !! encoding
!type string
!values base58 base64 base64+zstd jsonParsed
Encoding format for Account data
- `base58` is slow.
- `jsonParsed` encoding attempts to use program-specific state parsers to return
more human-readable and explicit account state data
- If `jsonParsed` is requested but a parser cannot be found, the field falls
back to binary encoding, detectable when the `data` field is type `string`.
### !!result
```jsonc !response
{
"jsonrpc": "2.0",
// !hover result
"result": 23784,
"id": 1
}
```
!type number
Subscription id (needed to unsubscribe)
</APIMethod>
#### Notification Format:
The notification format is the same as seen in the
[getAccountInfo](/docs/rpc/http/getaccountinfo) RPC HTTP method.
Base58 encoding:
```json
{
"jsonrpc": "2.0",
"method": "accountNotification",
"params": {
"result": {
"context": {
"slot": 5199307
},
"value": {
"data": [
"11116bv5nS2h3y12kD1yUKeMZvGcKLSjQgX6BeV7u1FrjeJcKfsHPXHRDEHrBesJhZyqnnq9qJeUuF7WHxiuLuL5twc38w2TXNLxnDbjmuR",
"base58"
],
"executable": false,
"lamports": 33594,
"owner": "11111111111111111111111111111111",
"rentEpoch": 635,
"space": 80
}
},
"subscription": 23784
}
}
```
Parsed-JSON encoding:
```json
{
"jsonrpc": "2.0",
"method": "accountNotification",
"params": {
"result": {
"context": {
"slot": 5199307
},
"value": {
"data": {
"program": "nonce",
"parsed": {
"type": "initialized",
"info": {
"authority": "Bbqg1M4YVVfbhEzwA9SpC9FhsaG83YMTYoR4a8oTDLX",
"blockhash": "LUaQTmM7WbMRiATdMMHaRGakPtCkc2GHtH57STKXs6k",
"feeCalculator": {
"lamportsPerSignature": 5000
}
}
}
},
"executable": false,
"lamports": 33594,
"owner": "11111111111111111111111111111111",
"rentEpoch": 635,
"space": 80
}
},
"subscription": 23784
}
}
```
---
title: accountUnsubscribe
hideTableOfContents: true
h1: accountUnsubscribe RPC Method
---
Unsubscribe from account change notifications
<APIMethod>
```jsonc !!request
{
"jsonrpc": "2.0",
"id": 1,
"method": "accountUnsubscribe",
"params": [
// !hover 0
0
]
}
```
### !params
#### !! 0
!type number
!required
id of the account Subscription to cancel
### !!result
```jsonc !response
{
"jsonrpc": "2.0",
// !hover result
"result": true,
"id": 1
}
```
!type boolean
unsubscribe success message
</APIMethod>
---
title: blockSubscribe
hideTableOfContents: true
h1: blockSubscribe RPC Method
---
Subscribe to receive notification anytime a new block is `confirmed` or
`finalized`.
<Callout type="warn" title={"Unstable Method"}>
This subscription is considered **unstable** and is only available if the
validator was started with the `--rpc-pubsub-enable-block-subscription` flag.
The format of this subscription may change in the future.
</Callout>
<APIMethod>
```jsonc !!request
{
"jsonrpc": "2.0",
"id": "1",
"method": "blockSubscribe",
"params": [
// !hover(1:3) 0
{
"mentionsAccountOrProgram": "LieKvPRE8XeX3Y2xVNHjKlpAScD12lYySBVQ4HqoJ5op"
},
// !hover(1:6) 1
{
// !hover commitment
"commitment": "confirmed",
// !hover encoding
"encoding": "base64",
// !hover transactionDetails
"transactionDetails": "full",
// !hover maxSupportedTransactionVersion
"maxSupportedTransactionVersion": 0,
// !hover showRewards
"showRewards": true
}
]
}
```
### !params
#### !! 0
!type string | object
!required
filter criteria for the logs to receive results by account type; currently
supported:
- `all` - include all transactions in block
- A JSON object with the following field:
- `mentionsAccountOrProgram: <string>` - return only transactions that mention
the provided public key (as base-58 encoded string). If no mentions in a
given block, then no notification will be sent.
#### !! 1
!type object
Configuration object containing the following fields:
##### !! commitment
!type string
!values confirmed finalized
!default finalized
The commitment describes how finalized a block is at that point in time. See
[Configuring State Commitment](/docs/rpc#configuring-state-commitment).
- `processed` is not supported.
##### !! encoding
!type string
!values json jsonParsed base58 base64
!default json
encoding format for each returned Transaction
- `jsonParsed` attempts to use program-specific instruction parsers to return
more human-readable and explicit data in the
`transaction.message.instructions` list.
- If `jsonParsed` is requested but a parser cannot be found, the instruction
falls back to regular JSON encoding (`accounts`, `data`, and `programIdIndex`
fields).
##### !! transactionDetails
!type string
!values full accounts signatures none
!default full
level of transaction detail to return
- If `accounts` are requested, transaction details only include signatures and
an annotated list of accounts in each transaction.
- Transaction metadata is limited to only: fee, err, pre_balances,
post_balances, pre_token_balances, and post_token_balances.
##### !! maxSupportedTransactionVersion
!type number
!values 0
!default 0
Currently, the only valid value for this parameter is `0`.
Setting it to `0` allows you to fetch all transactions, including both Versioned and legacy transactions.
This parameter determines the maximum transaction version that will be returned in the response.
If you request a transaction with a higher version than this value, an error will be returned.
If you omit this parameter, only legacy transactions will be returned—any versioned transaction will result in an error.
##### !! showRewards
!type bool
whether to populate the `rewards` array. If parameter not provided, the default
includes rewards.
### !!result
```jsonc !response
{
"jsonrpc": "2.0",
// !hover result
"result": 0,
"id": 1
}
```
!type integer
subscription id (needed to unsubscribe)
</APIMethod>
#### Notification Format:
The notification will be an object with the following fields:
- `slot: <u64>` - The corresponding slot.
- `err: <object|null>` - Error if something went wrong publishing the
notification otherwise null.
- `block: <object|null>` - A block object as seen in the
[getBlock](/docs/rpc/http/getblock) RPC HTTP method.
```json
{
"jsonrpc": "2.0",
"method": "blockNotification",
"params": {
"result": {
"context": {
"slot": 112301554
},
"value": {
"slot": 112301554,
"block": {
"previousBlockhash": "GJp125YAN4ufCSUvZJVdCyWQJ7RPWMmwxoyUQySydZA",
"blockhash": "6ojMHjctdqfB55JDpEpqfHnP96fiaHEcvzEQ2NNcxzHP",
"parentSlot": 112301553,
"transactions": [
{
"transaction": [
"OpltwoUvWxYi1P2U8vbIdE/aPntjYo5Aa0VQ2JJyeJE2g9Vvxk8dDGgFMruYfDu8/IfUWb0REppTe7IpAuuLRgIBAAkWnj4KHRpEWWW7gvO1c0BHy06wZi2g7/DLqpEtkRsThAXIdBbhXCLvltw50ZnjDx2hzw74NVn49kmpYj2VZHQJoeJoYJqaKcvuxCi/2i4yywedcVNDWkM84Iuw+cEn9/ROCrXY4qBFI9dveEERQ1c4kdU46xjxj9Vi+QXkb2Kx45QFVkG4Y7HHsoS6WNUiw2m4ffnMNnOVdF9tJht7oeuEfDMuUEaO7l9JeUxppCvrGk3CP45saO51gkwVYEgKzhpKjCx3rgsYxNR81fY4hnUQXSbbc2Y55FkwgRBpVvQK7/+clR4Gjhd3L4y+OtPl7QF93Akg1LaU9wRMs5nvfDFlggqI9PqJl+IvVWrNRdBbPS8LIIhcwbRTkSbqlJQWxYg3Bo2CTVbw7rt1ZubuHWWp0mD/UJpLXGm2JprWTePNULzHu67sfqaWF99LwmwjTyYEkqkRt1T0Je5VzHgJs0N5jY4iIU9K3lMqvrKOIn/2zEMZ+ol2gdgjshx+sphIyhw65F3J/Dbzk04LLkK+CULmN571Y+hFlXF2ke0BIuUG6AUF+4214Cu7FXnqo3rkxEHDZAk0lRrAJ8X/Z+iwuwI5cgbd9uHXZaGT2cvhRs7reawctIXtX1s3kTqM9YV+/wCpDLAp8axcEkaQkLDKRoWxqp8XLNZSKial7Rk+ELAVVKWoWLRXRZ+OIggu0OzMExvVLE5VHqy71FNHq4gGitkiKYNFWSLIE4qGfdFLZXy/6hwS+wq9ewjikCpd//C9BcCL7Wl0iQdUslxNVCBZHnCoPYih9JXvGefOb9WWnjGy14sG9j70+RSVx6BlkFELWwFvIlWR/tHn3EhHAuL0inS2pwX7ZQTAU6gDVaoqbR2EiJ47cKoPycBNvHLoKxoY9AZaBjPl6q8SKQJSFyFd9n44opAgI6zMTjYF/8Ok4VpXEESp3QaoUyTI9sOJ6oFP6f4dwnvQelgXS+AEfAsHsKXxGAIUDQENAgMEBQAGBwgIDg8IBJCER3QXl1AVDBADCQoOAAQLERITDAjb7ugh3gOuTy==",
"base64"
],
"meta": {
"err": null,
"status": {
"Ok": null
},
"fee": 5000,
"preBalances": [
1758510880, 2067120, 1566000, 1461600, 2039280, 2039280,
1900080, 1865280, 0, 3680844220, 2039280
],
"postBalances": [
1758505880, 2067120, 1566000, 1461600, 2039280, 2039280,
1900080, 1865280, 0, 3680844220, 2039280
],
"innerInstructions": [
{
"index": 0,
"instructions": [
{
"programIdIndex": 13,
"accounts": [1, 15, 3, 4, 2, 14],
"data": "21TeLgZXNbtHXVBzCaiRmH"
},
{
"programIdIndex": 14,
"accounts": [3, 4, 1],
"data": "6qfC8ic7Aq99"
},
{
"programIdIndex": 13,
"accounts": [1, 15, 3, 5, 2, 14],
"data": "21TeLgZXNbsn4QEpaSEr3q"
},
{
"programIdIndex": 14,
"accounts": [3, 5, 1],
"data": "6LC7BYyxhFRh"
}
]
},
{
"index": 1,
"instructions": [
{
"programIdIndex": 14,
"accounts": [4, 3, 0],
"data": "7aUiLHFjSVdZ"
},
{
"programIdIndex": 19,
"accounts": [17, 18, 16, 9, 11, 12, 14],
"data": "8kvZyjATKQWYxaKR1qD53V"
},
{
"programIdIndex": 14,
"accounts": [9, 11, 18],
"data": "6qfC8ic7Aq99"
}
]
}
],
"logMessages": [
"Program QMNeHCGYnLVDn1icRAfQZpjPLBNkfGbSKRB83G5d8KB invoke [1]",
"Program QMWoBmAyJLAsA1Lh9ugMTw2gciTihncciphzdNzdZYV invoke [2]"
],
"preTokenBalances": [
{
"accountIndex": 4,
"mint": "iouQcQBAiEXe6cKLS85zmZxUqaCqBdeHFpqKoSz615u",
"uiTokenAmount": {
"uiAmount": null,
"decimals": 6,
"amount": "0",
"uiAmountString": "0"
},
"owner": "LieKvPRE8XeX3Y2xVNHjKlpAScD12lYySBVQ4HqoJ5op",
"programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
},
{
"accountIndex": 5,
"mint": "iouQcQBAiEXe6cKLS85zmZxUqaCqBdeHFpqKoSz615u",
"uiTokenAmount": {
"uiAmount": 11513.0679,
"decimals": 6,
"amount": "11513067900",
"uiAmountString": "11513.0679"
},
"owner": "rXhAofQCT7NN9TUqigyEAUzV1uLL4boeD8CRkNBSkYk",
"programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
},
{
"accountIndex": 10,
"mint": "Saber2gLauYim4Mvftnrasomsv6NvAuncvMEZwcLpD1",
"uiTokenAmount": {
"uiAmount": null,
"decimals": 6,
"amount": "0",
"uiAmountString": "0"
},
"owner": "CL9wkGFT3SZRRNa9dgaovuRV7jrVVigBUZ6DjcgySsCU",
"programId": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"
},
{
"accountIndex": 11,
"mint": "Saber2gLauYim4Mvftnrasomsv6NvAuncvMEZwcLpD1",
"uiTokenAmount": {
"uiAmount": 15138.514093,
"decimals": 6,
"amount": "15138514093",
"uiAmountString": "15138.514093"
},
"owner": "LieKvPRE8XeX3Y2xVNHjKlpAScD12lYySBVQ4HqoJ5op",
"programId": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"
}
],
"postTokenBalances": [
{
"accountIndex": 4,
"mint": "iouQcQBAiEXe6cKLS85zmZxUqaCqBdeHFpqKoSz615u",
"uiTokenAmount": {
"uiAmount": null,
"decimals": 6,
"amount": "0",
"uiAmountString": "0"
},
"owner": "LieKvPRE8XeX3Y2xVNHjKlpAScD12lYySBVQ4HqoJ5op",
"programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
},
{
"accountIndex": 5,
"mint": "iouQcQBAiEXe6cKLS85zmZxUqaCqBdeHFpqKoSz615u",
"uiTokenAmount": {
"uiAmount": 11513.103028,
"decimals": 6,
"amount": "11513103028",
"uiAmountString": "11513.103028"
},
"owner": "rXhAofQCT7NN9TUqigyEAUzV1uLL4boeD8CRkNBSkYk",
"programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
},
{
"accountIndex": 10,
"mint": "Saber2gLauYim4Mvftnrasomsv6NvAuncvMEZwcLpD1",
"uiTokenAmount": {
"uiAmount": null,
"decimals": 6,
"amount": "0",
"uiAmountString": "0"
},
"owner": "CL9wkGFT3SZRRNa9dgaovuRV7jrVVigBUZ6DjcgySsCU",
"programId": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"
},
{
"accountIndex": 11,
"mint": "Saber2gLauYim4Mvftnrasomsv6NvAuncvMEZwcLpD1",
"uiTokenAmount": {
"uiAmount": 15489.767829,
"decimals": 6,
"amount": "15489767829",
"uiAmountString": "15489.767829"
},
"owner": "BeiHVPRE8XeX3Y2xVNrSsTpAScH94nYySBVQ4HqgN9at",
"programId": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"
}
],
"rewards": []
}
}
],
"blockTime": 1639926816,
"blockHeight": 101210751
},
"err": null
}
},
"subscription": 14
}
}
```
---
title: blockUnsubscribe
hideTableOfContents: true
h1: blockUnsubscribe RPC Method
---
Unsubscribe from block notifications
<APIMethod>
```jsonc !!request
{
"jsonrpc": "2.0",
"id": 1,
"method": "blockUnsubscribe",
"params": [
// !hover 0
0
]
}
```
### !params
#### !! 0
!type integer
!required
subscription id to cancel
### !!result
```jsonc !response
{
"jsonrpc": "2.0",
// !hover result
"result": true,
"id": 1
}
```
!type boolean
unsubscribe success message
</APIMethod>
---
title: Websocket Methods
seoTitle: Solana RPC Websocket Methods
hideTableOfContents: false
h1: Solana RPC Websocket Methods
---
After connecting to the RPC PubSub websocket at `ws://<ADDRESS>/`:
- Submit subscription requests to the websocket using the methods below
- Multiple subscriptions may be active at once
- Many subscriptions take the optional
[`commitment` parameter](/docs/rpc/#configuring-state-commitment),
defining how finalized a change should be to trigger a notification. For
subscriptions, if commitment is unspecified, the default value is `finalized`.
## RPC PubSub WebSocket Endpoint
Default port: `8900`
- ws://localhost:8900
- http://192.168.1.88:8900
---
title: logsSubscribe
hideTableOfContents: true
h1: logsSubscribe RPC Method
---
Subscribe to transaction logging
<APIMethod>
```jsonc !!request
{
"jsonrpc": "2.0",
"id": 1,
"method": "logsSubscribe",
"params": [
// !hover(1:3) 0
{
"mentions": ["11111111111111111111111111111111"]
},
// !hover(1:3) 1
{
// !hover commitment
"commitment": "finalized"
}
]
}
```
### !params
#### !! 0
!type string | object
!required
filter criteria for the logs to receive results by account type. The following
filters types are currently supported:
- `all` - subscribe to all transactions except for simple vote transactions
- `allWithVotes` - subscribe to all transactions, including simple vote
transactions
- An object with the following field:
- `mentions: [ <string> ]` - array containing a single Pubkey (as base-58
encoded string); if present, subscribe to only transactions mentioning this
address
<Callout type="warn" title={true}>
The `mentions` field currently [only supports
one](https://github.com/solana-labs/solana/blob/master/rpc/src/rpc_pubsub.rs#L481)
Pubkey string per method call. Listing additional addresses will result in an
error.
</Callout>
#### !! 1
!type object
Configuration object containing the following fields:
##### !! commitment
!type string
The commitment describes how finalized a block is at that point in time. See
[Configuring State Commitment](/docs/rpc#configuring-state-commitment).
### !!result
```jsonc !response
{
"jsonrpc": "2.0",
// !hover result
"result": 24040,
"id": 1
}
```
!type integer
Subscription id (needed to unsubscribe)
</APIMethod>
#### Notification Format:
The notification will be an RpcResponse JSON object with value equal to:
- `signature: <string>` - The transaction signature base58 encoded.
- `err: <object|null>` - Error if transaction failed, null if transaction
succeeded.
[TransactionError definitions](https://github.com/solana-labs/solana/blob/c0c60386544ec9a9ec7119229f37386d9f070523/sdk/src/transaction/error.rs#L13)
- `logs: <array[string]>` - Array of log messages the transaction instructions
output during execution.
Example:
```json
{
"jsonrpc": "2.0",
"method": "logsNotification",
"params": {
"result": {
"context": {
"slot": 5208469
},
"value": {
"signature": "5h6xBEauJ3PK6SWCZ1PGjBvj8vDdWG3KpwATGy1ARAXFSDwt8GFXM7W5Ncn16wmqokgpiKRLuS83KUxyZyv2sUYv",
"err": null,
"logs": [
"SBF program 83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri success"
]
}
},
"subscription": 24040