@naviprotocol/lending 1.0.4 → 1.0.6

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/index.esm.js CHANGED
@@ -1,27 +1,27 @@
1
1
  import { Transaction as $ } from "@mysten/sui/transactions";
2
- import { bcs as s, toHex as U, fromHex as H } from "@mysten/bcs";
3
- import { SuiClient as q, getFullnodeUrl as G } from "@mysten/sui/client";
4
- import z from "lodash.camelcase";
5
- import { normalizeStructTag as O } from "@mysten/sui/utils";
6
- import { SuiPriceServiceConnection as E, SuiPythClient as W } from "@pythnetwork/pyth-sui-js";
2
+ import { bcs as s, toHex as H, fromHex as q } from "@mysten/bcs";
3
+ import { SuiClient as z, getFullnodeUrl as O } from "@mysten/sui/client";
4
+ import W from "lodash.camelcase";
5
+ import { normalizeStructTag as K } from "@mysten/sui/utils";
6
+ import { SuiPriceServiceConnection as E, SuiPythClient as Y } from "@pythnetwork/pyth-sui-js";
7
7
  import T from "bignumber.js";
8
8
  import { bcs as b } from "@mysten/sui/bcs";
9
- const V = s.bytes(32).transform({
9
+ const R = s.bytes(32).transform({
10
10
  // To change the input type, you need to provide a type definition for the input
11
- input: (e) => H(e),
12
- output: (e) => U(e)
13
- }), le = s.struct("IncentiveAPYInfo", {
11
+ input: (e) => q(e),
12
+ output: (e) => H(e)
13
+ }), pe = s.struct("IncentiveAPYInfo", {
14
14
  /** Asset identifier */
15
15
  asset_id: s.u8(),
16
16
  /** Annual Percentage Yield as a 256-bit integer */
17
17
  apy: s.u256(),
18
18
  /** List of supported coin types for this incentive */
19
19
  coin_types: s.vector(s.string())
20
- }), K = s.struct("IncentivePoolInfo", {
20
+ }), J = s.struct("IncentivePoolInfo", {
21
21
  /** Unique pool identifier */
22
- pool_id: V,
22
+ pool_id: R,
23
23
  /** Address holding the incentive funds */
24
- funds: V,
24
+ funds: R,
25
25
  /** Current phase of the incentive program */
26
26
  phase: s.u64(),
27
27
  /** Timestamp when the incentive started */
@@ -44,12 +44,12 @@ const V = s.bytes(32).transform({
44
44
  available: s.u256(),
45
45
  /** Total amount of incentives */
46
46
  total: s.u256()
47
- }), de = s.struct("IncentivePoolInfoByPhase", {
47
+ }), fe = s.struct("IncentivePoolInfoByPhase", {
48
48
  /** Phase number */
49
49
  phase: s.u64(),
50
50
  /** List of incentive pools in this phase */
51
- pools: s.vector(K)
52
- }), pe = s.struct("OracleInfo", {
51
+ pools: s.vector(J)
52
+ }), me = s.struct("OracleInfo", {
53
53
  /** Oracle identifier */
54
54
  oracle_id: s.u8(),
55
55
  /** Current price as a 256-bit integer */
@@ -58,7 +58,7 @@ const V = s.bytes(32).transform({
58
58
  decimals: s.u8(),
59
59
  /** Whether the oracle data is valid */
60
60
  valid: s.bool()
61
- }), fe = s.struct("FlashLoanAssetConfig", {
61
+ }), ge = s.struct("FlashLoanAssetConfig", {
62
62
  /** Unique identifier for the flash loan asset */
63
63
  id: s.string(),
64
64
  /** Asset identifier */
@@ -75,7 +75,7 @@ const V = s.bytes(32).transform({
75
75
  max: s.u64(),
76
76
  /** Minimum flash loan amount */
77
77
  min: s.u64()
78
- }), me = s.struct("ReserveDataInfo", {
78
+ }), ye = s.struct("ReserveDataInfo", {
79
79
  /** Reserve identifier */
80
80
  id: s.u8(),
81
81
  /** Oracle identifier for price feeds */
@@ -122,129 +122,129 @@ const V = s.bytes(32).transform({
122
122
  liquidation_bonus: s.u256(),
123
123
  /** Liquidation threshold */
124
124
  liquidation_threshold: s.u256()
125
- }), Y = s.struct("UserStateInfo", {
125
+ }), Q = s.struct("UserStateInfo", {
126
126
  /** Asset identifier */
127
127
  asset_id: s.u8(),
128
128
  /** User's current borrow balance */
129
129
  borrow_balance: s.u256(),
130
130
  /** User's current supply balance */
131
131
  supply_balance: s.u256()
132
- }), _ = new q({
133
- url: G("mainnet")
132
+ }), I = new z({
133
+ url: O("mainnet")
134
134
  });
135
- function L(e) {
136
- const r = [];
137
- return e.forEach((a, t) => {
135
+ function N(e) {
136
+ const a = [];
137
+ return e.forEach((r, t) => {
138
138
  const c = t === e.length - 1;
139
- if (typeof a == "object" && c) {
140
- const { client: n, disableCache: o, cacheTime: i, ...u } = a;
141
- r.push(u);
139
+ if (typeof r == "object" && c) {
140
+ const { client: n, disableCache: o, cacheTime: i, ...u } = r;
141
+ a.push(u);
142
142
  } else
143
- r.push(a);
144
- }), JSON.stringify(r);
145
- }
146
- function C(e) {
147
- const r = {};
148
- return (...a) => {
149
- const t = L(a);
150
- return r[t] || (r[t] = e(...a).finally(() => {
151
- r[t] = null;
152
- })), r[t];
143
+ a.push(r);
144
+ }), JSON.stringify(a);
145
+ }
146
+ function _(e) {
147
+ const a = {};
148
+ return (...r) => {
149
+ const t = N(r);
150
+ return a[t] || (a[t] = e(...r).finally(() => {
151
+ a[t] = null;
152
+ })), a[t];
153
153
  };
154
154
  }
155
- function j(e) {
156
- let r = {};
157
- return (...a) => {
158
- const t = a[a.length - 1], c = L(a), n = r[c];
159
- return !(t != null && t.disableCache) && typeof (n == null ? void 0 : n.data) != "undefined" && (typeof (t == null ? void 0 : t.cacheTime) == "undefined" || t.cacheTime > Date.now() - n.cacheAt) ? n.data : e(...a).then((o) => (r[c] = {
155
+ function A(e) {
156
+ let a = {};
157
+ return (...r) => {
158
+ const t = r[r.length - 1], c = N(r), n = a[c];
159
+ return !(t != null && t.disableCache) && typeof (n == null ? void 0 : n.data) != "undefined" && (typeof (t == null ? void 0 : t.cacheTime) == "undefined" || t.cacheTime > Date.now() - n.cacheAt) ? n.data : e(...r).then((o) => (a[c] = {
160
160
  data: o,
161
161
  cacheAt: Date.now()
162
162
  }, o));
163
163
  };
164
164
  }
165
- function P(e) {
166
- return Array.isArray(e) ? e.map((r) => P(r)) : e != null && typeof e == "object" ? Object.keys(e).reduce(
167
- (r, a) => ({
168
- ...r,
169
- [z(a)]: P(e[a])
165
+ function B(e) {
166
+ return Array.isArray(e) ? e.map((a) => B(a)) : e != null && typeof e == "object" ? Object.keys(e).reduce(
167
+ (a, r) => ({
168
+ ...a,
169
+ [W(r)]: B(e[r])
170
170
  }),
171
171
  {}
172
172
  ) : e;
173
173
  }
174
- function p(e, r) {
175
- return typeof e == "object" ? e : r(e);
174
+ function f(e, a) {
175
+ return typeof e == "object" ? e : a(e);
176
176
  }
177
- function J(e, r) {
178
- return typeof r == "string" ? e.object(r) : typeof r == "object" && r.$kind ? r : e.object(r.contract.pool);
177
+ function X(e, a) {
178
+ return typeof a == "string" ? e.object(a) : typeof a == "object" && a.$kind ? a : e.object(a.contract.pool);
179
179
  }
180
- function B(e, r, a) {
180
+ function k(e, a, r) {
181
181
  if (e.results && e.results.length > 0) {
182
182
  if (e.results[0].returnValues && e.results[0].returnValues.length > 0)
183
- return e.results[0].returnValues.map((t, c) => (r[c] || r[0]).parse(Uint8Array.from(t[0])));
183
+ return e.results[0].returnValues.map((t, c) => (a[c] || a[0]).parse(Uint8Array.from(t[0])));
184
184
  } else if (e.error)
185
185
  return console.log(`Get an error, msg: ${e.error}`), [];
186
186
  return [];
187
187
  }
188
188
  function m(e) {
189
- return O(e);
189
+ return K(e);
190
190
  }
191
- function N(e) {
192
- const r = (e || 0) / Math.pow(10, 27);
193
- return r > Math.pow(10, 5) ? 1 / 0 : r;
191
+ function L(e) {
192
+ const a = (e || 0) / Math.pow(10, 27);
193
+ return a > Math.pow(10, 5) ? 1 / 0 : a;
194
194
  }
195
195
  new E("https://hermes.pyth.network", {
196
196
  timeout: 2e4
197
197
  });
198
- const Q = 27, R = (e, r) => {
199
- if (!Number(e) || !Number(r)) return new T(0);
200
- const a = new T(1).shiftedBy(1 * Q), t = a.multipliedBy(new T(0.5));
201
- return new T(e).multipliedBy(new T(r)).plus(t).dividedBy(a).integerValue(T.ROUND_DOWN);
202
- }, h = j(
203
- C(async (e) => {
204
- const r = `https://open-api.naviprotocol.io/api/navi/config?env=${(e == null ? void 0 : e.env) || "prod"}`;
205
- return (await fetch(r).then((t) => t.json())).data;
198
+ const Z = 27, V = (e, a) => {
199
+ if (!Number(e) || !Number(a)) return new T(0);
200
+ const r = new T(1).shiftedBy(1 * Z), t = r.multipliedBy(new T(0.5));
201
+ return new T(e).multipliedBy(new T(a)).plus(t).dividedBy(r).integerValue(T.ROUND_DOWN);
202
+ }, w = A(
203
+ _(async (e) => {
204
+ const a = `https://open-api.naviprotocol.io/api/navi/config?env=${(e == null ? void 0 : e.env) || "prod"}`;
205
+ return (await fetch(a).then((t) => t.json())).data;
206
206
  })
207
207
  ), g = 1e3 * 60 * 5;
208
- var I = /* @__PURE__ */ ((e) => (e[e.Supply = 1] = "Supply", e[e.Withdraw = 2] = "Withdraw", e[e.Borrow = 3] = "Borrow", e[e.Repay = 4] = "Repay", e))(I || {});
209
- const k = j(
210
- C(async (e) => {
211
- const r = `https://open-api.naviprotocol.io/api/navi/pools?env=${(e == null ? void 0 : e.env) || "prod"}`;
212
- return (await fetch(r).then((t) => t.json())).data;
208
+ var P = /* @__PURE__ */ ((e) => (e[e.Supply = 1] = "Supply", e[e.Withdraw = 2] = "Withdraw", e[e.Borrow = 3] = "Borrow", e[e.Repay = 4] = "Repay", e))(P || {});
209
+ const S = A(
210
+ _(async (e) => {
211
+ const a = `https://open-api.naviprotocol.io/api/navi/pools?env=${(e == null ? void 0 : e.env) || "prod"}`;
212
+ return (await fetch(a).then((t) => t.json())).data;
213
213
  })
214
214
  );
215
- async function v(e, r) {
216
- const a = await k({
217
- ...r,
215
+ async function C(e, a) {
216
+ const r = await S({
217
+ ...a,
218
218
  cacheTime: g
219
219
  });
220
220
  if (typeof e == "object")
221
221
  return e;
222
- const t = a.find((c) => typeof e == "string" ? m(c.suiCoinType) === m(e) : typeof e == "number" ? c.id === e : !1);
222
+ const t = r.find((c) => typeof e == "string" ? m(c.suiCoinType) === m(e) : typeof e == "number" ? c.id === e : !1);
223
223
  if (!t)
224
224
  throw new Error("Pool not found");
225
225
  return t;
226
226
  }
227
- const ge = j(
228
- C(async (e) => (await fetch("https://open-api.naviprotocol.io/api/navi/stats").then((t) => t.json())).data)
229
- ), ye = j(
230
- C(
227
+ const we = A(
228
+ _(async (e) => (await fetch("https://open-api.naviprotocol.io/api/navi/stats").then((t) => t.json())).data)
229
+ ), he = A(
230
+ _(
231
231
  async (e) => await fetch("https://open-api.naviprotocol.io/api/navi/fee").then((t) => t.json())
232
232
  )
233
233
  );
234
- async function X(e, r, a, t) {
235
- const c = await h({
234
+ async function x(e, a, r, t) {
235
+ const c = await w({
236
236
  ...t,
237
237
  cacheTime: g
238
- }), n = await v(r, t), o = typeof a == "object" && a.$kind === "GasCoin";
238
+ }), n = await C(a, t), o = typeof r == "object" && r.$kind === "GasCoin";
239
239
  if (m(n.suiCoinType) === m("0x2::sui::SUI") && o) {
240
240
  if (!(t != null && t.amount))
241
241
  throw new Error("Amount is required for sui coin");
242
- a = e.splitCoins(a, [t.amount]);
242
+ r = e.splitCoins(r, [t.amount]);
243
243
  }
244
244
  let i;
245
- return typeof (t == null ? void 0 : t.amount) != "undefined" ? i = p(t.amount, e.pure.u64) : i = e.moveCall({
245
+ return typeof (t == null ? void 0 : t.amount) != "undefined" ? i = f(t.amount, e.pure.u64) : i = e.moveCall({
246
246
  target: "0x2::coin::value",
247
- arguments: [p(a, e.object)],
247
+ arguments: [f(r, e.object)],
248
248
  typeArguments: [n.suiCoinType]
249
249
  }), t != null && t.accountCap ? e.moveCall({
250
250
  target: `${c.package}::incentive_v3::deposit_with_account_cap`,
@@ -253,10 +253,10 @@ async function X(e, r, a, t) {
253
253
  e.object(c.storage),
254
254
  e.object(n.contract.pool),
255
255
  e.pure.u8(n.id),
256
- p(a, e.object),
256
+ f(r, e.object),
257
257
  e.object(c.incentiveV2),
258
258
  e.object(c.incentiveV3),
259
- p(t.accountCap, e.object)
259
+ f(t.accountCap, e.object)
260
260
  ],
261
261
  typeArguments: [n.suiCoinType]
262
262
  }) : e.moveCall({
@@ -266,7 +266,7 @@ async function X(e, r, a, t) {
266
266
  e.object(c.storage),
267
267
  e.object(n.contract.pool),
268
268
  e.pure.u8(n.id),
269
- p(a, e.object),
269
+ f(r, e.object),
270
270
  i,
271
271
  e.object(c.incentiveV2),
272
272
  e.object(c.incentiveV3)
@@ -274,11 +274,11 @@ async function X(e, r, a, t) {
274
274
  typeArguments: [n.suiCoinType]
275
275
  }), e;
276
276
  }
277
- async function we(e, r, a, t) {
278
- const c = await h({
277
+ async function be(e, a, r, t) {
278
+ const c = await w({
279
279
  ...t,
280
280
  cacheTime: g
281
- }), n = await v(r, t), o = p(a, e.pure.u64);
281
+ }), n = await C(a, t), o = f(r, e.pure.u64);
282
282
  let i;
283
283
  if (t != null && t.accountCap) {
284
284
  const [l] = e.moveCall({
@@ -292,7 +292,7 @@ async function we(e, r, a, t) {
292
292
  o,
293
293
  e.object(c.incentiveV2),
294
294
  e.object(c.incentiveV3),
295
- p(t.accountCap, e.object)
295
+ f(t.accountCap, e.object)
296
296
  ],
297
297
  typeArguments: [n.suiCoinType]
298
298
  });
@@ -320,11 +320,11 @@ async function we(e, r, a, t) {
320
320
  typeArguments: [n.suiCoinType]
321
321
  });
322
322
  }
323
- async function he(e, r, a, t) {
324
- const c = await h({
323
+ async function ve(e, a, r, t) {
324
+ const c = await w({
325
325
  ...t,
326
326
  cacheTime: g
327
- }), n = await v(r, t), o = p(a, e.pure.u64);
327
+ }), n = await C(a, t), o = f(r, e.pure.u64);
328
328
  let i;
329
329
  if (t != null && t.accountCap) {
330
330
  const [l] = e.moveCall({
@@ -338,7 +338,7 @@ async function he(e, r, a, t) {
338
338
  o,
339
339
  e.object(c.incentiveV2),
340
340
  e.object(c.incentiveV3),
341
- p(t.accountCap, e.object)
341
+ f(t.accountCap, e.object)
342
342
  ],
343
343
  typeArguments: [n.suiCoinType]
344
344
  });
@@ -366,20 +366,20 @@ async function he(e, r, a, t) {
366
366
  typeArguments: [n.suiCoinType]
367
367
  });
368
368
  }
369
- async function be(e, r, a, t) {
370
- const c = await h({
369
+ async function Ce(e, a, r, t) {
370
+ const c = await w({
371
371
  ...t,
372
372
  cacheTime: g
373
- }), n = await v(r, t), o = typeof a == "object" && a.$kind === "GasCoin";
373
+ }), n = await C(a, t), o = typeof r == "object" && r.$kind === "GasCoin";
374
374
  if (m(n.suiCoinType) === m("0x2::sui::SUI") && o) {
375
375
  if (!(t != null && t.amount))
376
376
  throw new Error("Amount is required for sui coin");
377
- a = e.splitCoins(a, [t.amount]);
377
+ r = e.splitCoins(r, [t.amount]);
378
378
  }
379
379
  let i;
380
- return typeof (t == null ? void 0 : t.amount) != "undefined" ? i = p(t.amount, e.pure.u64) : i = e.moveCall({
380
+ return typeof (t == null ? void 0 : t.amount) != "undefined" ? i = f(t.amount, e.pure.u64) : i = e.moveCall({
381
381
  target: "0x2::coin::value",
382
- arguments: [p(a, e.object)],
382
+ arguments: [f(r, e.object)],
383
383
  typeArguments: [n.suiCoinType]
384
384
  }), t != null && t.accountCap ? e.moveCall({
385
385
  target: `${c.package}::incentive_v3::repay_with_account_cap`,
@@ -389,11 +389,11 @@ async function be(e, r, a, t) {
389
389
  e.object(c.storage),
390
390
  e.object(n.contract.pool),
391
391
  e.pure.u8(n.id),
392
- p(a, e.object),
392
+ f(r, e.object),
393
393
  i,
394
394
  e.object(c.incentiveV2),
395
395
  e.object(c.incentiveV3),
396
- p(t.accountCap, e.object)
396
+ f(t.accountCap, e.object)
397
397
  ],
398
398
  typeArguments: [n.suiCoinType]
399
399
  }) : e.moveCall({
@@ -404,7 +404,7 @@ async function be(e, r, a, t) {
404
404
  e.object(c.storage),
405
405
  e.object(n.contract.pool),
406
406
  e.pure.u8(n.id),
407
- p(a, e.object),
407
+ f(r, e.object),
408
408
  i,
409
409
  e.object(c.incentiveV2),
410
410
  e.object(c.incentiveV3)
@@ -412,23 +412,23 @@ async function be(e, r, a, t) {
412
412
  typeArguments: [n.suiCoinType]
413
413
  }), e;
414
414
  }
415
- const ve = j(
416
- C(async (e) => {
417
- const r = await h({
415
+ const _e = A(
416
+ _(async (e) => {
417
+ const a = await w({
418
418
  ...e
419
- }), t = (await _.getObject({
420
- id: r.incentiveV3,
419
+ }), t = (await I.getObject({
420
+ id: a.incentiveV3,
421
421
  options: { showType: !0, showOwner: !0, showContent: !0 }
422
422
  })).data.content.fields.borrow_fee_rate;
423
423
  return Number(t) / 100;
424
424
  })
425
425
  );
426
- function Ce(e, r, a) {
427
- const t = typeof (a == null ? void 0 : a.balance) == "number", c = t ? a.balance : 0;
426
+ function je(e, a, r) {
427
+ const t = typeof (r == null ? void 0 : r.balance) == "number", c = t ? r.balance : 0;
428
428
  let n = 0;
429
429
  const o = [];
430
430
  let i = "";
431
- if (r.sort((l, d) => Number(d.balance) - Number(l.balance)).forEach((l) => {
431
+ if (a.sort((l, d) => Number(d.balance) - Number(l.balance)).forEach((l) => {
432
432
  if (!(t && n >= c) && Number(l.balance) !== 0) {
433
433
  if (i || (i = l.coinType), i !== l.coinType)
434
434
  throw new Error("All coins must be of the same type");
@@ -440,86 +440,86 @@ function Ce(e, r, a) {
440
440
  throw new Error(
441
441
  `Balance is less than the specified balance: ${n} < ${c}`
442
442
  );
443
- if (m(i) === m("0x2::sui::SUI") && (a != null && a.useGasCoin))
443
+ if (m(i) === m("0x2::sui::SUI") && (r != null && r.useGasCoin))
444
444
  return t ? e.splitCoins(e.gas, [e.pure.u64(c)]) : e.gas;
445
445
  const u = o.length === 1 ? e.object(o[0]) : e.mergeCoins(o[0], o.slice(1));
446
446
  return t ? e.splitCoins(u, [e.pure.u64(c)]) : u;
447
447
  }
448
- async function D(e, r, a, t, c, n, o) {
449
- const i = await h({
448
+ async function D(e, a, r, t, c, n, o) {
449
+ const i = await w({
450
450
  ...o,
451
451
  cacheTime: g
452
- }), u = await v(a, o);
452
+ }), u = await C(r, o);
453
453
  return e.moveCall({
454
454
  target: `${i.uiGetter}::calculator_unchecked::dynamic_health_factor`,
455
455
  arguments: [
456
456
  e.object("0x06"),
457
457
  e.object(i.storage),
458
458
  e.object(i.oracle.priceOracle),
459
- J(e, u),
460
- p(r, e.pure.address),
461
- p(u.id, e.pure.u8),
462
- p(t, e.pure.u64),
463
- p(c, e.pure.u64),
464
- p(n, e.pure.bool)
459
+ X(e, u),
460
+ f(a, e.pure.address),
461
+ f(u.id, e.pure.u8),
462
+ f(t, e.pure.u64),
463
+ f(c, e.pure.u64),
464
+ f(n, e.pure.bool)
465
465
  ],
466
466
  typeArguments: [u.suiCoinType]
467
467
  });
468
468
  }
469
- async function Z(e, r, a) {
470
- return D(e, r, 0, 0, 0, !1, a);
469
+ async function ee(e, a, r) {
470
+ return D(e, a, 0, 0, 0, !1, r);
471
471
  }
472
- const _e = j(
473
- async (e, r) => {
472
+ const Te = A(
473
+ async (e, a) => {
474
474
  var l;
475
- const a = await h({
476
- ...r,
475
+ const r = await w({
476
+ ...a,
477
477
  cacheTime: g
478
- }), t = new $(), c = (l = r == null ? void 0 : r.client) != null ? l : _, n = await k(r);
478
+ }), t = new $(), c = (l = a == null ? void 0 : a.client) != null ? l : I, n = await S(a);
479
479
  t.moveCall({
480
- target: `${a.uiGetter}::getter_unchecked::get_user_state`,
481
- arguments: [t.object(a.storage), t.pure.address(e)]
480
+ target: `${r.uiGetter}::getter_unchecked::get_user_state`,
481
+ arguments: [t.object(r.storage), t.pure.address(e)]
482
482
  });
483
483
  const o = await c.devInspectTransactionBlock({
484
484
  transactionBlock: t,
485
485
  sender: e
486
- }), i = B(o, [b.vector(Y)]);
487
- return P(
486
+ }), i = k(o, [b.vector(Q)]);
487
+ return B(
488
488
  i[0].filter((d) => d.supply_balance !== "0" || d.borrow_balance !== "0")
489
489
  ).map((d) => {
490
- const w = n.find((A) => A.id === d.assetId), f = R(
490
+ const h = n.find((v) => v.id === d.assetId), p = V(
491
491
  d.supplyBalance,
492
- w.currentSupplyIndex
493
- ).toString(), y = R(
492
+ h.currentSupplyIndex
493
+ ).toString(), y = V(
494
494
  d.borrowBalance,
495
- w.currentBorrowIndex
495
+ h.currentBorrowIndex
496
496
  ).toString();
497
497
  return {
498
498
  ...d,
499
- supplyBalance: f,
499
+ supplyBalance: p,
500
500
  borrowBalance: y,
501
- pool: w
501
+ pool: h
502
502
  };
503
503
  }).filter((d) => !!d.pool);
504
504
  }
505
505
  );
506
- async function je(e, r) {
506
+ async function Ie(e, a) {
507
507
  var o;
508
- const a = (o = r == null ? void 0 : r.client) != null ? o : _, t = new $();
509
- await Z(t, e, r);
510
- const c = await a.devInspectTransactionBlock({
508
+ const r = (o = a == null ? void 0 : a.client) != null ? o : I, t = new $();
509
+ await ee(t, e, a);
510
+ const c = await r.devInspectTransactionBlock({
511
511
  transactionBlock: t,
512
512
  sender: e
513
- }), n = B(c, [b.u256()]);
514
- return N(Number(n[0]) || 0);
513
+ }), n = k(c, [b.u256()]);
514
+ return L(Number(n[0]) || 0);
515
515
  }
516
- async function Te(e, r, a, t) {
517
- var f;
518
- const c = (f = t == null ? void 0 : t.client) != null ? f : _, n = new $();
516
+ async function Ae(e, a, r, t) {
517
+ var p;
518
+ const c = (p = t == null ? void 0 : t.client) != null ? p : I, n = new $();
519
519
  let o = 0, i = 0;
520
- const u = await v(r, t);
521
- if (a.forEach((y) => {
522
- y.type === I.Supply ? o += y.amount : y.type === I.Withdraw ? o -= y.amount : y.type === I.Borrow ? i += y.amount : y.type === I.Repay && (i -= y.amount);
520
+ const u = await C(a, t);
521
+ if (r.forEach((y) => {
522
+ y.type === P.Supply ? o += y.amount : y.type === P.Withdraw ? o -= y.amount : y.type === P.Borrow ? i += y.amount : y.type === P.Repay && (i -= y.amount);
523
523
  }), o * i < 0)
524
524
  throw new Error("Invalid operations");
525
525
  const l = o > 0 || i > 0;
@@ -535,47 +535,47 @@ async function Te(e, r, a, t) {
535
535
  const d = await c.devInspectTransactionBlock({
536
536
  transactionBlock: n,
537
537
  sender: e
538
- }), w = B(d, [b.u256()]);
539
- return N(Number(w[0]) || 0);
540
- }
541
- const Ie = C(
542
- async (e, r) => {
543
- const a = new URLSearchParams();
544
- r != null && r.cursor && a.set("cursor", r.cursor), a.set("userAddress", e);
545
- const t = `https://open-api.naviprotocol.io/api/navi/user/transactions?${a.toString()}`;
538
+ }), h = k(d, [b.u256()]);
539
+ return L(Number(h[0]) || 0);
540
+ }
541
+ const Pe = _(
542
+ async (e, a) => {
543
+ const r = new URLSearchParams();
544
+ a != null && a.cursor && r.set("cursor", a.cursor), r.set("userAddress", e);
545
+ const t = `https://open-api.naviprotocol.io/api/navi/user/transactions?${r.toString()}`;
546
546
  return (await fetch(t).then((n) => n.json())).data;
547
547
  }
548
548
  );
549
- async function Ae(e, r) {
549
+ async function Be(e, a) {
550
550
  var n;
551
- let a = null;
552
- const t = [], c = (n = r == null ? void 0 : r.client) != null ? n : _;
551
+ let r = null;
552
+ const t = [], c = (n = a == null ? void 0 : a.client) != null ? n : I;
553
553
  do {
554
554
  let o;
555
- if (r != null && r.coinType ? o = await c.getCoins({
555
+ if (a != null && a.coinType ? o = await c.getCoins({
556
556
  owner: e,
557
- coinType: r == null ? void 0 : r.coinType,
558
- cursor: a,
557
+ coinType: a == null ? void 0 : a.coinType,
558
+ cursor: r,
559
559
  limit: 100
560
560
  }) : o = await c.getAllCoins({
561
561
  owner: e,
562
- cursor: a,
562
+ cursor: r,
563
563
  limit: 100
564
564
  }), !o.data || !o.data.length)
565
565
  break;
566
- t.push(...o.data), a = o.nextCursor;
567
- } while (a);
566
+ t.push(...o.data), r = o.nextCursor;
567
+ } while (r);
568
568
  return t;
569
569
  }
570
570
  const M = new E("https://hermes.pyth.network", {
571
571
  timeout: 1e4
572
572
  });
573
- async function x(e) {
573
+ async function te(e) {
574
574
  try {
575
- const r = [], a = await M.getLatestPriceFeeds(e);
576
- if (!a) return r;
575
+ const a = [], r = await M.getLatestPriceFeeds(e);
576
+ if (!r) return a;
577
577
  const t = Math.floor((/* @__PURE__ */ new Date()).valueOf() / 1e3);
578
- for (const c of a) {
578
+ for (const c of r) {
579
579
  const n = c.getPriceUnchecked();
580
580
  if (n.publishTime > t) {
581
581
  console.warn(
@@ -585,44 +585,44 @@ async function x(e) {
585
585
  }
586
586
  t - c.getPriceUnchecked().publishTime > 30 && (console.info(
587
587
  `stale price feed, id: ${c.id}, publish time: ${n.publishTime}, current timestamp: ${t}`
588
- ), r.push(c.id));
588
+ ), a.push(c.id));
589
589
  }
590
- return r;
591
- } catch (r) {
592
- throw new Error(`failed to get pyth stale price feed id, msg: ${r.message}`);
590
+ return a;
591
+ } catch (a) {
592
+ throw new Error(`failed to get pyth stale price feed id, msg: ${a.message}`);
593
593
  }
594
594
  }
595
- async function ee(e, r, a) {
595
+ async function ae(e, a, r) {
596
596
  var n;
597
- const t = (n = a == null ? void 0 : a.client) != null ? n : _, c = await h({
598
- ...a,
597
+ const t = (n = r == null ? void 0 : r.client) != null ? n : I, c = await w({
598
+ ...r,
599
599
  cacheTime: g
600
600
  });
601
601
  try {
602
- const o = await M.getPriceFeedsUpdateData(r);
603
- return await new W(
602
+ const o = await M.getPriceFeedsUpdateData(a);
603
+ return await new Y(
604
604
  t,
605
605
  c.oracle.pythStateId,
606
606
  c.oracle.wormholeStateId
607
- ).updatePriceFeeds(e, o, r);
607
+ ).updatePriceFeeds(e, o, a);
608
608
  } catch (o) {
609
609
  throw new Error(`failed to update pyth price feeds, msg: ${o.message}`);
610
610
  }
611
611
  }
612
- async function Pe(e, r, a) {
613
- const t = await h({
614
- ...a,
612
+ async function $e(e, a, r) {
613
+ const t = await w({
614
+ ...r,
615
615
  cacheTime: g
616
616
  });
617
- if (a != null && a.updatePythPriceFeeds) {
618
- const c = r.filter((n) => !!n.pythPriceFeedId).map((n) => n.pythPriceFeedId);
617
+ if (r != null && r.updatePythPriceFeeds) {
618
+ const c = a.filter((n) => !!n.pythPriceFeedId).map((n) => n.pythPriceFeedId);
619
619
  try {
620
- const n = await x(c);
621
- n.length > 0 && await ee(e, n, a);
620
+ const n = await te(c);
621
+ n.length > 0 && await ae(e, n, r);
622
622
  } catch {
623
623
  }
624
624
  }
625
- for (const c of r)
625
+ for (const c of a)
626
626
  e.moveCall({
627
627
  target: `${t.oracle.packageId}::oracle_pro::update_single_price`,
628
628
  arguments: [
@@ -642,32 +642,32 @@ async function Pe(e, r, a) {
642
642
  });
643
643
  return e;
644
644
  }
645
- async function te(e) {
646
- return (await h({
645
+ async function re(e) {
646
+ return (await w({
647
647
  ...e,
648
648
  cacheTime: g
649
649
  })).oracle.feeds;
650
650
  }
651
- function $e(e, r) {
652
- return e.filter((a) => !!(r != null && r.lendingState && r.lendingState.find((c) => c.assetId === a.assetId) || r != null && r.pools && r.pools.find((c) => c.id === a.assetId)));
651
+ function ke(e, a) {
652
+ return e.filter((r) => !!(a != null && a.lendingState && a.lendingState.find((c) => c.assetId === r.assetId) || a != null && a.pools && a.pools.find((c) => c.id === r.assetId)));
653
653
  }
654
- const F = j(
655
- C(async (e) => {
656
- const r = `https://open-api.naviprotocol.io/api/navi/flashloan?env=${(e == null ? void 0 : e.env) || "prod"}`, a = await fetch(r).then((t) => t.json());
657
- return Object.keys(a.data).map((t) => ({
658
- ...a.data[t],
654
+ const F = A(
655
+ _(async (e) => {
656
+ const a = `https://open-api.naviprotocol.io/api/navi/flashloan?env=${(e == null ? void 0 : e.env) || "prod"}`, r = await fetch(a).then((t) => t.json());
657
+ return Object.keys(r.data).map((t) => ({
658
+ ...r.data[t],
659
659
  coinType: t
660
660
  }));
661
661
  })
662
662
  );
663
- async function Be(e, r) {
664
- return (await F(r)).find((t) => typeof e == "string" ? m(t.coinType) === m(e) : typeof e == "number" ? t.assetId === e : t.assetId === e.id) || null;
663
+ async function Se(e, a) {
664
+ return (await F(a)).find((t) => typeof e == "string" ? m(t.coinType) === m(e) : typeof e == "number" ? t.assetId === e : t.assetId === e.id) || null;
665
665
  }
666
- async function ke(e, r, a, t) {
667
- const c = await h({
666
+ async function Fe(e, a, r, t) {
667
+ const c = await w({
668
668
  ...t,
669
669
  cacheTime: g
670
- }), n = await v(r, t);
670
+ }), n = await C(a, t);
671
671
  if (!(await F({
672
672
  ...t,
673
673
  cacheTime: g
@@ -680,17 +680,17 @@ async function ke(e, r, a, t) {
680
680
  arguments: [
681
681
  e.object(c.flashloanConfig),
682
682
  e.object(n.contract.pool),
683
- p(a, e.pure.u64)
683
+ f(r, e.pure.u64)
684
684
  ],
685
685
  typeArguments: [n.suiCoinType]
686
686
  });
687
687
  return [u, l];
688
688
  }
689
- async function Se(e, r, a, t, c) {
690
- const n = await h({
689
+ async function Re(e, a, r, t, c) {
690
+ const n = await w({
691
691
  ...c,
692
692
  cacheTime: g
693
- }), o = await v(r, c);
693
+ }), o = await C(a, c);
694
694
  if (!(await F({
695
695
  ...c,
696
696
  cacheTime: g
@@ -704,18 +704,18 @@ async function Se(e, r, a, t, c) {
704
704
  e.object("0x06"),
705
705
  e.object(n.storage),
706
706
  e.object(o.contract.pool),
707
- p(a, e.object),
708
- p(t, e.object)
707
+ f(r, e.object),
708
+ f(t, e.object)
709
709
  ],
710
710
  typeArguments: [o.suiCoinType]
711
711
  });
712
712
  return [l];
713
713
  }
714
- async function Fe(e, r, a, t, c, n) {
714
+ async function Ve(e, a, r, t, c, n) {
715
715
  const o = {
716
716
  ...n,
717
717
  cacheTime: g
718
- }, i = await h(o), u = await v(r, o), l = await v(t, o), [d, w] = e.moveCall({
718
+ }, i = await w(o), u = await C(a, o), l = await C(t, o), [d, h] = e.moveCall({
719
719
  target: `${i.package}::incentive_v3::liquidation`,
720
720
  arguments: [
721
721
  e.object("0x06"),
@@ -728,13 +728,13 @@ async function Fe(e, r, a, t, c, n) {
728
728
  // Pay asset ID
729
729
  e.object(u.contract.pool),
730
730
  // Pay asset pool contract
731
- p(a, e.object),
731
+ f(r, e.object),
732
732
  // Debt repayment amount
733
733
  e.pure.u8(l.id),
734
734
  // Collateral asset ID
735
735
  e.object(l.contract.pool),
736
736
  // Collateral asset pool contract
737
- p(c, e.pure.address),
737
+ f(c, e.pure.address),
738
738
  // Borrower address
739
739
  e.object(i.incentiveV2),
740
740
  // Incentive V2 contract
@@ -743,12 +743,12 @@ async function Fe(e, r, a, t, c, n) {
743
743
  ],
744
744
  typeArguments: [u.suiCoinType, l.suiCoinType]
745
745
  });
746
- return [d, w];
746
+ return [d, h];
747
747
  }
748
- async function Ve(e, r) {
748
+ async function Ee(e, a) {
749
749
  var d;
750
- const a = await te(r), t = await k(r), c = (d = r == null ? void 0 : r.client) != null ? d : _, n = await h({
751
- ...r,
750
+ const r = await re(a), t = await S(a), c = (d = a == null ? void 0 : a.client) != null ? d : I, n = await w({
751
+ ...a,
752
752
  cacheTime: g
753
753
  }), o = new $();
754
754
  o.moveCall({
@@ -767,7 +767,7 @@ async function Ve(e, r) {
767
767
  const i = await c.devInspectTransactionBlock({
768
768
  transactionBlock: o,
769
769
  sender: e
770
- }), u = B(
770
+ }), u = k(
771
771
  i,
772
772
  [
773
773
  b.vector(b.string()),
@@ -783,44 +783,44 @@ async function Ve(e, r) {
783
783
  ]
784
784
  ), l = [];
785
785
  if (u.length === 5 && Array.isArray(u[0])) {
786
- const w = u[0].length;
787
- for (let f = 0; f < w; f++) {
788
- const y = a.find(
789
- (S) => m(S.coinType) === m(u[1][f])
790
- ), A = t.find(
791
- (S) => m(S.coinType) === m(u[0][f])
786
+ const h = u[0].length;
787
+ for (let p = 0; p < h; p++) {
788
+ const y = r.find(
789
+ (j) => m(j.coinType) === m(u[1][p])
790
+ ), v = t.find(
791
+ (j) => m(j.coinType) === m(u[0][p])
792
792
  );
793
- !y || !A || l.push({
794
- assetId: A.id,
795
- assetCoinType: m(u[0][f]),
796
- rewardCoinType: m(u[1][f]),
797
- option: Number(u[2][f]),
798
- userClaimableReward: Number(u[4][f]) / Math.pow(10, y.priceDecimal),
799
- ruleIds: Array.isArray(u[3][f]) ? u[3][f] : [u[3][f]]
793
+ !y || !v || l.push({
794
+ assetId: v.id,
795
+ assetCoinType: m(u[0][p]),
796
+ rewardCoinType: m(u[1][p]),
797
+ option: Number(u[2][p]),
798
+ userClaimableReward: Number(u[4][p]) / Math.pow(10, y.priceDecimal),
799
+ ruleIds: Array.isArray(u[3][p]) ? u[3][p] : [u[3][p]]
800
800
  });
801
801
  }
802
802
  }
803
803
  return l;
804
804
  }
805
- function Re(e) {
806
- const r = /* @__PURE__ */ new Map();
805
+ function Ne(e) {
806
+ const a = /* @__PURE__ */ new Map();
807
807
  e.forEach((t) => {
808
808
  const c = t.assetId, n = t.option, o = `${c}-${n}-${t.rewardCoinType}`;
809
- r.has(o) ? r.get(o).total += t.userClaimableReward : r.set(o, {
809
+ a.has(o) ? a.get(o).total += t.userClaimableReward : a.set(o, {
810
810
  assetId: c,
811
811
  rewardType: n,
812
812
  coinType: t.rewardCoinType,
813
813
  total: Number(t.userClaimableReward)
814
814
  });
815
815
  });
816
- const a = /* @__PURE__ */ new Map();
817
- for (const { assetId: t, rewardType: c, coinType: n, total: o } of r.values()) {
816
+ const r = /* @__PURE__ */ new Map();
817
+ for (const { assetId: t, rewardType: c, coinType: n, total: o } of a.values()) {
818
818
  const i = `${t}-${c}`;
819
- a.has(i) || a.set(i, { assetId: t, rewardType: c, rewards: /* @__PURE__ */ new Map() });
820
- const u = a.get(i);
819
+ r.has(i) || r.set(i, { assetId: t, rewardType: c, rewards: /* @__PURE__ */ new Map() });
820
+ const u = r.get(i);
821
821
  u.rewards.set(n, (u.rewards.get(n) || 0) + o);
822
822
  }
823
- return Array.from(a.values()).map((t) => ({
823
+ return Array.from(r.values()).map((t) => ({
824
824
  assetId: t.assetId,
825
825
  rewardType: t.rewardType,
826
826
  rewards: Array.from(t.rewards.entries()).map(([c, n]) => ({
@@ -829,48 +829,49 @@ function Re(e) {
829
829
  }))
830
830
  }));
831
831
  }
832
- const Ee = C(
832
+ const Le = _(
833
833
  async (e) => {
834
- const r = `https://open-api.naviprotocol.io/api/navi/user/total_claimed_reward?userAddress=${e}`;
835
- return (await fetch(r).then((t) => t.json())).data;
834
+ const a = `https://open-api.naviprotocol.io/api/navi/user/total_claimed_reward?userAddress=${e}`;
835
+ return (await fetch(a).then((t) => t.json())).data;
836
836
  }
837
- ), Le = C(
838
- async (e, r) => {
839
- const a = `https://open-api.naviprotocol.io/api/navi/user/rewards?userAddress=${e}&page=${(r == null ? void 0 : r.page) || 1}&pageSize=${(r == null ? void 0 : r.size) || 400}`, t = await fetch(a).then((c) => c.json());
840
- return P({
837
+ ), De = _(
838
+ async (e, a) => {
839
+ const r = `https://open-api.naviprotocol.io/api/navi/user/rewards?userAddress=${e}&page=${(a == null ? void 0 : a.page) || 1}&pageSize=${(a == null ? void 0 : a.size) || 400}`, t = await fetch(r).then((c) => c.json());
840
+ return B({
841
841
  data: t.data.rewards
842
842
  });
843
843
  }
844
844
  );
845
- async function Ne(e, r, a) {
846
- const t = await h({
847
- ...a,
845
+ async function Me(e, a, r) {
846
+ var i;
847
+ const t = await w({
848
+ ...r,
848
849
  cacheTime: g
849
- }), c = await k({
850
- ...a,
850
+ }), c = await S({
851
+ ...r,
851
852
  cacheTime: g
852
853
  }), n = /* @__PURE__ */ new Map();
853
- for (const i of r) {
854
- const { rewardCoinType: u, ruleIds: l } = i;
855
- for (const d of l) {
856
- n.has(u) || n.set(u, { assetIds: [], ruleIds: [] });
857
- const w = n.get(u);
858
- w.assetIds.push(i.assetCoinType.replace("0x", "")), w.ruleIds.push(d);
854
+ for (const u of a) {
855
+ const { rewardCoinType: l, ruleIds: d } = u;
856
+ for (const h of d) {
857
+ n.has(l) || n.set(l, { assetIds: [], ruleIds: [], amount: 0 });
858
+ const p = n.get(l);
859
+ p.assetIds.push(u.assetCoinType.replace("0x", "")), p.ruleIds.push(h), p.amount += u.userClaimableReward;
859
860
  }
860
861
  }
861
862
  const o = [];
862
- for (const [i, { assetIds: u, ruleIds: l }] of n) {
863
- const d = c.find(
864
- (f) => m(f.suiCoinType) === m(i)
863
+ for (const [u, { assetIds: l, ruleIds: d, amount: h }] of n) {
864
+ const p = c.find(
865
+ (v) => m(v.suiCoinType) === m(u)
865
866
  );
866
- if (!d || !d.contract.rewardFundId)
867
- throw new Error(`No matching rewardFund found for reward coin: ${i}`);
868
- const w = d.contract.rewardFundId;
869
- if (a != null && a.accountCap && !a.customCoinReceive)
867
+ if (!p || !p.contract.rewardFundId)
868
+ throw new Error(`No matching rewardFund found for reward coin: ${u}`);
869
+ const y = p.contract.rewardFundId;
870
+ if (r != null && r.accountCap && !r.customCoinReceive)
870
871
  throw new Error("customCoinReceive is required when accountCap is provided");
871
- if (a != null && a.customCoinReceive) {
872
- let f;
873
- a.accountCap ? f = e.moveCall({
872
+ if (r != null && r.customCoinReceive) {
873
+ let v;
874
+ r.accountCap ? v = e.moveCall({
874
875
  target: `${t.package}::incentive_v3::claim_reward_with_account_cap`,
875
876
  arguments: [
876
877
  e.object("0x06"),
@@ -879,17 +880,17 @@ async function Ne(e, r, a) {
879
880
  // Incentive V3 contract
880
881
  e.object(t.storage),
881
882
  // Protocol storage
882
- e.object(w),
883
+ e.object(y),
883
884
  // Reward fund
884
- e.pure.vector("string", u),
885
+ e.pure.vector("string", l),
885
886
  // Asset IDs
886
- e.pure.vector("address", l),
887
+ e.pure.vector("address", d),
887
888
  // Rule IDs
888
- p(a.accountCap, e.object)
889
+ f(r.accountCap, e.object)
889
890
  // Account capability
890
891
  ],
891
- typeArguments: [i]
892
- }) : f = e.moveCall({
892
+ typeArguments: [u]
893
+ }) : v = e.moveCall({
893
894
  target: `${t.package}::incentive_v3::claim_reward`,
894
895
  arguments: [
895
896
  e.object("0x06"),
@@ -898,32 +899,39 @@ async function Ne(e, r, a) {
898
899
  // Incentive V3 contract
899
900
  e.object(t.storage),
900
901
  // Protocol storage
901
- e.object(w),
902
+ e.object(y),
902
903
  // Reward fund
903
- e.pure.vector("string", u),
904
+ e.pure.vector("string", l),
904
905
  // Asset IDs
905
- e.pure.vector("address", l)
906
+ e.pure.vector("address", d)
906
907
  // Rule IDs
907
908
  ],
908
- typeArguments: [i]
909
+ typeArguments: [u]
909
910
  });
910
- const [y] = e.moveCall({
911
+ const [j] = e.moveCall({
911
912
  target: "0x2::coin::from_balance",
912
- arguments: [f],
913
- typeArguments: [i]
913
+ arguments: [v],
914
+ typeArguments: [u]
914
915
  });
915
- if ((a == null ? void 0 : a.customCoinReceive.type) === "transfer") {
916
- if (!a.customCoinReceive.transfer)
916
+ if ((r == null ? void 0 : r.customCoinReceive.type) === "transfer") {
917
+ if (!r.customCoinReceive.transfer)
917
918
  throw new Error("customCoinReceive.transfer is required");
918
919
  e.transferObjects(
919
- [y],
920
- p(a.customCoinReceive.transfer, e.pure.address)
920
+ [j],
921
+ f(r.customCoinReceive.transfer, e.pure.address)
921
922
  );
922
923
  }
923
- (a == null ? void 0 : a.customCoinReceive.type) === "depositNAVI" ? await X(e, d, y, a) : o.push({
924
- coin: y,
925
- identifier: d
926
- });
924
+ if ((r == null ? void 0 : r.customCoinReceive.type) === "depositNAVI") {
925
+ const U = T(p.totalSupplyAmount).shiftedBy(-9), G = T(p.supplyCapCeiling).shiftedBy(-27);
926
+ U.plus(h).isGreaterThan(G) && ((i = r == null ? void 0 : r.customCoinReceive.depositNAVI) != null && i.fallbackReceiveAddress) ? e.transferObjects(
927
+ [j],
928
+ e.pure.address(r.customCoinReceive.depositNAVI.fallbackReceiveAddress)
929
+ ) : await x(e, p, j, r);
930
+ } else
931
+ o.push({
932
+ coin: j,
933
+ identifier: p
934
+ });
927
935
  } else
928
936
  e.moveCall({
929
937
  target: `${t.package}::incentive_v3::claim_reward_entry`,
@@ -934,75 +942,75 @@ async function Ne(e, r, a) {
934
942
  // Incentive V3 contract
935
943
  e.object(t.storage),
936
944
  // Protocol storage
937
- e.object(w),
945
+ e.object(y),
938
946
  // Reward fund
939
- e.pure.vector("string", u),
947
+ e.pure.vector("string", l),
940
948
  // Asset IDs
941
- e.pure.vector("address", l)
949
+ e.pure.vector("address", d)
942
950
  // Rule IDs
943
951
  ],
944
- typeArguments: [i]
952
+ typeArguments: [u]
945
953
  });
946
954
  }
947
955
  return o;
948
956
  }
949
- async function De(e, r) {
950
- const a = await h({
951
- ...r
957
+ async function Ue(e, a) {
958
+ const r = await w({
959
+ ...a
952
960
  });
953
961
  return e.moveCall({
954
- target: `${a.package}::lending::create_account`,
962
+ target: `${r.package}::lending::create_account`,
955
963
  arguments: []
956
964
  });
957
965
  }
958
966
  export {
959
- V as Address,
967
+ R as Address,
960
968
  g as DEFAULT_CACHE_TIME,
961
- fe as FlashLoanAssetConfig,
962
- le as IncentiveAPYInfo,
963
- K as IncentivePoolInfo,
964
- de as IncentivePoolInfoByPhase,
965
- pe as OracleInfo,
966
- I as PoolOperator,
967
- me as ReserveDataInfo,
968
- Y as UserStateInfo,
969
- he as borrowCoinPTB,
970
- Ne as claimLendingRewardsPTB,
971
- De as createAccountCapPTB,
972
- X as depositCoinPTB,
973
- $e as filterPriceFeeds,
974
- ke as flashloanPTB,
969
+ ge as FlashLoanAssetConfig,
970
+ pe as IncentiveAPYInfo,
971
+ J as IncentivePoolInfo,
972
+ fe as IncentivePoolInfoByPhase,
973
+ me as OracleInfo,
974
+ P as PoolOperator,
975
+ ye as ReserveDataInfo,
976
+ Q as UserStateInfo,
977
+ ve as borrowCoinPTB,
978
+ Me as claimLendingRewardsPTB,
979
+ Ue as createAccountCapPTB,
980
+ x as depositCoinPTB,
981
+ ke as filterPriceFeeds,
982
+ Fe as flashloanPTB,
975
983
  F as getAllFlashLoanAssets,
976
- ve as getBorrowFee,
977
- Ae as getCoins,
978
- h as getConfig,
979
- ye as getFees,
980
- Be as getFlashLoanAsset,
981
- je as getHealthFactor,
982
- Z as getHealthFactorPTB,
983
- _e as getLendingState,
984
- v as getPool,
985
- k as getPools,
986
- te as getPriceFeeds,
987
- x as getPythStalePriceFeedId,
988
- Te as getSimulatedHealthFactor,
984
+ _e as getBorrowFee,
985
+ Be as getCoins,
986
+ w as getConfig,
987
+ he as getFees,
988
+ Se as getFlashLoanAsset,
989
+ Ie as getHealthFactor,
990
+ ee as getHealthFactorPTB,
991
+ Te as getLendingState,
992
+ C as getPool,
993
+ S as getPools,
994
+ re as getPriceFeeds,
995
+ te as getPythStalePriceFeedId,
996
+ Ae as getSimulatedHealthFactor,
989
997
  D as getSimulatedHealthFactorPTB,
990
- ge as getStats,
991
- Ie as getTransactions,
992
- Ve as getUserAvailableLendingRewards,
993
- Le as getUserClaimedRewardHistory,
994
- Ee as getUserTotalClaimedReward,
995
- Fe as liquidatePTB,
996
- Ce as mergeCoinsPTB,
998
+ we as getStats,
999
+ Pe as getTransactions,
1000
+ Ee as getUserAvailableLendingRewards,
1001
+ De as getUserClaimedRewardHistory,
1002
+ Le as getUserTotalClaimedReward,
1003
+ Ve as liquidatePTB,
1004
+ je as mergeCoinsPTB,
997
1005
  m as normalizeCoinType,
998
- p as parseTxValue,
999
- be as repayCoinPTB,
1000
- Se as repayFlashLoanPTB,
1001
- Re as summaryLendingRewards,
1002
- Pe as updateOraclePricesPTB,
1003
- ee as updatePythPriceFeeds,
1004
- j as withCache,
1005
- C as withSingleton,
1006
- we as withdrawCoinPTB
1006
+ f as parseTxValue,
1007
+ Ce as repayCoinPTB,
1008
+ Re as repayFlashLoanPTB,
1009
+ Ne as summaryLendingRewards,
1010
+ $e as updateOraclePricesPTB,
1011
+ ae as updatePythPriceFeeds,
1012
+ A as withCache,
1013
+ _ as withSingleton,
1014
+ be as withdrawCoinPTB
1007
1015
  };
1008
1016
  //# sourceMappingURL=index.esm.js.map