-
Notifications
You must be signed in to change notification settings - Fork 911
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove extends RpcApiMethods from RPC APIs
- Loading branch information
1 parent
3df153c
commit 728d517
Showing
68 changed files
with
157 additions
and
186 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
'@solana/rpc-graphql': patch | ||
'@solana/accounts': patch | ||
'@solana/rpc-spec': patch | ||
'@solana/rpc-api': patch | ||
--- | ||
|
||
Clean up SolanaRpcApi: no longer extend RpcApiMethods + remove export |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { SolanaRpcApi, SolanaRpcApiDevnet, SolanaRpcApiMainnet, SolanaRpcApiTestnet } from '..'; | ||
|
||
'getAccountInfo' satisfies keyof SolanaRpcApi; | ||
// @ts-expect-error RPC API does not have this method | ||
'someMadeUpMethod' satisfies keyof SolanaRpcApi; | ||
|
||
// if we extend the RPC API with additional methods, we can access them on keyof | ||
type TestRpcApi = SolanaRpcApi & { | ||
someMadeUpMethod: () => void; | ||
}; | ||
'someMadeUpMethod' satisfies keyof TestRpcApi; | ||
|
||
// request airdrop is available on test networks, but not mainnet | ||
'requestAirdrop' satisfies keyof SolanaRpcApiDevnet; | ||
'requestAirdrop' satisfies keyof SolanaRpcApiTestnet; | ||
'requestAirdrop' satisfies keyof SolanaRpcApi; | ||
// @ts-expect-error requestAirdrop is not available on mainnet | ||
'requestAirdrop' satisfies keyof SolanaRpcApiMainnet; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,14 @@ | ||
import type { RpcApiMethods } from '@solana/rpc-spec'; | ||
import type { LamportsUnsafeBeyond2Pow53Minus1, Slot } from '@solana/rpc-types'; | ||
|
||
type GetBlockCommitmentApiResponse = Readonly<{ | ||
commitment: LamportsUnsafeBeyond2Pow53Minus1[] | null; | ||
totalStake: LamportsUnsafeBeyond2Pow53Minus1; | ||
}>; | ||
|
||
export interface GetBlockCommitmentApi extends RpcApiMethods { | ||
export type GetBlockCommitmentApi = { | ||
/** | ||
* Returns the amount of cluster stake in lamports that has voted on | ||
* a particular block, as well as the stake attributed to each vote account | ||
*/ | ||
getBlockCommitment(slot: Slot): GetBlockCommitmentApiResponse; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,14 @@ | ||
import type { RpcApiMethods } from '@solana/rpc-spec'; | ||
import type { Slot, UnixTimestampUnsafeBeyond2Pow53Minus1 } from '@solana/rpc-types'; | ||
|
||
/** Estimated production time, as Unix timestamp (seconds since the Unix epoch) */ | ||
type GetBlockTimeApiResponse = UnixTimestampUnsafeBeyond2Pow53Minus1; | ||
|
||
export interface GetBlockTimeApi extends RpcApiMethods { | ||
export type GetBlockTimeApi = { | ||
/** | ||
* Returns the estimated production time of a block. | ||
*/ | ||
getBlockTime( | ||
/** block number, identified by Slot */ | ||
blockNumber: Slot, | ||
): GetBlockTimeApiResponse; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.