File tree Expand file tree Collapse file tree 4 files changed +48
-0
lines changed
packages/rpc-core/src/types Expand file tree Collapse file tree 4 files changed +48
-0
lines changed Original file line number Diff line number Diff line change 1+ import { GetBlockHeightApi } from './rpc-methods/getBlockHeight' ;
2+ import { GetBlocksApi } from './rpc-methods/getBlocks' ;
3+
4+ declare interface JsonRpcApi extends GetBlockHeightApi , GetBlocksApi { }
Original file line number Diff line number Diff line change 1+ // TODO: Eventually move this into whatever package implements transactions
2+ declare type Finality = 'confirmed' | 'finalized' | 'processed' ;
3+
4+ declare type Slot =
5+ // TODO(solana-labs/solana/issues/30341) Represent as bigint
6+ number ;
Original file line number Diff line number Diff line change 1+ import { IJsonRpcTransport } from '@solana/rpc-transport' ;
2+
3+ type GetBlockHeightApiResponse =
4+ // TODO(solana-labs/solana/issues/30341) Represent as bigint
5+ number ;
6+
7+ declare interface GetBlockHeightApi {
8+ /**
9+ * Returns the current block height of the node
10+ */
11+ getBlockHeight (
12+ transport : IJsonRpcTransport ,
13+ config ?: readonly {
14+ // Defaults to `finalized`
15+ commitment ?: Finality ;
16+ // The minimum slot that the request can be evaluated at
17+ minContextSlot ?: Slot ;
18+ }
19+ ) : Promise < GetBlockHeightApiResponse > ;
20+ }
Original file line number Diff line number Diff line change 1+ import { IJsonRpcTransport } from '@solana/rpc-transport' ;
2+
3+ type GetBlocksApiResponse = Slot [ ] ;
4+
5+ declare interface GetBlocksApi {
6+ /**
7+ * Returns a list of confirmed blocks between two slots
8+ */
9+ getBlocks (
10+ transport : IJsonRpcTransport ,
11+ startSlot : Slot ,
12+ endSlotInclusive ?: Slot ,
13+ config ?: readonly {
14+ // Defaults to `finalized`
15+ commitment ?: Exclude < Finality , 'processed' > ;
16+ }
17+ ) : Promise < GetBlocksApiResponse > ;
18+ }
You can’t perform that action at this time.
0 commit comments