@typus/typus-sdk 1.4.29 → 1.4.31

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.
@@ -35,9 +35,39 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
35
35
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
36
  }
37
37
  };
38
+ var __values = (this && this.__values) || function(o) {
39
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
40
+ if (m) return m.call(o);
41
+ if (o && typeof o.length === "number") return {
42
+ next: function () {
43
+ if (o && i >= o.length) o = void 0;
44
+ return { value: o && o[i++], done: !o };
45
+ }
46
+ };
47
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
48
+ };
49
+ var __read = (this && this.__read) || function (o, n) {
50
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
51
+ if (!m) return o;
52
+ var i = m.call(o), r, ar = [], e;
53
+ try {
54
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
55
+ }
56
+ catch (error) { e = { error: error }; }
57
+ finally {
58
+ try {
59
+ if (r && !r.done && (m = i["return"])) m.call(i);
60
+ }
61
+ finally { if (e) throw e.error; }
62
+ }
63
+ return ar;
64
+ };
38
65
  Object.defineProperty(exports, "__esModule", { value: true });
39
66
  exports.getUserEvents = getUserEvents;
40
67
  exports.parseTxHistory = parseTxHistory;
68
+ exports.getDepositorCashFlows = getDepositorCashFlows;
69
+ var bcs_1 = require("@mysten/bcs");
70
+ var constants_1 = require("../../src/constants");
41
71
  function getUserEvents(provider, sender, cursor) {
42
72
  return __awaiter(this, void 0, void 0, function () {
43
73
  var senderFilter, hasNextPage, datas, result;
@@ -91,7 +121,7 @@ function parseTxHistory(datas, originPackage // safu package
91
121
  }
92
122
  })
93
123
  .reduce(function (promise, event) { return __awaiter(_this, void 0, void 0, function () {
94
- var txHistory, action, log;
124
+ var txHistory, action, log, reader, Token, asset, decimal;
95
125
  return __generator(this, function (_a) {
96
126
  switch (_a.label) {
97
127
  case 0: return [4 /*yield*/, promise];
@@ -99,77 +129,91 @@ function parseTxHistory(datas, originPackage // safu package
99
129
  txHistory = _a.sent();
100
130
  action = event.parsedJson.action;
101
131
  log = event.parsedJson.log;
102
- switch (action) {
103
- case "raise_fund":
104
- if (Number(log[2]) + Number(log[3]) + Number(log[4]) + Number(log[5]) > 0) {
105
- txHistory.push({
106
- Action: "Deposit",
107
- Index: log[0],
108
- Amount: (Number(log[2]) + Number(log[3]) + Number(log[4]) + Number(log[5])).toString(),
109
- Exp: log[6],
110
- Date: new Date(Number(event.timestampMs)),
111
- txDigest: event.id.txDigest,
112
- log: log,
113
- });
114
- }
115
- if (Number(log[5]) > 0) {
116
- txHistory.push({
117
- Action: "Compound",
118
- Index: log[0],
119
- Amount: Number(log[5]).toString(),
120
- Exp: log[6],
121
- Date: new Date(Number(event.timestampMs)),
122
- txDigest: event.id.txDigest,
123
- log: log,
124
- });
125
- }
126
- break;
127
- case "reduce_fund":
128
- if (Number(log[2]) > 0) {
129
- txHistory.push({
130
- Action: "Withdraw",
131
- Index: log[0],
132
- Amount: Number(log[2]).toString(),
133
- Exp: log[5],
134
- Date: new Date(Number(event.timestampMs)),
135
- txDigest: event.id.txDigest,
136
- log: log,
137
- });
138
- }
139
- if (Number(log[3]) > 0) {
132
+ // skip the event without tokenType
133
+ if (event.parsedJson.bcs_padding.length > 0) {
134
+ reader = new bcs_1.BcsReader(new Uint8Array(event.parsedJson.bcs_padding[0]));
135
+ Token = String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.read8())));
136
+ asset = (0, constants_1.typeArgToAsset)(Token);
137
+ decimal = (0, constants_1.assetToDecimal)(asset);
138
+ // console.log(asset, decimal);
139
+ switch (action) {
140
+ case "raise_fund":
141
+ if (Number(log[2]) + Number(log[3]) + Number(log[4]) > 0) {
142
+ txHistory.push({
143
+ Action: "Deposit",
144
+ Index: log[0],
145
+ Amount: divByDecimal(Number(log[2]) + Number(log[3]) + Number(log[4]), decimal),
146
+ Token: Token,
147
+ Exp: log[6],
148
+ Date: new Date(Number(event.timestampMs)),
149
+ txDigest: event.id.txDigest,
150
+ log: log,
151
+ });
152
+ }
153
+ if (Number(log[5]) > 0) {
154
+ txHistory.push({
155
+ Action: "Compound",
156
+ Index: log[0],
157
+ Amount: divByDecimal(Number(log[5]), decimal),
158
+ Token: Token,
159
+ Exp: log[6],
160
+ Date: new Date(Number(event.timestampMs)),
161
+ txDigest: event.id.txDigest,
162
+ log: log,
163
+ });
164
+ }
165
+ break;
166
+ case "reduce_fund":
167
+ if (Number(log[2]) > 0) {
168
+ txHistory.push({
169
+ Action: "Withdraw",
170
+ Index: log[0],
171
+ Amount: divByDecimal(Number(log[2]), decimal),
172
+ Token: Token,
173
+ Exp: log[5],
174
+ Date: new Date(Number(event.timestampMs)),
175
+ txDigest: event.id.txDigest,
176
+ log: log,
177
+ });
178
+ }
179
+ if (Number(log[3]) > 0) {
180
+ txHistory.push({
181
+ Action: "Unsubscribe",
182
+ Index: log[0],
183
+ Amount: divByDecimal(Number(log[3]), decimal),
184
+ Token: Token,
185
+ Exp: log[5],
186
+ Date: new Date(Number(event.timestampMs)),
187
+ txDigest: event.id.txDigest,
188
+ log: log,
189
+ });
190
+ }
191
+ if (Number(log[4]) > 0) {
192
+ txHistory.push({
193
+ Action: "Claim",
194
+ Index: log[0],
195
+ Amount: divByDecimal(Number(log[4]), decimal),
196
+ Token: Token,
197
+ Exp: log[5],
198
+ Date: new Date(Number(event.timestampMs)),
199
+ txDigest: event.id.txDigest,
200
+ log: log,
201
+ });
202
+ }
203
+ break;
204
+ case "claim_reward":
140
205
  txHistory.push({
141
- Action: "Unsubscribe",
206
+ Action: "Harvest Options Profit",
142
207
  Index: log[0],
143
- Amount: Number(log[3]).toString(),
144
- Exp: log[5],
208
+ Amount: divByDecimal(Number(log[2]), decimal),
209
+ Token: Token,
210
+ Exp: undefined,
145
211
  Date: new Date(Number(event.timestampMs)),
146
212
  txDigest: event.id.txDigest,
147
213
  log: log,
148
214
  });
149
- }
150
- if (Number(log[4]) > 0) {
151
- txHistory.push({
152
- Action: "Claim",
153
- Index: log[0],
154
- Amount: Number(log[4]).toString(),
155
- Exp: log[5],
156
- Date: new Date(Number(event.timestampMs)),
157
- txDigest: event.id.txDigest,
158
- log: log,
159
- });
160
- }
161
- break;
162
- case "claim_reward":
163
- txHistory.push({
164
- Action: "Harvest Options Profit",
165
- Index: log[0],
166
- Amount: Number(log[2]).toString(),
167
- Exp: undefined,
168
- Date: new Date(Number(event.timestampMs)),
169
- txDigest: event.id.txDigest,
170
- log: log,
171
- });
172
- break;
215
+ break;
216
+ }
173
217
  }
174
218
  return [2 /*return*/, txHistory];
175
219
  }
@@ -182,131 +226,149 @@ function parseTxHistory(datas, originPackage // safu package
182
226
  });
183
227
  });
184
228
  }
185
- // export function getDepositorCashFlows(userHistory: TxHistory[]) {
186
- // let depositorCashFlows = new Map<string, DepositorCashFlow>();
187
- // for (let history of userHistory) {
188
- // const index = history.Index!;
189
- // if (history.Action!.startsWith("Harvest Reward")) {
190
- // let historyAmounts = history.Amount?.split("\n")!;
191
- // for (let historyAmount of historyAmounts) {
192
- // const [amount, token] = historyAmount.split(" ")!;
193
- // if (depositorCashFlows.has(index)) {
194
- // let depositorCashFlow = depositorCashFlows.get(index)!;
195
- // let totalHarvest = depositorCashFlow.totalHarvest;
196
- // if (totalHarvest.has(token)) {
197
- // let sum = totalHarvest.get(token)!;
198
- // totalHarvest.set(token, sum + Number(amount));
199
- // } else {
200
- // totalHarvest.set(token, Number(amount));
201
- // }
202
- // depositorCashFlow.totalHarvest = totalHarvest;
203
- // depositorCashFlows.set(index, depositorCashFlow);
204
- // } else {
205
- // let totalHarvest = new Map();
206
- // totalHarvest.set(token, Number(amount));
207
- // let depositorCashFlow: DepositorCashFlow = {
208
- // D_TOKEN: undefined,
209
- // totalDeposit: 0,
210
- // totalWithdraw: 0,
211
- // totalClaim: 0,
212
- // totalCompound: 0,
213
- // netDeposit: undefined,
214
- // totalHarvest,
215
- // };
216
- // depositorCashFlows.set(index, depositorCashFlow);
217
- // }
218
- // }
219
- // } else if (history.Action!.startsWith("Deposit")) {
220
- // const [amount, token] = history.Amount?.split(" ")!;
221
- // if (depositorCashFlows.has(index)) {
222
- // let depositorCashFlow = depositorCashFlows.get(index)!;
223
- // depositorCashFlow.D_TOKEN = token;
224
- // depositorCashFlow.totalDeposit += Number(amount);
225
- // depositorCashFlows.set(index, depositorCashFlow);
226
- // } else {
227
- // let depositorCashFlow: DepositorCashFlow = {
228
- // D_TOKEN: token,
229
- // totalDeposit: Number(amount),
230
- // totalWithdraw: 0,
231
- // totalClaim: 0,
232
- // totalCompound: 0,
233
- // netDeposit: undefined,
234
- // totalHarvest: new Map(),
235
- // };
236
- // depositorCashFlows.set(index, depositorCashFlow);
237
- // }
238
- // } else if (history.Action!.startsWith("Withdraw")) {
239
- // const [amount, token] = history.Amount?.split(" ")!;
240
- // if (depositorCashFlows.has(index)) {
241
- // let depositorCashFlow = depositorCashFlows.get(index)!;
242
- // depositorCashFlow.D_TOKEN = token;
243
- // depositorCashFlow.totalWithdraw += Number(amount);
244
- // depositorCashFlows.set(index, depositorCashFlow);
245
- // } else {
246
- // let depositorCashFlow: DepositorCashFlow = {
247
- // D_TOKEN: token,
248
- // totalDeposit: 0,
249
- // totalWithdraw: Number(amount),
250
- // totalClaim: 0,
251
- // totalCompound: 0,
252
- // netDeposit: undefined,
253
- // totalHarvest: new Map(),
254
- // };
255
- // depositorCashFlows.set(index, depositorCashFlow);
256
- // }
257
- // } else if (history.Action! == "Claim") {
258
- // const [amount, token] = history.Amount?.split(" ")!;
259
- // if (depositorCashFlows.has(index)) {
260
- // let depositorCashFlow = depositorCashFlows.get(index)!;
261
- // depositorCashFlow.D_TOKEN = token;
262
- // depositorCashFlow.totalClaim += Number(amount);
263
- // depositorCashFlows.set(index, depositorCashFlow);
264
- // } else {
265
- // let depositorCashFlow: DepositorCashFlow = {
266
- // D_TOKEN: token,
267
- // totalDeposit: 0,
268
- // totalWithdraw: 0,
269
- // totalClaim: Number(amount),
270
- // totalCompound: 0,
271
- // netDeposit: undefined,
272
- // totalHarvest: new Map(),
273
- // };
274
- // depositorCashFlows.set(index, depositorCashFlow);
275
- // }
276
- // } else if (history.Action! == "Compound") {
277
- // const [amount, token] = history.Amount?.split(" ")!;
278
- // if (depositorCashFlows.has(index)) {
279
- // let depositorCashFlow = depositorCashFlows.get(index)!;
280
- // depositorCashFlow.D_TOKEN = token;
281
- // depositorCashFlow.totalCompound += Number(amount);
282
- // depositorCashFlows.set(index, depositorCashFlow);
283
- // } else {
284
- // let depositorCashFlow: DepositorCashFlow = {
285
- // D_TOKEN: token,
286
- // totalDeposit: 0,
287
- // totalWithdraw: 0,
288
- // totalClaim: 0,
289
- // totalCompound: Number(amount),
290
- // netDeposit: undefined,
291
- // totalHarvest: new Map(),
292
- // };
293
- // depositorCashFlows.set(index, depositorCashFlow);
294
- // }
295
- // }
296
- // }
297
- // // console.log(depositorCashFlows);
298
- // for (let [index, share] of depositorCashFlows.entries()) {
299
- // share.netDeposit = share.totalDeposit + share.totalCompound - share.totalWithdraw - share.totalClaim;
300
- // depositorCashFlows.set(index, share);
301
- // }
302
- // return depositorCashFlows;
303
- // }
304
- // export interface DepositorCashFlow {
305
- // D_TOKEN: string | undefined;
306
- // totalDeposit: number;
307
- // totalWithdraw: number;
308
- // totalClaim: number;
309
- // totalCompound: number;
310
- // netDeposit: number | undefined;
311
- // totalHarvest: Map<string, number>;
312
- // }
229
+ function divByDecimal(numerator, decimal) {
230
+ return (numerator / Math.pow(10, decimal)).toString();
231
+ }
232
+ function getDepositorCashFlows(userHistory) {
233
+ var e_1, _a, e_2, _b;
234
+ var depositorCashFlows = new Map();
235
+ try {
236
+ for (var userHistory_1 = __values(userHistory), userHistory_1_1 = userHistory_1.next(); !userHistory_1_1.done; userHistory_1_1 = userHistory_1.next()) {
237
+ var history_1 = userHistory_1_1.value;
238
+ var index = history_1.Index;
239
+ var _c = __read([history_1.Amount, history_1.Token], 2), amount = _c[0], token = _c[1];
240
+ if (history_1.Action == "Harvest Options Profit") {
241
+ if (depositorCashFlows.has(index)) {
242
+ var depositorCashFlow = depositorCashFlows.get(index);
243
+ var totalHarvest = depositorCashFlow.totalHarvest;
244
+ if (totalHarvest.has(token)) {
245
+ var sum = totalHarvest.get(token);
246
+ totalHarvest.set(token, sum + Number(amount));
247
+ }
248
+ else {
249
+ totalHarvest.set(token, Number(amount));
250
+ }
251
+ depositorCashFlow.totalHarvest = totalHarvest;
252
+ depositorCashFlows.set(index, depositorCashFlow);
253
+ }
254
+ else {
255
+ var totalHarvest = new Map();
256
+ totalHarvest.set(token, Number(amount));
257
+ var depositorCashFlow = {
258
+ D_TOKEN: undefined,
259
+ totalDeposit: 0,
260
+ totalWithdraw: 0,
261
+ totalClaim: 0,
262
+ totalCompound: 0,
263
+ netDeposit: undefined,
264
+ totalHarvest: totalHarvest,
265
+ };
266
+ depositorCashFlows.set(index, depositorCashFlow);
267
+ }
268
+ }
269
+ else if (history_1.Action == "Deposit") {
270
+ if (depositorCashFlows.has(index)) {
271
+ var depositorCashFlow = depositorCashFlows.get(index);
272
+ depositorCashFlow.D_TOKEN = token;
273
+ depositorCashFlow.totalDeposit += Number(amount);
274
+ depositorCashFlows.set(index, depositorCashFlow);
275
+ }
276
+ else {
277
+ var depositorCashFlow = {
278
+ D_TOKEN: token,
279
+ totalDeposit: Number(amount),
280
+ totalWithdraw: 0,
281
+ totalClaim: 0,
282
+ totalCompound: 0,
283
+ netDeposit: undefined,
284
+ totalHarvest: new Map(),
285
+ };
286
+ depositorCashFlows.set(index, depositorCashFlow);
287
+ }
288
+ }
289
+ else if (history_1.Action == "Withdraw") {
290
+ if (depositorCashFlows.has(index)) {
291
+ var depositorCashFlow = depositorCashFlows.get(index);
292
+ depositorCashFlow.D_TOKEN = token;
293
+ depositorCashFlow.totalWithdraw += Number(amount);
294
+ depositorCashFlows.set(index, depositorCashFlow);
295
+ }
296
+ else {
297
+ var depositorCashFlow = {
298
+ D_TOKEN: token,
299
+ totalDeposit: 0,
300
+ totalWithdraw: Number(amount),
301
+ totalClaim: 0,
302
+ totalCompound: 0,
303
+ netDeposit: undefined,
304
+ totalHarvest: new Map(),
305
+ };
306
+ depositorCashFlows.set(index, depositorCashFlow);
307
+ }
308
+ }
309
+ else if (history_1.Action == "Claim") {
310
+ if (depositorCashFlows.has(index)) {
311
+ var depositorCashFlow = depositorCashFlows.get(index);
312
+ depositorCashFlow.D_TOKEN = token;
313
+ depositorCashFlow.totalClaim += Number(amount);
314
+ depositorCashFlows.set(index, depositorCashFlow);
315
+ }
316
+ else {
317
+ var depositorCashFlow = {
318
+ D_TOKEN: token,
319
+ totalDeposit: 0,
320
+ totalWithdraw: 0,
321
+ totalClaim: Number(amount),
322
+ totalCompound: 0,
323
+ netDeposit: undefined,
324
+ totalHarvest: new Map(),
325
+ };
326
+ depositorCashFlows.set(index, depositorCashFlow);
327
+ }
328
+ }
329
+ else if (history_1.Action == "Compound") {
330
+ if (depositorCashFlows.has(index)) {
331
+ var depositorCashFlow = depositorCashFlows.get(index);
332
+ depositorCashFlow.D_TOKEN = token;
333
+ depositorCashFlow.totalCompound += Number(amount);
334
+ depositorCashFlows.set(index, depositorCashFlow);
335
+ }
336
+ else {
337
+ var depositorCashFlow = {
338
+ D_TOKEN: token,
339
+ totalDeposit: 0,
340
+ totalWithdraw: 0,
341
+ totalClaim: 0,
342
+ totalCompound: Number(amount),
343
+ netDeposit: undefined,
344
+ totalHarvest: new Map(),
345
+ };
346
+ depositorCashFlows.set(index, depositorCashFlow);
347
+ }
348
+ }
349
+ }
350
+ }
351
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
352
+ finally {
353
+ try {
354
+ if (userHistory_1_1 && !userHistory_1_1.done && (_a = userHistory_1.return)) _a.call(userHistory_1);
355
+ }
356
+ finally { if (e_1) throw e_1.error; }
357
+ }
358
+ try {
359
+ // console.log(depositorCashFlows);
360
+ for (var _d = __values(depositorCashFlows.entries()), _e = _d.next(); !_e.done; _e = _d.next()) {
361
+ var _f = __read(_e.value, 2), index = _f[0], share = _f[1];
362
+ share.netDeposit = share.totalDeposit + share.totalCompound - share.totalWithdraw - share.totalClaim;
363
+ depositorCashFlows.set(index, share);
364
+ }
365
+ }
366
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
367
+ finally {
368
+ try {
369
+ if (_e && !_e.done && (_b = _d.return)) _b.call(_d);
370
+ }
371
+ finally { if (e_2) throw e_2.error; }
372
+ }
373
+ return depositorCashFlows;
374
+ }
@@ -1,4 +1,5 @@
1
1
  import { TypusConfig } from "../../src/utils";
2
+ import { TypusBidReceipt } from "../../src/auto-bid/view-function";
2
3
  export interface Vault {
3
4
  id: string;
4
5
  depositToken: string;
@@ -12,7 +13,7 @@ export interface Vault {
12
13
  export interface Info {
13
14
  index: string;
14
15
  round: string;
15
- portfolio_vault_index: string;
16
+ portfolio_vaultIndex: string;
16
17
  refresh_ts_ms: string;
17
18
  status: string;
18
19
  lending_enabled: string;
@@ -42,7 +43,7 @@ export interface ShareSupply {
42
43
  export declare function getVaultData(config: TypusConfig, input: {
43
44
  indexes: string[];
44
45
  }): Promise<{
45
- [key: string]: Vault;
46
+ [key: string]: [Vault, TypusBidReceipt | null];
46
47
  }>;
47
48
  export interface Share {
48
49
  user: string;
@@ -53,7 +53,7 @@ function getVaultData(config, input) {
53
53
  transactionBlock = new transactions_1.TransactionBlock();
54
54
  transactionBlock.moveCall({
55
55
  target: "".concat(config.package.safu, "::view_function::get_vault_data_bcs"),
56
- typeArguments: [],
56
+ typeArguments: ["".concat(config.package.framework, "::vault::TypusBidReceipt")],
57
57
  arguments: [transactionBlock.pure(config.registry.safu.safu), transactionBlock.pure(input.indexes)],
58
58
  });
59
59
  return [4 /*yield*/, provider.devInspectTransactionBlock({ sender: constants_1.SENDER, transactionBlock: transactionBlock })];
@@ -78,7 +78,7 @@ function getVaultData(config, input) {
78
78
  var info = {
79
79
  index: infoArray[0],
80
80
  round: infoArray[1],
81
- portfolio_vault_index: infoArray[2],
81
+ portfolio_vaultIndex: infoArray[2],
82
82
  refresh_ts_ms: infoArray[3],
83
83
  status: infoArray[4],
84
84
  lending_enabled: infoArray[5],
@@ -120,16 +120,45 @@ function getVaultData(config, input) {
120
120
  var bcsPadding = reader.readVec(function (reader) {
121
121
  return reader.read8();
122
122
  });
123
- result[info.index] = {
124
- id: id,
125
- depositToken: depositToken,
126
- rewardToken: rewardToken,
127
- info: info,
128
- config: config,
129
- shareSupply: shareSupply,
130
- u64Padding: u64Padding,
131
- bcsPadding: bcsPadding,
132
- };
123
+ var has_bid_receipt = reader.read8() > 0;
124
+ if (has_bid_receipt) {
125
+ result[info.index] = [
126
+ {
127
+ id: id,
128
+ depositToken: depositToken,
129
+ rewardToken: rewardToken,
130
+ info: info,
131
+ config: config,
132
+ shareSupply: shareSupply,
133
+ u64Padding: u64Padding,
134
+ bcsPadding: bcsPadding,
135
+ },
136
+ {
137
+ id: (0, utils_1.AddressFromBytes)(reader.readBytes(32)),
138
+ vid: (0, utils_1.AddressFromBytes)(reader.readBytes(32)),
139
+ index: reader.read64(),
140
+ metadata: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.read8()))),
141
+ u64_padding: reader.readVec(function (reader) {
142
+ return reader.read64();
143
+ }),
144
+ },
145
+ ];
146
+ }
147
+ else {
148
+ result[info.index] = [
149
+ {
150
+ id: id,
151
+ depositToken: depositToken,
152
+ rewardToken: rewardToken,
153
+ info: info,
154
+ config: config,
155
+ shareSupply: shareSupply,
156
+ u64Padding: u64Padding,
157
+ bcsPadding: bcsPadding,
158
+ },
159
+ null,
160
+ ];
161
+ }
133
162
  });
134
163
  return [2 /*return*/, result];
135
164
  }
@@ -98,6 +98,6 @@ function getExpLeaderBoard(startTimestamp, endTimestamp) {
98
98
  });
99
99
  }
100
100
  // (async () => {
101
- // const res1 = await getExpLeaderBoard("0");
101
+ // let res1 = await getExpLeaderBoard("0");
102
102
  // console.log(res1);
103
103
  // })();