@silvana-one/orderbook 1.1.9 → 1.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/node/index.cjs +88 -0
- package/dist/node/index.d.ts +1 -0
- package/dist/node/index.js +1 -0
- package/dist/node/index.js.map +1 -1
- package/dist/node/news.d.ts +48 -0
- package/dist/node/news.js +63 -0
- package/dist/node/news.js.map +1 -0
- package/dist/node/proto/silvana/news/v1/news_pb.d.ts +245 -0
- package/dist/node/proto/silvana/news/v1/news_pb.js +44 -0
- package/dist/node/proto/silvana/news/v1/news_pb.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/tsconfig.web.tsbuildinfo +1 -1
- package/dist/web/index.d.ts +1 -0
- package/dist/web/index.js +1 -0
- package/dist/web/index.js.map +1 -1
- package/dist/web/news.d.ts +48 -0
- package/dist/web/news.js +63 -0
- package/dist/web/news.js.map +1 -0
- package/dist/web/proto/silvana/news/v1/news_pb.d.ts +245 -0
- package/dist/web/proto/silvana/news/v1/news_pb.js +44 -0
- package/dist/web/proto/silvana/news/v1/news_pb.js.map +1 -0
- package/package.json +3 -2
- package/src/index.ts +1 -0
- package/src/news.ts +105 -0
- package/src/proto/silvana/news/v1/news_pb.ts +295 -0
package/dist/node/index.cjs
CHANGED
|
@@ -36,6 +36,8 @@ __export(index_exports, {
|
|
|
36
36
|
GetMarketDataResponseSchema: () => GetMarketDataResponseSchema,
|
|
37
37
|
GetMarketsRequestSchema: () => GetMarketsRequestSchema,
|
|
38
38
|
GetMarketsResponseSchema: () => GetMarketsResponseSchema,
|
|
39
|
+
GetNewsRequestSchema: () => GetNewsRequestSchema,
|
|
40
|
+
GetNewsResponseSchema: () => GetNewsResponseSchema,
|
|
39
41
|
GetOrderBookRequestSchema: () => GetOrderBookRequestSchema,
|
|
40
42
|
GetOrderBookResponseSchema: () => GetOrderBookResponseSchema,
|
|
41
43
|
GetOrderHistoryRequestSchema: () => GetOrderHistoryRequestSchema,
|
|
@@ -61,6 +63,10 @@ __export(index_exports, {
|
|
|
61
63
|
MarketSchema: () => MarketSchema,
|
|
62
64
|
MarketType: () => MarketType,
|
|
63
65
|
MarketTypeSchema: () => MarketTypeSchema,
|
|
66
|
+
NewsArticleSchema: () => NewsArticleSchema,
|
|
67
|
+
NewsClient: () => NewsClient,
|
|
68
|
+
NewsError: () => NewsError,
|
|
69
|
+
NewsService: () => NewsService,
|
|
64
70
|
OrderBookLevelSchema: () => OrderBookLevelSchema,
|
|
65
71
|
OrderBookUpdateSchema: () => OrderBookUpdateSchema,
|
|
66
72
|
OrderMatchSchema: () => OrderMatchSchema,
|
|
@@ -97,6 +103,8 @@ __export(index_exports, {
|
|
|
97
103
|
SettlementUpdateSchema: () => SettlementUpdateSchema,
|
|
98
104
|
SettlementUpdate_EventType: () => SettlementUpdate_EventType,
|
|
99
105
|
SettlementUpdate_EventTypeSchema: () => SettlementUpdate_EventTypeSchema,
|
|
106
|
+
SourceSchema: () => SourceSchema,
|
|
107
|
+
StreamNewsRequestSchema: () => StreamNewsRequestSchema,
|
|
100
108
|
StreamPricesRequestSchema: () => StreamPricesRequestSchema,
|
|
101
109
|
SubmitOrderRequestSchema: () => SubmitOrderRequestSchema,
|
|
102
110
|
SubmitOrderResponseSchema: () => SubmitOrderResponseSchema,
|
|
@@ -105,9 +113,11 @@ __export(index_exports, {
|
|
|
105
113
|
SubscribeSettlementsRequestSchema: () => SubscribeSettlementsRequestSchema,
|
|
106
114
|
TimeInForce: () => TimeInForce,
|
|
107
115
|
TimeInForceSchema: () => TimeInForceSchema,
|
|
116
|
+
TokenNewsSchema: () => TokenNewsSchema,
|
|
108
117
|
TradeUpdateSchema: () => TradeUpdateSchema,
|
|
109
118
|
UpdateMarketPriceFeedsRequestSchema: () => UpdateMarketPriceFeedsRequestSchema,
|
|
110
119
|
UpdateMarketPriceFeedsResponseSchema: () => UpdateMarketPriceFeedsResponseSchema,
|
|
120
|
+
file_proto_silvana_news_v1_news: () => file_proto_silvana_news_v1_news,
|
|
111
121
|
file_proto_silvana_orderbook_v1_orderbook: () => file_proto_silvana_orderbook_v1_orderbook,
|
|
112
122
|
file_proto_silvana_pricing_v1_pricing: () => file_proto_silvana_pricing_v1_pricing
|
|
113
123
|
});
|
|
@@ -630,6 +640,74 @@ var PricingClient = class {
|
|
|
630
640
|
}, "getPivotPoints");
|
|
631
641
|
}
|
|
632
642
|
};
|
|
643
|
+
|
|
644
|
+
// dist/node/news.js
|
|
645
|
+
var import_connect_node3 = require("@connectrpc/connect-node");
|
|
646
|
+
var import_connect3 = require("@connectrpc/connect");
|
|
647
|
+
var import_protobuf3 = require("@bufbuild/protobuf");
|
|
648
|
+
|
|
649
|
+
// dist/node/proto/silvana/news/v1/news_pb.js
|
|
650
|
+
var import_codegenv23 = require("@bufbuild/protobuf/codegenv2");
|
|
651
|
+
var import_wkt5 = require("@bufbuild/protobuf/wkt");
|
|
652
|
+
var file_proto_silvana_news_v1_news = /* @__PURE__ */ (0, import_codegenv23.fileDesc)("CiBwcm90by9zaWx2YW5hL25ld3MvdjEvbmV3cy5wcm90bxIPc2lsdmFuYS5uZXdzLnYxIi4KBlNvdXJjZRIPCgJpZBgBIAEoCUgAiAEBEgwKBG5hbWUYAiABKAlCBQoDX2lkIq8CCgtOZXdzQXJ0aWNsZRInCgZzb3VyY2UYASABKAsyFy5zaWx2YW5hLm5ld3MudjEuU291cmNlEhMKBmF1dGhvchgCIAEoCUgAiAEBEg0KBXRpdGxlGAMgASgJEhgKC2Rlc2NyaXB0aW9uGAQgASgJSAGIAQESCwoDdXJsGAUgASgJEhkKDHVybF90b19pbWFnZRgGIAEoCUgCiAEBEjAKDHB1Ymxpc2hlZF9hdBgHIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5UaW1lc3RhbXASFAoHY29udGVudBgIIAEoCUgDiAEBEhEKCXRleHRfc2l6ZRgJIAEoBUIJCgdfYXV0aG9yQg4KDF9kZXNjcmlwdGlvbkIPCg1fdXJsX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YW50b24tYWdlbnQvcHJvdG87bmV3c2IGcHJvdG8z", [import_wkt5.file_google_protobuf_timestamp]);
|
|
653
|
+
var SourceSchema = /* @__PURE__ */ (0, import_codegenv23.messageDesc)(file_proto_silvana_news_v1_news, 0);
|
|
654
|
+
var NewsArticleSchema = /* @__PURE__ */ (0, import_codegenv23.messageDesc)(file_proto_silvana_news_v1_news, 1);
|
|
655
|
+
var GetNewsRequestSchema = /* @__PURE__ */ (0, import_codegenv23.messageDesc)(file_proto_silvana_news_v1_news, 2);
|
|
656
|
+
var GetNewsResponseSchema = /* @__PURE__ */ (0, import_codegenv23.messageDesc)(file_proto_silvana_news_v1_news, 3);
|
|
657
|
+
var TokenNewsSchema = /* @__PURE__ */ (0, import_codegenv23.messageDesc)(file_proto_silvana_news_v1_news, 4);
|
|
658
|
+
var StreamNewsRequestSchema = /* @__PURE__ */ (0, import_codegenv23.messageDesc)(file_proto_silvana_news_v1_news, 5);
|
|
659
|
+
var NewsService = /* @__PURE__ */ (0, import_codegenv23.serviceDesc)(file_proto_silvana_news_v1_news, 0);
|
|
660
|
+
|
|
661
|
+
// dist/node/news.js
|
|
662
|
+
var NewsError = class extends Error {
|
|
663
|
+
constructor(message, code, details) {
|
|
664
|
+
super(message);
|
|
665
|
+
this.code = code;
|
|
666
|
+
this.details = details;
|
|
667
|
+
this.name = "NewsError";
|
|
668
|
+
}
|
|
669
|
+
};
|
|
670
|
+
var NewsClient = class {
|
|
671
|
+
/**
|
|
672
|
+
* Creates a new NewsClient instance
|
|
673
|
+
* @param config Client configuration
|
|
674
|
+
*/
|
|
675
|
+
constructor(config) {
|
|
676
|
+
const transport = (0, import_connect_node3.createGrpcTransport)({
|
|
677
|
+
baseUrl: config.baseUrl
|
|
678
|
+
});
|
|
679
|
+
this.client = (0, import_connect3.createClient)(NewsService, transport);
|
|
680
|
+
}
|
|
681
|
+
/**
|
|
682
|
+
* Wraps async calls with error handling
|
|
683
|
+
*/
|
|
684
|
+
async wrapCall(operation, operationName) {
|
|
685
|
+
try {
|
|
686
|
+
return await operation();
|
|
687
|
+
} catch (error) {
|
|
688
|
+
if (error instanceof import_connect3.ConnectError) {
|
|
689
|
+
throw new NewsError(`${operationName} failed: ${error.message}`, String(error.code), error.metadata);
|
|
690
|
+
}
|
|
691
|
+
throw new NewsError(`${operationName} failed: ${error instanceof Error ? error.message : "Unknown error"}`, "UNKNOWN", error);
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
/**
|
|
695
|
+
* Get news articles for specific cryptocurrencies
|
|
696
|
+
*/
|
|
697
|
+
async getNews(params) {
|
|
698
|
+
return await this.wrapCall(async () => {
|
|
699
|
+
const request = (0, import_protobuf3.create)(GetNewsRequestSchema, params || {});
|
|
700
|
+
return await this.client.getNews(request);
|
|
701
|
+
}, "getNews");
|
|
702
|
+
}
|
|
703
|
+
/**
|
|
704
|
+
* Stream real-time news updates
|
|
705
|
+
*/
|
|
706
|
+
streamNews(params) {
|
|
707
|
+
const request = (0, import_protobuf3.create)(StreamNewsRequestSchema, params || {});
|
|
708
|
+
return this.client.streamNews(request);
|
|
709
|
+
}
|
|
710
|
+
};
|
|
633
711
|
// Annotate the CommonJS export names for ESM import in node:
|
|
634
712
|
0 && (module.exports = {
|
|
635
713
|
CancelOrderRequestSchema,
|
|
@@ -648,6 +726,8 @@ var PricingClient = class {
|
|
|
648
726
|
GetMarketDataResponseSchema,
|
|
649
727
|
GetMarketsRequestSchema,
|
|
650
728
|
GetMarketsResponseSchema,
|
|
729
|
+
GetNewsRequestSchema,
|
|
730
|
+
GetNewsResponseSchema,
|
|
651
731
|
GetOrderBookRequestSchema,
|
|
652
732
|
GetOrderBookResponseSchema,
|
|
653
733
|
GetOrderHistoryRequestSchema,
|
|
@@ -673,6 +753,10 @@ var PricingClient = class {
|
|
|
673
753
|
MarketSchema,
|
|
674
754
|
MarketType,
|
|
675
755
|
MarketTypeSchema,
|
|
756
|
+
NewsArticleSchema,
|
|
757
|
+
NewsClient,
|
|
758
|
+
NewsError,
|
|
759
|
+
NewsService,
|
|
676
760
|
OrderBookLevelSchema,
|
|
677
761
|
OrderBookUpdateSchema,
|
|
678
762
|
OrderMatchSchema,
|
|
@@ -709,6 +793,8 @@ var PricingClient = class {
|
|
|
709
793
|
SettlementUpdateSchema,
|
|
710
794
|
SettlementUpdate_EventType,
|
|
711
795
|
SettlementUpdate_EventTypeSchema,
|
|
796
|
+
SourceSchema,
|
|
797
|
+
StreamNewsRequestSchema,
|
|
712
798
|
StreamPricesRequestSchema,
|
|
713
799
|
SubmitOrderRequestSchema,
|
|
714
800
|
SubmitOrderResponseSchema,
|
|
@@ -717,9 +803,11 @@ var PricingClient = class {
|
|
|
717
803
|
SubscribeSettlementsRequestSchema,
|
|
718
804
|
TimeInForce,
|
|
719
805
|
TimeInForceSchema,
|
|
806
|
+
TokenNewsSchema,
|
|
720
807
|
TradeUpdateSchema,
|
|
721
808
|
UpdateMarketPriceFeedsRequestSchema,
|
|
722
809
|
UpdateMarketPriceFeedsResponseSchema,
|
|
810
|
+
file_proto_silvana_news_v1_news,
|
|
723
811
|
file_proto_silvana_orderbook_v1_orderbook,
|
|
724
812
|
file_proto_silvana_pricing_v1_pricing
|
|
725
813
|
});
|
package/dist/node/index.d.ts
CHANGED
package/dist/node/index.js
CHANGED
package/dist/node/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export * from "./proto/silvana/news/v1/news_pb.js";
|
|
2
|
+
import { type GetNewsResponse } from "./proto/silvana/news/v1/news_pb.js";
|
|
3
|
+
/**
|
|
4
|
+
* Custom error class for News client errors
|
|
5
|
+
*/
|
|
6
|
+
export declare class NewsError extends Error {
|
|
7
|
+
code?: string | undefined;
|
|
8
|
+
details?: any | undefined;
|
|
9
|
+
constructor(message: string, code?: string | undefined, details?: any | undefined);
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* News client configuration
|
|
13
|
+
*/
|
|
14
|
+
export interface NewsClientConfig {
|
|
15
|
+
/** Base URL of the news service (e.g., "http://localhost:50054") */
|
|
16
|
+
baseUrl: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* News client for interacting with the Silvana News Service
|
|
20
|
+
*/
|
|
21
|
+
export declare class NewsClient {
|
|
22
|
+
private client;
|
|
23
|
+
/**
|
|
24
|
+
* Creates a new NewsClient instance
|
|
25
|
+
* @param config Client configuration
|
|
26
|
+
*/
|
|
27
|
+
constructor(config: NewsClientConfig);
|
|
28
|
+
/**
|
|
29
|
+
* Wraps async calls with error handling
|
|
30
|
+
*/
|
|
31
|
+
private wrapCall;
|
|
32
|
+
/**
|
|
33
|
+
* Get news articles for specific cryptocurrencies
|
|
34
|
+
*/
|
|
35
|
+
getNews(params?: {
|
|
36
|
+
tokens?: string[];
|
|
37
|
+
limit?: number;
|
|
38
|
+
language?: string;
|
|
39
|
+
hours?: number;
|
|
40
|
+
}): Promise<GetNewsResponse>;
|
|
41
|
+
/**
|
|
42
|
+
* Stream real-time news updates
|
|
43
|
+
*/
|
|
44
|
+
streamNews(params?: {
|
|
45
|
+
tokens?: string[];
|
|
46
|
+
updateInterval?: number;
|
|
47
|
+
}): AsyncIterable<import("./proto/silvana/news/v1/news_pb.js").NewsArticle>;
|
|
48
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { createGrpcTransport } from "@connectrpc/connect-node";
|
|
2
|
+
import { createClient, ConnectError } from "@connectrpc/connect";
|
|
3
|
+
import { create } from "@bufbuild/protobuf";
|
|
4
|
+
// Export all types and schemas from the generated protobuf file
|
|
5
|
+
export * from "./proto/silvana/news/v1/news_pb.js";
|
|
6
|
+
import { NewsService, GetNewsRequestSchema, StreamNewsRequestSchema, } from "./proto/silvana/news/v1/news_pb.js";
|
|
7
|
+
/**
|
|
8
|
+
* Custom error class for News client errors
|
|
9
|
+
*/
|
|
10
|
+
export class NewsError extends Error {
|
|
11
|
+
constructor(message, code, details) {
|
|
12
|
+
super(message);
|
|
13
|
+
this.code = code;
|
|
14
|
+
this.details = details;
|
|
15
|
+
this.name = 'NewsError';
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* News client for interacting with the Silvana News Service
|
|
20
|
+
*/
|
|
21
|
+
export class NewsClient {
|
|
22
|
+
/**
|
|
23
|
+
* Creates a new NewsClient instance
|
|
24
|
+
* @param config Client configuration
|
|
25
|
+
*/
|
|
26
|
+
constructor(config) {
|
|
27
|
+
const transport = createGrpcTransport({
|
|
28
|
+
baseUrl: config.baseUrl,
|
|
29
|
+
});
|
|
30
|
+
this.client = createClient(NewsService, transport);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Wraps async calls with error handling
|
|
34
|
+
*/
|
|
35
|
+
async wrapCall(operation, operationName) {
|
|
36
|
+
try {
|
|
37
|
+
return await operation();
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
if (error instanceof ConnectError) {
|
|
41
|
+
throw new NewsError(`${operationName} failed: ${error.message}`, String(error.code), error.metadata);
|
|
42
|
+
}
|
|
43
|
+
throw new NewsError(`${operationName} failed: ${error instanceof Error ? error.message : 'Unknown error'}`, 'UNKNOWN', error);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Get news articles for specific cryptocurrencies
|
|
48
|
+
*/
|
|
49
|
+
async getNews(params) {
|
|
50
|
+
return await this.wrapCall(async () => {
|
|
51
|
+
const request = create(GetNewsRequestSchema, params || {});
|
|
52
|
+
return await this.client.getNews(request);
|
|
53
|
+
}, 'getNews');
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Stream real-time news updates
|
|
57
|
+
*/
|
|
58
|
+
streamNews(params) {
|
|
59
|
+
const request = create(StreamNewsRequestSchema, params || {});
|
|
60
|
+
return this.client.streamNews(request);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=news.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"news.js","sourceRoot":"","sources":["../../src/news.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C,gEAAgE;AAChE,cAAc,oCAAoC,CAAC;AAEnD,OAAO,EACL,WAAW,EAEX,oBAAoB,EACpB,uBAAuB,GACxB,MAAM,oCAAoC,CAAC;AAE5C;;GAEG;AACH,MAAM,OAAO,SAAU,SAAQ,KAAK;IAClC,YACE,OAAe,EACR,IAAa,EACb,OAAa;QAEpB,KAAK,CAAC,OAAO,CAAC,CAAC;QAHR,SAAI,GAAJ,IAAI,CAAS;QACb,YAAO,GAAP,OAAO,CAAM;QAGpB,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC;IAC1B,CAAC;CACF;AAUD;;GAEG;AACH,MAAM,OAAO,UAAU;IAGrB;;;OAGG;IACH,YAAY,MAAwB;QAClC,MAAM,SAAS,GAAG,mBAAmB,CAAC;YACpC,OAAO,EAAE,MAAM,CAAC,OAAO;SACxB,CAAC,CAAC;QAEH,IAAI,CAAC,MAAM,GAAG,YAAY,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;IACrD,CAAC;IAED;;OAEG;IACK,KAAK,CAAC,QAAQ,CACpB,SAA2B,EAC3B,aAAqB;QAErB,IAAI,CAAC;YACH,OAAO,MAAM,SAAS,EAAE,CAAC;QAC3B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,KAAK,YAAY,YAAY,EAAE,CAAC;gBAClC,MAAM,IAAI,SAAS,CACjB,GAAG,aAAa,YAAY,KAAK,CAAC,OAAO,EAAE,EAC3C,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,EAClB,KAAK,CAAC,QAAQ,CACf,CAAC;YACJ,CAAC;YACD,MAAM,IAAI,SAAS,CACjB,GAAG,aAAa,YAAY,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,EAAE,EACtF,SAAS,EACT,KAAK,CACN,CAAC;QACJ,CAAC;IACH,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,OAAO,CAAC,MAKb;QACC,OAAO,MAAM,IAAI,CAAC,QAAQ,CAAC,KAAK,IAAI,EAAE;YACpC,MAAM,OAAO,GAAG,MAAM,CAAC,oBAAoB,EAAE,MAAM,IAAI,EAAE,CAAC,CAAC;YAC3D,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAC5C,CAAC,EAAE,SAAS,CAAC,CAAC;IAChB,CAAC;IAED;;OAEG;IACH,UAAU,CAAC,MAGV;QACC,MAAM,OAAO,GAAG,MAAM,CAAC,uBAAuB,EAAE,MAAM,IAAI,EAAE,CAAC,CAAC;QAC9D,OAAO,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;CACF"}
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2";
|
|
2
|
+
import type { Timestamp } from "@bufbuild/protobuf/wkt";
|
|
3
|
+
import type { Message } from "@bufbuild/protobuf";
|
|
4
|
+
/**
|
|
5
|
+
* Describes the file proto/silvana/news/v1/news.proto.
|
|
6
|
+
*/
|
|
7
|
+
export declare const file_proto_silvana_news_v1_news: GenFile;
|
|
8
|
+
/**
|
|
9
|
+
* News article source information
|
|
10
|
+
*
|
|
11
|
+
* @generated from message silvana.news.v1.Source
|
|
12
|
+
*/
|
|
13
|
+
export type Source = Message<"silvana.news.v1.Source"> & {
|
|
14
|
+
/**
|
|
15
|
+
* @generated from field: optional string id = 1;
|
|
16
|
+
*/
|
|
17
|
+
id?: string;
|
|
18
|
+
/**
|
|
19
|
+
* @generated from field: string name = 2;
|
|
20
|
+
*/
|
|
21
|
+
name: string;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Describes the message silvana.news.v1.Source.
|
|
25
|
+
* Use `create(SourceSchema)` to create a new message.
|
|
26
|
+
*/
|
|
27
|
+
export declare const SourceSchema: GenMessage<Source>;
|
|
28
|
+
/**
|
|
29
|
+
* News article
|
|
30
|
+
*
|
|
31
|
+
* @generated from message silvana.news.v1.NewsArticle
|
|
32
|
+
*/
|
|
33
|
+
export type NewsArticle = Message<"silvana.news.v1.NewsArticle"> & {
|
|
34
|
+
/**
|
|
35
|
+
* @generated from field: silvana.news.v1.Source source = 1;
|
|
36
|
+
*/
|
|
37
|
+
source?: Source;
|
|
38
|
+
/**
|
|
39
|
+
* @generated from field: optional string author = 2;
|
|
40
|
+
*/
|
|
41
|
+
author?: string;
|
|
42
|
+
/**
|
|
43
|
+
* @generated from field: string title = 3;
|
|
44
|
+
*/
|
|
45
|
+
title: string;
|
|
46
|
+
/**
|
|
47
|
+
* @generated from field: optional string description = 4;
|
|
48
|
+
*/
|
|
49
|
+
description?: string;
|
|
50
|
+
/**
|
|
51
|
+
* @generated from field: string url = 5;
|
|
52
|
+
*/
|
|
53
|
+
url: string;
|
|
54
|
+
/**
|
|
55
|
+
* @generated from field: optional string url_to_image = 6;
|
|
56
|
+
*/
|
|
57
|
+
urlToImage?: string;
|
|
58
|
+
/**
|
|
59
|
+
* @generated from field: google.protobuf.Timestamp published_at = 7;
|
|
60
|
+
*/
|
|
61
|
+
publishedAt?: Timestamp;
|
|
62
|
+
/**
|
|
63
|
+
* @generated from field: optional string content = 8;
|
|
64
|
+
*/
|
|
65
|
+
content?: string;
|
|
66
|
+
/**
|
|
67
|
+
* Total text size (title + description + content)
|
|
68
|
+
*
|
|
69
|
+
* @generated from field: int32 text_size = 9;
|
|
70
|
+
*/
|
|
71
|
+
textSize: number;
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Describes the message silvana.news.v1.NewsArticle.
|
|
75
|
+
* Use `create(NewsArticleSchema)` to create a new message.
|
|
76
|
+
*/
|
|
77
|
+
export declare const NewsArticleSchema: GenMessage<NewsArticle>;
|
|
78
|
+
/**
|
|
79
|
+
* Request for news articles
|
|
80
|
+
*
|
|
81
|
+
* @generated from message silvana.news.v1.GetNewsRequest
|
|
82
|
+
*/
|
|
83
|
+
export type GetNewsRequest = Message<"silvana.news.v1.GetNewsRequest"> & {
|
|
84
|
+
/**
|
|
85
|
+
* Cryptocurrency tokens to fetch news for (e.g., "btc", "eth", "mina")
|
|
86
|
+
* If empty, fetches news for default tokens (btc, eth, mina)
|
|
87
|
+
*
|
|
88
|
+
* @generated from field: repeated string tokens = 1;
|
|
89
|
+
*/
|
|
90
|
+
tokens: string[];
|
|
91
|
+
/**
|
|
92
|
+
* Maximum number of articles per token
|
|
93
|
+
*
|
|
94
|
+
* Default: 5
|
|
95
|
+
*
|
|
96
|
+
* @generated from field: optional int32 limit = 2;
|
|
97
|
+
*/
|
|
98
|
+
limit?: number;
|
|
99
|
+
/**
|
|
100
|
+
* Filter by language (e.g., "en")
|
|
101
|
+
*
|
|
102
|
+
* Default: "en"
|
|
103
|
+
*
|
|
104
|
+
* @generated from field: optional string language = 3;
|
|
105
|
+
*/
|
|
106
|
+
language?: string;
|
|
107
|
+
/**
|
|
108
|
+
* Time window in hours (e.g., 48 for last 48 hours)
|
|
109
|
+
*
|
|
110
|
+
* Default: 48
|
|
111
|
+
*
|
|
112
|
+
* @generated from field: optional int32 hours = 4;
|
|
113
|
+
*/
|
|
114
|
+
hours?: number;
|
|
115
|
+
};
|
|
116
|
+
/**
|
|
117
|
+
* Describes the message silvana.news.v1.GetNewsRequest.
|
|
118
|
+
* Use `create(GetNewsRequestSchema)` to create a new message.
|
|
119
|
+
*/
|
|
120
|
+
export declare const GetNewsRequestSchema: GenMessage<GetNewsRequest>;
|
|
121
|
+
/**
|
|
122
|
+
* Response containing news articles
|
|
123
|
+
*
|
|
124
|
+
* @generated from message silvana.news.v1.GetNewsResponse
|
|
125
|
+
*/
|
|
126
|
+
export type GetNewsResponse = Message<"silvana.news.v1.GetNewsResponse"> & {
|
|
127
|
+
/**
|
|
128
|
+
* @generated from field: bool success = 1;
|
|
129
|
+
*/
|
|
130
|
+
success: boolean;
|
|
131
|
+
/**
|
|
132
|
+
* @generated from field: string message = 2;
|
|
133
|
+
*/
|
|
134
|
+
message: string;
|
|
135
|
+
/**
|
|
136
|
+
* News results grouped by token
|
|
137
|
+
*
|
|
138
|
+
* @generated from field: repeated silvana.news.v1.TokenNews token_news = 3;
|
|
139
|
+
*/
|
|
140
|
+
tokenNews: TokenNews[];
|
|
141
|
+
/**
|
|
142
|
+
* Indicates if results were served from cache
|
|
143
|
+
*
|
|
144
|
+
* @generated from field: bool from_cache = 4;
|
|
145
|
+
*/
|
|
146
|
+
fromCache: boolean;
|
|
147
|
+
/**
|
|
148
|
+
* Cache expiration time (if from_cache = true)
|
|
149
|
+
*
|
|
150
|
+
* @generated from field: optional google.protobuf.Timestamp cache_expires_at = 5;
|
|
151
|
+
*/
|
|
152
|
+
cacheExpiresAt?: Timestamp;
|
|
153
|
+
};
|
|
154
|
+
/**
|
|
155
|
+
* Describes the message silvana.news.v1.GetNewsResponse.
|
|
156
|
+
* Use `create(GetNewsResponseSchema)` to create a new message.
|
|
157
|
+
*/
|
|
158
|
+
export declare const GetNewsResponseSchema: GenMessage<GetNewsResponse>;
|
|
159
|
+
/**
|
|
160
|
+
* News articles for a specific token
|
|
161
|
+
*
|
|
162
|
+
* @generated from message silvana.news.v1.TokenNews
|
|
163
|
+
*/
|
|
164
|
+
export type TokenNews = Message<"silvana.news.v1.TokenNews"> & {
|
|
165
|
+
/**
|
|
166
|
+
* e.g., "btc", "eth", "mina"
|
|
167
|
+
*
|
|
168
|
+
* @generated from field: string token = 1;
|
|
169
|
+
*/
|
|
170
|
+
token: string;
|
|
171
|
+
/**
|
|
172
|
+
* Search query used (e.g., "bitcoin", "ethereum")
|
|
173
|
+
*
|
|
174
|
+
* @generated from field: string query = 2;
|
|
175
|
+
*/
|
|
176
|
+
query: string;
|
|
177
|
+
/**
|
|
178
|
+
* @generated from field: int32 total_results = 3;
|
|
179
|
+
*/
|
|
180
|
+
totalResults: number;
|
|
181
|
+
/**
|
|
182
|
+
* @generated from field: repeated silvana.news.v1.NewsArticle articles = 4;
|
|
183
|
+
*/
|
|
184
|
+
articles: NewsArticle[];
|
|
185
|
+
/**
|
|
186
|
+
* @generated from field: google.protobuf.Timestamp fetched_at = 5;
|
|
187
|
+
*/
|
|
188
|
+
fetchedAt?: Timestamp;
|
|
189
|
+
};
|
|
190
|
+
/**
|
|
191
|
+
* Describes the message silvana.news.v1.TokenNews.
|
|
192
|
+
* Use `create(TokenNewsSchema)` to create a new message.
|
|
193
|
+
*/
|
|
194
|
+
export declare const TokenNewsSchema: GenMessage<TokenNews>;
|
|
195
|
+
/**
|
|
196
|
+
* Request for streaming news updates
|
|
197
|
+
*
|
|
198
|
+
* @generated from message silvana.news.v1.StreamNewsRequest
|
|
199
|
+
*/
|
|
200
|
+
export type StreamNewsRequest = Message<"silvana.news.v1.StreamNewsRequest"> & {
|
|
201
|
+
/**
|
|
202
|
+
* Cryptocurrency tokens to stream news for
|
|
203
|
+
*
|
|
204
|
+
* @generated from field: repeated string tokens = 1;
|
|
205
|
+
*/
|
|
206
|
+
tokens: string[];
|
|
207
|
+
/**
|
|
208
|
+
* Minimum time between updates in seconds
|
|
209
|
+
*
|
|
210
|
+
* Default: 300 (5 minutes)
|
|
211
|
+
*
|
|
212
|
+
* @generated from field: optional int32 update_interval = 2;
|
|
213
|
+
*/
|
|
214
|
+
updateInterval?: number;
|
|
215
|
+
};
|
|
216
|
+
/**
|
|
217
|
+
* Describes the message silvana.news.v1.StreamNewsRequest.
|
|
218
|
+
* Use `create(StreamNewsRequestSchema)` to create a new message.
|
|
219
|
+
*/
|
|
220
|
+
export declare const StreamNewsRequestSchema: GenMessage<StreamNewsRequest>;
|
|
221
|
+
/**
|
|
222
|
+
* @generated from service silvana.news.v1.NewsService
|
|
223
|
+
*/
|
|
224
|
+
export declare const NewsService: GenService<{
|
|
225
|
+
/**
|
|
226
|
+
* Get news articles for specific cryptocurrencies
|
|
227
|
+
*
|
|
228
|
+
* @generated from rpc silvana.news.v1.NewsService.GetNews
|
|
229
|
+
*/
|
|
230
|
+
getNews: {
|
|
231
|
+
methodKind: "unary";
|
|
232
|
+
input: typeof GetNewsRequestSchema;
|
|
233
|
+
output: typeof GetNewsResponseSchema;
|
|
234
|
+
};
|
|
235
|
+
/**
|
|
236
|
+
* Stream real-time news updates (optional future enhancement)
|
|
237
|
+
*
|
|
238
|
+
* @generated from rpc silvana.news.v1.NewsService.StreamNews
|
|
239
|
+
*/
|
|
240
|
+
streamNews: {
|
|
241
|
+
methodKind: "server_streaming";
|
|
242
|
+
input: typeof StreamNewsRequestSchema;
|
|
243
|
+
output: typeof NewsArticleSchema;
|
|
244
|
+
};
|
|
245
|
+
}>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// @generated by protoc-gen-es v2.10.1 with parameter "target=ts,js_import_style=module"
|
|
2
|
+
// @generated from file proto/silvana/news/v1/news.proto (package silvana.news.v1, syntax proto3)
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2";
|
|
5
|
+
import { file_google_protobuf_timestamp } from "@bufbuild/protobuf/wkt";
|
|
6
|
+
/**
|
|
7
|
+
* Describes the file proto/silvana/news/v1/news.proto.
|
|
8
|
+
*/
|
|
9
|
+
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YAiABKAkSFQoNdG90YWxfcmVzdWx0cxgDIAEoBRIuCghhcnRpY2xlcxgEIAMoCzIcLnNpbHZhbmEubmV3cy52MS5OZXdzQXJ0aWNsZRIuCgpmZXRjaGVkX2F0GAUgASgLMhouZ29vZ2xlLnByb3RvYnVmLlRpbWVzdGFtcCJVChFTdHJlYW1OZXdzUmVxdWVzdBIOCgZ0b2tlbnMYASADKAkSHAoPdXBkYXRlX2ludGVydmFsGAIgASgFSACIAQFCEgoQX3VwZGF0ZV9pbnRlcnZhbDKtAQoLTmV3c1NlcnZpY2USTAoHR2V0TmV3cxIfLnNpbHZhbmEubmV3cy52MS5HZXROZXdzUmVxdWVzdBogLnNpbHZhbmEubmV3cy52MS5HZXROZXdzUmVzcG9uc2USUAoKU3RyZWFtTmV3cxIiLnNpbHZhbmEubmV3cy52MS5TdHJlYW1OZXdzUmVxdWVzdBocLnNpbHZhbmEubmV3cy52MS5OZXdzQXJ0aWNsZTABQi9aLWdpdGh1Yi5jb20vU2lsdmFuYU9uZS9jYW50b24tYWdlbnQvcHJvdG87bmV3c2IGcHJvdG8z", [file_google_protobuf_timestamp]);
|
|
10
|
+
/**
|
|
11
|
+
* Describes the message silvana.news.v1.Source.
|
|
12
|
+
* Use `create(SourceSchema)` to create a new message.
|
|
13
|
+
*/
|
|
14
|
+
export const SourceSchema = /*@__PURE__*/ messageDesc(file_proto_silvana_news_v1_news, 0);
|
|
15
|
+
/**
|
|
16
|
+
* Describes the message silvana.news.v1.NewsArticle.
|
|
17
|
+
* Use `create(NewsArticleSchema)` to create a new message.
|
|
18
|
+
*/
|
|
19
|
+
export const NewsArticleSchema = /*@__PURE__*/ messageDesc(file_proto_silvana_news_v1_news, 1);
|
|
20
|
+
/**
|
|
21
|
+
* Describes the message silvana.news.v1.GetNewsRequest.
|
|
22
|
+
* Use `create(GetNewsRequestSchema)` to create a new message.
|
|
23
|
+
*/
|
|
24
|
+
export const GetNewsRequestSchema = /*@__PURE__*/ messageDesc(file_proto_silvana_news_v1_news, 2);
|
|
25
|
+
/**
|
|
26
|
+
* Describes the message silvana.news.v1.GetNewsResponse.
|
|
27
|
+
* Use `create(GetNewsResponseSchema)` to create a new message.
|
|
28
|
+
*/
|
|
29
|
+
export const GetNewsResponseSchema = /*@__PURE__*/ messageDesc(file_proto_silvana_news_v1_news, 3);
|
|
30
|
+
/**
|
|
31
|
+
* Describes the message silvana.news.v1.TokenNews.
|
|
32
|
+
* Use `create(TokenNewsSchema)` to create a new message.
|
|
33
|
+
*/
|
|
34
|
+
export const TokenNewsSchema = /*@__PURE__*/ messageDesc(file_proto_silvana_news_v1_news, 4);
|
|
35
|
+
/**
|
|
36
|
+
* Describes the message silvana.news.v1.StreamNewsRequest.
|
|
37
|
+
* Use `create(StreamNewsRequestSchema)` to create a new message.
|
|
38
|
+
*/
|
|
39
|
+
export const StreamNewsRequestSchema = /*@__PURE__*/ messageDesc(file_proto_silvana_news_v1_news, 5);
|
|
40
|
+
/**
|
|
41
|
+
* @generated from service silvana.news.v1.NewsService
|
|
42
|
+
*/
|
|
43
|
+
export const NewsService = /*@__PURE__*/ serviceDesc(file_proto_silvana_news_v1_news, 0);
|
|
44
|
+
//# sourceMappingURL=news_pb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"news_pb.js","sourceRoot":"","sources":["../../../../../../src/proto/silvana/news/v1/news_pb.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,iGAAiG;AACjG,oBAAoB;AAGpB,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAElF,OAAO,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAC;AAGxE;;GAEG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAY,aAAa,CACnE,QAAQ,CAAC,8lDAA8lD,EAAE,CAAC,8BAA8B,CAAC,CAAC,CAAC;AAmB7oD;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAuB,aAAa,CAC3D,WAAW,CAAC,+BAA+B,EAAE,CAAC,CAAC,CAAC;AAwDlD;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAA4B,aAAa,CACrE,WAAW,CAAC,+BAA+B,EAAE,CAAC,CAAC,CAAC;AA4ClD;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAA+B,aAAa,CAC3E,WAAW,CAAC,+BAA+B,EAAE,CAAC,CAAC,CAAC;AAwClD;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAgC,aAAa,CAC7E,WAAW,CAAC,+BAA+B,EAAE,CAAC,CAAC,CAAC;AAsClD;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAA0B,aAAa,CACjE,WAAW,CAAC,+BAA+B,EAAE,CAAC,CAAC,CAAC;AAyBlD;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAkC,aAAa,CACjF,WAAW,CAAC,+BAA+B,EAAE,CAAC,CAAC,CAAC;AAElD;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAqBnB,aAAa,CAChB,WAAW,CAAC,+BAA+B,EAAE,CAAC,CAAC,CAAC"}
|