@injectivelabs/sdk-ts 1.10.73-beta.11 → 1.10.73-beta.13

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.
Files changed (61) hide show
  1. package/dist/cjs/client/BaseGrpcDmmWebConsumer.d.ts +10 -0
  2. package/dist/cjs/client/BaseGrpcDmmWebConsumer.d.ts.map +1 -0
  3. package/dist/cjs/client/BaseGrpcDmmWebConsumer.js +23 -0
  4. package/dist/cjs/client/BaseGrpcDmmWebConsumer.js.map +1 -0
  5. package/dist/cjs/client/dmm/grpc/DmmGrpcApi.d.ts +52 -0
  6. package/dist/cjs/client/dmm/grpc/DmmGrpcApi.d.ts.map +1 -0
  7. package/dist/cjs/client/dmm/grpc/DmmGrpcApi.js +327 -0
  8. package/dist/cjs/client/dmm/grpc/DmmGrpcApi.js.map +1 -0
  9. package/dist/cjs/client/dmm/grpc/index.d.ts +3 -0
  10. package/dist/cjs/client/dmm/grpc/index.d.ts.map +1 -0
  11. package/dist/cjs/client/dmm/grpc/index.js +19 -0
  12. package/dist/cjs/client/dmm/grpc/index.js.map +1 -0
  13. package/dist/cjs/client/dmm/grpc/transformers/index.d.ts +24 -0
  14. package/dist/cjs/client/dmm/grpc/transformers/index.d.ts.map +1 -0
  15. package/dist/cjs/client/dmm/grpc/transformers/index.js +232 -0
  16. package/dist/cjs/client/dmm/grpc/transformers/index.js.map +1 -0
  17. package/dist/cjs/client/dmm/grpc/types/index.d.ts +228 -0
  18. package/dist/cjs/client/dmm/grpc/types/index.d.ts.map +1 -0
  19. package/dist/cjs/client/dmm/grpc/types/index.js +3 -0
  20. package/dist/cjs/client/dmm/grpc/types/index.js.map +1 -0
  21. package/dist/cjs/client/dmm/index.d.ts +2 -0
  22. package/dist/cjs/client/dmm/index.d.ts.map +1 -0
  23. package/dist/cjs/client/dmm/index.js +18 -0
  24. package/dist/cjs/client/dmm/index.js.map +1 -0
  25. package/dist/cjs/client/index.d.ts +1 -0
  26. package/dist/cjs/client/index.d.ts.map +1 -1
  27. package/dist/cjs/client/index.js +1 -0
  28. package/dist/cjs/client/index.js.map +1 -1
  29. package/dist/cjs/client/indexer/types/index.d.ts +1 -0
  30. package/dist/cjs/client/indexer/types/index.d.ts.map +1 -1
  31. package/dist/esm/client/BaseGrpcDmmWebConsumer.d.ts +10 -0
  32. package/dist/esm/client/BaseGrpcDmmWebConsumer.d.ts.map +1 -0
  33. package/dist/esm/client/BaseGrpcDmmWebConsumer.js +18 -0
  34. package/dist/esm/client/BaseGrpcDmmWebConsumer.js.map +1 -0
  35. package/dist/esm/client/dmm/grpc/DmmGrpcApi.d.ts +52 -0
  36. package/dist/esm/client/dmm/grpc/DmmGrpcApi.d.ts.map +1 -0
  37. package/dist/esm/client/dmm/grpc/DmmGrpcApi.js +293 -0
  38. package/dist/esm/client/dmm/grpc/DmmGrpcApi.js.map +1 -0
  39. package/dist/esm/client/dmm/grpc/index.d.ts +3 -0
  40. package/dist/esm/client/dmm/grpc/index.d.ts.map +1 -0
  41. package/dist/esm/client/dmm/grpc/index.js +3 -0
  42. package/dist/esm/client/dmm/grpc/index.js.map +1 -0
  43. package/dist/esm/client/dmm/grpc/transformers/index.d.ts +24 -0
  44. package/dist/esm/client/dmm/grpc/transformers/index.d.ts.map +1 -0
  45. package/dist/esm/client/dmm/grpc/transformers/index.js +228 -0
  46. package/dist/esm/client/dmm/grpc/transformers/index.js.map +1 -0
  47. package/dist/esm/client/dmm/grpc/types/index.d.ts +228 -0
  48. package/dist/esm/client/dmm/grpc/types/index.d.ts.map +1 -0
  49. package/dist/esm/client/dmm/grpc/types/index.js +2 -0
  50. package/dist/esm/client/dmm/grpc/types/index.js.map +1 -0
  51. package/dist/esm/client/dmm/index.d.ts +2 -0
  52. package/dist/esm/client/dmm/index.d.ts.map +1 -0
  53. package/dist/esm/client/dmm/index.js +2 -0
  54. package/dist/esm/client/dmm/index.js.map +1 -0
  55. package/dist/esm/client/index.d.ts +1 -0
  56. package/dist/esm/client/index.d.ts.map +1 -1
  57. package/dist/esm/client/index.js +1 -0
  58. package/dist/esm/client/index.js.map +1 -1
  59. package/dist/esm/client/indexer/types/index.d.ts +1 -0
  60. package/dist/esm/client/indexer/types/index.d.ts.map +1 -1
  61. package/package.json +7 -6
@@ -0,0 +1,10 @@
1
+ import { InjectiveDmmRpc } from '@injectivelabs/dmm-proto-ts';
2
+ /**
3
+ * @hidden
4
+ */
5
+ export default class BaseDmmGrpcWebConsumer extends InjectiveDmmRpc.GrpcWebImpl {
6
+ protected module: string;
7
+ constructor(endpoint: string);
8
+ }
9
+ export declare const getGrpcDmmWebImpl: (endpoint: string) => BaseDmmGrpcWebConsumer;
10
+ //# sourceMappingURL=BaseGrpcDmmWebConsumer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseGrpcDmmWebConsumer.d.ts","sourceRoot":"","sources":["../../../src/client/BaseGrpcDmmWebConsumer.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAM7D;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,sBAAuB,SAAQ,eAAe,CAAC,WAAW;IAC7E,SAAS,CAAC,MAAM,EAAE,MAAM,CAAK;gBAEjB,QAAQ,EAAE,MAAM;CAG7B;AAED,eAAO,MAAM,iBAAiB,aAAc,MAAM,2BACZ,CAAA"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getGrpcDmmWebImpl = void 0;
4
+ const grpc_web_1 = require("@injectivelabs/grpc-web");
5
+ const helpers_1 = require("../utils/helpers");
6
+ const grpc_1 = require("../utils/grpc");
7
+ const dmm_proto_ts_1 = require("@injectivelabs/dmm-proto-ts");
8
+ if (!(0, helpers_1.isBrowser)()) {
9
+ grpc_web_1.grpc.setDefaultTransport((0, grpc_1.getGrpcTransport)());
10
+ }
11
+ /**
12
+ * @hidden
13
+ */
14
+ class BaseDmmGrpcWebConsumer extends dmm_proto_ts_1.InjectiveDmmRpc.GrpcWebImpl {
15
+ constructor(endpoint) {
16
+ super(endpoint, { transport: (0, grpc_1.getGrpcTransport)() });
17
+ this.module = '';
18
+ }
19
+ }
20
+ exports.default = BaseDmmGrpcWebConsumer;
21
+ const getGrpcDmmWebImpl = (endpoint) => new BaseDmmGrpcWebConsumer(endpoint);
22
+ exports.getGrpcDmmWebImpl = getGrpcDmmWebImpl;
23
+ //# sourceMappingURL=BaseGrpcDmmWebConsumer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseGrpcDmmWebConsumer.js","sourceRoot":"","sources":["../../../src/client/BaseGrpcDmmWebConsumer.ts"],"names":[],"mappings":";;;AAAA,sDAA8C;AAC9C,8CAA4C;AAC5C,wCAAgD;AAChD,8DAA6D;AAE7D,IAAI,CAAC,IAAA,mBAAS,GAAE,EAAE;IAChB,eAAI,CAAC,mBAAmB,CAAC,IAAA,uBAAgB,GAA2B,CAAC,CAAA;CACtE;AAED;;GAEG;AACH,MAAqB,sBAAuB,SAAQ,8BAAe,CAAC,WAAW;IAG7E,YAAY,QAAgB;QAC1B,KAAK,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAA,uBAAgB,GAAE,EAAE,CAAC,CAAA;QAH1C,WAAM,GAAW,EAAE,CAAA;IAI7B,CAAC;CACF;AAND,yCAMC;AAEM,MAAM,iBAAiB,GAAG,CAAC,QAAgB,EAAE,EAAE,CACpD,IAAI,sBAAsB,CAAC,QAAQ,CAAC,CAAA;AADzB,QAAA,iBAAiB,qBACQ"}
@@ -0,0 +1,52 @@
1
+ import { InjectiveDmmRpc } from '@injectivelabs/dmm-proto-ts';
2
+ export declare class DmmGrpcApi {
3
+ protected module: string;
4
+ protected client: InjectiveDmmRpc.InjectiveDmmV2RPCClientImpl;
5
+ constructor(endpoint: string);
6
+ fetchEpochs(status?: string): Promise<import("./types").EpochV2[]>;
7
+ fetchMarketRewards(epochId: string): Promise<import("./types").MarketReward[]>;
8
+ fetchEligibleAddresses({ epochId, page, }: {
9
+ epochId: string;
10
+ page?: InjectiveDmmRpc.Pagination;
11
+ }): Promise<import("./types").EligibleAddresses>;
12
+ fetchEpochScores({ epochId, page, }: {
13
+ epochId: string;
14
+ page?: InjectiveDmmRpc.Pagination;
15
+ }): Promise<import("./types").EpochScores>;
16
+ fetchEpochScoresHistory({ epochId, accountAddress, page, }: {
17
+ epochId: string;
18
+ accountAddress: string;
19
+ page?: InjectiveDmmRpc.Pagination;
20
+ }): Promise<import("./types").EpochScoresHistory>;
21
+ fetchTotalScores({ epochId, marketId, page, }: {
22
+ epochId: string;
23
+ marketId: string;
24
+ page?: InjectiveDmmRpc.Pagination;
25
+ }): Promise<import("./types").TotalScores>;
26
+ fetchTotalScoresHistory({ epochId, marketId, accountAddress, page, }: {
27
+ epochId: string;
28
+ marketId: string;
29
+ accountAddress: string;
30
+ page?: InjectiveDmmRpc.Pagination;
31
+ }): Promise<import("./types").TotalScoresHistory>;
32
+ fetchLiquiditySnapshots({ epochId, marketId, accountAddress, page, }: {
33
+ epochId: string;
34
+ marketId: string;
35
+ accountAddress: string;
36
+ page?: InjectiveDmmRpc.Pagination;
37
+ }): Promise<import("./types").LiquiditySnapshots>;
38
+ fetchRewardsDistribution({ epochId, height, page, }: {
39
+ epochId: string;
40
+ height?: string;
41
+ page?: InjectiveDmmRpc.Pagination;
42
+ }): Promise<import("./types").RewardsDistribution>;
43
+ fetchAccountVolumes({ epochId, accountAddress, }: {
44
+ epochId: string;
45
+ accountAddress: string;
46
+ }): Promise<import("./types").AccountVolume[]>;
47
+ fetchRewardsEligibility({ epochId, accountAddress, }: {
48
+ epochId?: string;
49
+ accountAddress?: string;
50
+ }): Promise<import("./types").RewardsEligibility>;
51
+ }
52
+ //# sourceMappingURL=DmmGrpcApi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DmmGrpcApi.d.ts","sourceRoot":"","sources":["../../../../../src/client/dmm/grpc/DmmGrpcApi.ts"],"names":[],"mappings":"AAAA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MAAM,CAAA;QACf,QAAQ,EAAE,MAAM,CAAA;QAChB,cAAc,EAAE,MAAM,CAAA;QACtB,IAAI,CAAC,EAAE,eAAe,CAAC,UAAU,CAAA;KAClC;IAkCK,wBAAwB,CAAC,EAC7B,OAAO,EACP,MAAM,EACN,IAAI,GACL,EAAE;QACD,OAAO,EAAE,MAAM,CAAA;QACf,MAAM,CAAC,EAAE,MAAM,CAAA;QACf,IAAI,CAAC,EAAE,eAAe,CAAC,UAAU,CAAA;KAClC;IAoCK,mBAAmB,CAAC,EACxB,OAAO,EACP,cAAc,GACf,EAAE;QACD,OAAO,EAAE,MAAM,CAAA;QACf,cAAc,EAAE,MAAM,CAAA;KACvB;IA2BK,uBAAuB,CAAC,EAC5B,OAAO,EACP,cAAc,GACf,EAAE;QACD,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,cAAc,CAAC,EAAE,MAAM,CAAA;KACxB;CAiCF"}
@@ -0,0 +1,327 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.DmmGrpcApi = void 0;
13
+ const dmm_proto_ts_1 = require("@injectivelabs/dmm-proto-ts");
14
+ const BaseGrpcDmmWebConsumer_1 = require("../../BaseGrpcDmmWebConsumer");
15
+ const transformers_1 = require("./transformers");
16
+ const exceptions_1 = require("@injectivelabs/exceptions");
17
+ class DmmGrpcApi {
18
+ constructor(endpoint) {
19
+ this.module = exceptions_1.IndexerErrorModule.Dmm;
20
+ this.client = new dmm_proto_ts_1.InjectiveDmmRpc.InjectiveDmmV2RPCClientImpl((0, BaseGrpcDmmWebConsumer_1.getGrpcDmmWebImpl)(endpoint));
21
+ }
22
+ fetchEpochs(status) {
23
+ return __awaiter(this, void 0, void 0, function* () {
24
+ const request = dmm_proto_ts_1.InjectiveDmmRpc.GetEpochsRequest.create();
25
+ if (status) {
26
+ request.status = status;
27
+ }
28
+ try {
29
+ const response = yield this.client.GetEpochs(request);
30
+ return transformers_1.DmmGrpcTransformer.epochsResponseToEpochs(response);
31
+ }
32
+ catch (e) {
33
+ if (e instanceof dmm_proto_ts_1.InjectiveDmmRpc.GrpcWebError) {
34
+ throw new exceptions_1.GrpcUnaryRequestException(new Error(e.toString()), {
35
+ code: e.code,
36
+ context: 'GetEpochs',
37
+ contextModule: this.module,
38
+ });
39
+ }
40
+ throw new exceptions_1.GrpcUnaryRequestException(e, {
41
+ code: exceptions_1.UnspecifiedErrorCode,
42
+ context: 'GetEpochs',
43
+ contextModule: this.module,
44
+ });
45
+ }
46
+ });
47
+ }
48
+ fetchMarketRewards(epochId) {
49
+ return __awaiter(this, void 0, void 0, function* () {
50
+ const request = dmm_proto_ts_1.InjectiveDmmRpc.GetMarketRewardsRequest.create();
51
+ request.epochId = epochId.toString();
52
+ try {
53
+ const response = yield this.client.GetMarketRewards(request);
54
+ return transformers_1.DmmGrpcTransformer.marketRewardsResponseToMarketRewards(response);
55
+ }
56
+ catch (e) {
57
+ if (e instanceof dmm_proto_ts_1.InjectiveDmmRpc.GrpcWebError) {
58
+ throw new exceptions_1.GrpcUnaryRequestException(new Error(e.toString()), {
59
+ code: e.code,
60
+ context: 'GetMarketRewards',
61
+ contextModule: this.module,
62
+ });
63
+ }
64
+ throw new exceptions_1.GrpcUnaryRequestException(e, {
65
+ code: exceptions_1.UnspecifiedErrorCode,
66
+ context: 'GetMarketRewards',
67
+ contextModule: this.module,
68
+ });
69
+ }
70
+ });
71
+ }
72
+ fetchEligibleAddresses({ epochId, page, }) {
73
+ return __awaiter(this, void 0, void 0, function* () {
74
+ const request = dmm_proto_ts_1.InjectiveDmmRpc.GetEligibleAddressesRequest.create();
75
+ dmm_proto_ts_1.InjectiveDmmRpc.GetRewardsDistributionRequest;
76
+ request.epochId = epochId;
77
+ if (page) {
78
+ request.page = page;
79
+ }
80
+ try {
81
+ const response = yield this.client.GetEligibleAddresses(request);
82
+ return transformers_1.DmmGrpcTransformer.eligibleAddressesResponseToEligibleAddresses(response);
83
+ }
84
+ catch (e) {
85
+ if (e instanceof dmm_proto_ts_1.InjectiveDmmRpc.GrpcWebError) {
86
+ throw new exceptions_1.GrpcUnaryRequestException(new Error(e.toString()), {
87
+ code: e.code,
88
+ context: 'GetEligibleAddresses',
89
+ contextModule: this.module,
90
+ });
91
+ }
92
+ throw new exceptions_1.GrpcUnaryRequestException(e, {
93
+ code: exceptions_1.UnspecifiedErrorCode,
94
+ context: 'GetEligibleAddresses',
95
+ contextModule: this.module,
96
+ });
97
+ }
98
+ });
99
+ }
100
+ fetchEpochScores({ epochId, page, }) {
101
+ return __awaiter(this, void 0, void 0, function* () {
102
+ const request = dmm_proto_ts_1.InjectiveDmmRpc.GetEpochScoresRequest.create();
103
+ request.epochId = epochId;
104
+ if (page) {
105
+ request.page = page;
106
+ }
107
+ try {
108
+ const response = yield this.client.GetEpochScores(request);
109
+ return transformers_1.DmmGrpcTransformer.epochScoresResponseToEpochScores(response);
110
+ }
111
+ catch (e) {
112
+ if (e instanceof dmm_proto_ts_1.InjectiveDmmRpc.GrpcWebError) {
113
+ throw new exceptions_1.GrpcUnaryRequestException(new Error(e.toString()), {
114
+ code: e.code,
115
+ context: 'GetEpochScores',
116
+ contextModule: this.module,
117
+ });
118
+ }
119
+ throw new exceptions_1.GrpcUnaryRequestException(e, {
120
+ code: exceptions_1.UnspecifiedErrorCode,
121
+ context: 'GetEpochScores',
122
+ contextModule: this.module,
123
+ });
124
+ }
125
+ });
126
+ }
127
+ fetchEpochScoresHistory({ epochId, accountAddress, page, }) {
128
+ return __awaiter(this, void 0, void 0, function* () {
129
+ const request = dmm_proto_ts_1.InjectiveDmmRpc.GetEpochScoresHistoryRequest.create();
130
+ request.epochId = epochId;
131
+ request.accountAddress = accountAddress;
132
+ if (page) {
133
+ request.page = page;
134
+ }
135
+ try {
136
+ const response = yield this.client.GetEpochScoresHistory(request);
137
+ return transformers_1.DmmGrpcTransformer.epochScoresHistoryResponseToEpochScoresHistory(response);
138
+ }
139
+ catch (e) {
140
+ if (e instanceof dmm_proto_ts_1.InjectiveDmmRpc.GrpcWebError) {
141
+ throw new exceptions_1.GrpcUnaryRequestException(new Error(e.toString()), {
142
+ code: e.code,
143
+ context: 'GetEpochScoresHistory',
144
+ contextModule: this.module,
145
+ });
146
+ }
147
+ throw new exceptions_1.GrpcUnaryRequestException(e, {
148
+ code: exceptions_1.UnspecifiedErrorCode,
149
+ context: 'GetEpochScoresHistory',
150
+ contextModule: this.module,
151
+ });
152
+ }
153
+ });
154
+ }
155
+ fetchTotalScores({ epochId, marketId, page, }) {
156
+ return __awaiter(this, void 0, void 0, function* () {
157
+ const request = dmm_proto_ts_1.InjectiveDmmRpc.GetTotalScoresRequest.create();
158
+ request.epochId = epochId;
159
+ request.marketId = marketId;
160
+ if (page) {
161
+ request.page = page;
162
+ }
163
+ try {
164
+ const response = yield this.client.GetTotalScores(request);
165
+ return transformers_1.DmmGrpcTransformer.totalScoresResponseToTotalScores(response);
166
+ }
167
+ catch (e) {
168
+ if (e instanceof dmm_proto_ts_1.InjectiveDmmRpc.GrpcWebError) {
169
+ throw new exceptions_1.GrpcUnaryRequestException(new Error(e.toString()), {
170
+ code: e.code,
171
+ context: 'GetTotalScores',
172
+ contextModule: this.module,
173
+ });
174
+ }
175
+ throw new exceptions_1.GrpcUnaryRequestException(e, {
176
+ code: exceptions_1.UnspecifiedErrorCode,
177
+ context: 'GetTotalScores',
178
+ contextModule: this.module,
179
+ });
180
+ }
181
+ });
182
+ }
183
+ fetchTotalScoresHistory({ epochId, marketId, accountAddress, page, }) {
184
+ return __awaiter(this, void 0, void 0, function* () {
185
+ const request = dmm_proto_ts_1.InjectiveDmmRpc.GetTotalScoresHistoryRequest.create();
186
+ request.epochId = epochId;
187
+ request.marketId = marketId;
188
+ request.accountAddress = accountAddress;
189
+ if (page) {
190
+ request.page = page;
191
+ }
192
+ try {
193
+ const response = yield this.client.GetTotalScoresHistory(request);
194
+ return transformers_1.DmmGrpcTransformer.totalScoresHistoryResponseToTotalScoresHistory(response);
195
+ }
196
+ catch (e) {
197
+ if (e instanceof dmm_proto_ts_1.InjectiveDmmRpc.GrpcWebError) {
198
+ throw new exceptions_1.GrpcUnaryRequestException(new Error(e.toString()), {
199
+ code: e.code,
200
+ context: 'GetTotalScoresHistory',
201
+ contextModule: this.module,
202
+ });
203
+ }
204
+ throw new exceptions_1.GrpcUnaryRequestException(e, {
205
+ code: exceptions_1.UnspecifiedErrorCode,
206
+ context: 'GetTotalScoresHistory',
207
+ contextModule: this.module,
208
+ });
209
+ }
210
+ });
211
+ }
212
+ fetchLiquiditySnapshots({ epochId, marketId, accountAddress, page, }) {
213
+ return __awaiter(this, void 0, void 0, function* () {
214
+ const request = dmm_proto_ts_1.InjectiveDmmRpc.GetLiquiditySnapshotsRequest.create();
215
+ request.epochId = epochId;
216
+ request.marketId = marketId;
217
+ request.accountAddress = accountAddress;
218
+ if (page) {
219
+ request.page = page;
220
+ }
221
+ try {
222
+ const response = yield this.client.GetLiquiditySnapshots(request);
223
+ return transformers_1.DmmGrpcTransformer.liquiditySnapshotsResponseToLiquiditySnapshots(response);
224
+ }
225
+ catch (e) {
226
+ if (e instanceof dmm_proto_ts_1.InjectiveDmmRpc.GrpcWebError) {
227
+ throw new exceptions_1.GrpcUnaryRequestException(new Error(e.toString()), {
228
+ code: e.code,
229
+ context: 'GetLiquiditySnapshots',
230
+ contextModule: this.module,
231
+ });
232
+ }
233
+ throw new exceptions_1.GrpcUnaryRequestException(e, {
234
+ code: exceptions_1.UnspecifiedErrorCode,
235
+ context: 'GetLiquiditySnapshots',
236
+ contextModule: this.module,
237
+ });
238
+ }
239
+ });
240
+ }
241
+ fetchRewardsDistribution({ epochId, height, page, }) {
242
+ return __awaiter(this, void 0, void 0, function* () {
243
+ const request = dmm_proto_ts_1.InjectiveDmmRpc.GetRewardsDistributionRequest.create();
244
+ request.epochId = epochId;
245
+ if (height) {
246
+ request.height = height;
247
+ }
248
+ if (page) {
249
+ request.page = page;
250
+ }
251
+ try {
252
+ const response = yield this.client.GetRewardsDistribution(request);
253
+ return transformers_1.DmmGrpcTransformer.rewardsDistributionResponseToRewardsDistribution(response);
254
+ }
255
+ catch (e) {
256
+ if (e instanceof dmm_proto_ts_1.InjectiveDmmRpc.GrpcWebError) {
257
+ throw new exceptions_1.GrpcUnaryRequestException(new Error(e.toString()), {
258
+ code: e.code,
259
+ context: 'GetRewardsDistribution',
260
+ contextModule: this.module,
261
+ });
262
+ }
263
+ throw new exceptions_1.GrpcUnaryRequestException(e, {
264
+ code: exceptions_1.UnspecifiedErrorCode,
265
+ context: 'GetRewardsDistribution',
266
+ contextModule: this.module,
267
+ });
268
+ }
269
+ });
270
+ }
271
+ fetchAccountVolumes({ epochId, accountAddress, }) {
272
+ return __awaiter(this, void 0, void 0, function* () {
273
+ const request = dmm_proto_ts_1.InjectiveDmmRpc.GetAccountVolumesRequest.create();
274
+ request.epochId = epochId;
275
+ request.accountAddress = accountAddress;
276
+ try {
277
+ const response = yield this.client.GetAccountVolumes(request);
278
+ return transformers_1.DmmGrpcTransformer.accountVolumesResponseToAccountVolumes(response);
279
+ }
280
+ catch (e) {
281
+ if (e instanceof dmm_proto_ts_1.InjectiveDmmRpc.GrpcWebError) {
282
+ throw new exceptions_1.GrpcUnaryRequestException(new Error(e.toString()), {
283
+ code: e.code,
284
+ context: 'GetAccountVolumes',
285
+ contextModule: this.module,
286
+ });
287
+ }
288
+ throw new exceptions_1.GrpcUnaryRequestException(e, {
289
+ code: exceptions_1.UnspecifiedErrorCode,
290
+ context: 'GetAccountVolumes',
291
+ contextModule: this.module,
292
+ });
293
+ }
294
+ });
295
+ }
296
+ fetchRewardsEligibility({ epochId, accountAddress, }) {
297
+ return __awaiter(this, void 0, void 0, function* () {
298
+ const request = dmm_proto_ts_1.InjectiveDmmRpc.GetRewardsEligibilityRequest.create();
299
+ if (epochId) {
300
+ request.epochId = epochId;
301
+ }
302
+ if (accountAddress) {
303
+ request.accountAddress = accountAddress;
304
+ }
305
+ try {
306
+ const response = yield this.client.GetRewardsEligibility(request);
307
+ return transformers_1.DmmGrpcTransformer.rewardsEligibilityResponseToRewardsEligibility(response);
308
+ }
309
+ catch (e) {
310
+ if (e instanceof dmm_proto_ts_1.InjectiveDmmRpc.GrpcWebError) {
311
+ throw new exceptions_1.GrpcUnaryRequestException(new Error(e.toString()), {
312
+ code: e.code,
313
+ context: 'GetRewardsEligibility',
314
+ contextModule: this.module,
315
+ });
316
+ }
317
+ throw new exceptions_1.GrpcUnaryRequestException(e, {
318
+ code: exceptions_1.UnspecifiedErrorCode,
319
+ context: 'GetRewardsEligibility',
320
+ contextModule: this.module,
321
+ });
322
+ }
323
+ });
324
+ }
325
+ }
326
+ exports.DmmGrpcApi = DmmGrpcApi;
327
+ //# sourceMappingURL=DmmGrpcApi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DmmGrpcApi.js","sourceRoot":"","sources":["../../../../../src/client/dmm/grpc/DmmGrpcApi.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,8DAA6D;AAC7D,yEAAgE;AAChE,iDAAmD;AACnD,0DAIkC;AAElC,MAAa,UAAU;IAGrB,YAAY,QAAgB;QAFlB,WAAM,GAAW,+BAAkB,CAAC,GAAG,CAAA;QAG/C,IAAI,CAAC,MAAM,GAAG,IAAI,8BAAe,CAAC,2BAA2B,CAC3D,IAAA,0CAAiB,EAAC,QAAQ,CAAC,CAC5B,CAAA;IACH,CAAC;IAEK,WAAW,CAAC,MAAe;;YAC/B,MAAM,OAAO,GAA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AAI,CAAC,MAAM;iBAC3B,CAAC,CAAA;aACH;QACH,CAAC;KAAA;CACF;AAraD,gCAqaC"}
@@ -0,0 +1,3 @@
1
+ export * from './DmmGrpcApi';
2
+ export * from './types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/client/dmm/grpc/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./DmmGrpcApi"), exports);
18
+ __exportStar(require("./types"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/client/dmm/grpc/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA4B;AAC5B,0CAAuB"}
@@ -0,0 +1,24 @@
1
+ import { InjectiveDmmRpc } from '@injectivelabs/dmm-proto-ts';
2
+ import { GrpcEpochV2, EpochV2, MarketReward, EligibleAddress, EligibleAddresses, EpochScoresHistory, GrpcMarketReward, GrpcEligibleAddress, GrpcTotalScore, EpochScores, TotalScore, AccountVolume, TotalScores, GrpcEpochScore, EpochScore, TotalScoresHistory, LiquidityScoreSnapshot, LiquiditySnapshots, GrpcLiquidityScoreSnapshot, GrpcRewardDistribution, RewardsDistribution, RewardDistribution, RewardsEligibility, GrpcAccountVolume } from '../types';
3
+ export declare class DmmGrpcTransformer {
4
+ static epochsResponseToEpochs(response: InjectiveDmmRpc.GetEpochsResponse): EpochV2[];
5
+ static grpcEpochToEpoch(epoch: GrpcEpochV2): EpochV2;
6
+ static marketRewardsResponseToMarketRewards(response: InjectiveDmmRpc.GetMarketRewardsResponse): MarketReward[];
7
+ static grpcMarketRewardToMarketReward(marketReward: GrpcMarketReward): MarketReward;
8
+ static eligibleAddressesResponseToEligibleAddresses(response: InjectiveDmmRpc.GetEligibleAddressesResponse): EligibleAddresses;
9
+ static grpcEligibleAddresssesToEligibileAddresses(eligibleAddress: GrpcEligibleAddress): EligibleAddress;
10
+ static epochScoresResponseToEpochScores(response: InjectiveDmmRpc.GetEpochScoresResponse): EpochScores;
11
+ static grpcEpochScoresToEpochScores(score: GrpcEpochScore): EpochScore;
12
+ static epochScoresHistoryResponseToEpochScoresHistory(response: InjectiveDmmRpc.GetEpochScoresHistoryResponse): EpochScoresHistory;
13
+ static totalScoresResponseToTotalScores(response: InjectiveDmmRpc.GetTotalScoresResponse): TotalScores;
14
+ static grpcTotalScoresToTotalScores(score: GrpcTotalScore): TotalScore;
15
+ static totalScoresHistoryResponseToTotalScoresHistory(response: InjectiveDmmRpc.GetTotalScoresHistoryResponse): TotalScoresHistory;
16
+ static liquiditySnapshotsResponseToLiquiditySnapshots(response: InjectiveDmmRpc.GetLiquiditySnapshotsResponse): LiquiditySnapshots;
17
+ static grpcLiquiditySnapshotsToLiquiditySnapshots(snapshot: GrpcLiquidityScoreSnapshot): LiquidityScoreSnapshot;
18
+ static rewardsDistributionResponseToRewardsDistribution(response: InjectiveDmmRpc.GetRewardsDistributionResponse): RewardsDistribution;
19
+ static grpcRewardsDistributionToRewardsDistribution(reward: GrpcRewardDistribution): RewardDistribution;
20
+ static accountVolumesResponseToAccountVolumes(response: InjectiveDmmRpc.GetAccountVolumesResponse): AccountVolume[];
21
+ static grpcAccountVolumesToAccountVolumes(reward: GrpcAccountVolume): AccountVolume;
22
+ static rewardsEligibilityResponseToRewardsEligibility(response: InjectiveDmmRpc.GetRewardsEligibilityResponse): RewardsEligibility;
23
+ }
24
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/client/dmm/grpc/transformers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAC7D,OAAO,EACL,WAAW,EACX,OAAO,EACP,YAAY,EACZ,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,EACd,WAAW,EACX,UAAU,EACV,aAAa,EACb,WAAW,EACX,cAAc,EACd,UAAU,EACV,kBAAkB,EAClB,sBAAsB,EACtB,kBAAkB,EAClB,0BAA0B,EAC1B,sBAAsB,EACtB,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,UAAU,CAAA;AAEjB,qBAAa,kBAAkB;IAC7B,MAAM,CAAC,sBAAsB,CAC3B,QAAQ,EAAE,eAAe,CAAC,iBAAiB,GAC1C,OAAO,EAAE;IAMZ,MAAM,CAAC,gBAAgB,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO;IAcpD,MAAM,CAAC,oCAAoC,CACzC,QAAQ,EAAE,eAAe,CAAC,wBAAwB,GACjD,YAAY,EAAE;IAMjB,MAAM,CAAC,8BAA8B,CACnC,YAAY,EAAE,gBAAgB,GAC7B,YAAY;IAgBf,MAAM,CAAC,4CAA4C,CACjD,QAAQ,EAAE,eAAe,CAAC,4BAA4B,GACrD,iBAAiB;IAWpB,MAAM,CAAC,0CAA0C,CAC/C,eAAe,EAAE,mBAAmB,GACnC,eAA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