@naviprotocol/lending 2.0.3 → 2.0.5-beta.0

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,12 +1,12 @@
1
- import { Transaction as N } from "@mysten/sui/transactions";
1
+ import { Transaction as q } from "@mysten/sui/transactions";
2
2
  import { bcs as l } from "@mysten/sui/bcs";
3
- import { toHex as Me, fromHex as Ue, normalizeStructTag as K, SUI_CLOCK_OBJECT_ID as Z, fromBase64 as De } from "@mysten/sui/utils";
3
+ import { toHex as Me, fromHex as Ue, normalizeStructTag as Y, SUI_CLOCK_OBJECT_ID as x, fromBase64 as De } from "@mysten/sui/utils";
4
4
  import Fe from "lodash.camelcase";
5
5
  import p from "bignumber.js";
6
6
  import { SuiJsonRpcClient as Ne } from "@mysten/sui/jsonRpc";
7
7
  import { SuiGraphQLClient as Re } from "@mysten/sui/graphql";
8
- import { SuiGrpcClient as ye, GrpcWebFetchTransport as ge } from "@mysten/sui/grpc";
9
- const oe = l.bytes(32).transform({
8
+ import { SuiGrpcClient as he, GrpcWebFetchTransport as we } from "@mysten/sui/grpc";
9
+ const ie = l.bytes(32).transform({
10
10
  // To change the input type, you need to provide a type definition for the input
11
11
  input: (e) => Ue(e),
12
12
  output: (e) => Me(e)
@@ -19,9 +19,9 @@ const oe = l.bytes(32).transform({
19
19
  coin_types: l.vector(l.string())
20
20
  }), Le = l.struct("IncentivePoolInfo", {
21
21
  /** Unique pool identifier */
22
- pool_id: oe,
22
+ pool_id: ie,
23
23
  /** Address holding the incentive funds */
24
- funds: oe,
24
+ funds: ie,
25
25
  /** Current phase of the incentive program */
26
26
  phase: l.u64(),
27
27
  /** Timestamp when the incentive started */
@@ -129,9 +129,9 @@ const oe = l.bytes(32).transform({
129
129
  borrow_balance: l.u256(),
130
130
  /** User's current supply balance */
131
131
  supply_balance: l.u256()
132
- }), Ge = "2.0.3", E = {
132
+ }), Ge = "2.0.5-beta.0", V = {
133
133
  version: Ge
134
- }, We = E.version, He = () => {
134
+ }, We = V.version, He = () => {
135
135
  if (typeof process < "u" && process.versions && process.versions.node) {
136
136
  const e = process.version;
137
137
  return `Node.js ${e.startsWith("v") ? e.substring(1) : e}`;
@@ -140,7 +140,7 @@ const oe = l.bytes(32).transform({
140
140
  }, Je = () => {
141
141
  let e = "";
142
142
  return typeof process < "u" && process.versions && process.versions.node && (e = `lending/${We} (${He()})`), e;
143
- }, ae = Je(), he = "0x2::sui::SUI";
143
+ }, ce = Je(), be = "0x2::sui::SUI";
144
144
  class Ke extends Error {
145
145
  constructor(t) {
146
146
  super(
@@ -148,7 +148,7 @@ class Ke extends Error {
148
148
  ), this.name = "NaviMissingGraphQLClientError";
149
149
  }
150
150
  }
151
- function X(e) {
151
+ function ee(e) {
152
152
  return e == null ? void 0 : String(e);
153
153
  }
154
154
  function Qe(e, t) {
@@ -157,48 +157,48 @@ function Qe(e, t) {
157
157
  function Ye(e, t) {
158
158
  return (BigInt(e) - BigInt(t)).toString();
159
159
  }
160
- function we(e) {
160
+ function ve(e) {
161
161
  const t = e.core;
162
162
  if (typeof t?.getBalance != "function" || typeof t?.listBalances != "function")
163
163
  throw new Error("NAVI Sui balance helpers require a v2 Core API client");
164
164
  return t;
165
165
  }
166
- function be(e, t = he) {
167
- const r = X(e.addressBalance ?? e.fundsInAddressBalance) ?? "0";
168
- let o = X(e.balance ?? e.totalBalance), n = X(e.coinBalance);
166
+ function Ce(e, t = be) {
167
+ const r = ee(e.addressBalance ?? e.fundsInAddressBalance) ?? "0";
168
+ let o = ee(e.balance ?? e.totalBalance), n = ee(e.coinBalance);
169
169
  return !n && o && (n = Ye(o, r)), !o && n && (o = Qe(n, r)), {
170
- coinType: K(e.coinType ?? t),
170
+ coinType: Y(e.coinType ?? t),
171
171
  totalBalance: o ?? "0",
172
172
  coinBalance: n ?? "0",
173
173
  addressBalance: r,
174
174
  ...e.coinObjectCount === null || e.coinObjectCount === void 0 ? {} : { coinObjectCount: e.coinObjectCount }
175
175
  };
176
176
  }
177
- function Ht(e, t = he) {
178
- const r = K(t);
179
- return e.filter((o) => K(o.coinType) === r).reduce((o, n) => o + BigInt(n.balance), 0n).toString();
177
+ function Ht(e, t = be) {
178
+ const r = Y(t);
179
+ return e.filter((o) => Y(o.coinType) === r).reduce((o, n) => o + BigInt(n.balance), 0n).toString();
180
180
  }
181
181
  async function Jt(e, t) {
182
- const r = await we(e).getBalance(t), o = r.balance;
183
- return be((o && typeof o == "object" ? o : r) ?? {}, t.coinType);
182
+ const r = await ve(e).getBalance(t), o = r.balance;
183
+ return Ce((o && typeof o == "object" ? o : r) ?? {}, t.coinType);
184
184
  }
185
185
  async function Kt(e, t) {
186
- const r = await we(e).listBalances(t), { balances: o = [] } = r;
186
+ const r = await ve(e).listBalances(t), { balances: o = [] } = r;
187
187
  return {
188
- balances: o.map((n) => be(n)),
188
+ balances: o.map((n) => Ce(n)),
189
189
  nextCursor: r.nextCursor ?? r.cursor ?? null
190
190
  };
191
191
  }
192
192
  function Ze(e, t) {
193
193
  if ("client" in t)
194
194
  return t.client;
195
- const r = new ge({
195
+ const r = new we({
196
196
  baseUrl: t.url,
197
197
  meta: t.headers,
198
198
  fetchInit: t.fetchInit,
199
199
  fetch: t.fetch
200
200
  });
201
- return new ye({
201
+ return new he({
202
202
  network: e,
203
203
  transport: r
204
204
  });
@@ -211,7 +211,7 @@ function Xe(e, t) {
211
211
  fetch: t.fetch
212
212
  });
213
213
  }
214
- function ve(e, t) {
214
+ function je(e, t) {
215
215
  return "client" in t ? t.client : new Ne({
216
216
  network: e,
217
217
  url: t.url
@@ -224,7 +224,7 @@ function xe(e) {
224
224
  coreClient: t,
225
225
  grpc: t,
226
226
  graphql: e.graphql ? Xe(e.network, e.graphql) : void 0,
227
- legacyJsonRpc: e.legacyJsonRpc ? ve(e.network, e.legacyJsonRpc) : void 0,
227
+ legacyJsonRpc: e.legacyJsonRpc ? je(e.network, e.legacyJsonRpc) : void 0,
228
228
  services: e.services
229
229
  };
230
230
  }
@@ -234,22 +234,22 @@ function Qt(e, t) {
234
234
  return e.graphql;
235
235
  }
236
236
  const et = "https://fullnode.mainnet.sui.io:443";
237
- let x;
237
+ let te;
238
238
  function tt() {
239
- return x || (x = new ye({
239
+ return te || (te = new he({
240
240
  network: "mainnet",
241
- transport: new ge({ baseUrl: et })
242
- })), x;
241
+ transport: new we({ baseUrl: et })
242
+ })), te;
243
243
  }
244
244
  function rt(e, t = "mainnet") {
245
- return e ? typeof e == "string" ? ve(t, { url: e }) : xe(e) : tt();
245
+ return e ? typeof e == "string" ? je(t, { url: e }) : xe(e) : tt();
246
246
  }
247
247
  const nt = 16 * 1024;
248
- function re(e) {
248
+ function oe(e) {
249
249
  return e.replace(/^0x/i, "");
250
250
  }
251
- function ie(e) {
252
- const t = re(e), r = new Uint8Array(t.length / 2);
251
+ function se(e) {
252
+ const t = oe(e), r = new Uint8Array(t.length / 2);
253
253
  for (let o = 0; o < r.length; o += 1)
254
254
  r[o] = parseInt(t.slice(o * 2, o * 2 + 2), 16);
255
255
  return r;
@@ -257,12 +257,12 @@ function ie(e) {
257
257
  function ot(e, t) {
258
258
  return (e[t] << 8) + e[t + 1];
259
259
  }
260
- function ce(e) {
260
+ function ue(e) {
261
261
  return l.vector(l.U8).serialize(Array.from(e), {
262
262
  maxSize: nt
263
263
  });
264
264
  }
265
- function se(e, t) {
265
+ function le(e, t) {
266
266
  return {
267
267
  type: e,
268
268
  bcs: t
@@ -299,7 +299,7 @@ function st(e) {
299
299
  function ut(e) {
300
300
  return Uint8Array.from(atob(e), (t) => t.charCodeAt(0));
301
301
  }
302
- class Ce {
302
+ class Ie {
303
303
  constructor(t, r) {
304
304
  this.endpoint = t.replace(/\/$/, ""), this.timeout = r?.timeout ?? 1e4;
305
305
  }
@@ -334,7 +334,7 @@ class Ce {
334
334
  for (const [i, s] of Object.entries(o ?? {}))
335
335
  c.searchParams.set(i, s);
336
336
  for (const i of r)
337
- c.searchParams.append("ids[]", re(i));
337
+ c.searchParams.append("ids[]", oe(i));
338
338
  try {
339
339
  const i = await fetch(c, {
340
340
  signal: n.signal
@@ -353,7 +353,7 @@ class lt {
353
353
  }
354
354
  getCoreProvider() {
355
355
  const t = this.provider.core;
356
- return t && typeof t.getObject == "function" && typeof t.getDynamicObjectField == "function" ? t : null;
356
+ return t && typeof t.getObject == "function" && typeof t.getDynamicObjectField == "function" && typeof t.getDynamicField == "function" ? t : null;
357
357
  }
358
358
  async getMoveObjectJson(t) {
359
359
  const r = this.getCoreProvider();
@@ -445,8 +445,8 @@ class lt {
445
445
  target: `${o}::vaa::parse_and_verify`,
446
446
  arguments: [
447
447
  r.object(this.wormholeStateId),
448
- r.pure(ce(n)),
449
- r.object(Z)
448
+ r.pure(ue(n)),
449
+ r.object(x)
450
450
  ]
451
451
  });
452
452
  return a;
@@ -461,9 +461,9 @@ class lt {
461
461
  target: `${o}::pyth::create_authenticated_price_infos_using_accumulator`,
462
462
  arguments: [
463
463
  t.object(this.pythStateId),
464
- t.pure(ce(r[0])),
464
+ t.pure(ue(r[0])),
465
465
  a,
466
- t.object(Z)
466
+ t.object(x)
467
467
  ]
468
468
  });
469
469
  return c;
@@ -481,7 +481,7 @@ class lt {
481
481
  n,
482
482
  t.object(u),
483
483
  a[i],
484
- t.object(Z)
484
+ t.object(x)
485
485
  ]
486
486
  });
487
487
  }
@@ -498,24 +498,33 @@ class lt {
498
498
  return this.pythPackageId || (this.pythPackageId = await this.getPackageId(this.pythStateId)), this.pythPackageId;
499
499
  }
500
500
  async getPriceFeedObjectId(t) {
501
- const r = re(t);
501
+ const r = oe(t);
502
502
  if (!this.priceFeedObjectIdCache.has(r)) {
503
- const { id: o, fieldType: n } = await this.getPriceTableInfo(), a = this.getCoreProvider() ? se(
504
- `${n}::price_identifier::PriceIdentifier`,
505
- it(ie(r))
506
- ) : {
507
- type: `${n}::price_identifier::PriceIdentifier`,
508
- value: {
509
- bytes: Array.from(ie(r))
510
- }
511
- }, c = await this.getDynamicMoveObjectJson(o, a);
512
- c?.fields ? this.priceFeedObjectIdCache.set(r, c.fields.value) : this.priceFeedObjectIdCache.set(r, void 0);
503
+ const { id: o, fieldType: n } = await this.getPriceTableInfo(), a = `${n}::price_identifier::PriceIdentifier`, c = this.getCoreProvider();
504
+ if (c) {
505
+ const { dynamicField: i } = await c.getDynamicField({
506
+ parentId: o,
507
+ name: le(a, it(se(r)))
508
+ }), s = i?.value?.bcs;
509
+ this.priceFeedObjectIdCache.set(
510
+ r,
511
+ s && s.length === 32 ? l.Address.parse(Uint8Array.from(s)) : void 0
512
+ );
513
+ } else {
514
+ const i = await this.getDynamicMoveObjectJson(o, {
515
+ type: a,
516
+ value: {
517
+ bytes: Array.from(se(r))
518
+ }
519
+ });
520
+ i?.fields ? this.priceFeedObjectIdCache.set(r, i.fields.value) : this.priceFeedObjectIdCache.set(r, void 0);
521
+ }
513
522
  }
514
523
  return this.priceFeedObjectIdCache.get(r);
515
524
  }
516
525
  async getPriceTableInfo() {
517
526
  if (!this.priceTableInfo) {
518
- const t = this.getCoreProvider() ? se("vector<u8>", at("price_info")) : {
527
+ const t = this.getCoreProvider() ? le("vector<u8>", at("price_info")) : {
519
528
  type: "vector<u8>",
520
529
  value: "price_info"
521
530
  }, r = await this.getDynamicMoveObjectJson(this.pythStateId, t);
@@ -534,32 +543,32 @@ class lt {
534
543
  }
535
544
  }
536
545
  const dt = "https://open-api.naviprotocol.io/api";
537
- let J = {}, je = 0;
546
+ let Q = {}, ke = 0;
538
547
  function pt(e) {
539
548
  return e.replace(/\/+$/, "");
540
549
  }
541
550
  function Yt(e) {
542
- J = {
543
- ...J,
551
+ Q = {
552
+ ...Q,
544
553
  ...e,
545
554
  services: {
546
- ...J.services,
555
+ ...Q.services,
547
556
  ...e.services
548
557
  }
549
- }, je += 1;
558
+ }, ke += 1;
550
559
  }
551
- function ue() {
552
- return je;
560
+ function de() {
561
+ return ke;
553
562
  }
554
- function O(e) {
555
- const t = e?.services?.naviOpenApi ?? J.services?.naviOpenApi;
563
+ function M(e) {
564
+ const t = e?.services?.naviOpenApi ?? Q.services?.naviOpenApi;
556
565
  return {
557
566
  baseUrl: pt(t?.baseUrl ?? dt),
558
567
  headers: t?.headers
559
568
  };
560
569
  }
561
- function M(e, t) {
562
- const r = O(t), o = e.startsWith("/") ? e : `/${e}`;
570
+ function F(e, t) {
571
+ const r = M(t), o = e.startsWith("/") ? e : `/${e}`;
563
572
  return `${r.baseUrl}${o}`;
564
573
  }
565
574
  function mt(e) {
@@ -571,14 +580,14 @@ function mt(e) {
571
580
  }
572
581
  return Array.isArray(e) ? Object.fromEntries(e) : e;
573
582
  }
574
- function U(e, t) {
583
+ function N(e, t) {
575
584
  return {
576
585
  ...mt(e),
577
586
  ...t?.headers ?? {}
578
587
  };
579
588
  }
580
- const V = rt();
581
- function le(e) {
589
+ const U = rt();
590
+ function pe(e) {
582
591
  return e ? e instanceof Uint8Array ? Array.from(e) : Array.isArray(e) ? e : Array.from(De(e)) : [];
583
592
  }
584
593
  function ft(e) {
@@ -588,21 +597,21 @@ function ft(e) {
588
597
  events: r.events,
589
598
  error: o,
590
599
  results: t.map((n) => ({
591
- returnValues: (n.returnValues ?? []).map((a) => [le(a.bcs), ""]),
600
+ returnValues: (n.returnValues ?? []).map((a) => [pe(a.bcs), ""]),
592
601
  mutableReferenceOutputs: (n.mutatedReferences ?? []).map((a) => [
593
602
  "",
594
- le(a.bcs),
603
+ pe(a.bcs),
595
604
  ""
596
605
  ])
597
606
  }))
598
607
  };
599
608
  }
600
- async function q(e, t) {
609
+ async function W(e, t) {
601
610
  const r = e?.core;
602
611
  if (typeof r?.simulateTransaction != "function")
603
612
  throw new Error("devInspectTransaction requires a Sui v2 Core-capable client");
604
613
  const o = t.transaction ?? t.transactionBlock;
605
- o instanceof N && o.setSenderIfNotSet(t.sender);
614
+ o instanceof q && o.setSenderIfNotSet(t.sender);
606
615
  const n = await r.simulateTransaction({
607
616
  transaction: o,
608
617
  checksEnabled: !1,
@@ -614,7 +623,7 @@ async function q(e, t) {
614
623
  });
615
624
  return ft(n);
616
625
  }
617
- function ke(e) {
626
+ function _e(e) {
618
627
  return {
619
628
  json: !!e?.showContent,
620
629
  display: !!e?.showDisplay,
@@ -622,7 +631,7 @@ function ke(e) {
622
631
  objectBcs: !!e?.showBcs
623
632
  };
624
633
  }
625
- function Ie(e) {
634
+ function Te(e) {
626
635
  return !e || e instanceof Error ? {
627
636
  error: e instanceof Error ? { code: "notFound", error: e.message } : void 0
628
637
  } : {
@@ -648,9 +657,9 @@ async function yt(e, t) {
648
657
  throw new Error("getSuiObject requires a Sui v2 Core-capable client");
649
658
  const { object: o } = await r.getObject({
650
659
  objectId: t.id,
651
- include: ke(t.options)
660
+ include: _e(t.options)
652
661
  });
653
- return Ie(o);
662
+ return Te(o);
654
663
  }
655
664
  async function gt(e, t) {
656
665
  const r = e?.core;
@@ -658,48 +667,48 @@ async function gt(e, t) {
658
667
  throw new Error("multiGetSuiObjects requires a Sui v2 Core-capable client");
659
668
  const { objects: o } = await r.getObjects({
660
669
  objectIds: t.ids,
661
- include: ke(t.options)
670
+ include: _e(t.options)
662
671
  });
663
- return o.map(Ie);
672
+ return o.map(Te);
664
673
  }
665
- function _e(e) {
674
+ function Be(e) {
666
675
  const t = [];
667
676
  let r = !1;
668
677
  return e.forEach((o, n) => {
669
678
  const a = n === e.length - 1;
670
679
  if (typeof o == "object" && o !== null && a) {
671
680
  const { client: c, disableCache: i, cacheTime: s, ...u } = o;
672
- u.__naviSdkServiceConfigVersion = ue(), t.push(u), r = !0;
681
+ u.__naviSdkServiceConfigVersion = de(), t.push(u), r = !0;
673
682
  } else
674
683
  t.push(o);
675
684
  }), r || t.push({
676
- __naviSdkServiceConfigVersion: ue()
685
+ __naviSdkServiceConfigVersion: de()
677
686
  }), JSON.stringify(t);
678
687
  }
679
- function A(e) {
688
+ function S(e) {
680
689
  const t = {};
681
690
  return (...r) => {
682
- const o = _e(r);
691
+ const o = Be(r);
683
692
  return t[o] || (t[o] = e(...r).finally(() => {
684
693
  delete t[o];
685
694
  })), t[o];
686
695
  };
687
696
  }
688
- function $(e) {
697
+ function O(e) {
689
698
  let t = {};
690
699
  return (...r) => {
691
- const o = r[r.length - 1], n = _e(r), a = t[n];
700
+ const o = r[r.length - 1], n = Be(r), a = t[n];
692
701
  return !o?.disableCache && typeof a?.data < "u" && (typeof o?.cacheTime > "u" || o.cacheTime > Date.now() - a.cacheAt) ? Promise.resolve(a.data) : e(...r).then((c) => (t[n] = {
693
702
  data: c,
694
703
  cacheAt: Date.now()
695
704
  }, c));
696
705
  };
697
706
  }
698
- function ee(e) {
699
- return Array.isArray(e) ? e.map((t) => ee(t)) : e != null && typeof e == "object" ? Object.keys(e).reduce(
707
+ function re(e) {
708
+ return Array.isArray(e) ? e.map((t) => re(t)) : e != null && typeof e == "object" ? Object.keys(e).reduce(
700
709
  (t, r) => ({
701
710
  ...t,
702
- [Fe(r)]: ee(e[r])
711
+ [Fe(r)]: re(e[r])
703
712
  }),
704
713
  {}
705
714
  ) : e;
@@ -712,7 +721,7 @@ function h(e, t) {
712
721
  function ht(e, t) {
713
722
  return typeof t == "string" ? e.object(t) : typeof t == "object" && t.$kind ? t : e.object(t.contract.pool);
714
723
  }
715
- function Q(e, t, r) {
724
+ function Z(e, t, r) {
716
725
  if (e.results && e.results.length > 0) {
717
726
  if (e.results[0].returnValues && e.results[0].returnValues.length > 0)
718
727
  return e.results[0].returnValues.map((o, n) => (t[n] || t[0]).parse(Uint8Array.from(o[0])));
@@ -721,35 +730,35 @@ function Q(e, t, r) {
721
730
  return [];
722
731
  }
723
732
  function C(e) {
724
- return K(e);
733
+ return Y(e);
725
734
  }
726
- function Te(e) {
735
+ function Pe(e) {
727
736
  const t = (e || 0) / Math.pow(10, 27);
728
737
  return t > Math.pow(10, 5) ? 1 / 0 : t;
729
738
  }
730
- new Ce("https://hermes.pyth.network", {
739
+ new Ie("https://hermes.pyth.network", {
731
740
  timeout: 2e4
732
741
  });
733
- const wt = 27, de = (e, t) => {
742
+ const wt = 27, me = (e, t) => {
734
743
  if (!Number(e) || !Number(t)) return new p(0);
735
744
  const r = new p(1).shiftedBy(1 * wt), o = r.multipliedBy(new p(0.5));
736
745
  return new p(e).multipliedBy(new p(t)).plus(o).dividedBy(r).integerValue(p.ROUND_DOWN);
737
- }, D = ae ? {
738
- "User-Agent": ae
746
+ }, R = ce ? {
747
+ "User-Agent": ce
739
748
  } : {};
740
- function te(e, t = "uniqueId") {
749
+ function ne(e, t = "uniqueId") {
741
750
  return e.reduce(
742
751
  (r, o) => (r[o[t]] = o, r),
743
752
  {}
744
753
  );
745
754
  }
746
- function pe(e, t = "uniqueId") {
755
+ function fe(e, t = "uniqueId") {
747
756
  return e.reduce(
748
757
  (r, o) => (r[o[t]] = o, r),
749
758
  {}
750
759
  );
751
760
  }
752
- function H(e, t) {
761
+ function K(e, t) {
753
762
  const r = e.emodes.find((n) => n.emodeId === t.emodeId);
754
763
  if (!r)
755
764
  throw new Error("EMode not found in pool");
@@ -770,45 +779,45 @@ function bt(e) {
770
779
  poolId: parseInt(r)
771
780
  };
772
781
  }
773
- function P() {
782
+ function A() {
774
783
  return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
775
784
  }
776
- var z = /* @__PURE__ */ ((e) => (e[e.Supply = 1] = "Supply", e[e.Withdraw = 2] = "Withdraw", e[e.Borrow = 3] = "Borrow", e[e.Repay = 4] = "Repay", e))(z || {});
777
- const G = $(
778
- A(
785
+ var H = /* @__PURE__ */ ((e) => (e[e.Supply = 1] = "Supply", e[e.Withdraw = 2] = "Withdraw", e[e.Borrow = 3] = "Borrow", e[e.Repay = 4] = "Repay", e))(H || {});
786
+ const J = O(
787
+ S(
779
788
  async (e) => {
780
- const t = (e?.markets || [F.main]).map((a) => _(a)), r = O(e), o = M(
781
- `/navi/pools?env=${e?.env || "prod"}&sdk=${E.version}&market=${t.map(
789
+ const t = (e?.markets || [L.main]).map((a) => P(a)), r = M(e), o = F(
790
+ `/navi/pools?env=${e?.env || "prod"}&sdk=${V.version}&market=${t.map(
782
791
  (a) => a.key
783
792
  )}`,
784
793
  e
785
- ), n = await fetch(o, { headers: U(D, r) }).then(
794
+ ), n = await fetch(o, { headers: N(R, r) }).then(
786
795
  (a) => a.json()
787
796
  );
788
797
  return n.data.forEach((a) => {
789
798
  const i = n.meta.emodes.filter((b) => {
790
- const k = _(b.marketId);
791
- return a.market === k.key && b.isActive;
792
- }).filter((b) => !!b.assets.find((k) => k.assetId === a.id));
799
+ const j = P(b.marketId);
800
+ return a.market === j.key && b.isActive;
801
+ }).filter((b) => !!b.assets.find((j) => j.assetId === a.id));
793
802
  a.emodes = i;
794
- const s = p(a.totalSupplyAmount).div(Math.pow(10, 9)).decimalPlaces(a.token.decimals, p.ROUND_DOWN).toString(), u = p(a.borrowedAmount).shiftedBy(-9).decimalPlaces(a.token.decimals, p.ROUND_DOWN).toString(), m = p(s).multipliedBy(a.oracle.price).toString(), w = p(u).multipliedBy(a.oracle.price).toString(), y = p(a.supplyCapCeiling).shiftedBy(-27).decimalPlaces(a.token.decimals, p.ROUND_DOWN).toString(), g = p.max(
803
+ const s = p(a.totalSupplyAmount).div(Math.pow(10, 9)).decimalPlaces(a.token.decimals, p.ROUND_DOWN).toString(), u = p(a.borrowedAmount).shiftedBy(-9).decimalPlaces(a.token.decimals, p.ROUND_DOWN).toString(), m = p(s).multipliedBy(a.oracle.price).toString(), w = p(u).multipliedBy(a.oracle.price).toString(), g = p(a.supplyCapCeiling).shiftedBy(-27).decimalPlaces(a.token.decimals, p.ROUND_DOWN).toString(), y = p.max(
795
804
  p(a.borrowedAmount),
796
805
  p(a.validBorrowAmount)
797
- ).shiftedBy(-9).decimalPlaces(a.token.decimals, p.ROUND_DOWN).toString(), d = p(y).multipliedBy(a.oracle.price).toString(), f = p(g).multipliedBy(a.oracle.price).toString();
798
- a.poolSupplyAmount = s, a.poolBorrowAmount = u, a.poolSupplyValue = m, a.poolBorrowValue = w, a.poolSupplyCapAmount = y, a.poolBorrowCapAmount = g, a.poolSupplyCapValue = d, a.poolBorrowCapValue = f;
806
+ ).shiftedBy(-9).decimalPlaces(a.token.decimals, p.ROUND_DOWN).toString(), d = p(g).multipliedBy(a.oracle.price).toString(), f = p(y).multipliedBy(a.oracle.price).toString();
807
+ a.poolSupplyAmount = s, a.poolBorrowAmount = u, a.poolSupplyValue = m, a.poolBorrowValue = w, a.poolSupplyCapAmount = g, a.poolBorrowCapAmount = y, a.poolSupplyCapValue = d, a.poolBorrowCapValue = f;
799
808
  }), n.data;
800
809
  }
801
810
  )
802
811
  );
803
- async function S(e, t) {
812
+ async function E(e, t) {
804
813
  let r = t?.market;
805
814
  if (typeof e == "string") {
806
815
  const a = bt(e);
807
816
  a && (r = a.marketKey, e = a.poolId);
808
817
  }
809
- const o = await G({
818
+ const o = await J({
810
819
  ...t,
811
- markets: [r || R],
820
+ markets: [r || z],
812
821
  cacheTime: v
813
822
  });
814
823
  if (typeof e == "object")
@@ -818,28 +827,28 @@ async function S(e, t) {
818
827
  throw new Error("Pool not found");
819
828
  return n.isDeprecated && console.log(`The lending pool for coinType ${n.suiCoinType} is going to be deprecated.`), n;
820
829
  }
821
- const Zt = $(
822
- A(async (e) => {
823
- const t = O(e), r = M(`/navi/stats?sdk=${E.version}`, e);
830
+ const Zt = O(
831
+ S(async (e) => {
832
+ const t = M(e), r = F(`/navi/stats?sdk=${V.version}`, e);
824
833
  return (await fetch(r, {
825
- headers: U(D, t)
834
+ headers: N(R, t)
826
835
  }).then((n) => n.json())).data;
827
836
  })
828
- ), Xt = $(
829
- A(
837
+ ), Xt = O(
838
+ S(
830
839
  async (e) => {
831
- const t = O(e), r = M(`/navi/fee?sdk=${E.version}`, e);
840
+ const t = M(e), r = F(`/navi/fee?sdk=${V.version}`, e);
832
841
  return await fetch(r, {
833
- headers: U(D, t)
842
+ headers: N(R, t)
834
843
  }).then((n) => n.json());
835
844
  }
836
845
  )
837
846
  );
838
847
  async function vt(e, t, r, o) {
839
- const n = await j({
848
+ const n = await I({
840
849
  ...o,
841
850
  cacheTime: v
842
- }), a = await S(t, o), c = o?.market || R, i = o?.env || "prod";
851
+ }), a = await E(t, o), c = o?.market || z, i = o?.env || "prod";
843
852
  if (a?.deprecatedAt && Date.now() > a.deprecatedAt)
844
853
  throw new Error(`The lending pool for coinType ${a.suiCoinType} has been deprecated.`);
845
854
  if (C(a.suiCoinType) === C("0x2::sui::SUI") && typeof r == "object" && r?.$kind === "GasCoin") {
@@ -884,10 +893,10 @@ async function vt(e, t, r, o) {
884
893
  }), e;
885
894
  }
886
895
  async function xt(e, t, r, o) {
887
- const n = await j({
896
+ const n = await I({
888
897
  ...o,
889
898
  cacheTime: v
890
- }), a = await S(t, o), c = h(r, e.pure.u64);
899
+ }), a = await E(t, o), c = h(r, e.pure.u64);
891
900
  let i;
892
901
  if (n.version === 1)
893
902
  if (o?.accountCap) {
@@ -967,10 +976,10 @@ async function xt(e, t, r, o) {
967
976
  });
968
977
  }
969
978
  async function er(e, t, r, o) {
970
- const n = await j({
979
+ const n = await I({
971
980
  ...o,
972
981
  cacheTime: v
973
- }), a = await S(t, o);
982
+ }), a = await E(t, o);
974
983
  if (a?.deprecatedAt && Date.now() > a.deprecatedAt)
975
984
  throw new Error(`The lending pool for coinType ${a.suiCoinType} has been deprecated.`);
976
985
  const c = h(r, e.pure.u64);
@@ -1053,10 +1062,10 @@ async function er(e, t, r, o) {
1053
1062
  });
1054
1063
  }
1055
1064
  async function tr(e, t, r, o) {
1056
- const n = await j({
1065
+ const n = await I({
1057
1066
  ...o,
1058
1067
  cacheTime: v
1059
- }), a = await S(t, o);
1068
+ }), a = await E(t, o);
1060
1069
  if (C(a.suiCoinType) === C("0x2::sui::SUI") && typeof r == "object" && r?.$kind === "GasCoin") {
1061
1070
  if (!o?.amount)
1062
1071
  throw new Error("Amount is required for sui coin");
@@ -1105,15 +1114,15 @@ async function tr(e, t, r, o) {
1105
1114
  typeArguments: [a.suiCoinType]
1106
1115
  }), e;
1107
1116
  }
1108
- const rr = $(
1109
- A(
1117
+ const rr = O(
1118
+ S(
1110
1119
  async (e) => {
1111
- const t = await j({
1120
+ const t = await I({
1112
1121
  ...e
1113
- }), r = e?.client ?? V;
1122
+ }), r = e?.client ?? U;
1114
1123
  if (e?.address && typeof e?.asset < "u")
1115
1124
  try {
1116
- const a = await S(e.asset, e), c = new N();
1125
+ const a = await E(e.asset, e), c = new q();
1117
1126
  c.moveCall({
1118
1127
  target: `${t.package}::incentive_v3::get_borrow_fee_v2`,
1119
1128
  arguments: [
@@ -1124,10 +1133,10 @@ const rr = $(
1124
1133
  ],
1125
1134
  typeArguments: []
1126
1135
  });
1127
- const i = await q(r, {
1136
+ const i = await W(r, {
1128
1137
  transactionBlock: c,
1129
1138
  sender: e.address
1130
- }), s = Q(i, [l.u64()]);
1139
+ }), s = Z(i, [l.u64()]);
1131
1140
  return (Number(s[0]) || 0) / 100;
1132
1141
  } catch (a) {
1133
1142
  console.error(
@@ -1142,7 +1151,7 @@ const rr = $(
1142
1151
  return Number(n) / 100;
1143
1152
  }
1144
1153
  )
1145
- ), R = "main", F = {
1154
+ ), z = "main", L = {
1146
1155
  main: {
1147
1156
  id: 0,
1148
1157
  key: "main",
@@ -1169,13 +1178,13 @@ class Ct {
1169
1178
  this.poolMap = {}, this.emodeMap = {}, this.pools = [], this.emodes = [], this.emodePools = [], this.emodeBorrowablePools = [], this.emodeSupplyablePools = [], this._overview = {
1170
1179
  marketTotalSupplyValue: "0",
1171
1180
  marketTotalBorrowValue: "0"
1172
- }, this.config = _(t), this.initPools(r);
1181
+ }, this.config = P(t), this.initPools(r);
1173
1182
  }
1174
1183
  get overview() {
1175
1184
  return this._overview;
1176
1185
  }
1177
1186
  initPools(t) {
1178
- const r = te(this.pools), o = pe(this.emodes), n = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set();
1187
+ const r = ne(this.pools), o = fe(this.emodes), n = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set();
1179
1188
  let c = p(0), i = p(0);
1180
1189
  t.forEach((s) => {
1181
1190
  if (!this.checkMarket(s.market)) {
@@ -1185,11 +1194,11 @@ class Ct {
1185
1194
  r[s.uniqueId] || this.pools.push(s), s?.emodes?.forEach((m) => {
1186
1195
  o[m.uniqueId] || this.emodes.push(m), m.assets.forEach((w) => {
1187
1196
  w.isDebt && m.assets.find(
1188
- (g) => g.isCollateral && g.ltv > 0 && g.assetId !== s.id
1189
- ) && n.add(s.uniqueId), w.isCollateral && m.assets.find((g) => g.isDebt && g.assetId !== s.id) && a.add(s.uniqueId);
1197
+ (y) => y.isCollateral && y.ltv > 0 && y.assetId !== s.id
1198
+ ) && n.add(s.uniqueId), w.isCollateral && m.assets.find((y) => y.isDebt && y.assetId !== s.id) && a.add(s.uniqueId);
1190
1199
  });
1191
1200
  }), i = i.plus(s.poolBorrowValue), c = c.plus(s.poolSupplyValue);
1192
- }), this.poolMap = te(this.pools, "id"), this.emodeMap = pe(this.emodes, "emodeId"), this.emodes.forEach((s) => {
1201
+ }), this.poolMap = ne(this.pools, "id"), this.emodeMap = fe(this.emodes, "emodeId"), this.emodes.forEach((s) => {
1193
1202
  const u = this.getEModePools(s.emodeId);
1194
1203
  this.emodePools.push(...u);
1195
1204
  }), this._overview = {
@@ -1227,44 +1236,44 @@ class Ct {
1227
1236
  return typeof t == "number" && t === this.config.id && (r = !0), typeof t == "string" && t === this.config.key && (r = !0), typeof t == "object" && t.id === this.config.id && (r = !0), r;
1228
1237
  }
1229
1238
  }
1230
- const _ = (e) => {
1231
- const r = Object.values(F).find((o) => typeof e == "number" ? o.id === e : typeof e == "string" ? o.key === e : o.id === e.id);
1239
+ const P = (e) => {
1240
+ const r = Object.values(L).find((o) => typeof e == "number" ? o.id === e : typeof e == "string" ? o.key === e : o.id === e.id);
1232
1241
  if (!r)
1233
1242
  throw new Error("Market not found");
1234
1243
  return r;
1235
- }, jt = $(
1236
- A(
1244
+ }, jt = O(
1245
+ S(
1237
1246
  async (e, t) => {
1238
- const r = await G({
1247
+ const r = await J({
1239
1248
  cacheTime: 6e4,
1240
1249
  ...t,
1241
1250
  markets: e
1242
1251
  });
1243
1252
  return e.map((o) => {
1244
- const n = _(o), a = r.filter((c) => c.market === n.key);
1253
+ const n = P(o), a = r.filter((c) => c.market === n.key);
1245
1254
  return new Ct(o, a);
1246
1255
  });
1247
1256
  }
1248
1257
  )
1249
- ), nr = $(
1250
- A(
1258
+ ), nr = O(
1259
+ S(
1251
1260
  async (e, t) => (await jt([e], t))[0]
1252
1261
  )
1253
- ), j = $(
1254
- A(
1262
+ ), I = O(
1263
+ S(
1255
1264
  async (e) => {
1256
- const t = _(e?.market || R), r = O(e), o = M(
1257
- `/navi/config?env=${e?.env || "prod"}&sdk=${E.version}&market=${t.key}`,
1265
+ const t = P(e?.market || z), r = M(e), o = F(
1266
+ `/navi/config?env=${e?.env || "prod"}&sdk=${V.version}&market=${t.key}`,
1258
1267
  e
1259
1268
  );
1260
1269
  return (await fetch(o, {
1261
- headers: U(D, r)
1270
+ headers: N(R, r)
1262
1271
  }).then((a) => a.json())).data;
1263
1272
  }
1264
1273
  )
1265
1274
  ), v = 1e3 * 60 * 5;
1266
- async function kt(e, t) {
1267
- const r = await j({
1275
+ async function It(e, t) {
1276
+ const r = await I({
1268
1277
  cacheTime: v,
1269
1278
  ...t
1270
1279
  });
@@ -1273,8 +1282,8 @@ async function kt(e, t) {
1273
1282
  arguments: []
1274
1283
  });
1275
1284
  }
1276
- async function It(e, t, r) {
1277
- const o = await j({
1285
+ async function kt(e, t, r) {
1286
+ const o = await I({
1278
1287
  cacheTime: v,
1279
1288
  ...r
1280
1289
  });
@@ -1284,7 +1293,7 @@ async function It(e, t, r) {
1284
1293
  });
1285
1294
  }
1286
1295
  async function _t(e, t, r) {
1287
- const o = await j({
1296
+ const o = await I({
1288
1297
  ...r,
1289
1298
  cacheTime: v
1290
1299
  });
@@ -1301,7 +1310,7 @@ async function _t(e, t, r) {
1301
1310
  }), e;
1302
1311
  }
1303
1312
  async function or(e, t) {
1304
- const r = await j({
1313
+ const r = await I({
1305
1314
  ...t,
1306
1315
  cacheTime: v
1307
1316
  });
@@ -1314,15 +1323,15 @@ async function or(e, t) {
1314
1323
  }), e;
1315
1324
  }
1316
1325
  async function ar(e, t, r) {
1317
- const o = await j({
1326
+ const o = await I({
1318
1327
  cacheTime: v,
1319
1328
  ...r
1320
- }), n = await kt(e, r);
1329
+ }), n = await It(e, r);
1321
1330
  await _t(e, t, {
1322
1331
  ...r,
1323
1332
  accountCap: n
1324
1333
  });
1325
- const a = await _(r?.market || R), c = await It(e, n, r);
1334
+ const a = await P(r?.market || z), c = await kt(e, n, r);
1326
1335
  return e.moveCall({
1327
1336
  target: `${o.emode.contract.registryPackage}::registry::register_emode_for_account_cap`,
1328
1337
  arguments: [
@@ -1333,18 +1342,18 @@ async function ar(e, t, r) {
1333
1342
  ]
1334
1343
  }), n;
1335
1344
  }
1336
- const Be = $(
1337
- A(
1345
+ const Ae = O(
1346
+ S(
1338
1347
  async (e, t) => {
1339
- const r = await j({
1348
+ const r = await I({
1340
1349
  cacheTime: v,
1341
1350
  ...t
1342
- }), o = new N(), n = t?.client ?? V;
1351
+ }), o = new q(), n = t?.client ?? U;
1343
1352
  o.moveCall({
1344
1353
  target: `${r.emode.contract.registryPackage}::registry::find_user_emode_account_caps`,
1345
1354
  arguments: [o.object(r.emode.contract.registryObject), o.pure.address(e)]
1346
1355
  });
1347
- const c = (await q(n, {
1356
+ const c = (await W(n, {
1348
1357
  transactionBlock: o,
1349
1358
  sender: e
1350
1359
  })).results[0].returnValues, i = l.vector(l.u64()).parse(Uint8Array.from(c[0][0])), s = l.vector(l.u64()).parse(Uint8Array.from(c[1][0])), u = l.vector(l.Address).parse(Uint8Array.from(c[2][0]));
@@ -1357,12 +1366,12 @@ const Be = $(
1357
1366
  )
1358
1367
  );
1359
1368
  function ir(e) {
1360
- return `${_(e.marketId).key}-${e.emodeId}`;
1369
+ return `${P(e.marketId).key}-${e.emodeId}`;
1361
1370
  }
1362
1371
  function Tt(e, t) {
1363
1372
  return e.coinType ? e.coinType : t || (typeof e.type == "string" ? e.type.match(/::coin::Coin<(.+)>$/) : null)?.[1];
1364
1373
  }
1365
- function me(e, t) {
1374
+ function ye(e, t) {
1366
1375
  const r = Tt(e, t), o = e.coinObjectId ?? e.objectId;
1367
1376
  return !r || !o || e.balance === void 0 || e.balance === null ? null : {
1368
1377
  ...e,
@@ -1371,29 +1380,55 @@ function me(e, t) {
1371
1380
  };
1372
1381
  }
1373
1382
  function cr(e, t, r) {
1374
- const o = typeof r?.balance == "number", n = o ? r.balance : 0;
1375
- let a = 0;
1376
- const c = [];
1377
- let i = "";
1378
- if (t.sort((s, u) => Number(u.balance) - Number(s.balance)).forEach((s) => {
1379
- if (!(o && a >= n) && Number(s.balance) !== 0) {
1380
- if (i || (i = s.coinType), i !== s.coinType)
1383
+ const o = typeof r?.balance == "number", n = o ? r.balance : 0, a = BigInt(r?.addressBalance ?? 0);
1384
+ let c = 0;
1385
+ const i = [];
1386
+ let s = "", u = 0n;
1387
+ t.sort((B, X) => Number(X.balance) - Number(B.balance)).forEach((B) => {
1388
+ if (u += BigInt(B.balance), !(o && c >= n) && Number(B.balance) !== 0) {
1389
+ if (s || (s = B.coinType), s !== B.coinType)
1381
1390
  throw new Error("All coins must be of the same type");
1382
- a += Number(s.balance), c.push(s.coinObjectId);
1391
+ c += Number(B.balance), i.push(B.coinObjectId);
1392
+ }
1393
+ });
1394
+ const m = r?.coinType, y = ((B) => {
1395
+ if (!B)
1396
+ return !1;
1397
+ try {
1398
+ return C(B) === C("0x2::sui::SUI");
1399
+ } catch {
1400
+ return !1;
1383
1401
  }
1384
- }), c.length === 0)
1402
+ })(s || m || "") && !!r?.useGasCoin, d = BigInt(n), f = !y && !!m, b = f ? a : 0n, j = u + b, _ = !o || u >= d ? 0n : d - u, k = f && _ > 0n && b >= _;
1403
+ if (o && j < d)
1404
+ throw new Error(`Balance is less than the specified balance: ${j} < ${d}`);
1405
+ if (i.length === 0 && !k)
1385
1406
  throw new Error("No coins to merge");
1386
- if (o && a < n)
1387
- throw new Error(
1388
- `Balance is less than the specified balance: ${a} < ${n}`
1389
- );
1390
- return C(i) === C("0x2::sui::SUI") && r?.useGasCoin ? o ? e.splitCoins(e.gas, [e.pure.u64(n)]) : e.gas : (c.length === 1 ? e.object(c[0]) : e.mergeCoins(c[0], c.slice(1)), o ? e.splitCoins(c[0], [e.pure.u64(n)]) : c[0]);
1407
+ if (y)
1408
+ return o ? e.splitCoins(e.gas, [e.pure.u64(n)]) : e.gas;
1409
+ if (!k)
1410
+ return i.length === 1 ? e.object(i[0]) : e.mergeCoins(i[0], i.slice(1)), o ? e.splitCoins(i[0], [e.pure.u64(n)]) : i[0];
1411
+ const T = e.moveCall({
1412
+ target: "0x2::coin::redeem_funds",
1413
+ typeArguments: [m],
1414
+ arguments: [e.withdrawal({ amount: _, type: m })]
1415
+ });
1416
+ let $;
1417
+ const D = [];
1418
+ if (i.length > 0) {
1419
+ $ = e.object(i[0]);
1420
+ for (const B of i.slice(1))
1421
+ D.push(e.object(B));
1422
+ D.push(T);
1423
+ } else
1424
+ $ = T;
1425
+ return D.length > 0 && e.mergeCoins($, D), i.length === 0 ? $ : o ? e.splitCoins($, [e.pure.u64(n)]) : $;
1391
1426
  }
1392
- async function Pe(e, t, r, o, n, a, c) {
1393
- const i = await j({
1427
+ async function Se(e, t, r, o, n, a, c) {
1428
+ const i = await I({
1394
1429
  ...c,
1395
1430
  cacheTime: v
1396
- }), s = await S(r, c);
1431
+ }), s = await E(r, c);
1397
1432
  return e.moveCall({
1398
1433
  target: `${i.uiGetter}::calculator_unchecked::dynamic_health_factor`,
1399
1434
  arguments: [
@@ -1411,15 +1446,15 @@ async function Pe(e, t, r, o, n, a, c) {
1411
1446
  });
1412
1447
  }
1413
1448
  async function Bt(e, t, r) {
1414
- return Pe(e, t, 0, 0, 0, !1, r);
1449
+ return Se(e, t, 0, 0, 0, !1, r);
1415
1450
  }
1416
- async function Ae(e, t, r) {
1417
- const o = new N(), n = r?.client ?? V, a = await G({
1451
+ async function $e(e, t, r) {
1452
+ const o = new q(), n = r?.client ?? U, a = await J({
1418
1453
  ...r,
1419
- markets: Object.values(F)
1420
- }), c = te(a), s = Array.from(new Set(t.map((d) => d.market))).map((d) => _(d));
1454
+ markets: Object.values(L)
1455
+ }), c = ne(a), s = Array.from(new Set(t.map((d) => d.market))).map((d) => P(d));
1421
1456
  for (const d of s) {
1422
- const f = await j({
1457
+ const f = await I({
1423
1458
  ...r,
1424
1459
  cacheTime: v,
1425
1460
  market: d.key
@@ -1430,7 +1465,7 @@ async function Ae(e, t, r) {
1430
1465
  });
1431
1466
  }
1432
1467
  for (let d of t) {
1433
- const f = await j({
1468
+ const f = await I({
1434
1469
  ...r,
1435
1470
  cacheTime: v,
1436
1471
  market: d.market
@@ -1440,19 +1475,19 @@ async function Ae(e, t, r) {
1440
1475
  arguments: [o.object(f.storage), o.pure.address(d.address)]
1441
1476
  });
1442
1477
  }
1443
- const m = (await q(n, {
1478
+ const m = (await W(n, {
1444
1479
  transactionBlock: o,
1445
1480
  sender: e
1446
1481
  })).results || [], w = {};
1447
1482
  s.forEach((d, f) => {
1448
1483
  try {
1449
- const b = m[f]?.returnValues?.map((T) => l.vector(qe).parse(Uint8Array.from(T[0])))[0] || [], k = {};
1450
- for (const T of b)
1451
- k[T.id] = {
1452
- supplyIndex: T.supply_index,
1453
- borrowIndex: T.borrow_index
1484
+ const b = m[f]?.returnValues?.map((_) => l.vector(qe).parse(Uint8Array.from(_[0])))[0] || [], j = {};
1485
+ for (const _ of b)
1486
+ j[_.id] = {
1487
+ supplyIndex: _.supply_index,
1488
+ borrowIndex: _.borrow_index
1454
1489
  };
1455
- w[d.key] = k;
1490
+ w[d.key] = j;
1456
1491
  } catch (b) {
1457
1492
  console.warn(
1458
1493
  `[@naviprotocol/lending] Failed to decode reserve data for market "${d.key}", falling back to open-api pool indices`,
@@ -1460,55 +1495,55 @@ async function Ae(e, t, r) {
1460
1495
  );
1461
1496
  }
1462
1497
  });
1463
- const y = m.slice(s.length).map((d) => d.returnValues?.map((f) => l.vector(ze).parse(Uint8Array.from(f[0])))[0] || []), g = [];
1464
- return y.forEach((d, f) => {
1465
- const b = t[f], k = _(b.market), T = w[k.key] || {};
1466
- d.forEach((I) => {
1467
- if (I.supply_balance === "0" && I.borrow_balance === "0" && (b.emodeId === void 0 || !r?.includeZeroBalanceEmodePositions))
1498
+ const g = m.slice(s.length).map((d) => d.returnValues?.map((f) => l.vector(ze).parse(Uint8Array.from(f[0])))[0] || []), y = [];
1499
+ return g.forEach((d, f) => {
1500
+ const b = t[f], j = P(b.market), _ = w[j.key] || {};
1501
+ d.forEach((k) => {
1502
+ if (k.supply_balance === "0" && k.borrow_balance === "0" && (b.emodeId === void 0 || !r?.includeZeroBalanceEmodePositions))
1468
1503
  return;
1469
- const B = c[`${k.key}-${I.asset_id}`];
1470
- if (!B)
1504
+ const T = c[`${j.key}-${k.asset_id}`];
1505
+ if (!T)
1471
1506
  return;
1472
- const W = T[I.asset_id], Y = W?.supplyIndex ?? B.currentSupplyIndex, Ee = W?.borrowIndex ?? B.currentBorrowIndex, Oe = de(I.supply_balance, Y).toString(), Ve = de(I.borrow_balance, Ee).toString();
1473
- g.push({
1474
- supplyBalance: Oe,
1507
+ const $ = _[k.asset_id], D = $?.supplyIndex ?? T.currentSupplyIndex, B = $?.borrowIndex ?? T.currentBorrowIndex, X = me(k.supply_balance, D).toString(), Ve = me(k.borrow_balance, B).toString();
1508
+ y.push({
1509
+ supplyBalance: X,
1475
1510
  borrowBalance: Ve,
1476
- assetId: I.asset_id,
1477
- market: k.key,
1478
- pool: B,
1511
+ assetId: k.asset_id,
1512
+ market: j.key,
1513
+ pool: T,
1479
1514
  emodeId: b.emodeId
1480
1515
  });
1481
1516
  });
1482
- }), g;
1517
+ }), y;
1483
1518
  }
1484
- const sr = $(
1519
+ const sr = O(
1485
1520
  async (e, t) => {
1486
- const o = (t?.markets || Object.keys(F)).map((n) => _(n)).map((n) => ({
1521
+ const o = (t?.markets || Object.keys(L)).map((n) => P(n)).map((n) => ({
1487
1522
  address: e,
1488
1523
  market: n.key
1489
1524
  }));
1490
- return await Ae(e, o, t);
1525
+ return await $e(e, o, t);
1491
1526
  }
1492
1527
  );
1493
1528
  async function ur(e, t) {
1494
- const r = t?.client ?? V, o = new N();
1529
+ const r = t?.client ?? U, o = new q();
1495
1530
  await Bt(o, e, t);
1496
- const n = await q(r, {
1531
+ const n = await W(r, {
1497
1532
  transactionBlock: o,
1498
1533
  sender: e
1499
- }), a = Q(n, [l.u256()]);
1500
- return Te(Number(a[0]) || 0);
1534
+ }), a = Z(n, [l.u256()]);
1535
+ return Pe(Number(a[0]) || 0);
1501
1536
  }
1502
1537
  async function lr(e, t, r, o) {
1503
- const n = o?.client ?? V, a = new N();
1538
+ const n = o?.client ?? U, a = new q();
1504
1539
  let c = 0, i = 0;
1505
- const s = await S(t, o);
1506
- if (r.forEach((y) => {
1507
- y.type === z.Supply ? c += y.amount : y.type === z.Withdraw ? c -= y.amount : y.type === z.Borrow ? i += y.amount : y.type === z.Repay && (i -= y.amount);
1540
+ const s = await E(t, o);
1541
+ if (r.forEach((g) => {
1542
+ g.type === H.Supply ? c += g.amount : g.type === H.Withdraw ? c -= g.amount : g.type === H.Borrow ? i += g.amount : g.type === H.Repay && (i -= g.amount);
1508
1543
  }), c * i < 0)
1509
1544
  throw new Error("Invalid operations");
1510
1545
  const u = c > 0 || i > 0;
1511
- await Pe(
1546
+ await Se(
1512
1547
  a,
1513
1548
  e,
1514
1549
  s,
@@ -1517,28 +1552,28 @@ async function lr(e, t, r, o) {
1517
1552
  u,
1518
1553
  o
1519
1554
  );
1520
- const m = await q(n, {
1555
+ const m = await W(n, {
1521
1556
  transactionBlock: a,
1522
1557
  sender: e
1523
- }), w = Q(m, [l.u256()]);
1524
- return Te(Number(w[0]) || 0);
1558
+ }), w = Z(m, [l.u256()]);
1559
+ return Pe(Number(w[0]) || 0);
1525
1560
  }
1526
- const dr = A(
1561
+ const dr = S(
1527
1562
  async (e, t) => {
1528
1563
  const r = new URLSearchParams();
1529
1564
  t?.cursor && r.set("cursor", t.cursor), r.set("userAddress", e);
1530
- const o = O(t), n = M(
1531
- `/navi/user/transactions?${r.toString()}&sdk=${E.version}`,
1565
+ const o = M(t), n = F(
1566
+ `/navi/user/transactions?${r.toString()}&sdk=${V.version}`,
1532
1567
  t
1533
1568
  );
1534
1569
  return (await fetch(n, {
1535
- headers: U(D, o)
1570
+ headers: N(R, o)
1536
1571
  }).then((c) => c.json())).data;
1537
1572
  }
1538
1573
  );
1539
1574
  async function pr(e, t) {
1540
1575
  let r = null;
1541
- const o = [], n = t?.client ?? V, a = n.core;
1576
+ const o = [], n = t?.client ?? U, a = n.core;
1542
1577
  do {
1543
1578
  let c;
1544
1579
  if (t?.coinType)
@@ -1550,7 +1585,7 @@ async function pr(e, t) {
1550
1585
  limit: 100
1551
1586
  });
1552
1587
  c = {
1553
- data: (i.objects ?? i.data ?? []).map((s) => me(s, t?.coinType)).filter(Boolean),
1588
+ data: (i.objects ?? i.data ?? []).map((s) => ye(s, t?.coinType)).filter(Boolean),
1554
1589
  nextCursor: i.cursor ?? i.nextCursor ?? null,
1555
1590
  hasNextPage: i.hasNextPage ?? !1
1556
1591
  };
@@ -1587,7 +1622,7 @@ async function pr(e, t) {
1587
1622
  limit: 100
1588
1623
  });
1589
1624
  o.push(
1590
- ...(w.objects ?? w.data ?? []).map((y) => me(y, u)).filter(Boolean)
1625
+ ...(w.objects ?? w.data ?? []).map((g) => ye(g, u)).filter(Boolean)
1591
1626
  ), m = w.cursor ?? w.nextCursor ?? null;
1592
1627
  } while (m);
1593
1628
  }
@@ -1609,75 +1644,75 @@ async function pr(e, t) {
1609
1644
  } while (r);
1610
1645
  return o;
1611
1646
  }
1612
- const Pt = $(
1647
+ const Pt = O(
1613
1648
  async (e, t) => {
1614
- const r = [], o = (t?.markets || Object.keys(F)).map((i) => _(i)), n = await Be(e, t), a = o.map((i) => ({
1649
+ const r = [], o = (t?.markets || Object.keys(L)).map((i) => P(i)), n = await Ae(e, t), a = o.map((i) => ({
1615
1650
  address: e,
1616
1651
  market: i.key
1617
1652
  })).concat(
1618
1653
  n.filter((i) => !!o.find((s) => s.id === i.marketId)).map((i) => ({
1619
1654
  address: i.accountCap,
1620
- market: _(i.marketId).key,
1655
+ market: P(i.marketId).key,
1621
1656
  emodeId: i.emodeId
1622
1657
  }))
1623
1658
  );
1624
- return (await Ae(e, a, t)).forEach((i) => {
1659
+ return (await $e(e, a, t)).forEach((i) => {
1625
1660
  const s = typeof i.emodeId == "number" ? n.find((u) => {
1626
- const m = _(i.market);
1661
+ const m = P(i.market);
1627
1662
  return u.emodeId === i.emodeId && u.marketId === m.id;
1628
1663
  }) : void 0;
1629
1664
  if (s) {
1630
1665
  if (!i.pool.emodes.find((m) => m.emodeId === s.emodeId))
1631
1666
  return;
1632
1667
  if (p(i.supplyBalance).gte(0)) {
1633
- const m = p(i.supplyBalance).shiftedBy(-9).decimalPlaces(i.pool.token.decimals, p.ROUND_DOWN), w = H(i.pool, s);
1668
+ const m = p(i.supplyBalance).shiftedBy(-9).decimalPlaces(i.pool.token.decimals, p.ROUND_DOWN), w = K(i.pool, s);
1634
1669
  if (m.gt(0) || w.emode.isCollateral)
1635
1670
  try {
1636
1671
  r.push({
1637
- id: `${i.pool.uniqueId}_${s.emodeId}_navi-lending-emode-supply-${P()}`,
1672
+ id: `${i.pool.uniqueId}_${s.emodeId}_navi-lending-emode-supply-${A()}`,
1638
1673
  wallet: e,
1639
1674
  protocol: "navi",
1640
1675
  market: i.market,
1641
1676
  type: "navi-lending-emode-supply",
1642
1677
  "navi-lending-emode-supply": {
1643
1678
  amount: m.toString(),
1644
- pool: H(i.pool, s),
1679
+ pool: K(i.pool, s),
1645
1680
  token: i.pool.token,
1646
1681
  valueUSD: m.multipliedBy(i.pool.oracle.price).toString(),
1647
1682
  emodeCap: s
1648
1683
  }
1649
1684
  });
1650
- } catch (y) {
1651
- console.error(y);
1685
+ } catch (g) {
1686
+ console.error(g);
1652
1687
  }
1653
1688
  }
1654
1689
  if (p(i.borrowBalance).gte(0)) {
1655
- const m = p(i.borrowBalance).shiftedBy(-9).decimalPlaces(i.pool.token.decimals, p.ROUND_DOWN), w = H(i.pool, s);
1690
+ const m = p(i.borrowBalance).shiftedBy(-9).decimalPlaces(i.pool.token.decimals, p.ROUND_DOWN), w = K(i.pool, s);
1656
1691
  if (m.gt(0) || w.emode.isDebt)
1657
1692
  try {
1658
1693
  r.push({
1659
- id: `${i.pool.uniqueId}_${s.emodeId}_navi-lending-emode-borrow-${P()}`,
1694
+ id: `${i.pool.uniqueId}_${s.emodeId}_navi-lending-emode-borrow-${A()}`,
1660
1695
  wallet: e,
1661
1696
  protocol: "navi",
1662
1697
  market: i.market,
1663
1698
  type: "navi-lending-emode-borrow",
1664
1699
  "navi-lending-emode-borrow": {
1665
1700
  amount: m.toString(),
1666
- pool: H(i.pool, s),
1701
+ pool: K(i.pool, s),
1667
1702
  token: i.pool.token,
1668
1703
  valueUSD: m.multipliedBy(i.pool.oracle.price).toString(),
1669
1704
  emodeCap: s
1670
1705
  }
1671
1706
  });
1672
- } catch (y) {
1673
- console.error(y);
1707
+ } catch (g) {
1708
+ console.error(g);
1674
1709
  }
1675
1710
  }
1676
1711
  } else {
1677
1712
  if (p(i.supplyBalance).gt(0)) {
1678
1713
  const u = p(i.supplyBalance).shiftedBy(-9).decimalPlaces(i.pool.token.decimals, p.ROUND_DOWN);
1679
1714
  r.push({
1680
- id: `${i.pool.uniqueId}_navi-lending-supply-${P()}`,
1715
+ id: `${i.pool.uniqueId}_navi-lending-supply-${A()}`,
1681
1716
  wallet: e,
1682
1717
  protocol: "navi",
1683
1718
  type: "navi-lending-supply",
@@ -1693,7 +1728,7 @@ const Pt = $(
1693
1728
  if (p(i.borrowBalance).gt(0)) {
1694
1729
  const u = p(i.borrowBalance).shiftedBy(-9).decimalPlaces(i.pool.token.decimals, p.ROUND_DOWN);
1695
1730
  r.push({
1696
- id: `${i.pool.uniqueId}_navi-lending-borrow-${P()}`,
1731
+ id: `${i.pool.uniqueId}_navi-lending-borrow-${A()}`,
1697
1732
  wallet: e,
1698
1733
  protocol: "navi",
1699
1734
  market: i.market,
@@ -1710,7 +1745,7 @@ const Pt = $(
1710
1745
  }), r;
1711
1746
  }
1712
1747
  );
1713
- class L {
1748
+ class G {
1714
1749
  constructor(t, r) {
1715
1750
  this._positions = [], this._priceMap = {}, this._overview = {
1716
1751
  hf: 1 / 0,
@@ -1750,7 +1785,7 @@ class L {
1750
1785
  }
1751
1786
  filterPositionsByPool(t) {
1752
1787
  const o = !!t.isEMode ? ["navi-lending-emode-supply", "navi-lending-emode-borrow"] : ["navi-lending-supply", "navi-lending-borrow"];
1753
- return new L(
1788
+ return new G(
1754
1789
  this.positions.filter((n) => {
1755
1790
  const a = n[n.type];
1756
1791
  return o.includes(n.type) && a.pool.uniqueId === t.uniqueId;
@@ -1762,7 +1797,7 @@ class L {
1762
1797
  const o = !!t.isEMode, n = this.getPrice(t);
1763
1798
  let a;
1764
1799
  return o ? a = {
1765
- id: P(),
1800
+ id: A(),
1766
1801
  wallet: "",
1767
1802
  protocol: "navi",
1768
1803
  market: "",
@@ -1775,7 +1810,7 @@ class L {
1775
1810
  emodeCap: {}
1776
1811
  }
1777
1812
  } : a = {
1778
- id: P(),
1813
+ id: A(),
1779
1814
  wallet: "",
1780
1815
  protocol: "navi",
1781
1816
  market: "",
@@ -1786,13 +1821,13 @@ class L {
1786
1821
  token: t.token,
1787
1822
  pool: t
1788
1823
  }
1789
- }, new L([...this.positions, a], this._priceMap);
1824
+ }, new G([...this.positions, a], this._priceMap);
1790
1825
  }
1791
1826
  withdraw(t, r) {
1792
1827
  const o = !!t.isEMode, n = this.getPrice(t);
1793
1828
  let a;
1794
1829
  return o ? a = {
1795
- id: P(),
1830
+ id: A(),
1796
1831
  wallet: "",
1797
1832
  protocol: "navi",
1798
1833
  market: "",
@@ -1805,7 +1840,7 @@ class L {
1805
1840
  emodeCap: {}
1806
1841
  }
1807
1842
  } : a = {
1808
- id: P(),
1843
+ id: A(),
1809
1844
  wallet: "",
1810
1845
  protocol: "navi",
1811
1846
  market: "",
@@ -1816,13 +1851,13 @@ class L {
1816
1851
  token: t.token,
1817
1852
  pool: t
1818
1853
  }
1819
- }, new L([...this.positions, a], this._priceMap);
1854
+ }, new G([...this.positions, a], this._priceMap);
1820
1855
  }
1821
1856
  borrow(t, r) {
1822
1857
  const o = !!t.isEMode, n = this.getPrice(t);
1823
1858
  let a;
1824
1859
  return o ? a = {
1825
- id: P(),
1860
+ id: A(),
1826
1861
  wallet: "",
1827
1862
  protocol: "navi",
1828
1863
  market: "",
@@ -1835,7 +1870,7 @@ class L {
1835
1870
  emodeCap: {}
1836
1871
  }
1837
1872
  } : a = {
1838
- id: P(),
1873
+ id: A(),
1839
1874
  wallet: "",
1840
1875
  protocol: "navi",
1841
1876
  market: "",
@@ -1846,13 +1881,13 @@ class L {
1846
1881
  token: t.token,
1847
1882
  pool: t
1848
1883
  }
1849
- }, new L([...this.positions, a], this._priceMap);
1884
+ }, new G([...this.positions, a], this._priceMap);
1850
1885
  }
1851
1886
  repay(t, r) {
1852
1887
  const o = !!t.isEMode, n = this.getPrice(t);
1853
1888
  let a;
1854
1889
  return o ? a = {
1855
- id: P(),
1890
+ id: A(),
1856
1891
  wallet: "",
1857
1892
  protocol: "navi",
1858
1893
  market: "",
@@ -1865,7 +1900,7 @@ class L {
1865
1900
  emodeCap: {}
1866
1901
  }
1867
1902
  } : a = {
1868
- id: P(),
1903
+ id: A(),
1869
1904
  wallet: "",
1870
1905
  protocol: "navi",
1871
1906
  market: "",
@@ -1876,7 +1911,7 @@ class L {
1876
1911
  token: t.token,
1877
1912
  pool: t
1878
1913
  }
1879
- }, new L([...this.positions, a], this._priceMap);
1914
+ }, new G([...this.positions, a], this._priceMap);
1880
1915
  }
1881
1916
  resolveValueUSD(t) {
1882
1917
  return Object.keys(this._priceMap).length > 0 ? p(t.amount).multipliedBy(this.getPrice(t.pool)).toString() : t.valueUSD;
@@ -1884,19 +1919,19 @@ class L {
1884
1919
  getPositionsOverview(t) {
1885
1920
  const r = {}, o = {};
1886
1921
  let n = new p(0), a = new p(0), c = new p(0), i = new p(0), s = new p(0), u = new p(0);
1887
- t.forEach((g) => {
1888
- if (g.type === "navi-lending-supply") {
1889
- const d = g["navi-lending-supply"], f = this.resolveValueUSD(d);
1922
+ t.forEach((y) => {
1923
+ if (y.type === "navi-lending-supply") {
1924
+ const d = y["navi-lending-supply"], f = this.resolveValueUSD(d);
1890
1925
  n = n.plus(f), s = s.plus(
1891
1926
  new p(f).multipliedBy(d.pool.liquidationFactor.threshold)
1892
1927
  ), u = u.plus(
1893
1928
  new p(f).multipliedBy(d.pool.ltvValue)
1894
1929
  );
1895
- } else if (g.type === "navi-lending-borrow") {
1896
- const d = g["navi-lending-borrow"];
1930
+ } else if (y.type === "navi-lending-borrow") {
1931
+ const d = y["navi-lending-borrow"];
1897
1932
  a = a.plus(this.resolveValueUSD(d));
1898
- } else if (g.type === "navi-lending-emode-supply") {
1899
- const d = g["navi-lending-emode-supply"], f = this.resolveValueUSD(d);
1933
+ } else if (y.type === "navi-lending-emode-supply") {
1934
+ const d = y["navi-lending-emode-supply"], f = this.resolveValueUSD(d);
1900
1935
  n = n.plus(f);
1901
1936
  const b = d.pool.emode;
1902
1937
  s = s.plus(
@@ -1904,28 +1939,28 @@ class L {
1904
1939
  ), u = u.plus(
1905
1940
  new p(f).multipliedBy(b.ltv)
1906
1941
  );
1907
- } else if (g.type === "navi-lending-emode-borrow") {
1908
- const d = g["navi-lending-emode-borrow"];
1942
+ } else if (y.type === "navi-lending-emode-borrow") {
1943
+ const d = y["navi-lending-emode-borrow"];
1909
1944
  a = a.plus(this.resolveValueUSD(d));
1910
1945
  }
1911
- }), a = p.max(a, 0), n = p.max(n, 0), s = p.max(s, 0), u = p.max(u, 0), t.forEach((g) => {
1912
- if (g.type === "navi-lending-supply") {
1913
- const d = g["navi-lending-supply"], f = this.resolveValueUSD(d), b = d.pool.supplyIncentiveApyInfo.apy;
1946
+ }), a = p.max(a, 0), n = p.max(n, 0), s = p.max(s, 0), u = p.max(u, 0), t.forEach((y) => {
1947
+ if (y.type === "navi-lending-supply") {
1948
+ const d = y["navi-lending-supply"], f = this.resolveValueUSD(d), b = d.pool.supplyIncentiveApyInfo.apy;
1914
1949
  n.gt(0) && (c = c.plus(
1915
1950
  new p(f).dividedBy(n).multipliedBy(new p(b).dividedBy(100))
1916
1951
  )), r[d.pool.suiCoinType] = p(r[d.pool.suiCoinType] || 0).plus(d.amount).toString();
1917
- } else if (g.type === "navi-lending-borrow") {
1918
- const d = g["navi-lending-borrow"], f = this.resolveValueUSD(d), b = d.pool.borrowIncentiveApyInfo.apy;
1952
+ } else if (y.type === "navi-lending-borrow") {
1953
+ const d = y["navi-lending-borrow"], f = this.resolveValueUSD(d), b = d.pool.borrowIncentiveApyInfo.apy;
1919
1954
  a.gt(0) && (i = i.plus(
1920
1955
  new p(f).dividedBy(a).multipliedBy(new p(b).dividedBy(100))
1921
1956
  )), o[d.pool.suiCoinType] = p(o[d.pool.suiCoinType] || 0).plus(d.amount).toString();
1922
- } else if (g.type === "navi-lending-emode-supply") {
1923
- const d = g["navi-lending-emode-supply"], f = this.resolveValueUSD(d), b = d.pool.supplyIncentiveApyInfo.apy;
1957
+ } else if (y.type === "navi-lending-emode-supply") {
1958
+ const d = y["navi-lending-emode-supply"], f = this.resolveValueUSD(d), b = d.pool.supplyIncentiveApyInfo.apy;
1924
1959
  n.gt(0) && (c = c.plus(
1925
1960
  new p(f).dividedBy(n).multipliedBy(new p(b).dividedBy(100))
1926
1961
  )), r[d.pool.suiCoinType] = p(r[d.pool.suiCoinType] || 0).plus(d.amount).toString();
1927
- } else if (g.type === "navi-lending-emode-borrow") {
1928
- const d = g["navi-lending-emode-borrow"], f = this.resolveValueUSD(d), b = d.pool.borrowIncentiveApyInfo.apy;
1962
+ } else if (y.type === "navi-lending-emode-borrow") {
1963
+ const d = y["navi-lending-emode-borrow"], f = this.resolveValueUSD(d), b = d.pool.borrowIncentiveApyInfo.apy;
1929
1964
  a.gt(0) && (i = i.plus(
1930
1965
  new p(f).dividedBy(a).multipliedBy(new p(b).dividedBy(100))
1931
1966
  )), o[d.pool.suiCoinType] = p(o[d.pool.suiCoinType] || 0).plus(d.amount).toString();
@@ -1948,7 +1983,7 @@ class L {
1948
1983
  }
1949
1984
  }
1950
1985
  async function mr(e, t, r, o) {
1951
- const n = await j({
1986
+ const n = await I({
1952
1987
  ...o,
1953
1988
  cacheTime: v
1954
1989
  });
@@ -1963,12 +1998,12 @@ async function mr(e, t, r, o) {
1963
1998
  ]
1964
1999
  });
1965
2000
  }
1966
- const Se = new Ce("https://hermes.pyth.network", {
2001
+ const Ee = new Ie("https://hermes.pyth.network", {
1967
2002
  timeout: 1e4
1968
2003
  });
1969
2004
  async function fr(e) {
1970
2005
  try {
1971
- const t = [], r = await Se.getLatestPriceFeeds(e);
2006
+ const t = [], r = await Ee.getLatestPriceFeeds(e);
1972
2007
  if (!r) return t;
1973
2008
  const o = Math.floor((/* @__PURE__ */ new Date()).valueOf() / 1e3);
1974
2009
  for (const n of r) {
@@ -1989,7 +2024,7 @@ async function fr(e) {
1989
2024
  }
1990
2025
  }
1991
2026
  async function At(e, t) {
1992
- const r = [], o = t?.client ?? V, n = e.map((c) => c.priceInfoObject), a = await gt(o, {
2027
+ const r = [], o = t?.client ?? U, n = e.map((c) => c.priceInfoObject), a = await gt(o, {
1993
2028
  ids: Array.from(new Set(n)),
1994
2029
  options: { showContent: !0 }
1995
2030
  });
@@ -2009,12 +2044,12 @@ async function At(e, t) {
2009
2044
  console.warn(`unexpected pyth price struct, priceInfoObject: ${i.objectId}`);
2010
2045
  continue;
2011
2046
  }
2012
- const { magnitude: w, negative: y } = m, g = u.conf, d = u.timestamp;
2047
+ const { magnitude: w, negative: g } = m, y = u.conf, d = u.timestamp;
2013
2048
  r.push({
2014
2049
  priceFeedId: s.priceFeedId,
2015
2050
  priceInfoObject: s.priceInfoObject,
2016
- price: y ? "-" + w : w,
2017
- conf: g,
2051
+ price: g ? "-" + w : w,
2052
+ conf: y,
2018
2053
  publishTime: Number(d),
2019
2054
  expiration: s.expiration
2020
2055
  });
@@ -2044,12 +2079,12 @@ async function St(e, t) {
2044
2079
  }
2045
2080
  }
2046
2081
  async function $t(e, t, r) {
2047
- const o = r?.client ?? V, n = await j({
2082
+ const o = r?.client ?? U, n = await I({
2048
2083
  ...r,
2049
2084
  cacheTime: v
2050
2085
  });
2051
2086
  try {
2052
- const a = await Se.getPriceFeedsUpdateData(t);
2087
+ const a = await Ee.getPriceFeedsUpdateData(t);
2053
2088
  return await new lt(
2054
2089
  o,
2055
2090
  n.oracle.pythStateId,
@@ -2059,8 +2094,8 @@ async function $t(e, t, r) {
2059
2094
  throw new Error(`failed to update pyth price feeds, msg: ${a.message}`);
2060
2095
  }
2061
2096
  }
2062
- async function fe(e, t, r) {
2063
- const o = await j({
2097
+ async function ge(e, t, r) {
2098
+ const o = await I({
2064
2099
  ...r,
2065
2100
  cacheTime: v
2066
2101
  });
@@ -2093,8 +2128,8 @@ async function fe(e, t, r) {
2093
2128
  });
2094
2129
  return e;
2095
2130
  }
2096
- async function $e(e) {
2097
- return (await j({
2131
+ async function Oe(e) {
2132
+ return (await I({
2098
2133
  ...e,
2099
2134
  cacheTime: v
2100
2135
  })).oracle.feeds;
@@ -2115,7 +2150,7 @@ function Et(e, t) {
2115
2150
  async function yr(e, t, r, o) {
2116
2151
  let n;
2117
2152
  try {
2118
- const a = await $e({
2153
+ const a = await Oe({
2119
2154
  ...o
2120
2155
  }), c = [];
2121
2156
  r.forEach((u) => {
@@ -2128,7 +2163,7 @@ async function yr(e, t, r, o) {
2128
2163
  return n = Et(a, {
2129
2164
  lendingPositions: i,
2130
2165
  pools: r
2131
- }), await fe(e, n, {
2166
+ }), await ge(e, n, {
2132
2167
  updatePythPriceFeeds: !0,
2133
2168
  ...o
2134
2169
  });
@@ -2137,7 +2172,7 @@ async function yr(e, t, r, o) {
2137
2172
  throw a;
2138
2173
  if (console.error(a), n)
2139
2174
  try {
2140
- return await fe(e, n, {
2175
+ return await ge(e, n, {
2141
2176
  ...o,
2142
2177
  updatePythPriceFeeds: !1
2143
2178
  });
@@ -2147,14 +2182,14 @@ async function yr(e, t, r, o) {
2147
2182
  return e;
2148
2183
  }
2149
2184
  }
2150
- const ne = $(
2151
- A(
2185
+ const ae = O(
2186
+ S(
2152
2187
  async (e) => {
2153
- const t = O(e), r = M(
2154
- `/navi/flashloan?env=${e?.env || "prod"}&sdk=${E.version}&market=${e?.market || R}`,
2188
+ const t = M(e), r = F(
2189
+ `/navi/flashloan?env=${e?.env || "prod"}&sdk=${V.version}&market=${e?.market || z}`,
2155
2190
  e
2156
2191
  ), o = await fetch(r, {
2157
- headers: U(D, t)
2192
+ headers: N(R, t)
2158
2193
  }).then((n) => n.json());
2159
2194
  return Object.keys(o.data).map((n) => ({
2160
2195
  ...o.data[n],
@@ -2164,14 +2199,14 @@ const ne = $(
2164
2199
  )
2165
2200
  );
2166
2201
  async function gr(e, t) {
2167
- return (await ne(t)).find((o) => typeof e == "string" ? C(o.coinType) === C(e) : typeof e == "number" ? o.assetId === e : o.assetId === e.id) || null;
2202
+ return (await ae(t)).find((o) => typeof e == "string" ? C(o.coinType) === C(e) : typeof e == "number" ? o.assetId === e : o.assetId === e.id) || null;
2168
2203
  }
2169
2204
  async function hr(e, t, r, o) {
2170
- const n = await j({
2205
+ const n = await I({
2171
2206
  ...o,
2172
2207
  cacheTime: v
2173
- }), a = await S(t, o);
2174
- if (!(await ne({
2208
+ }), a = await E(t, o);
2209
+ if (!(await ae({
2175
2210
  ...o,
2176
2211
  cacheTime: v
2177
2212
  })).some(
@@ -2204,11 +2239,11 @@ async function hr(e, t, r, o) {
2204
2239
  }
2205
2240
  }
2206
2241
  async function wr(e, t, r, o, n) {
2207
- const a = await j({
2242
+ const a = await I({
2208
2243
  ...n,
2209
2244
  cacheTime: v
2210
- }), c = await S(t, n);
2211
- if (!(await ne({
2245
+ }), c = await E(t, n);
2246
+ if (!(await ae({
2212
2247
  ...n,
2213
2248
  cacheTime: v
2214
2249
  })).some(
@@ -2232,7 +2267,7 @@ async function br(e, t, r, o, n, a) {
2232
2267
  const c = {
2233
2268
  ...a,
2234
2269
  cacheTime: v
2235
- }, i = await j(c), s = await S(t, c), u = await S(o, c);
2270
+ }, i = await I(c), s = await E(t, c), u = await E(o, c);
2236
2271
  if (i.version === 1) {
2237
2272
  const [m, w] = e.moveCall({
2238
2273
  target: `${i.package}::incentive_v3::liquidation`,
@@ -2298,19 +2333,19 @@ async function br(e, t, r, o, n, a) {
2298
2333
  }
2299
2334
  }
2300
2335
  async function Ot(e, t, r) {
2301
- const o = r?.client ?? V, n = await G({
2336
+ const o = r?.client ?? U, n = await J({
2302
2337
  ...r,
2303
- markets: Object.values(F),
2338
+ markets: Object.values(L),
2304
2339
  cacheTime: v
2305
- }), a = await $e(r), c = [];
2340
+ }), a = await Oe(r), c = [];
2306
2341
  return await Promise.all(
2307
2342
  t.map(async (i) => {
2308
2343
  try {
2309
- const s = await j({
2344
+ const s = await I({
2310
2345
  ...r,
2311
2346
  cacheTime: v,
2312
2347
  market: i.market
2313
- }), u = new N();
2348
+ }), u = new q();
2314
2349
  u.moveCall({
2315
2350
  target: `${s.uiGetter}::incentive_v3_getter::get_user_atomic_claimable_rewards`,
2316
2351
  arguments: [
@@ -2324,13 +2359,13 @@ async function Ot(e, t, r) {
2324
2359
  // User address
2325
2360
  ]
2326
2361
  });
2327
- const w = (await q(o, {
2362
+ const w = (await W(o, {
2328
2363
  transactionBlock: u,
2329
2364
  sender: e
2330
2365
  }))?.results?.[0];
2331
2366
  if (!w)
2332
2367
  return;
2333
- const y = Q({ results: [w] }, [
2368
+ const g = Z({ results: [w] }, [
2334
2369
  l.vector(l.string()),
2335
2370
  // Asset coin types
2336
2371
  l.vector(l.string()),
@@ -2342,21 +2377,21 @@ async function Ot(e, t, r) {
2342
2377
  l.vector(l.u256())
2343
2378
  // Claimable amounts
2344
2379
  ]);
2345
- if (y.length === 5 && Array.isArray(y[0])) {
2346
- const g = y[0].length;
2347
- for (let d = 0; d < g; d++) {
2380
+ if (g.length === 5 && Array.isArray(g[0])) {
2381
+ const y = g[0].length;
2382
+ for (let d = 0; d < y; d++) {
2348
2383
  const f = a.find(
2349
- (k) => C(k.coinType) === C(y[1][d])
2384
+ (j) => C(j.coinType) === C(g[1][d])
2350
2385
  ), b = n.find(
2351
- (k) => C(k.coinType) === C(y[0][d]) && k.market === i.market
2386
+ (j) => C(j.coinType) === C(g[0][d]) && j.market === i.market
2352
2387
  );
2353
2388
  !f || !b || c.push({
2354
2389
  assetId: b.id,
2355
- assetCoinType: C(y[0][d]),
2356
- rewardCoinType: C(y[1][d]),
2357
- option: Number(y[2][d]),
2358
- userClaimableReward: Number(y[4][d]) / Math.pow(10, f.priceDecimal),
2359
- ruleIds: Array.isArray(y[3][d]) ? y[3][d] : [y[3][d]],
2390
+ assetCoinType: C(g[0][d]),
2391
+ rewardCoinType: C(g[1][d]),
2392
+ option: Number(g[2][d]),
2393
+ userClaimableReward: Number(g[4][d]) / Math.pow(10, f.priceDecimal),
2394
+ ruleIds: Array.isArray(g[3][d]) ? g[3][d] : [g[3][d]],
2360
2395
  market: i.market,
2361
2396
  owner: i.owner,
2362
2397
  address: i.address,
@@ -2374,13 +2409,13 @@ async function Ot(e, t, r) {
2374
2409
  ), c;
2375
2410
  }
2376
2411
  async function vr(e, t) {
2377
- const r = (t?.markets || [F.main]).map((a) => _(a)), o = await Be(e, t), n = r.map((a) => ({
2412
+ const r = (t?.markets || [L.main]).map((a) => P(a)), o = await Ae(e, t), n = r.map((a) => ({
2378
2413
  address: e,
2379
2414
  owner: e,
2380
2415
  market: a.key
2381
2416
  })).concat(
2382
2417
  o.filter((a) => !!r.find((c) => c.id === a.marketId)).map((a) => {
2383
- const c = _(a.marketId);
2418
+ const c = P(a.marketId);
2384
2419
  return {
2385
2420
  address: a.accountCap,
2386
2421
  owner: e,
@@ -2420,72 +2455,72 @@ function Cr(e) {
2420
2455
  }))
2421
2456
  }));
2422
2457
  }
2423
- const jr = A(
2458
+ const jr = S(
2424
2459
  async (e, t) => {
2425
- const r = O(t), o = M(
2426
- `/navi/user/total_claimed_reward?userAddress=${e}&sdk=${E.version}&market=${t?.market || R}`,
2460
+ const r = M(t), o = F(
2461
+ `/navi/user/total_claimed_reward?userAddress=${e}&sdk=${V.version}&market=${t?.market || z}`,
2427
2462
  t
2428
2463
  );
2429
2464
  return (await fetch(o, {
2430
- headers: U(D, r)
2465
+ headers: N(R, r)
2431
2466
  }).then((a) => a.json())).data;
2432
2467
  }
2433
- ), kr = A(
2468
+ ), Ir = S(
2434
2469
  async (e, t) => {
2435
- const r = O(t), o = M(
2436
- `/navi/user/rewards?userAddress=${e}&page=${t?.page || 1}&pageSize=${t?.size || 400}&sdk=${E.version}&market=${t?.market || R}`,
2470
+ const r = M(t), o = F(
2471
+ `/navi/user/rewards?userAddress=${e}&page=${t?.page || 1}&pageSize=${t?.size || 400}&sdk=${V.version}&market=${t?.market || z}`,
2437
2472
  t
2438
2473
  ), n = await fetch(o, {
2439
- headers: U(D, r)
2474
+ headers: N(R, r)
2440
2475
  }).then((a) => a.json());
2441
- return ee({
2476
+ return re({
2442
2477
  data: n.data.rewards
2443
2478
  });
2444
2479
  }
2445
2480
  );
2446
- async function Ir(e, t, r) {
2447
- const o = await G({
2481
+ async function kr(e, t, r) {
2482
+ const o = await J({
2448
2483
  ...r,
2449
- markets: Object.values(F),
2484
+ markets: Object.values(L),
2450
2485
  cacheTime: v
2451
2486
  }), n = /* @__PURE__ */ new Map();
2452
2487
  for (const c of t) {
2453
- const { rewardCoinType: i, ruleIds: s, market: u, owner: m, address: w, emodeId: y } = c, g = `${i}___${w}__${u}`;
2488
+ const { rewardCoinType: i, ruleIds: s, market: u, owner: m, address: w, emodeId: g } = c, y = `${i}___${w}__${u}`;
2454
2489
  for (const d of s) {
2455
- n.has(g) || n.set(g, {
2490
+ n.has(y) || n.set(y, {
2456
2491
  assetIds: [],
2457
2492
  ruleIds: [],
2458
2493
  amount: 0,
2459
2494
  market: u,
2460
2495
  owner: m,
2461
2496
  address: w,
2462
- isEMode: typeof y < "u"
2497
+ isEMode: typeof g < "u"
2463
2498
  });
2464
- const f = n.get(g);
2499
+ const f = n.get(y);
2465
2500
  f.assetIds.push(c.assetCoinType.replace("0x", "")), f.ruleIds.push(d), f.amount += c.userClaimableReward;
2466
2501
  }
2467
2502
  }
2468
2503
  const a = [];
2469
2504
  for (const [
2470
2505
  c,
2471
- { assetIds: i, ruleIds: s, amount: u, market: m, owner: w, address: y, isEMode: g }
2506
+ { assetIds: i, ruleIds: s, amount: u, market: m, owner: w, address: g, isEMode: y }
2472
2507
  ] of n) {
2473
- const d = await j({
2508
+ const d = await I({
2474
2509
  ...r,
2475
2510
  cacheTime: v,
2476
2511
  market: m
2477
2512
  }), f = c.split("___")[0], b = o.filter(
2478
- (I) => C(I.suiCoinType) === C(f)
2513
+ (k) => C(k.suiCoinType) === C(f)
2479
2514
  );
2480
- b.sort((I, B) => I.market === m ? -1 : 1);
2481
- const k = b[0], T = d.rewardFunds[C(f)];
2482
- if (!T)
2515
+ b.sort((k, T) => k.market === m ? -1 : 1);
2516
+ const j = b[0], _ = d.rewardFunds[C(f)];
2517
+ if (!_)
2483
2518
  throw new Error(`No matching rewardFund found for reward coin: ${f} ${m}`);
2484
2519
  if (r?.accountCap && !r.customCoinReceive)
2485
2520
  throw new Error("customCoinReceive is required when accountCap is provided");
2486
2521
  if (r?.customCoinReceive) {
2487
- let I;
2488
- r.accountCap ? I = e.moveCall({
2522
+ let k;
2523
+ r.accountCap ? k = e.moveCall({
2489
2524
  target: `${d.package}::incentive_v3::claim_reward_with_account_cap`,
2490
2525
  arguments: [
2491
2526
  e.object("0x06"),
@@ -2494,7 +2529,7 @@ async function Ir(e, t, r) {
2494
2529
  // Incentive V3 contract
2495
2530
  e.object(d.storage),
2496
2531
  // Protocol storage
2497
- e.object(T),
2532
+ e.object(_),
2498
2533
  // Reward fund
2499
2534
  e.pure.vector("string", i),
2500
2535
  // Asset IDs
@@ -2504,7 +2539,7 @@ async function Ir(e, t, r) {
2504
2539
  // Account capability
2505
2540
  ],
2506
2541
  typeArguments: [f]
2507
- }) : g ? I = e.moveCall({
2542
+ }) : y ? k = e.moveCall({
2508
2543
  target: `${d.package}::incentive_v3::claim_reward_with_account_cap`,
2509
2544
  arguments: [
2510
2545
  e.object("0x06"),
@@ -2513,17 +2548,17 @@ async function Ir(e, t, r) {
2513
2548
  // Incentive V3 contract
2514
2549
  e.object(d.storage),
2515
2550
  // Protocol storage
2516
- e.object(T),
2551
+ e.object(_),
2517
2552
  // Reward fund
2518
2553
  e.pure.vector("string", i),
2519
2554
  // Asset IDs
2520
2555
  e.pure.vector("address", s),
2521
2556
  // Rule IDs
2522
- h(y, e.object)
2557
+ h(g, e.object)
2523
2558
  // Account capability
2524
2559
  ],
2525
2560
  typeArguments: [f]
2526
- }) : I = e.moveCall({
2561
+ }) : k = e.moveCall({
2527
2562
  target: `${d.package}::incentive_v3::claim_reward`,
2528
2563
  arguments: [
2529
2564
  e.object("0x06"),
@@ -2532,7 +2567,7 @@ async function Ir(e, t, r) {
2532
2567
  // Incentive V3 contract
2533
2568
  e.object(d.storage),
2534
2569
  // Protocol storage
2535
- e.object(T),
2570
+ e.object(_),
2536
2571
  // Reward fund
2537
2572
  e.pure.vector("string", i),
2538
2573
  // Asset IDs
@@ -2541,37 +2576,37 @@ async function Ir(e, t, r) {
2541
2576
  ],
2542
2577
  typeArguments: [f]
2543
2578
  });
2544
- const [B] = e.moveCall({
2579
+ const [T] = e.moveCall({
2545
2580
  target: "0x2::coin::from_balance",
2546
- arguments: [I],
2581
+ arguments: [k],
2547
2582
  typeArguments: [f]
2548
2583
  });
2549
2584
  if (r?.customCoinReceive.type === "transfer") {
2550
2585
  if (!r.customCoinReceive.transfer)
2551
2586
  throw new Error("customCoinReceive.transfer is required");
2552
2587
  e.transferObjects(
2553
- [B],
2588
+ [T],
2554
2589
  h(r.customCoinReceive.transfer, e.pure.address)
2555
2590
  );
2556
2591
  }
2557
2592
  if (r?.customCoinReceive.type === "depositNAVI") {
2558
- const W = p(k.totalSupplyAmount).shiftedBy(-9), Y = p(k.supplyCapCeiling).shiftedBy(-27);
2559
- W.plus(u).isGreaterThan(Y) && r?.customCoinReceive.depositNAVI?.fallbackReceiveAddress ? e.transferObjects(
2560
- [B],
2593
+ const $ = p(j.totalSupplyAmount).shiftedBy(-9), D = p(j.supplyCapCeiling).shiftedBy(-27);
2594
+ $.plus(u).isGreaterThan(D) && r?.customCoinReceive.depositNAVI?.fallbackReceiveAddress ? e.transferObjects(
2595
+ [T],
2561
2596
  e.pure.address(r.customCoinReceive.depositNAVI.fallbackReceiveAddress)
2562
- ) : await vt(e, k, B, {
2597
+ ) : await vt(e, j, T, {
2563
2598
  ...r,
2564
- market: k.market
2599
+ market: j.market
2565
2600
  });
2566
2601
  } else
2567
2602
  a.push({
2568
- coin: B,
2569
- identifier: k,
2603
+ coin: T,
2604
+ identifier: j,
2570
2605
  owner: w,
2571
- isEMode: g
2606
+ isEMode: y
2572
2607
  });
2573
- } else if (r?.accountCap || g) {
2574
- const I = e.moveCall({
2608
+ } else if (r?.accountCap || y) {
2609
+ const k = e.moveCall({
2575
2610
  target: `${d.package}::incentive_v3::claim_reward_with_account_cap`,
2576
2611
  arguments: [
2577
2612
  e.object("0x06"),
@@ -2580,23 +2615,23 @@ async function Ir(e, t, r) {
2580
2615
  // Incentive V3 contract
2581
2616
  e.object(d.storage),
2582
2617
  // Protocol storage
2583
- e.object(T),
2618
+ e.object(_),
2584
2619
  // Reward fund
2585
2620
  e.pure.vector("string", i),
2586
2621
  // Asset IDs
2587
2622
  e.pure.vector("address", s),
2588
2623
  // Rule IDs
2589
- h(r?.accountCap || y, e.object)
2624
+ h(r?.accountCap || g, e.object)
2590
2625
  // Account capability
2591
2626
  ],
2592
2627
  typeArguments: [f]
2593
- }), [B] = e.moveCall({
2628
+ }), [T] = e.moveCall({
2594
2629
  target: "0x2::coin::from_balance",
2595
- arguments: [I],
2630
+ arguments: [k],
2596
2631
  typeArguments: [f]
2597
2632
  });
2598
2633
  e.transferObjects(
2599
- [B],
2634
+ [T],
2600
2635
  h(r?.accountCap || w, e.pure.address)
2601
2636
  );
2602
2637
  } else
@@ -2609,7 +2644,7 @@ async function Ir(e, t, r) {
2609
2644
  // Incentive V3 contract
2610
2645
  e.object(d.storage),
2611
2646
  // Protocol storage
2612
- e.object(T),
2647
+ e.object(_),
2613
2648
  // Reward fund
2614
2649
  e.pure.vector("string", i),
2615
2650
  // Asset IDs
@@ -2622,31 +2657,31 @@ async function Ir(e, t, r) {
2622
2657
  return a;
2623
2658
  }
2624
2659
  export {
2625
- oe as Address,
2660
+ ie as Address,
2626
2661
  v as DEFAULT_CACHE_TIME,
2627
- R as DEFAULT_MARKET_IDENTITY,
2662
+ z as DEFAULT_MARKET_IDENTITY,
2628
2663
  Wt as FlashLoanAssetConfig,
2629
2664
  qt as IncentiveAPYInfo,
2630
2665
  Le as IncentivePoolInfo,
2631
2666
  zt as IncentivePoolInfoByPhase,
2632
- F as MARKETS,
2667
+ L as MARKETS,
2633
2668
  Ct as Market,
2634
2669
  Ke as NaviMissingGraphQLClientError,
2635
2670
  Gt as OracleInfo,
2636
2671
  et as PUBLIC_MAINNET_GRPC_URL,
2637
- z as PoolOperator,
2672
+ H as PoolOperator,
2638
2673
  qe as ReserveDataInfo,
2639
- Ce as SuiPriceServiceConnection,
2674
+ Ie as SuiPriceServiceConnection,
2640
2675
  lt as SuiPythClient,
2641
- L as UserPositions,
2676
+ G as UserPositions,
2642
2677
  ze as UserStateInfo,
2643
2678
  er as borrowCoinPTB,
2644
- M as buildNaviOpenApiUrl,
2645
- Ir as claimLendingRewardsPTB,
2679
+ F as buildNaviOpenApiUrl,
2680
+ kr as claimLendingRewardsPTB,
2646
2681
  Yt as configureNaviSdk,
2647
- kt as createAccountCapPTB,
2682
+ It as createAccountCapPTB,
2648
2683
  ar as createEModeCapPTB,
2649
- ve as createNaviLegacyJsonRpcClient,
2684
+ je as createNaviLegacyJsonRpcClient,
2650
2685
  rt as createNaviSuiClient,
2651
2686
  xe as createNaviSuiClientBundle,
2652
2687
  vt as depositCoinPTB,
@@ -2655,13 +2690,13 @@ export {
2655
2690
  or as exitEModePTB,
2656
2691
  Et as filterPriceFeeds,
2657
2692
  hr as flashloanPTB,
2658
- It as getAccountCapOwnerPTB,
2693
+ kt as getAccountCapOwnerPTB,
2659
2694
  Jt as getAddressBalance,
2660
- ne as getAllFlashLoanAssets,
2695
+ ae as getAllFlashLoanAssets,
2661
2696
  rr as getBorrowFee,
2662
2697
  Ht as getCoinObjectOnlyBalance,
2663
2698
  pr as getCoins,
2664
- j as getConfig,
2699
+ I as getConfig,
2665
2700
  Xt as getFees,
2666
2701
  gr as getFlashLoanAsset,
2667
2702
  ur as getHealthFactor,
@@ -2669,40 +2704,40 @@ export {
2669
2704
  Pt as getLendingPositions,
2670
2705
  sr as getLendingState,
2671
2706
  nr as getMarket,
2672
- _ as getMarketConfig,
2707
+ P as getMarketConfig,
2673
2708
  jt as getMarkets,
2674
- S as getPool,
2675
- G as getPools,
2676
- $e as getPriceFeeds,
2709
+ E as getPool,
2710
+ J as getPools,
2711
+ Oe as getPriceFeeds,
2677
2712
  fr as getPythStalePriceFeedId,
2678
2713
  St as getPythStalePriceFeedIdV2,
2679
2714
  lr as getSimulatedHealthFactor,
2680
- Pe as getSimulatedHealthFactorPTB,
2715
+ Se as getSimulatedHealthFactorPTB,
2681
2716
  Zt as getStats,
2682
2717
  dr as getTransactions,
2683
2718
  vr as getUserAvailableLendingRewards,
2684
- kr as getUserClaimedRewardHistory,
2685
- Be as getUserEModeCaps,
2719
+ Ir as getUserClaimedRewardHistory,
2720
+ Ae as getUserEModeCaps,
2686
2721
  jr as getUserTotalClaimedReward,
2687
2722
  br as liquidatePTB,
2688
2723
  Kt as listAddressBalances,
2689
2724
  cr as mergeCoinsPTB,
2690
- U as mergeServiceHeaders,
2691
- be as normalizeAddressBalance,
2725
+ N as mergeServiceHeaders,
2726
+ Ce as normalizeAddressBalance,
2692
2727
  C as normalizeCoinType,
2693
2728
  bt as parsePoolUID,
2694
2729
  h as parseTxValue,
2695
2730
  tr as repayCoinPTB,
2696
2731
  wr as repayFlashLoanPTB,
2697
2732
  Qt as requireNaviGraphQLClient,
2698
- O as resolveNaviOpenApiEndpoint,
2733
+ M as resolveNaviOpenApiEndpoint,
2699
2734
  Cr as summaryLendingRewards,
2700
2735
  yr as updateOraclePriceBeforeUserOperationPTB,
2701
- fe as updateOraclePricesPTB,
2736
+ ge as updateOraclePricesPTB,
2702
2737
  $t as updatePythPriceFeeds,
2703
2738
  mr as verifyHealthFactorPTB,
2704
- $ as withCache,
2705
- A as withSingleton,
2739
+ O as withCache,
2740
+ S as withSingleton,
2706
2741
  xt as withdrawCoinPTB
2707
2742
  };
2708
2743
  //# sourceMappingURL=index.esm.js.map