@naviprotocol/lending 2.0.2 → 2.0.4
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 +91 -98
- package/dist/index.esm.js.map +1 -1
- package/dist/oracle.d.ts.map +1 -1
- package/dist/pyth.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -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.
|
|
132
|
+
}), Ge = "2.0.4", E = {
|
|
133
133
|
version: Ge
|
|
134
|
-
}, We =
|
|
134
|
+
}, We = E.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}`;
|
|
@@ -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();
|
|
@@ -500,16 +500,25 @@ class lt {
|
|
|
500
500
|
async getPriceFeedObjectId(t) {
|
|
501
501
|
const r = re(t);
|
|
502
502
|
if (!this.priceFeedObjectIdCache.has(r)) {
|
|
503
|
-
const { id: o, fieldType: n } = await this.getPriceTableInfo(), a = this.getCoreProvider()
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
value
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
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: se(a, it(ie(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(ie(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
|
}
|
|
@@ -551,7 +560,7 @@ function Yt(e) {
|
|
|
551
560
|
function ue() {
|
|
552
561
|
return je;
|
|
553
562
|
}
|
|
554
|
-
function
|
|
563
|
+
function O(e) {
|
|
555
564
|
const t = e?.services?.naviOpenApi ?? J.services?.naviOpenApi;
|
|
556
565
|
return {
|
|
557
566
|
baseUrl: pt(t?.baseUrl ?? dt),
|
|
@@ -559,7 +568,7 @@ function E(e) {
|
|
|
559
568
|
};
|
|
560
569
|
}
|
|
561
570
|
function M(e, t) {
|
|
562
|
-
const r =
|
|
571
|
+
const r = O(t), o = e.startsWith("/") ? e : `/${e}`;
|
|
563
572
|
return `${r.baseUrl}${o}`;
|
|
564
573
|
}
|
|
565
574
|
function mt(e) {
|
|
@@ -614,7 +623,7 @@ async function q(e, t) {
|
|
|
614
623
|
});
|
|
615
624
|
return ft(n);
|
|
616
625
|
}
|
|
617
|
-
function
|
|
626
|
+
function ke(e) {
|
|
618
627
|
return {
|
|
619
628
|
json: !!e?.showContent,
|
|
620
629
|
display: !!e?.showDisplay,
|
|
@@ -622,7 +631,7 @@ function Ie(e) {
|
|
|
622
631
|
objectBcs: !!e?.showBcs
|
|
623
632
|
};
|
|
624
633
|
}
|
|
625
|
-
function
|
|
634
|
+
function Ie(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:
|
|
660
|
+
include: ke(t.options)
|
|
652
661
|
});
|
|
653
|
-
return
|
|
662
|
+
return Ie(o);
|
|
654
663
|
}
|
|
655
664
|
async function gt(e, t) {
|
|
656
665
|
const r = e?.core;
|
|
@@ -658,9 +667,9 @@ 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:
|
|
670
|
+
include: ke(t.options)
|
|
662
671
|
});
|
|
663
|
-
return o.map(
|
|
672
|
+
return o.map(Ie);
|
|
664
673
|
}
|
|
665
674
|
function _e(e) {
|
|
666
675
|
const t = [];
|
|
@@ -777,8 +786,8 @@ var z = /* @__PURE__ */ ((e) => (e[e.Supply = 1] = "Supply", e[e.Withdraw = 2] =
|
|
|
777
786
|
const G = $(
|
|
778
787
|
A(
|
|
779
788
|
async (e) => {
|
|
780
|
-
const t = (e?.markets || [F.main]).map((a) => _(a)), r =
|
|
781
|
-
`/navi/pools?env=${e?.env || "prod"}&sdk=${
|
|
789
|
+
const t = (e?.markets || [F.main]).map((a) => _(a)), r = O(e), o = M(
|
|
790
|
+
`/navi/pools?env=${e?.env || "prod"}&sdk=${E.version}&market=${t.map(
|
|
782
791
|
(a) => a.key
|
|
783
792
|
)}`,
|
|
784
793
|
e
|
|
@@ -787,9 +796,9 @@ const G = $(
|
|
|
787
796
|
);
|
|
788
797
|
return n.data.forEach((a) => {
|
|
789
798
|
const i = n.meta.emodes.filter((b) => {
|
|
790
|
-
const
|
|
791
|
-
return a.market ===
|
|
792
|
-
}).filter((b) => !!b.assets.find((
|
|
799
|
+
const k = _(b.marketId);
|
|
800
|
+
return a.market === k.key && b.isActive;
|
|
801
|
+
}).filter((b) => !!b.assets.find((k) => k.assetId === a.id));
|
|
793
802
|
a.emodes = i;
|
|
794
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(), y = p(a.supplyCapCeiling).shiftedBy(-27).decimalPlaces(a.token.decimals, p.ROUND_DOWN).toString(), g = p.max(
|
|
795
804
|
p(a.borrowedAmount),
|
|
@@ -820,7 +829,7 @@ async function S(e, t) {
|
|
|
820
829
|
}
|
|
821
830
|
const Zt = $(
|
|
822
831
|
A(async (e) => {
|
|
823
|
-
const t =
|
|
832
|
+
const t = O(e), r = M(`/navi/stats?sdk=${E.version}`, e);
|
|
824
833
|
return (await fetch(r, {
|
|
825
834
|
headers: U(D, t)
|
|
826
835
|
}).then((n) => n.json())).data;
|
|
@@ -828,7 +837,7 @@ const Zt = $(
|
|
|
828
837
|
), Xt = $(
|
|
829
838
|
A(
|
|
830
839
|
async (e) => {
|
|
831
|
-
const t =
|
|
840
|
+
const t = O(e), r = M(`/navi/fee?sdk=${E.version}`, e);
|
|
832
841
|
return await fetch(r, {
|
|
833
842
|
headers: U(D, t)
|
|
834
843
|
}).then((n) => n.json());
|
|
@@ -1253,8 +1262,8 @@ const _ = (e) => {
|
|
|
1253
1262
|
), j = $(
|
|
1254
1263
|
A(
|
|
1255
1264
|
async (e) => {
|
|
1256
|
-
const t = _(e?.market || R), r =
|
|
1257
|
-
`/navi/config?env=${e?.env || "prod"}&sdk=${
|
|
1265
|
+
const t = _(e?.market || R), r = O(e), o = M(
|
|
1266
|
+
`/navi/config?env=${e?.env || "prod"}&sdk=${E.version}&market=${t.key}`,
|
|
1258
1267
|
e
|
|
1259
1268
|
);
|
|
1260
1269
|
return (await fetch(o, {
|
|
@@ -1263,7 +1272,7 @@ const _ = (e) => {
|
|
|
1263
1272
|
}
|
|
1264
1273
|
)
|
|
1265
1274
|
), v = 1e3 * 60 * 5;
|
|
1266
|
-
async function
|
|
1275
|
+
async function kt(e, t) {
|
|
1267
1276
|
const r = await j({
|
|
1268
1277
|
cacheTime: v,
|
|
1269
1278
|
...t
|
|
@@ -1273,7 +1282,7 @@ async function It(e, t) {
|
|
|
1273
1282
|
arguments: []
|
|
1274
1283
|
});
|
|
1275
1284
|
}
|
|
1276
|
-
async function
|
|
1285
|
+
async function It(e, t, r) {
|
|
1277
1286
|
const o = await j({
|
|
1278
1287
|
cacheTime: v,
|
|
1279
1288
|
...r
|
|
@@ -1317,12 +1326,12 @@ async function ar(e, t, r) {
|
|
|
1317
1326
|
const o = await j({
|
|
1318
1327
|
cacheTime: v,
|
|
1319
1328
|
...r
|
|
1320
|
-
}), n = await
|
|
1329
|
+
}), n = await kt(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
|
|
1334
|
+
const a = await _(r?.market || R), c = await It(e, n, r);
|
|
1326
1335
|
return e.moveCall({
|
|
1327
1336
|
target: `${o.emode.contract.registryPackage}::registry::register_emode_for_account_cap`,
|
|
1328
1337
|
arguments: [
|
|
@@ -1446,13 +1455,13 @@ async function Ae(e, t, r) {
|
|
|
1446
1455
|
})).results || [], w = {};
|
|
1447
1456
|
s.forEach((d, f) => {
|
|
1448
1457
|
try {
|
|
1449
|
-
const b = m[f]?.returnValues?.map((T) => l.vector(qe).parse(Uint8Array.from(T[0])))[0] || [],
|
|
1458
|
+
const b = m[f]?.returnValues?.map((T) => l.vector(qe).parse(Uint8Array.from(T[0])))[0] || [], k = {};
|
|
1450
1459
|
for (const T of b)
|
|
1451
|
-
|
|
1460
|
+
k[T.id] = {
|
|
1452
1461
|
supplyIndex: T.supply_index,
|
|
1453
1462
|
borrowIndex: T.borrow_index
|
|
1454
1463
|
};
|
|
1455
|
-
w[d.key] =
|
|
1464
|
+
w[d.key] = k;
|
|
1456
1465
|
} catch (b) {
|
|
1457
1466
|
console.warn(
|
|
1458
1467
|
`[@naviprotocol/lending] Failed to decode reserve data for market "${d.key}", falling back to open-api pool indices`,
|
|
@@ -1462,19 +1471,19 @@ async function Ae(e, t, r) {
|
|
|
1462
1471
|
});
|
|
1463
1472
|
const y = m.slice(s.length).map((d) => d.returnValues?.map((f) => l.vector(ze).parse(Uint8Array.from(f[0])))[0] || []), g = [];
|
|
1464
1473
|
return y.forEach((d, f) => {
|
|
1465
|
-
const b = t[f],
|
|
1466
|
-
d.forEach((
|
|
1467
|
-
if (
|
|
1474
|
+
const b = t[f], k = _(b.market), T = w[k.key] || {};
|
|
1475
|
+
d.forEach((I) => {
|
|
1476
|
+
if (I.supply_balance === "0" && I.borrow_balance === "0" && (b.emodeId === void 0 || !r?.includeZeroBalanceEmodePositions))
|
|
1468
1477
|
return;
|
|
1469
|
-
const B = c[`${
|
|
1478
|
+
const B = c[`${k.key}-${I.asset_id}`];
|
|
1470
1479
|
if (!B)
|
|
1471
1480
|
return;
|
|
1472
|
-
const W = T[
|
|
1481
|
+
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
1482
|
g.push({
|
|
1474
|
-
supplyBalance:
|
|
1483
|
+
supplyBalance: Oe,
|
|
1475
1484
|
borrowBalance: Ve,
|
|
1476
|
-
assetId:
|
|
1477
|
-
market:
|
|
1485
|
+
assetId: I.asset_id,
|
|
1486
|
+
market: k.key,
|
|
1478
1487
|
pool: B,
|
|
1479
1488
|
emodeId: b.emodeId
|
|
1480
1489
|
});
|
|
@@ -1527,8 +1536,8 @@ const dr = A(
|
|
|
1527
1536
|
async (e, t) => {
|
|
1528
1537
|
const r = new URLSearchParams();
|
|
1529
1538
|
t?.cursor && r.set("cursor", t.cursor), r.set("userAddress", e);
|
|
1530
|
-
const o =
|
|
1531
|
-
`/navi/user/transactions?${r.toString()}&sdk=${
|
|
1539
|
+
const o = O(t), n = M(
|
|
1540
|
+
`/navi/user/transactions?${r.toString()}&sdk=${E.version}`,
|
|
1532
1541
|
t
|
|
1533
1542
|
);
|
|
1534
1543
|
return (await fetch(n, {
|
|
@@ -2073,23 +2082,7 @@ async function fe(e, t, r) {
|
|
|
2073
2082
|
a.length > 0 && await $t(e, a, r);
|
|
2074
2083
|
}
|
|
2075
2084
|
for (const n of t)
|
|
2076
|
-
|
|
2077
|
-
target: `${o.oracle.packageId}::oracle_pro::update_single_price`,
|
|
2078
|
-
arguments: [
|
|
2079
|
-
e.object("0x6"),
|
|
2080
|
-
// Clock object
|
|
2081
|
-
e.object(o.oracle.oracleConfig),
|
|
2082
|
-
// Oracle configuration
|
|
2083
|
-
e.object(o.oracle.priceOracle),
|
|
2084
|
-
// Price oracle contract
|
|
2085
|
-
e.object(o.oracle.supraOracleHolder),
|
|
2086
|
-
// Supra oracle holder
|
|
2087
|
-
e.object(n.pythPriceInfoObject),
|
|
2088
|
-
// Pyth price info object
|
|
2089
|
-
e.pure.address(n.feedId)
|
|
2090
|
-
// Price feed ID
|
|
2091
|
-
]
|
|
2092
|
-
}) : e.moveCall({
|
|
2085
|
+
e.moveCall({
|
|
2093
2086
|
target: `${o.oracle.packageId}::oracle_pro::update_single_price_v2`,
|
|
2094
2087
|
arguments: [
|
|
2095
2088
|
e.object("0x6"),
|
|
@@ -2115,7 +2108,7 @@ async function $e(e) {
|
|
|
2115
2108
|
cacheTime: v
|
|
2116
2109
|
})).oracle.feeds;
|
|
2117
2110
|
}
|
|
2118
|
-
function
|
|
2111
|
+
function Et(e, t) {
|
|
2119
2112
|
return e.filter((r) => !!(t?.lendingState && t.lendingState.find((n) => r.oracleId === n.pool.oracleId) || t?.lendingPositions && t.lendingPositions.find((n) => {
|
|
2120
2113
|
if (![
|
|
2121
2114
|
"navi-lending-supply",
|
|
@@ -2141,7 +2134,7 @@ async function yr(e, t, r, o) {
|
|
|
2141
2134
|
...o,
|
|
2142
2135
|
markets: c
|
|
2143
2136
|
});
|
|
2144
|
-
return n =
|
|
2137
|
+
return n = Et(a, {
|
|
2145
2138
|
lendingPositions: i,
|
|
2146
2139
|
pools: r
|
|
2147
2140
|
}), await fe(e, n, {
|
|
@@ -2166,8 +2159,8 @@ async function yr(e, t, r, o) {
|
|
|
2166
2159
|
const ne = $(
|
|
2167
2160
|
A(
|
|
2168
2161
|
async (e) => {
|
|
2169
|
-
const t =
|
|
2170
|
-
`/navi/flashloan?env=${e?.env || "prod"}&sdk=${
|
|
2162
|
+
const t = O(e), r = M(
|
|
2163
|
+
`/navi/flashloan?env=${e?.env || "prod"}&sdk=${E.version}&market=${e?.market || R}`,
|
|
2171
2164
|
e
|
|
2172
2165
|
), o = await fetch(r, {
|
|
2173
2166
|
headers: U(D, t)
|
|
@@ -2313,7 +2306,7 @@ async function br(e, t, r, o, n, a) {
|
|
|
2313
2306
|
return [m, w];
|
|
2314
2307
|
}
|
|
2315
2308
|
}
|
|
2316
|
-
async function
|
|
2309
|
+
async function Ot(e, t, r) {
|
|
2317
2310
|
const o = r?.client ?? V, n = await G({
|
|
2318
2311
|
...r,
|
|
2319
2312
|
markets: Object.values(F),
|
|
@@ -2362,9 +2355,9 @@ async function Et(e, t, r) {
|
|
|
2362
2355
|
const g = y[0].length;
|
|
2363
2356
|
for (let d = 0; d < g; d++) {
|
|
2364
2357
|
const f = a.find(
|
|
2365
|
-
(
|
|
2358
|
+
(k) => C(k.coinType) === C(y[1][d])
|
|
2366
2359
|
), b = n.find(
|
|
2367
|
-
(
|
|
2360
|
+
(k) => C(k.coinType) === C(y[0][d]) && k.market === i.market
|
|
2368
2361
|
);
|
|
2369
2362
|
!f || !b || c.push({
|
|
2370
2363
|
assetId: b.id,
|
|
@@ -2405,7 +2398,7 @@ async function vr(e, t) {
|
|
|
2405
2398
|
};
|
|
2406
2399
|
})
|
|
2407
2400
|
);
|
|
2408
|
-
return await
|
|
2401
|
+
return await Ot(e, n, t);
|
|
2409
2402
|
}
|
|
2410
2403
|
function Cr(e) {
|
|
2411
2404
|
const t = /* @__PURE__ */ new Map();
|
|
@@ -2438,18 +2431,18 @@ function Cr(e) {
|
|
|
2438
2431
|
}
|
|
2439
2432
|
const jr = A(
|
|
2440
2433
|
async (e, t) => {
|
|
2441
|
-
const r =
|
|
2442
|
-
`/navi/user/total_claimed_reward?userAddress=${e}&sdk=${
|
|
2434
|
+
const r = O(t), o = M(
|
|
2435
|
+
`/navi/user/total_claimed_reward?userAddress=${e}&sdk=${E.version}&market=${t?.market || R}`,
|
|
2443
2436
|
t
|
|
2444
2437
|
);
|
|
2445
2438
|
return (await fetch(o, {
|
|
2446
2439
|
headers: U(D, r)
|
|
2447
2440
|
}).then((a) => a.json())).data;
|
|
2448
2441
|
}
|
|
2449
|
-
),
|
|
2442
|
+
), kr = A(
|
|
2450
2443
|
async (e, t) => {
|
|
2451
|
-
const r =
|
|
2452
|
-
`/navi/user/rewards?userAddress=${e}&page=${t?.page || 1}&pageSize=${t?.size || 400}&sdk=${
|
|
2444
|
+
const r = O(t), o = M(
|
|
2445
|
+
`/navi/user/rewards?userAddress=${e}&page=${t?.page || 1}&pageSize=${t?.size || 400}&sdk=${E.version}&market=${t?.market || R}`,
|
|
2453
2446
|
t
|
|
2454
2447
|
), n = await fetch(o, {
|
|
2455
2448
|
headers: U(D, r)
|
|
@@ -2459,7 +2452,7 @@ const jr = A(
|
|
|
2459
2452
|
});
|
|
2460
2453
|
}
|
|
2461
2454
|
);
|
|
2462
|
-
async function
|
|
2455
|
+
async function Ir(e, t, r) {
|
|
2463
2456
|
const o = await G({
|
|
2464
2457
|
...r,
|
|
2465
2458
|
markets: Object.values(F),
|
|
@@ -2491,17 +2484,17 @@ async function kr(e, t, r) {
|
|
|
2491
2484
|
cacheTime: v,
|
|
2492
2485
|
market: m
|
|
2493
2486
|
}), f = c.split("___")[0], b = o.filter(
|
|
2494
|
-
(
|
|
2487
|
+
(I) => C(I.suiCoinType) === C(f)
|
|
2495
2488
|
);
|
|
2496
|
-
b.sort((
|
|
2497
|
-
const
|
|
2489
|
+
b.sort((I, B) => I.market === m ? -1 : 1);
|
|
2490
|
+
const k = b[0], T = d.rewardFunds[C(f)];
|
|
2498
2491
|
if (!T)
|
|
2499
2492
|
throw new Error(`No matching rewardFund found for reward coin: ${f} ${m}`);
|
|
2500
2493
|
if (r?.accountCap && !r.customCoinReceive)
|
|
2501
2494
|
throw new Error("customCoinReceive is required when accountCap is provided");
|
|
2502
2495
|
if (r?.customCoinReceive) {
|
|
2503
|
-
let
|
|
2504
|
-
r.accountCap ?
|
|
2496
|
+
let I;
|
|
2497
|
+
r.accountCap ? I = e.moveCall({
|
|
2505
2498
|
target: `${d.package}::incentive_v3::claim_reward_with_account_cap`,
|
|
2506
2499
|
arguments: [
|
|
2507
2500
|
e.object("0x06"),
|
|
@@ -2520,7 +2513,7 @@ async function kr(e, t, r) {
|
|
|
2520
2513
|
// Account capability
|
|
2521
2514
|
],
|
|
2522
2515
|
typeArguments: [f]
|
|
2523
|
-
}) : g ?
|
|
2516
|
+
}) : g ? I = e.moveCall({
|
|
2524
2517
|
target: `${d.package}::incentive_v3::claim_reward_with_account_cap`,
|
|
2525
2518
|
arguments: [
|
|
2526
2519
|
e.object("0x06"),
|
|
@@ -2539,7 +2532,7 @@ async function kr(e, t, r) {
|
|
|
2539
2532
|
// Account capability
|
|
2540
2533
|
],
|
|
2541
2534
|
typeArguments: [f]
|
|
2542
|
-
}) :
|
|
2535
|
+
}) : I = e.moveCall({
|
|
2543
2536
|
target: `${d.package}::incentive_v3::claim_reward`,
|
|
2544
2537
|
arguments: [
|
|
2545
2538
|
e.object("0x06"),
|
|
@@ -2559,7 +2552,7 @@ async function kr(e, t, r) {
|
|
|
2559
2552
|
});
|
|
2560
2553
|
const [B] = e.moveCall({
|
|
2561
2554
|
target: "0x2::coin::from_balance",
|
|
2562
|
-
arguments: [
|
|
2555
|
+
arguments: [I],
|
|
2563
2556
|
typeArguments: [f]
|
|
2564
2557
|
});
|
|
2565
2558
|
if (r?.customCoinReceive.type === "transfer") {
|
|
@@ -2571,23 +2564,23 @@ async function kr(e, t, r) {
|
|
|
2571
2564
|
);
|
|
2572
2565
|
}
|
|
2573
2566
|
if (r?.customCoinReceive.type === "depositNAVI") {
|
|
2574
|
-
const W = p(
|
|
2567
|
+
const W = p(k.totalSupplyAmount).shiftedBy(-9), Y = p(k.supplyCapCeiling).shiftedBy(-27);
|
|
2575
2568
|
W.plus(u).isGreaterThan(Y) && r?.customCoinReceive.depositNAVI?.fallbackReceiveAddress ? e.transferObjects(
|
|
2576
2569
|
[B],
|
|
2577
2570
|
e.pure.address(r.customCoinReceive.depositNAVI.fallbackReceiveAddress)
|
|
2578
|
-
) : await vt(e,
|
|
2571
|
+
) : await vt(e, k, B, {
|
|
2579
2572
|
...r,
|
|
2580
|
-
market:
|
|
2573
|
+
market: k.market
|
|
2581
2574
|
});
|
|
2582
2575
|
} else
|
|
2583
2576
|
a.push({
|
|
2584
2577
|
coin: B,
|
|
2585
|
-
identifier:
|
|
2578
|
+
identifier: k,
|
|
2586
2579
|
owner: w,
|
|
2587
2580
|
isEMode: g
|
|
2588
2581
|
});
|
|
2589
2582
|
} else if (r?.accountCap || g) {
|
|
2590
|
-
const
|
|
2583
|
+
const I = e.moveCall({
|
|
2591
2584
|
target: `${d.package}::incentive_v3::claim_reward_with_account_cap`,
|
|
2592
2585
|
arguments: [
|
|
2593
2586
|
e.object("0x06"),
|
|
@@ -2608,7 +2601,7 @@ async function kr(e, t, r) {
|
|
|
2608
2601
|
typeArguments: [f]
|
|
2609
2602
|
}), [B] = e.moveCall({
|
|
2610
2603
|
target: "0x2::coin::from_balance",
|
|
2611
|
-
arguments: [
|
|
2604
|
+
arguments: [I],
|
|
2612
2605
|
typeArguments: [f]
|
|
2613
2606
|
});
|
|
2614
2607
|
e.transferObjects(
|
|
@@ -2658,9 +2651,9 @@ export {
|
|
|
2658
2651
|
ze as UserStateInfo,
|
|
2659
2652
|
er as borrowCoinPTB,
|
|
2660
2653
|
M as buildNaviOpenApiUrl,
|
|
2661
|
-
|
|
2654
|
+
Ir as claimLendingRewardsPTB,
|
|
2662
2655
|
Yt as configureNaviSdk,
|
|
2663
|
-
|
|
2656
|
+
kt as createAccountCapPTB,
|
|
2664
2657
|
ar as createEModeCapPTB,
|
|
2665
2658
|
ve as createNaviLegacyJsonRpcClient,
|
|
2666
2659
|
rt as createNaviSuiClient,
|
|
@@ -2669,9 +2662,9 @@ export {
|
|
|
2669
2662
|
ir as emodeIdentityId,
|
|
2670
2663
|
_t as enterEModePTB,
|
|
2671
2664
|
or as exitEModePTB,
|
|
2672
|
-
|
|
2665
|
+
Et as filterPriceFeeds,
|
|
2673
2666
|
hr as flashloanPTB,
|
|
2674
|
-
|
|
2667
|
+
It as getAccountCapOwnerPTB,
|
|
2675
2668
|
Jt as getAddressBalance,
|
|
2676
2669
|
ne as getAllFlashLoanAssets,
|
|
2677
2670
|
rr as getBorrowFee,
|
|
@@ -2697,7 +2690,7 @@ export {
|
|
|
2697
2690
|
Zt as getStats,
|
|
2698
2691
|
dr as getTransactions,
|
|
2699
2692
|
vr as getUserAvailableLendingRewards,
|
|
2700
|
-
|
|
2693
|
+
kr as getUserClaimedRewardHistory,
|
|
2701
2694
|
Be as getUserEModeCaps,
|
|
2702
2695
|
jr as getUserTotalClaimedReward,
|
|
2703
2696
|
br as liquidatePTB,
|
|
@@ -2711,7 +2704,7 @@ export {
|
|
|
2711
2704
|
tr as repayCoinPTB,
|
|
2712
2705
|
wr as repayFlashLoanPTB,
|
|
2713
2706
|
Qt as requireNaviGraphQLClient,
|
|
2714
|
-
|
|
2707
|
+
O as resolveNaviOpenApiEndpoint,
|
|
2715
2708
|
Cr as summaryLendingRewards,
|
|
2716
2709
|
yr as updateOraclePriceBeforeUserOperationPTB,
|
|
2717
2710
|
fe as updateOraclePricesPTB,
|