@injectivelabs/sdk-ts 1.16.15 → 1.16.17
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/cjs/client/chain/ChainGrpcClient.d.ts +14 -10
- package/dist/cjs/client/chain/ChainGrpcClient.js +26 -20
- package/dist/cjs/client/chain/grpc/ChainGrpcAuthApi.js +2 -2
- package/dist/cjs/client/chain/grpc/ChainGrpcAuthZApi.js +4 -4
- package/dist/cjs/client/chain/grpc/ChainGrpcBankApi.js +5 -5
- package/dist/cjs/client/chain/grpc/ChainGrpcErc20Api.d.ts +28 -0
- package/dist/cjs/client/chain/grpc/ChainGrpcErc20Api.js +124 -0
- package/dist/cjs/client/chain/grpc/ChainGrpcEvmApi.d.ts +30 -0
- package/dist/cjs/client/chain/grpc/ChainGrpcEvmApi.js +198 -0
- package/dist/cjs/client/chain/grpc/ChainGrpcGovApi.js +4 -4
- package/dist/cjs/client/chain/grpc/ChainGrpcIbcApi.js +2 -2
- package/dist/cjs/client/chain/grpc/ChainGrpcStakingApi.js +14 -14
- package/dist/cjs/client/chain/grpc/ChainGrpcWasmApi.js +5 -5
- package/dist/cjs/client/chain/grpc/index.d.ts +15 -13
- package/dist/cjs/client/chain/grpc/index.js +31 -27
- package/dist/cjs/client/chain/transformers/ChainGrpcAuthTransformer.js +2 -2
- package/dist/cjs/client/chain/transformers/ChainGrpcAuthZTransformer.js +4 -4
- package/dist/cjs/client/chain/transformers/ChainGrpcBankTransformer.js +4 -5
- package/dist/cjs/client/chain/transformers/ChainGrpcCommonTransformer.d.ts +5 -0
- package/dist/cjs/client/chain/transformers/ChainGrpcCommonTransformer.js +42 -0
- package/dist/cjs/client/chain/transformers/ChainGrpcErc20Transformer.d.ts +16 -0
- package/dist/cjs/client/chain/transformers/ChainGrpcErc20Transformer.js +31 -0
- package/dist/cjs/client/chain/transformers/ChainGrpcEvmTransformer.d.ts +29 -0
- package/dist/cjs/client/chain/transformers/ChainGrpcEvmTransformer.js +102 -0
- package/dist/cjs/client/chain/transformers/ChainGrpcGovTransformer.js +4 -4
- package/dist/cjs/client/chain/transformers/ChainGrpcStakingTransformer.js +5 -5
- package/dist/cjs/client/chain/transformers/ChainGrpcWasmTransformer.js +6 -6
- package/dist/cjs/client/chain/transformers/index.d.ts +13 -10
- package/dist/cjs/client/chain/transformers/index.js +13 -10
- package/dist/cjs/client/chain/types/erc20.d.ts +13 -0
- package/dist/cjs/client/chain/types/erc20.js +2 -0
- package/dist/cjs/client/chain/types/evm.d.ts +62 -0
- package/dist/cjs/client/chain/types/evm.js +2 -0
- package/dist/cjs/client/chain/types/index.d.ts +20 -16
- package/dist/cjs/client/indexer/grpc/IndexerGrpcAuctionApi.d.ts +19 -1
- package/dist/cjs/client/indexer/grpc/IndexerGrpcAuctionApi.js +79 -1
- package/dist/cjs/client/indexer/grpc/IndexerGrpcMegaVaultApi.d.ts +45 -0
- package/dist/cjs/client/indexer/grpc/IndexerGrpcMegaVaultApi.js +207 -0
- package/dist/cjs/client/indexer/grpc/index.d.ts +1 -0
- package/dist/cjs/client/indexer/grpc/index.js +3 -1
- package/dist/cjs/client/indexer/grpc_stream/IndexerGrpcArchiverStream.d.ts +18 -0
- package/dist/cjs/client/indexer/grpc_stream/IndexerGrpcArchiverStream.js +38 -0
- package/dist/cjs/client/indexer/grpc_stream/index.d.ts +1 -0
- package/dist/cjs/client/indexer/grpc_stream/index.js +1 -0
- package/dist/cjs/client/indexer/transformers/IndexerArchiverStreamTransformer.d.ts +11 -0
- package/dist/cjs/client/indexer/transformers/IndexerArchiverStreamTransformer.js +21 -0
- package/dist/cjs/client/indexer/transformers/IndexerAuctionStreamTransformer.d.ts +2 -2
- package/dist/cjs/client/indexer/transformers/IndexerGrpcArchiverTransformer.d.ts +2 -1
- package/dist/cjs/client/indexer/transformers/IndexerGrpcArchiverTransformer.js +8 -0
- package/dist/cjs/client/indexer/transformers/IndexerGrpcAuctionTransformer.d.ts +18 -6
- package/dist/cjs/client/indexer/transformers/IndexerGrpcAuctionTransformer.js +51 -9
- package/dist/cjs/client/indexer/transformers/IndexerGrpcMegaVaultTransformer.d.ts +30 -0
- package/dist/cjs/client/indexer/transformers/IndexerGrpcMegaVaultTransformer.js +230 -0
- package/dist/cjs/client/indexer/transformers/index.d.ts +3 -1
- package/dist/cjs/client/indexer/transformers/index.js +3 -1
- package/dist/cjs/client/indexer/types/archiver.d.ts +7 -0
- package/dist/cjs/client/indexer/types/auction.d.ts +49 -5
- package/dist/cjs/client/indexer/types/index.d.ts +16 -14
- package/dist/cjs/client/indexer/types/mega-vault.d.ts +153 -0
- package/dist/cjs/client/indexer/types/mega-vault.js +11 -0
- package/dist/cjs/core/modules/exchange/index.d.ts +2 -1
- package/dist/cjs/core/modules/exchange/index.js +3 -1
- package/dist/cjs/core/modules/exchange/msgs/MsgCancelPostOnlyModeV2.d.ts +44 -0
- package/dist/cjs/core/modules/exchange/msgs/MsgCancelPostOnlyModeV2.js +83 -0
- package/dist/cjs/core/modules/msgs.d.ts +2 -1
- package/dist/cjs/utils/pagination.d.ts +11 -12
- package/dist/cjs/utils/pagination.js +14 -72
- package/dist/esm/client/chain/ChainGrpcClient.d.ts +14 -10
- package/dist/esm/client/chain/ChainGrpcClient.js +26 -20
- package/dist/esm/client/chain/grpc/ChainGrpcAuthApi.js +2 -2
- package/dist/esm/client/chain/grpc/ChainGrpcAuthZApi.js +4 -4
- package/dist/esm/client/chain/grpc/ChainGrpcBankApi.js +5 -5
- package/dist/esm/client/chain/grpc/ChainGrpcErc20Api.d.ts +28 -0
- package/dist/esm/client/chain/grpc/ChainGrpcErc20Api.js +117 -0
- package/dist/esm/client/chain/grpc/ChainGrpcEvmApi.d.ts +30 -0
- package/dist/esm/client/chain/grpc/ChainGrpcEvmApi.js +191 -0
- package/dist/esm/client/chain/grpc/ChainGrpcGovApi.js +4 -4
- package/dist/esm/client/chain/grpc/ChainGrpcIbcApi.js +2 -2
- package/dist/esm/client/chain/grpc/ChainGrpcStakingApi.js +14 -14
- package/dist/esm/client/chain/grpc/ChainGrpcWasmApi.js +5 -5
- package/dist/esm/client/chain/grpc/index.d.ts +15 -13
- package/dist/esm/client/chain/grpc/index.js +15 -13
- package/dist/esm/client/chain/transformers/ChainGrpcAuthTransformer.js +2 -2
- package/dist/esm/client/chain/transformers/ChainGrpcAuthZTransformer.js +4 -4
- package/dist/esm/client/chain/transformers/ChainGrpcBankTransformer.js +4 -5
- package/dist/esm/client/chain/transformers/ChainGrpcCommonTransformer.d.ts +5 -0
- package/dist/esm/client/chain/transformers/ChainGrpcCommonTransformer.js +42 -0
- package/dist/esm/client/chain/transformers/ChainGrpcErc20Transformer.d.ts +16 -0
- package/dist/esm/client/chain/transformers/ChainGrpcErc20Transformer.js +27 -0
- package/dist/esm/client/chain/transformers/ChainGrpcEvmTransformer.d.ts +29 -0
- package/dist/esm/client/chain/transformers/ChainGrpcEvmTransformer.js +98 -0
- package/dist/esm/client/chain/transformers/ChainGrpcGovTransformer.js +4 -4
- package/dist/esm/client/chain/transformers/ChainGrpcStakingTransformer.js +5 -5
- package/dist/esm/client/chain/transformers/ChainGrpcWasmTransformer.js +6 -6
- package/dist/esm/client/chain/transformers/index.d.ts +13 -10
- package/dist/esm/client/chain/transformers/index.js +13 -10
- package/dist/esm/client/chain/types/erc20.d.ts +13 -0
- package/dist/esm/client/chain/types/erc20.js +1 -0
- package/dist/esm/client/chain/types/evm.d.ts +62 -0
- package/dist/esm/client/chain/types/evm.js +1 -0
- package/dist/esm/client/chain/types/index.d.ts +20 -16
- package/dist/esm/client/indexer/grpc/IndexerGrpcAuctionApi.d.ts +19 -1
- package/dist/esm/client/indexer/grpc/IndexerGrpcAuctionApi.js +79 -1
- package/dist/esm/client/indexer/grpc/IndexerGrpcMegaVaultApi.d.ts +45 -0
- package/dist/esm/client/indexer/grpc/IndexerGrpcMegaVaultApi.js +200 -0
- package/dist/esm/client/indexer/grpc/index.d.ts +1 -0
- package/dist/esm/client/indexer/grpc/index.js +1 -0
- package/dist/esm/client/indexer/grpc_stream/IndexerGrpcArchiverStream.d.ts +18 -0
- package/dist/esm/client/indexer/grpc_stream/IndexerGrpcArchiverStream.js +34 -0
- package/dist/esm/client/indexer/grpc_stream/index.d.ts +1 -0
- package/dist/esm/client/indexer/grpc_stream/index.js +1 -0
- package/dist/esm/client/indexer/transformers/IndexerArchiverStreamTransformer.d.ts +11 -0
- package/dist/esm/client/indexer/transformers/IndexerArchiverStreamTransformer.js +17 -0
- package/dist/esm/client/indexer/transformers/IndexerAuctionStreamTransformer.d.ts +2 -2
- package/dist/esm/client/indexer/transformers/IndexerGrpcArchiverTransformer.d.ts +2 -1
- package/dist/esm/client/indexer/transformers/IndexerGrpcArchiverTransformer.js +8 -0
- package/dist/esm/client/indexer/transformers/IndexerGrpcAuctionTransformer.d.ts +18 -6
- package/dist/esm/client/indexer/transformers/IndexerGrpcAuctionTransformer.js +51 -9
- package/dist/esm/client/indexer/transformers/IndexerGrpcMegaVaultTransformer.d.ts +30 -0
- package/dist/esm/client/indexer/transformers/IndexerGrpcMegaVaultTransformer.js +226 -0
- package/dist/esm/client/indexer/transformers/index.d.ts +3 -1
- package/dist/esm/client/indexer/transformers/index.js +3 -1
- package/dist/esm/client/indexer/types/archiver.d.ts +7 -0
- package/dist/esm/client/indexer/types/auction.d.ts +49 -5
- package/dist/esm/client/indexer/types/index.d.ts +16 -14
- package/dist/esm/client/indexer/types/mega-vault.d.ts +153 -0
- package/dist/esm/client/indexer/types/mega-vault.js +10 -0
- package/dist/esm/core/modules/exchange/index.d.ts +2 -1
- package/dist/esm/core/modules/exchange/index.js +2 -1
- package/dist/esm/core/modules/exchange/msgs/MsgCancelPostOnlyModeV2.d.ts +44 -0
- package/dist/esm/core/modules/exchange/msgs/MsgCancelPostOnlyModeV2.js +77 -0
- package/dist/esm/core/modules/msgs.d.ts +2 -1
- package/dist/esm/utils/pagination.d.ts +11 -12
- package/dist/esm/utils/pagination.js +13 -69
- package/package.json +7 -7
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.IndexerGrpcMegaVaultApi = void 0;
|
|
7
|
+
const indexer_proto_ts_1 = require("@injectivelabs/indexer-proto-ts");
|
|
8
|
+
const exceptions_1 = require("@injectivelabs/exceptions");
|
|
9
|
+
const index_js_1 = require("../types/index.js");
|
|
10
|
+
const BaseIndexerGrpcConsumer_js_1 = __importDefault(require("../../base/BaseIndexerGrpcConsumer.js"));
|
|
11
|
+
const index_js_2 = require("../transformers/index.js");
|
|
12
|
+
/**
|
|
13
|
+
* @category Indexer Grpc API
|
|
14
|
+
*/
|
|
15
|
+
class IndexerGrpcMegaVaultApi extends BaseIndexerGrpcConsumer_js_1.default {
|
|
16
|
+
module = index_js_1.IndexerModule.MegaVault;
|
|
17
|
+
client;
|
|
18
|
+
constructor(endpoint) {
|
|
19
|
+
super(endpoint);
|
|
20
|
+
this.client = new indexer_proto_ts_1.InjectiveMegaVaultRpc.InjectiveMegavaultRPCClientImpl(this.getGrpcWebImpl(endpoint));
|
|
21
|
+
}
|
|
22
|
+
async fetchVault({ vaultAddress }) {
|
|
23
|
+
const request = indexer_proto_ts_1.InjectiveMegaVaultRpc.GetVaultRequest.create();
|
|
24
|
+
request.vaultAddress = vaultAddress;
|
|
25
|
+
try {
|
|
26
|
+
const response = await this.retry(() => this.client.GetVault(request, this.metadata));
|
|
27
|
+
return index_js_2.IndexerGrpcMegaVaultTransformer.vaultResponseToVault(response);
|
|
28
|
+
}
|
|
29
|
+
catch (e) {
|
|
30
|
+
if (e instanceof indexer_proto_ts_1.InjectiveMegaVaultRpc.GrpcWebError) {
|
|
31
|
+
throw new exceptions_1.GrpcUnaryRequestException(new Error(e.toString()), {
|
|
32
|
+
code: e.code,
|
|
33
|
+
context: 'fetchVault',
|
|
34
|
+
contextModule: this.module,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
throw new exceptions_1.GrpcUnaryRequestException(e, {
|
|
38
|
+
code: exceptions_1.UnspecifiedErrorCode,
|
|
39
|
+
context: 'fetchVault',
|
|
40
|
+
contextModule: this.module,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
async fetchVaultUser({ vaultAddress, userAddress, }) {
|
|
45
|
+
const request = indexer_proto_ts_1.InjectiveMegaVaultRpc.GetUserRequest.create();
|
|
46
|
+
request.vaultAddress = vaultAddress;
|
|
47
|
+
request.userAddress = userAddress;
|
|
48
|
+
try {
|
|
49
|
+
const response = await this.retry(() => this.client.GetUser(request, this.metadata));
|
|
50
|
+
return index_js_2.IndexerGrpcMegaVaultTransformer.userResponseToUser(response);
|
|
51
|
+
}
|
|
52
|
+
catch (e) {
|
|
53
|
+
if (e instanceof indexer_proto_ts_1.InjectiveMegaVaultRpc.GrpcWebError) {
|
|
54
|
+
throw new exceptions_1.GrpcUnaryRequestException(new Error(e.toString()), {
|
|
55
|
+
code: e.code,
|
|
56
|
+
context: 'fetchVaultUser',
|
|
57
|
+
contextModule: this.module,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
throw new exceptions_1.GrpcUnaryRequestException(e, {
|
|
61
|
+
code: exceptions_1.UnspecifiedErrorCode,
|
|
62
|
+
context: 'fetchVaultUser',
|
|
63
|
+
contextModule: this.module,
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
async fetchVaultSubscriptions({ token, status, perPage, userAddress, vaultAddress, }) {
|
|
68
|
+
const request = indexer_proto_ts_1.InjectiveMegaVaultRpc.ListSubscriptionsRequest.create();
|
|
69
|
+
request.vaultAddress = vaultAddress;
|
|
70
|
+
request.userAddress = userAddress;
|
|
71
|
+
if (status) {
|
|
72
|
+
request.status = status;
|
|
73
|
+
}
|
|
74
|
+
if (perPage) {
|
|
75
|
+
request.perPage = perPage;
|
|
76
|
+
}
|
|
77
|
+
if (token) {
|
|
78
|
+
request.token = token;
|
|
79
|
+
}
|
|
80
|
+
try {
|
|
81
|
+
const response = await this.retry(() => this.client.ListSubscriptions(request, this.metadata));
|
|
82
|
+
return index_js_2.IndexerGrpcMegaVaultTransformer.subscriptionsResponseToSubscriptions(response);
|
|
83
|
+
}
|
|
84
|
+
catch (e) {
|
|
85
|
+
if (e instanceof indexer_proto_ts_1.InjectiveMegaVaultRpc.GrpcWebError) {
|
|
86
|
+
throw new exceptions_1.GrpcUnaryRequestException(new Error(e.toString()), {
|
|
87
|
+
code: e.code,
|
|
88
|
+
context: 'fetchVaultSubscriptions',
|
|
89
|
+
contextModule: this.module,
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
throw new exceptions_1.GrpcUnaryRequestException(e, {
|
|
93
|
+
code: exceptions_1.UnspecifiedErrorCode,
|
|
94
|
+
context: 'fetchVaultSubscriptions',
|
|
95
|
+
contextModule: this.module,
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
async fetchVaultRedemptions({ token, status, perPage, userAddress, vaultAddress, }) {
|
|
100
|
+
const request = indexer_proto_ts_1.InjectiveMegaVaultRpc.ListRedemptionsRequest.create();
|
|
101
|
+
request.vaultAddress = vaultAddress;
|
|
102
|
+
request.userAddress = userAddress;
|
|
103
|
+
if (status) {
|
|
104
|
+
request.status = status;
|
|
105
|
+
}
|
|
106
|
+
if (perPage) {
|
|
107
|
+
request.perPage = perPage;
|
|
108
|
+
}
|
|
109
|
+
if (token) {
|
|
110
|
+
request.token = token;
|
|
111
|
+
}
|
|
112
|
+
try {
|
|
113
|
+
const response = await this.retry(() => this.client.ListRedemptions(request, this.metadata));
|
|
114
|
+
return index_js_2.IndexerGrpcMegaVaultTransformer.redemptionsResponseToRedemptions(response);
|
|
115
|
+
}
|
|
116
|
+
catch (e) {
|
|
117
|
+
if (e instanceof indexer_proto_ts_1.InjectiveMegaVaultRpc.GrpcWebError) {
|
|
118
|
+
throw new exceptions_1.GrpcUnaryRequestException(new Error(e.toString()), {
|
|
119
|
+
code: e.code,
|
|
120
|
+
context: 'fetchVaultRedemptions',
|
|
121
|
+
contextModule: this.module,
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
throw new exceptions_1.GrpcUnaryRequestException(e, {
|
|
125
|
+
code: exceptions_1.UnspecifiedErrorCode,
|
|
126
|
+
context: 'fetchVaultRedemptions',
|
|
127
|
+
contextModule: this.module,
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
async fetchOperatorRedemptionBuckets({ vaultAddress, operatorAddress, }) {
|
|
132
|
+
const request = indexer_proto_ts_1.InjectiveMegaVaultRpc.GetOperatorRedemptionBucketsRequest.create();
|
|
133
|
+
request.vaultAddress = vaultAddress;
|
|
134
|
+
request.operatorAddress = operatorAddress;
|
|
135
|
+
try {
|
|
136
|
+
const response = await this.retry(() => this.client.GetOperatorRedemptionBuckets(request, this.metadata));
|
|
137
|
+
return index_js_2.IndexerGrpcMegaVaultTransformer.operatorRedemptionBucketsResponseToOperatorRedemptionBuckets(response);
|
|
138
|
+
}
|
|
139
|
+
catch (e) {
|
|
140
|
+
if (e instanceof indexer_proto_ts_1.InjectiveMegaVaultRpc.GrpcWebError) {
|
|
141
|
+
throw new exceptions_1.GrpcUnaryRequestException(new Error(e.toString()), {
|
|
142
|
+
code: e.code,
|
|
143
|
+
context: 'fetchOperatorRedemptionBuckets',
|
|
144
|
+
contextModule: this.module,
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
throw new exceptions_1.GrpcUnaryRequestException(e, {
|
|
148
|
+
code: exceptions_1.UnspecifiedErrorCode,
|
|
149
|
+
context: 'fetchOperatorRedemptionBuckets',
|
|
150
|
+
contextModule: this.module,
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
async fetchVaultTvlHistory({ since, vaultAddress, maxDataPoints, }) {
|
|
155
|
+
const request = indexer_proto_ts_1.InjectiveMegaVaultRpc.TvlHistoryRequest.create();
|
|
156
|
+
request.vaultAddress = vaultAddress;
|
|
157
|
+
request.since = since.toString();
|
|
158
|
+
if (maxDataPoints) {
|
|
159
|
+
request.maxDataPoints = maxDataPoints;
|
|
160
|
+
}
|
|
161
|
+
try {
|
|
162
|
+
const response = await this.retry(() => this.client.TvlHistory(request, this.metadata));
|
|
163
|
+
return index_js_2.IndexerGrpcMegaVaultTransformer.tvlHistoryResponseToTvlHistory(response);
|
|
164
|
+
}
|
|
165
|
+
catch (e) {
|
|
166
|
+
if (e instanceof indexer_proto_ts_1.InjectiveMegaVaultRpc.GrpcWebError) {
|
|
167
|
+
throw new exceptions_1.GrpcUnaryRequestException(new Error(e.toString()), {
|
|
168
|
+
code: e.code,
|
|
169
|
+
context: 'fetchVaultTvlHistory',
|
|
170
|
+
contextModule: this.module,
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
throw new exceptions_1.GrpcUnaryRequestException(e, {
|
|
174
|
+
code: exceptions_1.UnspecifiedErrorCode,
|
|
175
|
+
context: 'fetchVaultTvlHistory',
|
|
176
|
+
contextModule: this.module,
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
async fetchVaultPnlHistory({ since, vaultAddress, maxDataPoints, }) {
|
|
181
|
+
const request = indexer_proto_ts_1.InjectiveMegaVaultRpc.PnlHistoryRequest.create();
|
|
182
|
+
request.vaultAddress = vaultAddress;
|
|
183
|
+
request.since = since.toString();
|
|
184
|
+
if (maxDataPoints) {
|
|
185
|
+
request.maxDataPoints = maxDataPoints;
|
|
186
|
+
}
|
|
187
|
+
try {
|
|
188
|
+
const response = await this.retry(() => this.client.PnlHistory(request, this.metadata));
|
|
189
|
+
return index_js_2.IndexerGrpcMegaVaultTransformer.pnlHistoryResponseToPnlHistory(response);
|
|
190
|
+
}
|
|
191
|
+
catch (e) {
|
|
192
|
+
if (e instanceof indexer_proto_ts_1.InjectiveMegaVaultRpc.GrpcWebError) {
|
|
193
|
+
throw new exceptions_1.GrpcUnaryRequestException(new Error(e.toString()), {
|
|
194
|
+
code: e.code,
|
|
195
|
+
context: 'fetchVaultPnlHistory',
|
|
196
|
+
contextModule: this.module,
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
throw new exceptions_1.GrpcUnaryRequestException(e, {
|
|
200
|
+
code: exceptions_1.UnspecifiedErrorCode,
|
|
201
|
+
context: 'fetchVaultPnlHistory',
|
|
202
|
+
contextModule: this.module,
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
exports.IndexerGrpcMegaVaultApi = IndexerGrpcMegaVaultApi;
|
|
@@ -10,6 +10,7 @@ export { IndexerGrpcExplorerApi } from './IndexerGrpcExplorerApi.js';
|
|
|
10
10
|
export { IndexerGrpcCampaignApi } from './IndexerGrpcCampaignApi.js';
|
|
11
11
|
export { IndexerGrpcArchiverApi } from './IndexerGrpcArchiverApi.js';
|
|
12
12
|
export { IndexerGrpcReferralApi } from './IndexerGrpcReferralApi.js';
|
|
13
|
+
export { IndexerGrpcMegaVaultApi } from './IndexerGrpcMegaVaultApi.js';
|
|
13
14
|
export { IndexerGrpcDerivativesApi } from './IndexerGrpcDerivativesApi.js';
|
|
14
15
|
export { IndexerGrpcTransactionApi } from './IndexerGrpcTransactionApi.js';
|
|
15
16
|
export { IndexerGrpcAccountPortfolioApi } from './IndexerGrpcPortfolioApi.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IndexerGrpcInsuranceFundApi = exports.IndexerGrpcAccountPortfolioApi = exports.IndexerGrpcTransactionApi = exports.IndexerGrpcDerivativesApi = exports.IndexerGrpcReferralApi = exports.IndexerGrpcArchiverApi = exports.IndexerGrpcCampaignApi = exports.IndexerGrpcExplorerApi = exports.IndexerGrpcTradingApi = exports.IndexerGrpcAuctionApi = exports.IndexerGrpcAccountApi = exports.IndexerGrpcWeb3GwApi = exports.IndexerGrpcOracleApi = exports.IndexerGrpcSpotApi = exports.IndexerGrpcMetaApi = exports.IndexerGrpcMitoApi = void 0;
|
|
3
|
+
exports.IndexerGrpcInsuranceFundApi = exports.IndexerGrpcAccountPortfolioApi = exports.IndexerGrpcTransactionApi = exports.IndexerGrpcDerivativesApi = exports.IndexerGrpcMegaVaultApi = exports.IndexerGrpcReferralApi = exports.IndexerGrpcArchiverApi = exports.IndexerGrpcCampaignApi = exports.IndexerGrpcExplorerApi = exports.IndexerGrpcTradingApi = exports.IndexerGrpcAuctionApi = exports.IndexerGrpcAccountApi = exports.IndexerGrpcWeb3GwApi = exports.IndexerGrpcOracleApi = exports.IndexerGrpcSpotApi = exports.IndexerGrpcMetaApi = exports.IndexerGrpcMitoApi = void 0;
|
|
4
4
|
var IndexerGrpcMitoApi_js_1 = require("./IndexerGrpcMitoApi.js");
|
|
5
5
|
Object.defineProperty(exports, "IndexerGrpcMitoApi", { enumerable: true, get: function () { return IndexerGrpcMitoApi_js_1.IndexerGrpcMitoApi; } });
|
|
6
6
|
var IndexerGrpcMetaApi_js_1 = require("./IndexerGrpcMetaApi.js");
|
|
@@ -25,6 +25,8 @@ var IndexerGrpcArchiverApi_js_1 = require("./IndexerGrpcArchiverApi.js");
|
|
|
25
25
|
Object.defineProperty(exports, "IndexerGrpcArchiverApi", { enumerable: true, get: function () { return IndexerGrpcArchiverApi_js_1.IndexerGrpcArchiverApi; } });
|
|
26
26
|
var IndexerGrpcReferralApi_js_1 = require("./IndexerGrpcReferralApi.js");
|
|
27
27
|
Object.defineProperty(exports, "IndexerGrpcReferralApi", { enumerable: true, get: function () { return IndexerGrpcReferralApi_js_1.IndexerGrpcReferralApi; } });
|
|
28
|
+
var IndexerGrpcMegaVaultApi_js_1 = require("./IndexerGrpcMegaVaultApi.js");
|
|
29
|
+
Object.defineProperty(exports, "IndexerGrpcMegaVaultApi", { enumerable: true, get: function () { return IndexerGrpcMegaVaultApi_js_1.IndexerGrpcMegaVaultApi; } });
|
|
28
30
|
var IndexerGrpcDerivativesApi_js_1 = require("./IndexerGrpcDerivativesApi.js");
|
|
29
31
|
Object.defineProperty(exports, "IndexerGrpcDerivativesApi", { enumerable: true, get: function () { return IndexerGrpcDerivativesApi_js_1.IndexerGrpcDerivativesApi; } });
|
|
30
32
|
var IndexerGrpcTransactionApi_js_1 = require("./IndexerGrpcTransactionApi.js");
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { InjectiveArchiverRpc } from '@injectivelabs/indexer-proto-ts';
|
|
2
|
+
import { IndexerArchiverStreamTransformer } from '../transformers/index.js';
|
|
3
|
+
import type { Subscription } from 'rxjs';
|
|
4
|
+
import type { StreamStatusResponse } from '../types/index.js';
|
|
5
|
+
export type SpotAverageEntriesStreamCallback = (response: ReturnType<typeof IndexerArchiverStreamTransformer.spotAverageEntriesStreamCallback>) => void;
|
|
6
|
+
/**
|
|
7
|
+
* @category Indexer Grpc Stream
|
|
8
|
+
*/
|
|
9
|
+
export declare class IndexerGrpcArchiverStream {
|
|
10
|
+
protected client: InjectiveArchiverRpc.InjectiveArchiverRPCClientImpl;
|
|
11
|
+
constructor(endpoint: string);
|
|
12
|
+
streamSpotAverageEntries({ account, callback, onEndCallback, onStatusCallback, }: {
|
|
13
|
+
account: string;
|
|
14
|
+
callback: SpotAverageEntriesStreamCallback;
|
|
15
|
+
onEndCallback?: (status?: StreamStatusResponse) => void;
|
|
16
|
+
onStatusCallback?: (status: StreamStatusResponse) => void;
|
|
17
|
+
}): Subscription;
|
|
18
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IndexerGrpcArchiverStream = void 0;
|
|
4
|
+
const indexer_proto_ts_1 = require("@injectivelabs/indexer-proto-ts");
|
|
5
|
+
const index_js_1 = require("../transformers/index.js");
|
|
6
|
+
const BaseIndexerGrpcWebConsumer_js_1 = require("../../base/BaseIndexerGrpcWebConsumer.js");
|
|
7
|
+
/**
|
|
8
|
+
* @category Indexer Grpc Stream
|
|
9
|
+
*/
|
|
10
|
+
class IndexerGrpcArchiverStream {
|
|
11
|
+
client;
|
|
12
|
+
constructor(endpoint) {
|
|
13
|
+
this.client = new indexer_proto_ts_1.InjectiveArchiverRpc.InjectiveArchiverRPCClientImpl((0, BaseIndexerGrpcWebConsumer_js_1.getGrpcIndexerWebImpl)(endpoint));
|
|
14
|
+
}
|
|
15
|
+
streamSpotAverageEntries({ account, callback, onEndCallback, onStatusCallback, }) {
|
|
16
|
+
const request = indexer_proto_ts_1.InjectiveArchiverRpc.StreamSpotAverageEntriesRequest.create();
|
|
17
|
+
request.account = account;
|
|
18
|
+
const subscription = this.client
|
|
19
|
+
.StreamSpotAverageEntries(request)
|
|
20
|
+
.subscribe({
|
|
21
|
+
next(response) {
|
|
22
|
+
callback(index_js_1.IndexerArchiverStreamTransformer.spotAverageEntriesStreamCallback(response));
|
|
23
|
+
},
|
|
24
|
+
error(err) {
|
|
25
|
+
if (onStatusCallback) {
|
|
26
|
+
onStatusCallback(err);
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
complete() {
|
|
30
|
+
if (onEndCallback) {
|
|
31
|
+
onEndCallback();
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
return subscription;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.IndexerGrpcArchiverStream = IndexerGrpcArchiverStream;
|
|
@@ -4,6 +4,7 @@ export * from './IndexerGrpcOracleStream.js';
|
|
|
4
4
|
export * from './IndexerGrpcAccountStream.js';
|
|
5
5
|
export * from './IndexerGrpcAuctionStream.js';
|
|
6
6
|
export * from './IndexerGrpcTradingStream.js';
|
|
7
|
+
export * from './IndexerGrpcArchiverStream.js';
|
|
7
8
|
export * from './IndexerGrpcExplorerStream.js';
|
|
8
9
|
export * from './IndexerGrpcDerivativesStream.js';
|
|
9
10
|
export * from './IndexerGrpcAccountPortfolioStream.js';
|
|
@@ -20,6 +20,7 @@ __exportStar(require("./IndexerGrpcOracleStream.js"), exports);
|
|
|
20
20
|
__exportStar(require("./IndexerGrpcAccountStream.js"), exports);
|
|
21
21
|
__exportStar(require("./IndexerGrpcAuctionStream.js"), exports);
|
|
22
22
|
__exportStar(require("./IndexerGrpcTradingStream.js"), exports);
|
|
23
|
+
__exportStar(require("./IndexerGrpcArchiverStream.js"), exports);
|
|
23
24
|
__exportStar(require("./IndexerGrpcExplorerStream.js"), exports);
|
|
24
25
|
__exportStar(require("./IndexerGrpcDerivativesStream.js"), exports);
|
|
25
26
|
__exportStar(require("./IndexerGrpcAccountPortfolioStream.js"), exports);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { InjectiveArchiverRpc } from '@injectivelabs/indexer-proto-ts';
|
|
2
|
+
/**
|
|
3
|
+
* @category Indexer Stream Transformer
|
|
4
|
+
*/
|
|
5
|
+
export declare class IndexerArchiverStreamTransformer {
|
|
6
|
+
static spotAverageEntriesStreamCallback: (response: InjectiveArchiverRpc.StreamSpotAverageEntriesResponse) => {
|
|
7
|
+
averageEntry: import("../index.js").SpotAverageEntry | undefined;
|
|
8
|
+
operation: "update";
|
|
9
|
+
timestamp: string;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IndexerArchiverStreamTransformer = void 0;
|
|
4
|
+
const index_js_1 = require("../../../types/index.js");
|
|
5
|
+
const IndexerGrpcArchiverTransformer_js_1 = require("./IndexerGrpcArchiverTransformer.js");
|
|
6
|
+
/**
|
|
7
|
+
* @category Indexer Stream Transformer
|
|
8
|
+
*/
|
|
9
|
+
class IndexerArchiverStreamTransformer {
|
|
10
|
+
static spotAverageEntriesStreamCallback = (response) => {
|
|
11
|
+
const averageEntry = response.averageEntry;
|
|
12
|
+
return {
|
|
13
|
+
averageEntry: averageEntry
|
|
14
|
+
? IndexerGrpcArchiverTransformer_js_1.IndexerGrpcArchiverTransformer.grpcSpotAverageEntryToSpotAverageEntry(averageEntry)
|
|
15
|
+
: undefined,
|
|
16
|
+
operation: index_js_1.StreamOperation.Update,
|
|
17
|
+
timestamp: response.timestamp,
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
exports.IndexerArchiverStreamTransformer = IndexerArchiverStreamTransformer;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IndexerAuctionBid } from '../types/index.js';
|
|
2
2
|
import type { InjectiveAuctionRpc } from '@injectivelabs/indexer-proto-ts';
|
|
3
3
|
/**
|
|
4
4
|
* @category Indexer Stream Transformer
|
|
5
5
|
*/
|
|
6
6
|
export declare class IndexerAuctionStreamTransformer {
|
|
7
7
|
static bidsStreamCallback: (response: InjectiveAuctionRpc.StreamBidsResponse) => {
|
|
8
|
-
bid:
|
|
8
|
+
bid: IndexerAuctionBid;
|
|
9
9
|
operation: "insert";
|
|
10
10
|
};
|
|
11
11
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { InjectiveArchiverRpc } from '@injectivelabs/indexer-proto-ts';
|
|
2
|
-
import type { AccountStats, DenomHolders, HistoricalRPNL, LeaderboardRow, PnlLeaderboard, VolLeaderboard, HistoricalBalance, HistoricalVolumes } from '../types/archiver.js';
|
|
2
|
+
import type { AccountStats, DenomHolders, HistoricalRPNL, LeaderboardRow, PnlLeaderboard, VolLeaderboard, SpotAverageEntry, HistoricalBalance, HistoricalVolumes } from '../types/archiver.js';
|
|
3
3
|
/**
|
|
4
4
|
* @category Indexer Grpc Transformer
|
|
5
5
|
*/
|
|
@@ -17,4 +17,5 @@ export declare class IndexerGrpcArchiverTransformer {
|
|
|
17
17
|
static grpcVolLeaderboardFixedResolutionResponseToVolLeaderboard(response: InjectiveArchiverRpc.VolLeaderboardFixedResolutionResponse): VolLeaderboard;
|
|
18
18
|
static grpcDenomHoldersResponseToDenomHolders(response: InjectiveArchiverRpc.DenomHoldersResponse): DenomHolders;
|
|
19
19
|
static grpcAccountStatsResponseToAccountStats(response: InjectiveArchiverRpc.AccountStatsResponse): AccountStats;
|
|
20
|
+
static grpcSpotAverageEntryToSpotAverageEntry(averageEntry: InjectiveArchiverRpc.SpotAverageEntry): SpotAverageEntry;
|
|
20
21
|
}
|
|
@@ -105,5 +105,13 @@ class IndexerGrpcArchiverTransformer {
|
|
|
105
105
|
volume: response.volume,
|
|
106
106
|
};
|
|
107
107
|
}
|
|
108
|
+
static grpcSpotAverageEntryToSpotAverageEntry(averageEntry) {
|
|
109
|
+
return {
|
|
110
|
+
marketId: averageEntry.marketId,
|
|
111
|
+
averageEntryPrice: averageEntry.averageEntryPrice,
|
|
112
|
+
quantity: averageEntry.quantity,
|
|
113
|
+
usdValue: averageEntry.usdValue,
|
|
114
|
+
};
|
|
115
|
+
}
|
|
108
116
|
}
|
|
109
117
|
exports.IndexerGrpcArchiverTransformer = IndexerGrpcArchiverTransformer;
|
|
@@ -1,15 +1,27 @@
|
|
|
1
1
|
import type { InjectiveAuctionRpc } from '@injectivelabs/indexer-proto-ts';
|
|
2
|
-
import type { Auction,
|
|
2
|
+
import type { Auction, AuctionV2, AuctionCoin, GrpcAuction, GrpcAuctionV2, GrpcAuctionCoin, AccountAuctionV2, AuctionCoinPrices, IndexerAuctionBid, GrpcAccountAuctionV2, GrpcIndexerAuctionBid, GrpcAuctionCoinPrices } from '../types/auction.js';
|
|
3
3
|
/**
|
|
4
4
|
* @category Indexer Grpc Transformer
|
|
5
5
|
*/
|
|
6
6
|
export declare class IndexerGrpcAuctionTransformer {
|
|
7
|
+
static grpcAuctionCoinToAuctionCoin(grpcCoin: GrpcAuctionCoin): AuctionCoin;
|
|
8
|
+
static grpcAuctionCoinPricesToAuctionCoinPrices(grpcCoinPrices: GrpcAuctionCoinPrices): AuctionCoinPrices;
|
|
9
|
+
static grpcBidToBid(grpcBid: GrpcIndexerAuctionBid): IndexerAuctionBid;
|
|
10
|
+
static grpcAuctionToAuction(grpcAuction: GrpcAuction): Auction;
|
|
11
|
+
static grpcAuctionV2ToAuctionV2(grpcAuction: GrpcAuctionV2): AuctionV2;
|
|
12
|
+
static grpcAccountAuctionV2ToAccountAuctionV2(grpcAccountAuction: GrpcAccountAuctionV2): AccountAuctionV2;
|
|
13
|
+
static auctionsResponseToAuctions(response: InjectiveAuctionRpc.AuctionsResponse): Auction[];
|
|
14
|
+
static auctionsHistoryV2ResponseToAuctionHistory(response: InjectiveAuctionRpc.AuctionsHistoryV2Response): {
|
|
15
|
+
auctions: AuctionV2[];
|
|
16
|
+
next: string[];
|
|
17
|
+
};
|
|
18
|
+
static accountAuctionsV2ResponseToAccountAuctionsV2(response: InjectiveAuctionRpc.AccountAuctionsV2Response): {
|
|
19
|
+
auctions: AccountAuctionV2[];
|
|
20
|
+
next: string[];
|
|
21
|
+
total: string;
|
|
22
|
+
};
|
|
7
23
|
static auctionResponseToAuction(response: InjectiveAuctionRpc.AuctionEndpointResponse): {
|
|
8
24
|
auction: Auction;
|
|
9
|
-
bids:
|
|
25
|
+
bids: IndexerAuctionBid[];
|
|
10
26
|
};
|
|
11
|
-
static auctionsResponseToAuctions(response: InjectiveAuctionRpc.AuctionsResponse): Auction[];
|
|
12
|
-
static grpcBidToBid(grpcBid: GrpcIndexerBid): IndexerBid;
|
|
13
|
-
static grpcAuctionToAuction(grpcAuction: GrpcAuction): Auction;
|
|
14
|
-
static injBurntResponseToInjBurnt(response: InjectiveAuctionRpc.InjBurntEndpointResponse): TotalInjBurnt;
|
|
15
27
|
}
|
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.IndexerGrpcAuctionTransformer = void 0;
|
|
4
|
-
const IndexerCommonTransformer_js_1 = require("./IndexerCommonTransformer.js");
|
|
5
4
|
/**
|
|
6
5
|
* @category Indexer Grpc Transformer
|
|
7
6
|
*/
|
|
8
7
|
class IndexerGrpcAuctionTransformer {
|
|
9
|
-
static
|
|
8
|
+
static grpcAuctionCoinToAuctionCoin(grpcCoin) {
|
|
10
9
|
return {
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
denom: grpcCoin.denom,
|
|
11
|
+
amount: grpcCoin.amount,
|
|
12
|
+
usdValue: grpcCoin.usdValue,
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
|
-
static
|
|
16
|
-
return
|
|
15
|
+
static grpcAuctionCoinPricesToAuctionCoinPrices(grpcCoinPrices) {
|
|
16
|
+
return {
|
|
17
|
+
denom: grpcCoinPrices.denom,
|
|
18
|
+
amount: grpcCoinPrices.amount,
|
|
19
|
+
prices: grpcCoinPrices.prices,
|
|
20
|
+
};
|
|
17
21
|
}
|
|
18
22
|
static grpcBidToBid(grpcBid) {
|
|
19
23
|
return {
|
|
@@ -25,15 +29,53 @@ class IndexerGrpcAuctionTransformer {
|
|
|
25
29
|
static grpcAuctionToAuction(grpcAuction) {
|
|
26
30
|
return {
|
|
27
31
|
winner: grpcAuction.winner,
|
|
28
|
-
|
|
32
|
+
basket: grpcAuction.basket.map(IndexerGrpcAuctionTransformer.grpcAuctionCoinToAuctionCoin),
|
|
33
|
+
winningBidAmount: grpcAuction.winningBidAmount,
|
|
34
|
+
round: parseInt(grpcAuction.round, 10),
|
|
35
|
+
endTimestamp: parseInt(grpcAuction.endTimestamp, 10),
|
|
36
|
+
updatedAt: parseInt(grpcAuction.updatedAt, 10),
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
static grpcAuctionV2ToAuctionV2(grpcAuction) {
|
|
40
|
+
return {
|
|
41
|
+
winner: grpcAuction.winner,
|
|
42
|
+
basket: grpcAuction.basket.map(IndexerGrpcAuctionTransformer.grpcAuctionCoinPricesToAuctionCoinPrices),
|
|
29
43
|
winningBidAmount: grpcAuction.winningBidAmount,
|
|
30
44
|
round: parseInt(grpcAuction.round, 10),
|
|
31
45
|
endTimestamp: parseInt(grpcAuction.endTimestamp, 10),
|
|
32
46
|
updatedAt: parseInt(grpcAuction.updatedAt, 10),
|
|
33
47
|
};
|
|
34
48
|
}
|
|
35
|
-
static
|
|
36
|
-
return
|
|
49
|
+
static grpcAccountAuctionV2ToAccountAuctionV2(grpcAccountAuction) {
|
|
50
|
+
return {
|
|
51
|
+
id: grpcAccountAuction.id,
|
|
52
|
+
round: parseInt(grpcAccountAuction.round, 10),
|
|
53
|
+
amountDeposited: grpcAccountAuction.amountDeposited,
|
|
54
|
+
isClaimable: grpcAccountAuction.isClaimable,
|
|
55
|
+
claimedAssets: grpcAccountAuction.claimedAssets.map(IndexerGrpcAuctionTransformer.grpcAuctionCoinPricesToAuctionCoinPrices),
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
static auctionsResponseToAuctions(response) {
|
|
59
|
+
return response.auctions.map((a) => IndexerGrpcAuctionTransformer.grpcAuctionToAuction(a));
|
|
60
|
+
}
|
|
61
|
+
static auctionsHistoryV2ResponseToAuctionHistory(response) {
|
|
62
|
+
return {
|
|
63
|
+
auctions: response.auctions.map(IndexerGrpcAuctionTransformer.grpcAuctionV2ToAuctionV2),
|
|
64
|
+
next: response.next,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
static accountAuctionsV2ResponseToAccountAuctionsV2(response) {
|
|
68
|
+
return {
|
|
69
|
+
auctions: response.auctions.map(IndexerGrpcAuctionTransformer.grpcAccountAuctionV2ToAccountAuctionV2),
|
|
70
|
+
next: response.next,
|
|
71
|
+
total: response.total,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
static auctionResponseToAuction(response) {
|
|
75
|
+
return {
|
|
76
|
+
auction: IndexerGrpcAuctionTransformer.grpcAuctionToAuction(response.auction),
|
|
77
|
+
bids: response.bids.map(IndexerGrpcAuctionTransformer.grpcBidToBid),
|
|
78
|
+
};
|
|
37
79
|
}
|
|
38
80
|
}
|
|
39
81
|
exports.IndexerGrpcAuctionTransformer = IndexerGrpcAuctionTransformer;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { InjectiveMegaVaultRpc } from '@injectivelabs/indexer-proto-ts';
|
|
2
|
+
import type { MegaVault, MegaVaultApr, MegaVaultPnl, MegaVaultUser, MegaVaultStats, GrpcMegaVaultApr, GrpcMegaVaultPnl, MegaVaultAprStats, MegaVaultOperator, MegaVaultPnlStats, MegaVaultTargetApr, MegaVaultUserStats, MegaVaultIncentives, MegaVaultRedemption, MegaVaultVolatility, MegaVaultMaxDrawdown, GrpcMegaVaultAprStats, GrpcMegaVaultPnlStats, GrpcMegaVaultOperator, MegaVaultSubscription, GrpcMegaVaultTargetApr, GrpcMegaVaultUserStats, MegaVaultHistoricalPnL, MegaVaultHistoricalTVL, MegaVaultUnrealizedPnl, GrpcMegaVaultIncentives, GrpcMegaVaultRedemption, GrpcMegaVaultVaultStats, GrpcMegaVaultVolatility, GrpcMegaVaultMaxDrawdown, MegaVaultVolatilityStats, GrpcMegaVaultSubscription, GrpcMegaVaultHistoricalPnL, GrpcMegaVaultHistoricalTVL, GrpcMegaVaultUnrealizedPnl, GrpcMegaVaultVolatilityStats, MegaVaultOperatorRedemptionBucket, GrpcMegaVaultOperatorRedemptionBucket } from '../types/mega-vault.js';
|
|
3
|
+
export declare class IndexerGrpcMegaVaultTransformer {
|
|
4
|
+
static vaultResponseToVault(response: InjectiveMegaVaultRpc.GetVaultResponse): MegaVault | undefined;
|
|
5
|
+
static userResponseToUser(response: InjectiveMegaVaultRpc.GetUserResponse): MegaVaultUser | undefined;
|
|
6
|
+
static subscriptionsResponseToSubscriptions(response: InjectiveMegaVaultRpc.ListSubscriptionsResponse): MegaVaultSubscription[];
|
|
7
|
+
static redemptionsResponseToRedemptions(response: InjectiveMegaVaultRpc.ListRedemptionsResponse): MegaVaultRedemption[];
|
|
8
|
+
static operatorRedemptionBucketsResponseToOperatorRedemptionBuckets(response: InjectiveMegaVaultRpc.GetOperatorRedemptionBucketsResponse): MegaVaultOperatorRedemptionBucket[];
|
|
9
|
+
static tvlHistoryResponseToTvlHistory(response: InjectiveMegaVaultRpc.TvlHistoryResponse): MegaVaultHistoricalTVL[];
|
|
10
|
+
static pnlHistoryResponseToPnlHistory(response: InjectiveMegaVaultRpc.PnlHistoryResponse): MegaVaultHistoricalPnL[];
|
|
11
|
+
static grpcOperatorToOperator(operator: GrpcMegaVaultOperator): MegaVaultOperator;
|
|
12
|
+
static grpcIncentiveToIncentive(incentive: GrpcMegaVaultIncentives): MegaVaultIncentives;
|
|
13
|
+
static grpcTargetAprToTargetApr(targetApr: GrpcMegaVaultTargetApr): MegaVaultTargetApr;
|
|
14
|
+
static grpcVaultStatsToVaultStats(stats: GrpcMegaVaultVaultStats): MegaVaultStats;
|
|
15
|
+
static grpcPnlStatsToPnlStats(pnl: GrpcMegaVaultPnlStats): MegaVaultPnlStats;
|
|
16
|
+
static grpcUnrealizedPnlToUnrealizedPnl(pnl: GrpcMegaVaultUnrealizedPnl): MegaVaultUnrealizedPnl;
|
|
17
|
+
static grpcPnlToPnl(pnl: GrpcMegaVaultPnl): MegaVaultPnl;
|
|
18
|
+
static grpcMaxDrawdownToMaxDrawdown(maxDrawdown: GrpcMegaVaultMaxDrawdown): MegaVaultMaxDrawdown;
|
|
19
|
+
static grpcVolatilityStatsToVolatilityStats(volatility: GrpcMegaVaultVolatilityStats): MegaVaultVolatilityStats;
|
|
20
|
+
static grpcVolatilityToVolatility(volatility: GrpcMegaVaultVolatility): MegaVaultVolatility;
|
|
21
|
+
static grpcAprStatsToAprStats(apr: GrpcMegaVaultAprStats): MegaVaultAprStats;
|
|
22
|
+
static grpcAprToApr(apr: GrpcMegaVaultApr): MegaVaultApr;
|
|
23
|
+
static grpcUserStatsToUserStats(stats: GrpcMegaVaultUserStats): MegaVaultUserStats;
|
|
24
|
+
static grpcSubscriptionsToSubscriptions(subscriptions: GrpcMegaVaultSubscription[]): MegaVaultSubscription[];
|
|
25
|
+
static grpcSubscriptionToSubscription(subscription: GrpcMegaVaultSubscription): MegaVaultSubscription;
|
|
26
|
+
static grpcRedemptionToRedemption(redemption: GrpcMegaVaultRedemption): MegaVaultRedemption;
|
|
27
|
+
static grpcOperatorRedemptionBucketToOperatorRedemptionBucket(bucket: GrpcMegaVaultOperatorRedemptionBucket): MegaVaultOperatorRedemptionBucket;
|
|
28
|
+
static grpcHistoricalTVLToHistoricalTVL(history: GrpcMegaVaultHistoricalTVL): MegaVaultHistoricalTVL;
|
|
29
|
+
static grpcHistoricalPnLToHistoricalPnL(history: GrpcMegaVaultHistoricalPnL): MegaVaultHistoricalPnL;
|
|
30
|
+
}
|