Skip to content

Commit fafa634

Browse files
committed
fix types
1 parent 2af8a8b commit fafa634

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

packages/sdk/src/sdk.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as logger from "@onflow/util-logger"
22
// Base
33
export {build} from "./build/build.js"
44
export {resolve} from "./resolve/resolve.js"
5-
export {send} from "./transport"
5+
export {send, subscribe, rawSubscribe} from "./transport"
66
export {decode} from "./decode/sdk-decode.js"
77
export {
88
encodeTransactionPayload,
@@ -113,5 +113,3 @@ import * as TestUtils from "./test-utils"
113113
export {TestUtils}
114114

115115
export {VERSION} from "./VERSION"
116-
117-
export {subscribe, rawSubscribe} from "./transport"

packages/transport-http/src/subscribe/subscription-manager.ts

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ type DeepRequired<T> = Required<{
2222

2323
type InferHandler<T> = T extends SubscriptionHandler<infer H> ? H : never
2424

25-
interface SubscriptionInfo<T extends DataSubscriber<any, any, any>> {
25+
interface SubscriptionInfo {
2626
// Internal ID for the subscription
2727
id: number
2828
// Remote ID assigned by the server used for message routing and unsubscribing
@@ -63,7 +63,7 @@ export interface SubscriptionManagerConfig {
6363
export class SubscriptionManager<Handlers extends SubscriptionHandler<any>[]> {
6464
private counter = 0
6565
private socket: WebSocket | null = null
66-
private subscriptions: SubscriptionInfo<DataSubscriber<any, any, any>>[] = []
66+
private subscriptions: SubscriptionInfo[] = []
6767
private config: DeepRequired<SubscriptionManagerConfig>
6868
private reconnectAttempts = 0
6969
private handlers: Record<string, SubscriptionHandler<any>>
@@ -203,7 +203,7 @@ export class SubscriptionManager<Handlers extends SubscriptionHandler<any>[]> {
203203
)
204204

205205
// Track the subscription locally
206-
const sub: SubscriptionInfo<DataSubscriber<any, any, any>> = {
206+
const sub: SubscriptionInfo = {
207207
id: this.counter++,
208208
topic: opts.topic,
209209
subscriber: subscriber,
@@ -248,9 +248,7 @@ export class SubscriptionManager<Handlers extends SubscriptionHandler<any>[]> {
248248
}
249249
}
250250

251-
private async sendSubscribe(
252-
sub: SubscriptionInfo<DataSubscriber<any, any, any>>
253-
) {
251+
private async sendSubscribe(sub: SubscriptionInfo) {
254252
// Send the subscription message
255253
const request: SubscribeMessageRequest = {
256254
action: Action.SUBSCRIBE,
@@ -270,9 +268,7 @@ export class SubscriptionManager<Handlers extends SubscriptionHandler<any>[]> {
270268
return response
271269
}
272270

273-
private async sendUnsubscribe(
274-
sub: SubscriptionInfo<DataSubscriber<any, any, any>>
275-
) {
271+
private async sendUnsubscribe(sub: SubscriptionInfo) {
276272
// Send the unsubscribe message if the subscription has a remote id
277273
const {remoteId} = sub
278274
if (remoteId) {

0 commit comments

Comments
 (0)