You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
type RequestParams = typeof inputParameters.validated
15
16
17
+
type PriceResponse = {
18
+
[symbol: string]: {
19
+
price: number
20
+
}
21
+
}
22
+
16
23
<%if (includeComments) { -%>
17
-
//CustomTransport extends base types from endpoint and adds additional, Provider-specific types (if needed).
24
+
//<%= normalizedEndpointNameCap %>Transport extends base types from endpoint and adds additional, Provider-specific types (if needed).
18
25
<% } -%>
19
-
export type CustomTransportTypes = BaseEndpointTypes & {
26
+
export type <%= normalizedEndpointNameCap %>TransportTypes = BaseEndpointTypes & {
20
27
Provider: {
21
28
RequestBody: never
22
29
ResponseBody: any
23
30
}
24
31
}
25
32
<%if (includeComments) { -%>
26
-
//CustomTransport is used to perform custom data fetching and processing from a Provider. The framework provides built-in transports to
27
-
// fetch data from a Provider using several protocols, including `http`, `websocket`, and `sse`. Use CustomTransport when the Provider uses
33
+
//<%= normalizedEndpointNameCap %>Transport is used to perform custom data fetching and processing from a Provider. The framework provides built-in transports to
34
+
// fetch data from a Provider using several protocols, including `http`, `websocket`, and `sse`. Use <%= normalizedEndpointNameCap %>Transport when the Provider uses
28
35
// different protocol, or you need custom functionality that built-in transports don't support. For example, custom, multistep authentication
29
36
// for requests, paginated requests, on-chain data retrieval using third party libraries, and so on.
30
37
<% } -%>
31
-
export class CustomTransport extends SubscriptionTransport<CustomTransportTypes> {
38
+
export class <%= normalizedEndpointNameCap %>Transport extends SubscriptionTransport<<%= normalizedEndpointNameCap %>TransportTypes> {
32
39
<%if (includeComments) { -%>
33
40
// name of the transport, used for logging
34
41
<% } -%>
35
42
name!: string
43
+
<%if (includeComments) { -%>
44
+
// name of the endpoint, used to calculate the request key
45
+
<% } -%>
46
+
endpointName!: string
47
+
<%if (includeComments) { -%>
48
+
// instance of adapter config
49
+
<% } -%>
50
+
config!: BaseEndpointTypes['Settings']
36
51
<%if (includeComments) { -%>
37
52
// cache instance for caching responses from provider
0 commit comments