File tree Expand file tree Collapse file tree 2 files changed +4
-14
lines changed Expand file tree Collapse file tree 2 files changed +4
-14
lines changed Original file line number Diff line number Diff line change 1
- import type { createSolanaRpcApi , Rpc , RpcPlan } from "@solana/kit" ;
1
+ import type { Rpc , SolanaRpcApi } from "@solana/kit" ;
2
2
import { AutoSent } from "./wrapAutoSend" ;
3
3
4
- // To resolve TS async type issues
5
- type UnwrapRpcPlan < T > = T extends RpcPlan < infer U > ? U : T ;
6
-
7
- type UnwrappedRpc < T > = {
8
- [ K in keyof T ] : T [ K ] extends ( ...args : infer A ) => Promise < infer P >
9
- ? ( ...args : A ) => Promise < UnwrapRpcPlan < P > >
10
- : T [ K ] ;
11
- } ;
12
-
13
- export type ResolvedHeliusRpcApi = UnwrappedRpc <
14
- AutoSent < Rpc < ReturnType < typeof createSolanaRpcApi > > >
15
- > ;
4
+ // Concrete type: Matches createSolanaRpcApi(DEFAULT_RPC_CONFIG) → Rpc → AutoSent (unwrapped Promises)
5
+ export type ResolvedHeliusRpcApi = AutoSent < Rpc < SolanaRpcApi > > ;
Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ export const createHelius = ({
105
105
const transport = createDefaultRpcTransport ( { url } ) ;
106
106
107
107
const baseRpc = createRpc ( { api : solanaApi , transport } ) ;
108
- const raw = wrapAutoSend ( baseRpc ) as unknown as ResolvedHeliusRpcApi ;
108
+ const raw : ResolvedHeliusRpcApi = wrapAutoSend ( baseRpc ) ;
109
109
110
110
const wsUrl = new URL ( url ) ;
111
111
wsUrl . protocol = "wss:" ;
You can’t perform that action at this time.
0 commit comments