This repository has been archived by the owner on Jan 22, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 932
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split
RpcResponse
into RpcResponse
and RpcTransportResponse
- Loading branch information
1 parent
0aa60a6
commit f7a09e2
Showing
9 changed files
with
83 additions
and
48 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,6 @@ | ||
--- | ||
'@solana/rpc-transport-http': patch | ||
'@solana/rpc-spec': patch | ||
--- | ||
|
||
Split `RpcResponse` into `RpcResponse` and `RpcTransportResponse` |
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 |
---|---|---|
@@ -1,11 +1,14 @@ | ||
import { RpcResponse } from './rpc-shared'; | ||
export type RpcTransportRequest = { | ||
readonly payload: unknown; | ||
readonly signal?: AbortSignal; | ||
readonly toText?: (payload: unknown) => string; | ||
}; | ||
|
||
type RpcTransportRequest = Readonly<{ | ||
payload: unknown; | ||
signal?: AbortSignal; | ||
toText?: (payload: unknown) => string; | ||
}>; | ||
export type RpcTransportResponse<TResponse = unknown> = { | ||
readonly json: () => Promise<TResponse>; | ||
readonly text: () => Promise<string>; | ||
}; | ||
|
||
export type RpcTransport = { | ||
<TResponse>(request: RpcTransportRequest): Promise<RpcResponse<TResponse>>; | ||
<TResponse>(request: RpcTransportRequest): Promise<RpcTransportResponse<TResponse>>; | ||
}; |
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