@naviprotocol/lending 1.4.5-beta.4 → 1.4.5
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.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +10 -8
- package/dist/index.esm.js.map +1 -1
- package/dist/pool.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -129,7 +129,7 @@ const J = d.bytes(32).transform({
|
|
|
129
129
|
borrow_balance: d.u256(),
|
|
130
130
|
/** User's current supply balance */
|
|
131
131
|
supply_balance: d.u256()
|
|
132
|
-
}), be = "1.4.5
|
|
132
|
+
}), be = "1.4.5", E = {
|
|
133
133
|
version: be
|
|
134
134
|
}, ke = E.version, _e = () => {
|
|
135
135
|
if (typeof process < "u" && process.versions && process.versions.node)
|
|
@@ -309,17 +309,19 @@ async function Be(e, r, o, n) {
|
|
|
309
309
|
const t = await _({
|
|
310
310
|
...n,
|
|
311
311
|
cacheTime: b
|
|
312
|
-
}), a = await S(r, n)
|
|
312
|
+
}), a = await S(r, n);
|
|
313
|
+
n?.market;
|
|
314
|
+
const s = n?.env || "prod";
|
|
313
315
|
if (a?.deprecatedAt && Date.now() > a.deprecatedAt)
|
|
314
316
|
throw new Error(`The lending pool for coinType ${a.suiCoinType} has been deprecated.`);
|
|
315
|
-
const
|
|
316
|
-
if (k(a.suiCoinType) === k("0x2::sui::SUI") &&
|
|
317
|
+
const i = typeof o == "object" && o.$kind === "GasCoin";
|
|
318
|
+
if (k(a.suiCoinType) === k("0x2::sui::SUI") && i) {
|
|
317
319
|
if (!n?.amount)
|
|
318
320
|
throw new Error("Amount is required for sui coin");
|
|
319
321
|
o = e.splitCoins(o, [n.amount]);
|
|
320
322
|
}
|
|
321
|
-
let
|
|
322
|
-
return typeof n?.amount < "u" ?
|
|
323
|
+
let c;
|
|
324
|
+
return typeof n?.amount < "u" ? c = g(n.amount, e.pure.u64) : c = e.moveCall({
|
|
323
325
|
target: "0x2::coin::value",
|
|
324
326
|
arguments: [g(o, e.object)],
|
|
325
327
|
typeArguments: [a.suiCoinType]
|
|
@@ -344,12 +346,12 @@ async function Be(e, r, o, n) {
|
|
|
344
346
|
e.object(a.contract.pool),
|
|
345
347
|
e.pure.u8(a.id),
|
|
346
348
|
g(o, e.object),
|
|
347
|
-
|
|
349
|
+
c,
|
|
348
350
|
e.object(t.incentiveV2),
|
|
349
351
|
e.object(t.incentiveV3)
|
|
350
352
|
],
|
|
351
353
|
typeArguments: [a.suiCoinType]
|
|
352
|
-
}), t.version === 2 && a.token.symbol === "SUI" &&
|
|
354
|
+
}), t.version === 2 && a.token.symbol === "SUI" && s === "prod" && e.moveCall({
|
|
353
355
|
target: `${t.package}::pool::refresh_stake`,
|
|
354
356
|
arguments: [e.object(a.contract.pool), e.object("0x05")]
|
|
355
357
|
}), e;
|