@injectivelabs/sdk-ts 1.16.16 → 1.16.18
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/transformers/IndexerAuctionStreamTransformer.d.ts +2 -2
- 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 +1 -0
- package/dist/cjs/client/indexer/transformers/index.js +1 -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/transformers/IndexerAuctionStreamTransformer.d.ts +2 -2
- 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 +1 -0
- package/dist/esm/client/indexer/transformers/index.js +1 -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");
|
|
@@ -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,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
|
+
}
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IndexerGrpcMegaVaultTransformer = void 0;
|
|
4
|
+
class IndexerGrpcMegaVaultTransformer {
|
|
5
|
+
static vaultResponseToVault(response) {
|
|
6
|
+
const vault = response.vault;
|
|
7
|
+
if (!vault) {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
return {
|
|
11
|
+
admin: vault.admin,
|
|
12
|
+
lpDenom: vault.lpDenom,
|
|
13
|
+
createdAt: vault.createdAt,
|
|
14
|
+
updatedAt: vault.updatedAt,
|
|
15
|
+
quoteDenom: vault.quoteDenom,
|
|
16
|
+
contractName: vault.contractName,
|
|
17
|
+
createdHeight: vault.createdHeight,
|
|
18
|
+
updatedHeight: vault.updatedHeight,
|
|
19
|
+
contractAddress: vault.contractAddress,
|
|
20
|
+
contractVersion: vault.contractVersion,
|
|
21
|
+
stats: vault.stats
|
|
22
|
+
? IndexerGrpcMegaVaultTransformer.grpcVaultStatsToVaultStats(vault.stats)
|
|
23
|
+
: undefined,
|
|
24
|
+
operators: vault.operators.map(IndexerGrpcMegaVaultTransformer.grpcOperatorToOperator),
|
|
25
|
+
targetApr: vault.targetApr
|
|
26
|
+
? IndexerGrpcMegaVaultTransformer.grpcTargetAprToTargetApr(vault.targetApr)
|
|
27
|
+
: undefined,
|
|
28
|
+
incentives: vault.incentives
|
|
29
|
+
? IndexerGrpcMegaVaultTransformer.grpcIncentiveToIncentive(vault.incentives)
|
|
30
|
+
: undefined,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
static userResponseToUser(response) {
|
|
34
|
+
const user = response.user;
|
|
35
|
+
if (!user) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
return {
|
|
39
|
+
address: user.address,
|
|
40
|
+
updatedAt: user.updatedAt,
|
|
41
|
+
updatedHeight: user.updatedHeight,
|
|
42
|
+
contractAddress: user.contractAddress,
|
|
43
|
+
stats: user.stats
|
|
44
|
+
? IndexerGrpcMegaVaultTransformer.grpcUserStatsToUserStats(user.stats)
|
|
45
|
+
: undefined,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
static subscriptionsResponseToSubscriptions(response) {
|
|
49
|
+
return response.subscriptions.map(IndexerGrpcMegaVaultTransformer.grpcSubscriptionToSubscription);
|
|
50
|
+
}
|
|
51
|
+
static redemptionsResponseToRedemptions(response) {
|
|
52
|
+
return response.redemptions.map(IndexerGrpcMegaVaultTransformer.grpcRedemptionToRedemption);
|
|
53
|
+
}
|
|
54
|
+
static operatorRedemptionBucketsResponseToOperatorRedemptionBuckets(response) {
|
|
55
|
+
return response.buckets.map(IndexerGrpcMegaVaultTransformer.grpcOperatorRedemptionBucketToOperatorRedemptionBucket);
|
|
56
|
+
}
|
|
57
|
+
static tvlHistoryResponseToTvlHistory(response) {
|
|
58
|
+
return response.history.map(IndexerGrpcMegaVaultTransformer.grpcHistoricalTVLToHistoricalTVL);
|
|
59
|
+
}
|
|
60
|
+
static pnlHistoryResponseToPnlHistory(response) {
|
|
61
|
+
return response.history.map(IndexerGrpcMegaVaultTransformer.grpcHistoricalPnLToHistoricalPnL);
|
|
62
|
+
}
|
|
63
|
+
static grpcOperatorToOperator(operator) {
|
|
64
|
+
return {
|
|
65
|
+
address: operator.address,
|
|
66
|
+
updatedAt: operator.updatedAt,
|
|
67
|
+
totalAmount: operator.totalAmount,
|
|
68
|
+
updatedHeight: operator.updatedHeight,
|
|
69
|
+
totalLiquidAmount: operator.totalLiquidAmount,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
static grpcIncentiveToIncentive(incentive) {
|
|
73
|
+
return {
|
|
74
|
+
address: incentive.address,
|
|
75
|
+
amount: incentive.amount,
|
|
76
|
+
updatedAt: incentive.updatedAt,
|
|
77
|
+
updatedHeight: incentive.updatedHeight,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
static grpcTargetAprToTargetApr(targetApr) {
|
|
81
|
+
return {
|
|
82
|
+
apr: targetApr.apr,
|
|
83
|
+
updatedAt: targetApr.updatedAt,
|
|
84
|
+
upperThreshold: targetApr.upperThreshold,
|
|
85
|
+
lowerThreshold: targetApr.lowerThreshold,
|
|
86
|
+
updatedHeight: targetApr.updatedHeight,
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
static grpcVaultStatsToVaultStats(stats) {
|
|
90
|
+
return {
|
|
91
|
+
currentAmount: stats.currentAmount,
|
|
92
|
+
currentLpPrice: stats.currentLpPrice,
|
|
93
|
+
currentLpAmount: stats.currentLpAmount,
|
|
94
|
+
totalRedeemedAmount: stats.totalRedeemedAmount,
|
|
95
|
+
totalSubscribedAmount: stats.totalSubscribedAmount,
|
|
96
|
+
currentAmountWithoutIncentives: stats.currentAmountWithoutIncentives,
|
|
97
|
+
apr: stats.apr
|
|
98
|
+
? IndexerGrpcMegaVaultTransformer.grpcAprStatsToAprStats(stats.apr)
|
|
99
|
+
: undefined,
|
|
100
|
+
pnl: stats.pnl
|
|
101
|
+
? IndexerGrpcMegaVaultTransformer.grpcPnlStatsToPnlStats(stats.pnl)
|
|
102
|
+
: undefined,
|
|
103
|
+
volatility: stats.volatility
|
|
104
|
+
? IndexerGrpcMegaVaultTransformer.grpcVolatilityStatsToVolatilityStats(stats.volatility)
|
|
105
|
+
: undefined,
|
|
106
|
+
maxDrawdown: stats.maxDrawdown
|
|
107
|
+
? IndexerGrpcMegaVaultTransformer.grpcMaxDrawdownToMaxDrawdown(stats.maxDrawdown)
|
|
108
|
+
: undefined,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
static grpcPnlStatsToPnlStats(pnl) {
|
|
112
|
+
return {
|
|
113
|
+
allTime: pnl.allTime
|
|
114
|
+
? IndexerGrpcMegaVaultTransformer.grpcPnlToPnl(pnl.allTime)
|
|
115
|
+
: undefined,
|
|
116
|
+
unrealized: pnl.unrealized
|
|
117
|
+
? IndexerGrpcMegaVaultTransformer.grpcUnrealizedPnlToUnrealizedPnl(pnl.unrealized)
|
|
118
|
+
: undefined,
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
static grpcUnrealizedPnlToUnrealizedPnl(pnl) {
|
|
122
|
+
return {
|
|
123
|
+
value: pnl.value,
|
|
124
|
+
percentage: pnl.percentage,
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
static grpcPnlToPnl(pnl) {
|
|
128
|
+
return {
|
|
129
|
+
value: pnl.value,
|
|
130
|
+
percentage: pnl.percentage,
|
|
131
|
+
currentAmount: pnl.currentAmount,
|
|
132
|
+
totalAmountRedeemed: pnl.totalAmountRedeemed,
|
|
133
|
+
totalAmountSubscribed: pnl.totalAmountSubscribed,
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
static grpcMaxDrawdownToMaxDrawdown(maxDrawdown) {
|
|
137
|
+
return {
|
|
138
|
+
value: maxDrawdown.value,
|
|
139
|
+
latestPnLPeak: maxDrawdown.latestPnLPeak,
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
static grpcVolatilityStatsToVolatilityStats(volatility) {
|
|
143
|
+
return {
|
|
144
|
+
thirtyDays: volatility.thirtyDays
|
|
145
|
+
? IndexerGrpcMegaVaultTransformer.grpcVolatilityToVolatility(volatility.thirtyDays)
|
|
146
|
+
: undefined,
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
static grpcVolatilityToVolatility(volatility) {
|
|
150
|
+
return {
|
|
151
|
+
value: volatility.value,
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
static grpcAprStatsToAprStats(apr) {
|
|
155
|
+
return {
|
|
156
|
+
thirtyDays: apr.thirtyDays
|
|
157
|
+
? IndexerGrpcMegaVaultTransformer.grpcAprToApr(apr.thirtyDays)
|
|
158
|
+
: undefined,
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
static grpcAprToApr(apr) {
|
|
162
|
+
return {
|
|
163
|
+
value: apr.value,
|
|
164
|
+
currentLpPrice: apr.currentLpPrice,
|
|
165
|
+
originalLpPrice: apr.originalLpPrice,
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
static grpcUserStatsToUserStats(stats) {
|
|
169
|
+
return {
|
|
170
|
+
currentAmount: stats.currentAmount,
|
|
171
|
+
currentLpAmount: stats.currentLpAmount,
|
|
172
|
+
pnl: stats.pnl
|
|
173
|
+
? IndexerGrpcMegaVaultTransformer.grpcPnlStatsToPnlStats(stats.pnl)
|
|
174
|
+
: undefined,
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
static grpcSubscriptionsToSubscriptions(subscriptions) {
|
|
178
|
+
return subscriptions.map(IndexerGrpcMegaVaultTransformer.grpcSubscriptionToSubscription);
|
|
179
|
+
}
|
|
180
|
+
static grpcSubscriptionToSubscription(subscription) {
|
|
181
|
+
return {
|
|
182
|
+
user: subscription.user,
|
|
183
|
+
index: subscription.index,
|
|
184
|
+
amount: subscription.amount,
|
|
185
|
+
status: subscription.status,
|
|
186
|
+
lpAmount: subscription.lpAmount,
|
|
187
|
+
createdAt: subscription.createdAt,
|
|
188
|
+
executedAt: subscription.executedAt,
|
|
189
|
+
createdHeight: subscription.createdHeight,
|
|
190
|
+
executedHeight: subscription.executedHeight,
|
|
191
|
+
contractAddress: subscription.contractAddress,
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
static grpcRedemptionToRedemption(redemption) {
|
|
195
|
+
return {
|
|
196
|
+
user: redemption.user,
|
|
197
|
+
dueAt: redemption.dueAt,
|
|
198
|
+
index: redemption.index,
|
|
199
|
+
amount: redemption.amount,
|
|
200
|
+
status: redemption.status,
|
|
201
|
+
lpAmount: redemption.lpAmount,
|
|
202
|
+
createdAt: redemption.createdAt,
|
|
203
|
+
executedAt: redemption.executedAt,
|
|
204
|
+
createdHeight: redemption.createdHeight,
|
|
205
|
+
executedHeight: redemption.executedHeight,
|
|
206
|
+
contractAddress: redemption.contractAddress,
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
static grpcOperatorRedemptionBucketToOperatorRedemptionBucket(bucket) {
|
|
210
|
+
return {
|
|
211
|
+
bucket: bucket.bucket,
|
|
212
|
+
neededAmount: bucket.neededAmount,
|
|
213
|
+
lpAmountToRedeem: bucket.lpAmountToRedeem,
|
|
214
|
+
missingLiquidity: bucket.missingLiquidity,
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
static grpcHistoricalTVLToHistoricalTVL(history) {
|
|
218
|
+
return {
|
|
219
|
+
t: history.t,
|
|
220
|
+
v: history.v,
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
static grpcHistoricalPnLToHistoricalPnL(history) {
|
|
224
|
+
return {
|
|
225
|
+
t: history.t,
|
|
226
|
+
v: history.v,
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
exports.IndexerGrpcMegaVaultTransformer = IndexerGrpcMegaVaultTransformer;
|
|
@@ -12,6 +12,7 @@ export * from './IndexerOracleStreamTransformer.js';
|
|
|
12
12
|
export * from './IndexerRestExplorerTransformer.js';
|
|
13
13
|
export * from './IndexerAccountStreamTransformer.js';
|
|
14
14
|
export * from './IndexerAuctionStreamTransformer.js';
|
|
15
|
+
export * from './IndexerGrpcMegaVaultTransformer.js';
|
|
15
16
|
export * from './IndexerArchiverStreamTransformer.js';
|
|
16
17
|
export * from './IndexerExplorerStreamTransformer.js';
|
|
17
18
|
export * from './IndexerGrpcDerivativeTransformer.js';
|
|
@@ -28,6 +28,7 @@ __exportStar(require("./IndexerOracleStreamTransformer.js"), exports);
|
|
|
28
28
|
__exportStar(require("./IndexerRestExplorerTransformer.js"), exports);
|
|
29
29
|
__exportStar(require("./IndexerAccountStreamTransformer.js"), exports);
|
|
30
30
|
__exportStar(require("./IndexerAuctionStreamTransformer.js"), exports);
|
|
31
|
+
__exportStar(require("./IndexerGrpcMegaVaultTransformer.js"), exports);
|
|
31
32
|
__exportStar(require("./IndexerArchiverStreamTransformer.js"), exports);
|
|
32
33
|
__exportStar(require("./IndexerExplorerStreamTransformer.js"), exports);
|
|
33
34
|
__exportStar(require("./IndexerGrpcDerivativeTransformer.js"), exports);
|