@naviprotocol/wallet-client 2.0.1 → 2.0.3

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 gt from "mitt";
2
- import { withSingleton as M, getCoins as tt, mergeCoinsPTB as p, getPriceFeeds as Q, updateOraclePricesPTB as $, filterPriceFeeds as q, depositCoinPTB as x, getFlashLoanAsset as et, flashloanPTB as nt, repayFlashLoanPTB as at, borrowCoinPTB as it, withdrawCoinPTB as st, repayCoinPTB as ot, getPools as pt, getPool as T, getHealthFactor as mt, liquidatePTB as Ct, getUserAvailableLendingRewards as H, getUserClaimedRewardHistory as yt, claimLendingRewardsPTB as bt, getLendingState as vt, createAccountCapPTB as Bt, withCache as rt, resolveNaviOpenApiEndpoint as lt, buildNaviOpenApiUrl as ct, mergeServiceHeaders as ut, parseTxValue as k, createNaviSuiClientBundle as Tt, createNaviLegacyJsonRpcClient as Pt } from "@naviprotocol/lending";
3
- import O, { BigNumber as L } from "bignumber.js";
4
- import { normalizeStructTag as v, fromBase64 as ht } from "@mysten/sui/utils";
1
+ import mt from "mitt";
2
+ import { withSingleton as Q, getCoins as et, mergeCoinsPTB as m, getPriceFeeds as $, updateOraclePricesPTB as K, filterPriceFeeds as q, depositCoinPTB as A, getFlashLoanAsset as nt, flashloanPTB as at, repayFlashLoanPTB as it, borrowCoinPTB as st, withdrawCoinPTB as ot, repayCoinPTB as rt, getPools as Ct, getPool as P, getHealthFactor as yt, liquidatePTB as bt, getUserAvailableLendingRewards as D, getUserClaimedRewardHistory as vt, claimLendingRewardsPTB as Bt, getLendingState as Tt, createAccountCapPTB as Pt, withCache as lt, resolveNaviOpenApiEndpoint as ct, buildNaviOpenApiUrl as ut, mergeServiceHeaders as ht, parseTxValue as F, PUBLIC_MAINNET_GRPC_URL as St, createNaviSuiClientBundle as Ot, createNaviLegacyJsonRpcClient as Et } from "@naviprotocol/lending";
3
+ import E, { BigNumber as M } from "bignumber.js";
4
+ import { normalizeStructTag as B, fromBase64 as dt } from "@mysten/sui/utils";
5
5
  import { Transaction as h } from "@mysten/sui/transactions";
6
- import { buildSwapPTBFromQuote as z, generateRefId as St, getQuote as Ot } from "@naviprotocol/astros-aggregator-sdk";
7
- import { executeAuction as Et } from "shio-sdk";
8
- import { Signer as dt } from "@mysten/sui/cryptography";
9
- class j {
6
+ import { buildSwapPTBFromQuote as z, generateRefId as Rt, getQuote as xt } from "@naviprotocol/astros-aggregator-sdk";
7
+ import { executeAuction as At } from "shio-sdk";
8
+ import { Signer as wt } from "@mysten/sui/cryptography";
9
+ class k {
10
10
  /**
11
11
  * Gets the current configuration for this module
12
12
  *
@@ -24,8 +24,8 @@ class j {
24
24
  * @param event - The event name to emit
25
25
  * @param data - The event data to emit
26
26
  */
27
- emit(t, n) {
28
- this.walletClient?.events.emit(t, n);
27
+ emit(t, e) {
28
+ this.walletClient?.events.emit(t, e);
29
29
  }
30
30
  /**
31
31
  * Installs this module into a wallet client
@@ -48,28 +48,28 @@ class j {
48
48
  this.walletClient = void 0;
49
49
  }
50
50
  }
51
- class E {
51
+ class R {
52
52
  /**
53
53
  * Creates a new user portfolio
54
54
  *
55
55
  * @param coins - Array of coin objects or existing portfolio to copy from
56
56
  */
57
57
  constructor(t) {
58
- if (t instanceof E)
58
+ if (t instanceof R)
59
59
  this.balances = JSON.parse(JSON.stringify(t.balances));
60
60
  else {
61
- const n = {};
62
- t?.forEach((e) => {
63
- if (!e.coinType || e.balance === void 0 || e.balance === null)
61
+ const e = {};
62
+ t?.forEach((n) => {
63
+ if (!n.coinType || n.balance === void 0 || n.balance === null)
64
64
  return;
65
- const s = v(e.coinType);
66
- let a = n[s];
65
+ const s = B(n.coinType);
66
+ let a = e[s];
67
67
  a || (a = {
68
68
  coinType: s,
69
- amount: L(0),
69
+ amount: M(0),
70
70
  coins: []
71
- }, n[s] = a), a.coins.push(e), a.amount = a.amount.plus(e.balance);
72
- }), this.balances = n;
71
+ }, e[s] = a), a.coins.push(n), a.amount = a.amount.plus(n.balance);
72
+ }), this.balances = e;
73
73
  }
74
74
  }
75
75
  /**
@@ -79,7 +79,7 @@ class E {
79
79
  * @returns UserCoinBalance object with coin type, total amount, and coin objects
80
80
  */
81
81
  getBalance(t) {
82
- return t = v(t), this.balances[t] || { coinType: t, amount: L(0), coins: [] };
82
+ return t = B(t), this.balances[t] || { coinType: t, amount: M(0), coins: [] };
83
83
  }
84
84
  /**
85
85
  * Gets all coin types in the portfolio
@@ -96,7 +96,7 @@ class E {
96
96
  * @returns BigNumber representing the total balance
97
97
  */
98
98
  balanceOf(t) {
99
- return t = v(t), this.getBalance(t)?.amount || L(0);
99
+ return t = B(t), this.getBalance(t)?.amount || M(0);
100
100
  }
101
101
  /**
102
102
  * Creates a deep copy of the portfolio
@@ -107,22 +107,22 @@ class E {
107
107
  * @returns New UserPortfolio instance with copied data
108
108
  */
109
109
  clone() {
110
- const t = JSON.parse(JSON.stringify(this.balances)), n = new E();
111
- return n.balances = t, n;
110
+ const t = JSON.parse(JSON.stringify(this.balances)), e = new R();
111
+ return e.balances = t, e;
112
112
  }
113
113
  }
114
- class Rt extends j {
114
+ class jt extends k {
115
115
  constructor() {
116
116
  super(...arguments), this.name = "balance", this.defaultConfig = {
117
117
  coinPollingInterval: 6e3,
118
118
  disableCoinPolling: !1
119
- }, this.updatePortfolio = M(async () => {
119
+ }, this.updatePortfolio = Q(async () => {
120
120
  if (!this.walletClient)
121
121
  throw new Error("Wallet client not found");
122
- this._coins = await tt(this.walletClient.address, {
122
+ this._coins = await et(this.walletClient.address, {
123
123
  client: this.walletClient.client
124
- }), this._portfolio = new E(this._coins), this.emit("balance:portfolio-updated", {});
125
- }), this._coins = [], this._portfolio = new E(), this.pollingTimer = null, this._updatePromise = null;
124
+ }), this._portfolio = new R(this._coins), this.emit("balance:portfolio-updated", {});
125
+ }), this._coins = [], this._portfolio = new R(), this.pollingTimer = null, this._updatePromise = null;
126
126
  }
127
127
  /**
128
128
  * Gets the current coin objects from the wallet
@@ -160,8 +160,8 @@ class Rt extends j {
160
160
  * @param options - Optional parameters including dry run mode
161
161
  * @returns Transaction response or dry run response
162
162
  */
163
- async sendCoin(t, n, e, s) {
164
- return this.sendCoinBatch(t, [n], [e], s);
163
+ async sendCoin(t, e, n, s) {
164
+ return this.sendCoinBatch(t, [e], [n], s);
165
165
  }
166
166
  /**
167
167
  * Sends coins to multiple recipients in a single transaction
@@ -172,22 +172,22 @@ class Rt extends j {
172
172
  * @param options - Optional parameters including dry run mode
173
173
  * @returns Transaction response or dry run response
174
174
  */
175
- async sendCoinBatch(t, n, e, s) {
175
+ async sendCoinBatch(t, e, n, s) {
176
176
  if (!this.walletClient)
177
177
  throw new Error("Wallet client not found");
178
- if (n.length !== e.length)
178
+ if (e.length !== n.length)
179
179
  throw new Error("Recipients and amounts must have the same length");
180
180
  await this.waitForUpdate();
181
- const a = this.portfolio.getBalance(t), r = e.reduce((w, d) => w.plus(d), O(0));
181
+ const a = this.portfolio.getBalance(t), r = n.reduce((w, d) => w.plus(d), E(0));
182
182
  if (a.amount.lt(r))
183
183
  throw new Error("Insufficient balance");
184
184
  const o = new h();
185
185
  let l = o.gas;
186
- v(t) !== v("0x2::sui::SUI") && (l = p(o, a.coins, {
186
+ B(t) !== B("0x2::sui::SUI") && (l = m(o, a.coins, {
187
187
  balance: r.toNumber()
188
188
  }));
189
- const c = o.splitCoins(l, e);
190
- return n.forEach((w, d) => {
189
+ const c = o.splitCoins(l, n);
190
+ return e.forEach((w, d) => {
191
191
  o.transferObjects([c[d]], w);
192
192
  }), await this.walletClient.signExecuteTransaction({
193
193
  transaction: o,
@@ -202,8 +202,8 @@ class Rt extends j {
202
202
  * @param options - Optional parameters including dry run mode
203
203
  * @returns Transaction response or dry run response
204
204
  */
205
- async transferObject(t, n, e) {
206
- return this.transferObjectBatch([t], [n], e);
205
+ async transferObject(t, e, n) {
206
+ return this.transferObjectBatch([t], [e], n);
207
207
  }
208
208
  /**
209
209
  * Transfers multiple objects to their respective recipients in a single transaction
@@ -216,18 +216,18 @@ class Rt extends j {
216
216
  * @param options - Optional parameters including dry run mode
217
217
  * @returns Transaction response or dry run response
218
218
  */
219
- async transferObjectBatch(t, n, e) {
219
+ async transferObjectBatch(t, e, n) {
220
220
  if (!this.walletClient)
221
221
  throw new Error("Wallet client not found");
222
- if (t.length !== n.length)
222
+ if (t.length !== e.length)
223
223
  throw new Error("Objects and recipients must have the same length");
224
224
  await this.waitForUpdate();
225
225
  const s = new h();
226
226
  return t.forEach((r, o) => {
227
- s.transferObjects([s.object(r)], n[o]);
227
+ s.transferObjects([s.object(r)], e[o]);
228
228
  }), await this.walletClient.signExecuteTransaction({
229
229
  transaction: s,
230
- dryRun: e?.dryRun ?? !1
230
+ dryRun: n?.dryRun ?? !1
231
231
  });
232
232
  }
233
233
  /**
@@ -252,9 +252,9 @@ class Rt extends j {
252
252
  * @param walletClient - The wallet client instance to install into
253
253
  */
254
254
  install(t) {
255
- super.install(t), this.startPolling = this.startPolling.bind(this), this.startPolling(), this._updatePromise = new Promise((n) => {
255
+ super.install(t), this.startPolling = this.startPolling.bind(this), this.startPolling(), this._updatePromise = new Promise((e) => {
256
256
  t.events.on("balance:portfolio-updated", () => {
257
- n();
257
+ e();
258
258
  });
259
259
  });
260
260
  }
@@ -267,10 +267,62 @@ class Rt extends j {
267
267
  super.uninstall(), this.pollingTimer && (clearTimeout(this.pollingTimer), this.pollingTimer = null);
268
268
  }
269
269
  }
270
- async function D(i, t, n, e) {
270
+ const G = {
271
+ showEffects: !0,
272
+ showEvents: !0,
273
+ showBalanceChanges: !0,
274
+ showObjectChanges: !0
275
+ };
276
+ function H(i) {
277
+ return {
278
+ ...G,
279
+ ...i
280
+ };
281
+ }
282
+ function p(i) {
283
+ const t = i?.effects?.status;
284
+ return t?.status === "success" || t?.success === !0;
285
+ }
286
+ function x(i, t) {
287
+ const n = kt(t ?? {}), s = Ft(n);
288
+ return {
289
+ ...n,
290
+ kind: i,
291
+ effects: s,
292
+ events: Nt(n.events),
293
+ balanceChanges: Array.isArray(n.balanceChanges) ? n.balanceChanges : [],
294
+ objectChanges: Array.isArray(n.objectChanges) ? n.objectChanges : []
295
+ };
296
+ }
297
+ function kt(i) {
298
+ const t = i.Transaction;
299
+ if (j(t))
300
+ return t;
301
+ const e = i.FailedTransaction;
302
+ return j(e) ? e : i;
303
+ }
304
+ function Ft(i) {
305
+ if (j(i.effects))
306
+ return i.effects;
307
+ if (j(i.status))
308
+ return {
309
+ status: i.status
310
+ };
311
+ }
312
+ function Nt(i) {
313
+ return Array.isArray(i) ? i.map((t) => j(t) ? {
314
+ ...t,
315
+ type: t.type ?? t.eventType,
316
+ parsedJson: t.parsedJson ?? t.json
317
+ } : t) : [];
318
+ }
319
+ function j(i) {
320
+ return typeof i == "object" && i !== null;
321
+ }
322
+ async function V(i, t, e, n) {
271
323
  if (!this.walletClient)
272
324
  throw new Error("Wallet client not found");
273
- const s = await this.getPool(t), a = await this.getPool(n), r = await this.getLendingState(), o = this.walletClient.address, l = e?.protocol ?? "navi", c = await this.getProtocol(l);
325
+ const s = await this.getPool(t), a = await this.getPool(e), r = await this.getLendingState(), o = this.walletClient.address, l = n?.protocol ?? "navi", c = await this.getProtocol(l);
274
326
  if (!c)
275
327
  throw new Error(`Protocol ${l} not found`);
276
328
  const u = await c.getPool(s.coinType);
@@ -278,84 +330,84 @@ async function D(i, t, n, e) {
278
330
  fromPoolLending: u
279
331
  }), l === "navi" && u.supplyBalance === 0)
280
332
  throw new Error("No supply balance");
281
- if (e?.amount && e.amount > u.supplyBalance)
333
+ if (n?.amount && n.amount > u.supplyBalance)
282
334
  throw new Error("Amount is less than supply balance");
283
- const w = e?.slippage ?? 5e-3, d = e?.amount ?? Number(u.supplyBalance), f = await Q(this.naviServiceOptions), m = await Promise.all([s, a]);
284
- if (await $(
335
+ const w = n?.slippage ?? 5e-3, d = n?.amount ?? Number(u.supplyBalance), f = await $(this.naviServiceOptions), C = await Promise.all([s, a]);
336
+ if (await K(
285
337
  i,
286
338
  q(f, {
287
339
  lendingState: r,
288
- pools: m
340
+ pools: C
289
341
  }),
290
342
  this.naviServiceOptions
291
343
  ), l !== "navi" && s.id === a.id) {
292
- const J = await c.withdrawCoinPTB(
344
+ const L = await c.withdrawCoinPTB(
293
345
  i,
294
346
  s.suiCoinType,
295
347
  d
296
348
  );
297
- return await x(i, a, J, {
349
+ return await A(i, a, L, {
298
350
  ...this.naviServiceOptions,
299
351
  amount: d
300
352
  }), i;
301
353
  }
302
- const C = await et(a, {
354
+ const y = await nt(a, {
303
355
  ...this.naviServiceOptions,
304
356
  env: this.config.env
305
357
  });
306
- if (!C)
358
+ if (!y)
307
359
  throw new Error(`${a.token.symbol} pool not support flashloan`);
308
- const y = await this.walletClient.swap.getQuote(
360
+ const b = await this.walletClient.swap.getQuote(
309
361
  s.suiCoinType,
310
362
  a.suiCoinType,
311
363
  d
312
- ), g = Number(y.amount_out);
364
+ ), g = Number(b.amount_out);
313
365
  if (g <= 0)
314
366
  throw new Error("The amount of swapAmountOut must be greater than 0.");
315
- const B = Math.floor(g * (1 - w)), b = Math.floor(B / (1 + C.flashloanFee));
316
- if (b <= 0)
367
+ const T = Math.floor(g * (1 - w)), v = Math.floor(T / (1 + y.flashloanFee));
368
+ if (v <= 0)
317
369
  throw new Error("The calculated borrow amount must be positive.");
318
- const [P, S] = await nt(
370
+ const [S, O] = await at(
319
371
  i,
320
372
  a,
321
- b,
373
+ v,
322
374
  this.naviServiceOptions
323
- ), [F] = i.moveCall({
375
+ ), [N] = i.moveCall({
324
376
  target: "0x2::coin::from_balance",
325
- arguments: [P],
377
+ arguments: [S],
326
378
  typeArguments: [a.suiCoinType]
327
379
  });
328
- await x(i, a, F, {
380
+ await A(i, a, N, {
329
381
  ...this.naviServiceOptions,
330
- amount: b
382
+ amount: v
331
383
  });
332
- const N = await c.withdrawCoinPTB(i, s.suiCoinType, d), _ = await z(
384
+ const _ = await c.withdrawCoinPTB(i, s.suiCoinType, d), U = await z(
333
385
  o,
334
386
  i,
335
- B,
336
- N,
337
- y
338
- ), U = i.moveCall({
387
+ T,
388
+ _,
389
+ b
390
+ ), W = i.moveCall({
339
391
  target: "0x2::coin::into_balance",
340
- arguments: [_],
392
+ arguments: [U],
341
393
  typeArguments: [a.suiCoinType]
342
- }), [W] = await at(
394
+ }), [I] = await it(
343
395
  i,
344
396
  a,
345
- S,
346
- U,
397
+ O,
398
+ W,
347
399
  this.naviServiceOptions
348
- ), [I] = i.moveCall({
400
+ ), [J] = i.moveCall({
349
401
  target: "0x2::coin::from_balance",
350
- arguments: [W],
402
+ arguments: [I],
351
403
  typeArguments: [a.suiCoinType]
352
404
  });
353
- return await x(i, a, I, this.naviServiceOptions), i;
405
+ return await A(i, a, J, this.naviServiceOptions), i;
354
406
  }
355
- async function V(i, t, n, e) {
407
+ async function X(i, t, e, n) {
356
408
  if (!this.walletClient)
357
409
  throw new Error("Wallet client not found");
358
- const s = this.walletClient.address, a = await this.getPool(t), r = await this.getPool(n), o = await this.getLendingState(), l = e?.protocol ?? "navi", c = await this.getProtocol(l);
410
+ const s = this.walletClient.address, a = await this.getPool(t), r = await this.getPool(e), o = await this.getLendingState(), l = n?.protocol ?? "navi", c = await this.getProtocol(l);
359
411
  if (!c)
360
412
  throw new Error(`Protocol ${l} not found`);
361
413
  const u = await c.getPool(a.coinType);
@@ -363,10 +415,10 @@ async function V(i, t, n, e) {
363
415
  fromPoolLending: u
364
416
  }), u.borrowBalance === 0)
365
417
  throw new Error("No borrow balance");
366
- if (e?.amount && e.amount > u.borrowBalance)
418
+ if (n?.amount && n.amount > u.borrowBalance)
367
419
  throw new Error("Amount is more than borrow balance");
368
- const w = await Q(this.naviServiceOptions), d = await Promise.all([a, r]);
369
- await $(
420
+ const w = await $(this.naviServiceOptions), d = await Promise.all([a, r]);
421
+ await K(
370
422
  i,
371
423
  q(w, {
372
424
  lendingState: o,
@@ -374,90 +426,90 @@ async function V(i, t, n, e) {
374
426
  }),
375
427
  this.naviServiceOptions
376
428
  );
377
- let f = e?.amount ?? Number(u.borrowBalance);
429
+ let f = n?.amount ?? Number(u.borrowBalance);
378
430
  if (Number(u.borrowBalance) === f) {
379
- const ft = u.borrowAPR / 100;
431
+ const pt = u.borrowAPR / 100;
380
432
  f = Math.ceil(
381
- new O(f).multipliedBy(ft * (60 * 3) / (365 * 24 * 3600)).plus(new O(1).shiftedBy(-a.token.decimals)).plus(f).toNumber()
433
+ new E(f).multipliedBy(pt * (60 * 3) / (365 * 24 * 3600)).plus(new E(1).shiftedBy(-a.token.decimals)).plus(f).toNumber()
382
434
  );
383
435
  }
384
- const m = await et(a, {
436
+ const C = await nt(a, {
385
437
  ...this.naviServiceOptions,
386
438
  env: this.config.env
387
439
  });
388
- if (!m)
440
+ if (!C)
389
441
  throw new Error(`${a.token.symbol} pool not support flashloan`);
390
442
  if (!this.walletClient)
391
443
  throw new Error("Wallet client not found");
392
- const C = e?.slippage ?? 5e-3, y = Math.ceil(f * (1 + m.flashloanFee)), g = y, B = await this.walletClient.swap.getQuote(
444
+ const y = n?.slippage ?? 5e-3, b = Math.ceil(f * (1 + C.flashloanFee)), g = b, T = await this.walletClient.swap.getQuote(
393
445
  a.suiCoinType,
394
446
  r.suiCoinType,
395
447
  g
396
448
  );
397
- let b = 1 + C, P = Math.ceil(Number(B.amount_out) * b), S = await this.walletClient.swap.getQuote(
449
+ let v = 1 + y, S = Math.ceil(Number(T.amount_out) * v), O = await this.walletClient.swap.getQuote(
398
450
  r.suiCoinType,
399
451
  a.suiCoinType,
400
- P
452
+ S
401
453
  );
402
- for (; Number(S.amount_out) < g; )
403
- b = b * Math.max(g / Number(S.amount_out), 1.001), P = Math.ceil(Number(B.amount_out) * b), S = await this.walletClient.swap.getQuote(
454
+ for (; Number(O.amount_out) < g; )
455
+ v = v * Math.max(g / Number(O.amount_out), 1.001), S = Math.ceil(Number(T.amount_out) * v), O = await this.walletClient.swap.getQuote(
404
456
  r.suiCoinType,
405
457
  a.suiCoinType,
406
- P
458
+ S
407
459
  );
408
- const [F, N] = await nt(
460
+ const [N, _] = await at(
409
461
  i,
410
462
  a,
411
463
  f,
412
464
  this.naviServiceOptions
413
- ), [_] = i.moveCall({
465
+ ), [U] = i.moveCall({
414
466
  target: "0x2::coin::from_balance",
415
- arguments: [F],
467
+ arguments: [N],
416
468
  typeArguments: [a.suiCoinType]
417
469
  });
418
- await c.repayCoinPTB(i, a.suiCoinType, _, f);
419
- const U = await it(i, r, P, this.naviServiceOptions), W = await z(
470
+ await c.repayCoinPTB(i, a.suiCoinType, U, f);
471
+ const W = await st(i, r, S, this.naviServiceOptions), I = await z(
420
472
  s,
421
473
  i,
422
- y,
423
- U,
424
- S
425
- ), I = i.moveCall({
474
+ b,
475
+ W,
476
+ O
477
+ ), J = i.moveCall({
426
478
  target: "0x2::coin::into_balance",
427
- arguments: [W],
479
+ arguments: [I],
428
480
  typeArguments: [a.suiCoinType]
429
- }), [J] = await at(
481
+ }), [L] = await it(
430
482
  i,
431
483
  a,
432
- N,
433
- I,
484
+ _,
485
+ J,
434
486
  this.naviServiceOptions
435
- ), [wt] = i.moveCall({
487
+ ), [gt] = i.moveCall({
436
488
  target: "0x2::coin::from_balance",
437
- arguments: [J],
489
+ arguments: [L],
438
490
  typeArguments: [a.suiCoinType]
439
491
  });
440
- return i.transferObjects([wt], s), i;
492
+ return i.transferObjects([gt], s), i;
441
493
  }
442
- async function X(i, t, n, e) {
494
+ async function Y(i, t, e, n) {
443
495
  if (!this.walletClient)
444
496
  throw new Error("Wallet client not found");
445
- const s = await tt(this.walletClient.address, {
497
+ const s = await et(this.walletClient.address, {
446
498
  client: this.walletClient.client,
447
499
  coinType: t
448
- }), a = await this.getPool(n), o = new E(s).getBalance(t);
500
+ }), a = await this.getPool(e), o = new R(s).getBalance(t);
449
501
  if (o.amount.eq(0))
450
502
  throw new Error(`No balance of ${t}`);
451
503
  if (console.log("migrateBalanceToSupplyPTB", {
452
504
  balance: o.amount.toNumber()
453
- }), e?.amount && o.amount.lt(e.amount))
505
+ }), n?.amount && o.amount.lt(n.amount))
454
506
  throw new Error("Amount is greater than balance");
455
- const l = e?.amount ?? o.amount.toNumber(), c = e?.slippage ?? 5e-3;
456
- let u = await p(i, o.coins, {
507
+ const l = n?.amount ?? o.amount.toNumber(), c = n?.slippage ?? 5e-3;
508
+ let u = await m(i, o.coins, {
457
509
  balance: l,
458
510
  useGasCoin: !0
459
511
  });
460
- if (v(t) !== v(a.suiCoinType)) {
512
+ if (B(t) !== B(a.suiCoinType)) {
461
513
  const w = await this.walletClient.swap.getQuote(t, a.suiCoinType, l);
462
514
  u = await this.walletClient.swap.buildSwapPTBFromQuote(
463
515
  i,
@@ -466,45 +518,45 @@ async function X(i, t, n, e) {
466
518
  c
467
519
  );
468
520
  }
469
- return await x(i, a, u, this.naviServiceOptions), i;
521
+ return await A(i, a, u, this.naviServiceOptions), i;
470
522
  }
471
- class xt {
523
+ class _t {
472
524
  constructor(t) {
473
525
  this.name = "navi", this.walletClient = t;
474
526
  }
475
527
  async getPool(t) {
476
- const n = await this.walletClient.lending.getPool(t), s = (await this.walletClient.lending.getLendingState()).find(
477
- (o) => o.pool.suiCoinType === v(t)
478
- ), a = s ? new O(s.supplyBalance).toNumber() : 0, r = s ? new O(s.borrowBalance).toNumber() : 0;
528
+ const e = await this.walletClient.lending.getPool(t), s = (await this.walletClient.lending.getLendingState()).find(
529
+ (o) => o.pool.suiCoinType === B(t)
530
+ ), a = s ? new E(s.supplyBalance).toNumber() : 0, r = s ? new E(s.borrowBalance).toNumber() : 0;
479
531
  return {
480
532
  supplyBalance: a,
481
533
  borrowBalance: r,
482
- borrowAPR: parseFloat(n.borrowIncentiveApyInfo.apy)
534
+ borrowAPR: parseFloat(e.borrowIncentiveApyInfo.apy)
483
535
  };
484
536
  }
485
- async depositCoinPTB(t, n, e, s) {
537
+ async depositCoinPTB(t, e, n, s) {
486
538
  throw new Error("Not implemented");
487
539
  }
488
- async withdrawCoinPTB(t, n, e) {
489
- return st(t, n, e, this.walletClient.lending.naviServiceOptions);
540
+ async withdrawCoinPTB(t, e, n) {
541
+ return ot(t, e, n, this.walletClient.lending.naviServiceOptions);
490
542
  }
491
- async borrowCoinPTB(t, n, e) {
543
+ async borrowCoinPTB(t, e, n) {
492
544
  throw new Error("Not implemented");
493
545
  }
494
- async repayCoinPTB(t, n, e, s) {
495
- ot(t, n, e, {
546
+ async repayCoinPTB(t, e, n, s) {
547
+ rt(t, e, n, {
496
548
  ...this.walletClient.lending.naviServiceOptions,
497
549
  amount: s
498
550
  });
499
551
  }
500
552
  }
501
- class At extends j {
553
+ class Ut extends k {
502
554
  constructor() {
503
555
  super(), this.name = "lending", this.defaultConfig = {
504
556
  env: "prod",
505
557
  protocols: [],
506
558
  enableSuilend: !0
507
- }, this._protocols = [], this.migrateBetweenSupplyPTB = D, this.migrateBetweenBorrowPTB = V, this.migrateBalanceToSupplyPTB = X, this.migrateBetweenSupplyPTB = D.bind(this), this.migrateBetweenBorrowPTB = V.bind(this), this.migrateBalanceToSupplyPTB = X.bind(this);
559
+ }, this._protocols = [], this.migrateBetweenSupplyPTB = V, this.migrateBetweenBorrowPTB = X, this.migrateBalanceToSupplyPTB = Y, this.migrateBetweenSupplyPTB = V.bind(this), this.migrateBetweenBorrowPTB = X.bind(this), this.migrateBalanceToSupplyPTB = Y.bind(this);
508
560
  }
509
561
  /** Get protocols (either from internal storage or config) */
510
562
  get protocols() {
@@ -520,7 +572,7 @@ class At extends j {
520
572
  super.install(t), this._protocols = [];
521
573
  }
522
574
  async getProtocol(t) {
523
- return (!this.protocols || this.protocols.length === 0) && await this.initializeProtocols(), this.protocols.find((n) => n.name === t);
575
+ return (!this.protocols || this.protocols.length === 0) && await this.initializeProtocols(), this.protocols.find((e) => e.name === t);
524
576
  }
525
577
  /**
526
578
  * Gets all available lending pools
@@ -529,7 +581,7 @@ class At extends j {
529
581
  * @returns Array of pool information
530
582
  */
531
583
  async getPools(t) {
532
- return await pt({
584
+ return await Ct({
533
585
  ...this.naviServiceOptions,
534
586
  env: this.config.env,
535
587
  ...t
@@ -542,11 +594,11 @@ class At extends j {
542
594
  * @param options - Optional caching options
543
595
  * @returns Pool information
544
596
  */
545
- async getPool(t, n) {
546
- return await T(t, {
597
+ async getPool(t, e) {
598
+ return await P(t, {
547
599
  ...this.naviServiceOptions,
548
600
  env: this.config.env,
549
- ...n
601
+ ...e
550
602
  });
551
603
  }
552
604
  /**
@@ -557,31 +609,31 @@ class At extends j {
557
609
  * @param options - Optional parameters including dry run mode and account capability
558
610
  * @returns Transaction response or dry run response
559
611
  */
560
- async deposit(t, n, e) {
612
+ async deposit(t, e, n) {
561
613
  if (!this.walletClient)
562
614
  throw new Error("Wallet client not found");
563
- const s = await T(t, {
615
+ const s = await P(t, {
564
616
  ...this.naviServiceOptions,
565
617
  env: this.config.env
566
618
  });
567
619
  await this.walletClient.module("balance").waitForUpdate();
568
- const a = new h(), r = this.walletClient.module("balance").portfolio.getBalance(s.suiCoinType), o = p(a, r.coins, {
569
- balance: n,
620
+ const a = new h(), r = this.walletClient.module("balance").portfolio.getBalance(s.suiCoinType), o = m(a, r.coins, {
621
+ balance: e,
570
622
  useGasCoin: !0
571
623
  });
572
- await x(a, s, o, {
624
+ await A(a, s, o, {
573
625
  ...this.naviServiceOptions,
574
626
  env: this.config.env,
575
- amount: n,
576
- accountCap: e?.accountCap
627
+ amount: e,
628
+ accountCap: n?.accountCap
577
629
  });
578
630
  const l = await this.walletClient.signExecuteTransaction({
579
631
  transaction: a,
580
- dryRun: e?.dryRun ?? !1
632
+ dryRun: n?.dryRun ?? !1
581
633
  });
582
- return !e?.dryRun && l.effects?.status?.status === "success" && (this.emit("lending:deposit-success", {
634
+ return !n?.dryRun && p(l) && (this.emit("lending:deposit-success", {
583
635
  identifier: t,
584
- amount: n
636
+ amount: e
585
637
  }), this.walletClient.module("balance").updatePortfolio()), l;
586
638
  }
587
639
  /**
@@ -592,27 +644,27 @@ class At extends j {
592
644
  * @param options - Optional parameters including dry run mode and account capability
593
645
  * @returns Transaction response or dry run response
594
646
  */
595
- async withdraw(t, n, e) {
647
+ async withdraw(t, e, n) {
596
648
  if (!this.walletClient)
597
649
  throw new Error("Wallet client not found");
598
- const s = await T(t, {
650
+ const s = await P(t, {
599
651
  ...this.naviServiceOptions,
600
652
  env: this.config.env
601
653
  }), a = new h();
602
- e?.disableUpdateOracle || await this.updateOraclePTB(a, [s]);
603
- const r = await st(a, s, n, {
654
+ n?.disableUpdateOracle || await this.updateOraclePTB(a, [s]);
655
+ const r = await ot(a, s, e, {
604
656
  ...this.naviServiceOptions,
605
657
  env: this.config.env,
606
- accountCap: e?.accountCap
658
+ accountCap: n?.accountCap
607
659
  });
608
660
  a.transferObjects([r], this.walletClient.address);
609
661
  const o = await this.walletClient.signExecuteTransaction({
610
662
  transaction: a,
611
- dryRun: e?.dryRun ?? !1
663
+ dryRun: n?.dryRun ?? !1
612
664
  });
613
- return !e?.dryRun && o.effects?.status?.status === "success" && (this.emit("lending:withdraw-success", {
665
+ return !n?.dryRun && p(o) && (this.emit("lending:withdraw-success", {
614
666
  identifier: t,
615
- amount: n
667
+ amount: e
616
668
  }), this.walletClient.module("balance").updatePortfolio()), o;
617
669
  }
618
670
  /**
@@ -623,27 +675,27 @@ class At extends j {
623
675
  * @param options - Optional parameters including dry run mode and account capability
624
676
  * @returns Transaction response or dry run response
625
677
  */
626
- async borrow(t, n, e) {
678
+ async borrow(t, e, n) {
627
679
  if (!this.walletClient)
628
680
  throw new Error("Wallet client not found");
629
- const s = await T(t, {
681
+ const s = await P(t, {
630
682
  ...this.naviServiceOptions,
631
683
  env: this.config.env
632
684
  }), a = new h();
633
- e?.disableUpdateOracle || await this.updateOraclePTB(a, [s]);
634
- const r = await it(a, s, n, {
685
+ n?.disableUpdateOracle || await this.updateOraclePTB(a, [s]);
686
+ const r = await st(a, s, e, {
635
687
  ...this.naviServiceOptions,
636
688
  env: this.config.env,
637
- accountCap: e?.accountCap
689
+ accountCap: n?.accountCap
638
690
  });
639
691
  a.transferObjects([r], this.walletClient.address);
640
692
  const o = await this.walletClient.signExecuteTransaction({
641
693
  transaction: a,
642
- dryRun: e?.dryRun ?? !1
694
+ dryRun: n?.dryRun ?? !1
643
695
  });
644
- return !e?.dryRun && o.effects?.status?.status === "success" && (this.emit("lending:borrow-success", {
696
+ return !n?.dryRun && p(o) && (this.emit("lending:borrow-success", {
645
697
  identifier: t,
646
- amount: n
698
+ amount: e
647
699
  }), this.walletClient.module("balance").updatePortfolio()), o;
648
700
  }
649
701
  /**
@@ -654,30 +706,30 @@ class At extends j {
654
706
  * @param options - Optional parameters including dry run mode and account capability
655
707
  * @returns Transaction response or dry run response
656
708
  */
657
- async repay(t, n, e) {
709
+ async repay(t, e, n) {
658
710
  if (!this.walletClient)
659
711
  throw new Error("Wallet client not found");
660
712
  await this.walletClient.module("balance").waitForUpdate();
661
- const s = await T(t, {
713
+ const s = await P(t, {
662
714
  ...this.naviServiceOptions,
663
715
  env: this.config.env
664
- }), a = new h(), r = this.walletClient.module("balance").portfolio.getBalance(s.suiCoinType), o = p(a, r.coins, {
665
- balance: n,
716
+ }), a = new h(), r = this.walletClient.module("balance").portfolio.getBalance(s.suiCoinType), o = m(a, r.coins, {
717
+ balance: e,
666
718
  useGasCoin: !0
667
719
  });
668
- await ot(a, s, o, {
720
+ await rt(a, s, o, {
669
721
  ...this.naviServiceOptions,
670
722
  env: this.config.env,
671
- amount: n,
672
- accountCap: e?.accountCap
723
+ amount: e,
724
+ accountCap: n?.accountCap
673
725
  });
674
726
  const l = await this.walletClient.signExecuteTransaction({
675
727
  transaction: a,
676
- dryRun: e?.dryRun ?? !1
728
+ dryRun: n?.dryRun ?? !1
677
729
  });
678
- return !e?.dryRun && l.effects?.status?.status === "success" && (this.emit("lending:repay-success", {
730
+ return !n?.dryRun && p(l) && (this.emit("lending:repay-success", {
679
731
  identifier: t,
680
- amount: n
732
+ amount: e
681
733
  }), this.walletClient.module("balance").updatePortfolio()), l;
682
734
  }
683
735
  /**
@@ -689,7 +741,7 @@ class At extends j {
689
741
  if (!this.walletClient)
690
742
  throw new Error("Wallet client not found");
691
743
  const t = this.walletClient.address;
692
- return await mt(t, {
744
+ return await yt(t, {
693
745
  ...this.naviServiceOptions,
694
746
  env: this.config.env,
695
747
  client: this.walletClient.client
@@ -705,19 +757,19 @@ class At extends j {
705
757
  * @param options - Optional parameters including dry run mode
706
758
  * @returns Transaction response or dry run response
707
759
  */
708
- async liquidate(t, n, e, s, a) {
760
+ async liquidate(t, e, n, s, a) {
709
761
  if (!this.walletClient)
710
762
  throw new Error("Wallet client not found");
711
- const r = await T(t, {
763
+ const r = await P(t, {
712
764
  ...this.naviServiceOptions,
713
765
  env: this.config.env
714
- }), o = await T(e, {
766
+ }), o = await P(n, {
715
767
  ...this.naviServiceOptions,
716
768
  env: this.config.env
717
- }), l = new h(), c = this.walletClient.module("balance").portfolio.getBalance(r.suiCoinType), u = p(l, c.coins, {
718
- balance: n,
769
+ }), l = new h(), c = this.walletClient.module("balance").portfolio.getBalance(r.suiCoinType), u = m(l, c.coins, {
770
+ balance: e,
719
771
  useGasCoin: !0
720
- }), [w, d] = await Ct(
772
+ }), [w, d] = await bt(
721
773
  l,
722
774
  r,
723
775
  u,
@@ -731,22 +783,22 @@ class At extends j {
731
783
  target: "0x2::coin::from_balance",
732
784
  arguments: [w],
733
785
  typeArguments: [o.suiCoinType]
734
- }), [m] = l.moveCall({
786
+ }), [C] = l.moveCall({
735
787
  target: "0x2::coin::from_balance",
736
788
  arguments: [d],
737
789
  typeArguments: [r.suiCoinType]
738
790
  });
739
- l.transferObjects([f, m], this.walletClient.address);
740
- const C = await this.walletClient.signExecuteTransaction({
791
+ l.transferObjects([f, C], this.walletClient.address);
792
+ const y = await this.walletClient.signExecuteTransaction({
741
793
  transaction: l,
742
794
  dryRun: a?.dryRun ?? !1
743
795
  });
744
- return !a?.dryRun && C.effects?.status?.status === "success" && (this.emit("lending:liquidate-success", {
796
+ return !a?.dryRun && p(y) && (this.emit("lending:liquidate-success", {
745
797
  payIdentifier: t,
746
- payAmount: n,
747
- collateralIdentifier: e,
798
+ payAmount: e,
799
+ collateralIdentifier: n,
748
800
  liquidationAddress: s
749
- }), this.walletClient.module("balance").updatePortfolio()), C;
801
+ }), this.walletClient.module("balance").updatePortfolio()), y;
750
802
  }
751
803
  /**
752
804
  * Gets the available lending rewards for the current user.
@@ -758,10 +810,11 @@ class At extends j {
758
810
  async getAvailableRewards(t) {
759
811
  if (!this.walletClient)
760
812
  throw new Error("Wallet client not found");
761
- return H(this.walletClient.address, {
813
+ return D(this.walletClient.address, {
762
814
  ...this.naviServiceOptions,
763
815
  ...t,
764
- env: this.config.env
816
+ env: this.config.env,
817
+ client: this.walletClient.client
765
818
  });
766
819
  }
767
820
  /**
@@ -774,7 +827,7 @@ class At extends j {
774
827
  async getClaimedRewardHistory(t) {
775
828
  if (!this.walletClient)
776
829
  throw new Error("Wallet client not found");
777
- return yt(this.walletClient.address, {
830
+ return vt(this.walletClient.address, {
778
831
  ...this.naviServiceOptions,
779
832
  ...t
780
833
  });
@@ -788,37 +841,39 @@ class At extends j {
788
841
  async claimAllRewards(t) {
789
842
  if (!this.walletClient)
790
843
  throw new Error("Wallet client not found");
791
- const n = new h(), e = await H(this.walletClient.address, {
844
+ const e = new h(), n = await D(this.walletClient.address, {
792
845
  ...this.naviServiceOptions,
793
- env: this.config.env
846
+ env: this.config.env,
847
+ client: this.walletClient.client
794
848
  });
795
- await bt(n, e, {
849
+ await Bt(e, n, {
796
850
  ...this.naviServiceOptions,
797
851
  env: this.config.env,
798
852
  accountCap: t?.accountCap
799
853
  });
800
854
  const s = await this.walletClient.signExecuteTransaction({
801
- transaction: n,
855
+ transaction: e,
802
856
  dryRun: t?.dryRun ?? !1
803
857
  });
804
- return !t?.dryRun && s.effects?.status?.status === "success" && (this.emit("lending:claim-rewards-success", {
805
- rewards: e
858
+ return !t?.dryRun && p(s) && (this.emit("lending:claim-rewards-success", {
859
+ rewards: n
806
860
  }), this.walletClient.module("balance").updatePortfolio()), s;
807
861
  }
808
- async updateOraclePTB(t, n) {
809
- const e = await Q({
862
+ async updateOraclePTB(t, e) {
863
+ const n = await $({
810
864
  ...this.naviServiceOptions,
811
865
  env: this.config.env
812
866
  }), s = await this.getLendingState({
813
867
  cacheTime: 60 * 1e3
814
- }), a = q(e, {
868
+ }), a = q(n, {
815
869
  lendingState: s,
816
- pools: n
870
+ pools: e
817
871
  });
818
- await $(t, a, {
872
+ await K(t, a, {
819
873
  ...this.naviServiceOptions,
820
874
  env: this.config.env,
821
- updatePythPriceFeeds: !0
875
+ updatePythPriceFeeds: !0,
876
+ client: this.walletClient?.client
822
877
  });
823
878
  }
824
879
  /**
@@ -831,9 +886,9 @@ class At extends j {
831
886
  async updateOracle(t) {
832
887
  if (!this.walletClient)
833
888
  throw new Error("Wallet client not found");
834
- const n = new h();
835
- return await this.updateOraclePTB(n, t?.pools), await this.walletClient.signExecuteTransaction({
836
- transaction: n,
889
+ const e = new h();
890
+ return await this.updateOraclePTB(e, t?.pools), await this.walletClient.signExecuteTransaction({
891
+ transaction: e,
837
892
  dryRun: t?.dryRun ?? !1
838
893
  });
839
894
  }
@@ -846,7 +901,7 @@ class At extends j {
846
901
  async getLendingState(t) {
847
902
  if (!this.walletClient)
848
903
  throw new Error("Wallet client not found");
849
- return await vt(this.walletClient.address, {
904
+ return await Tt(this.walletClient.address, {
850
905
  ...this.naviServiceOptions,
851
906
  env: this.config.env,
852
907
  ...t,
@@ -862,9 +917,9 @@ class At extends j {
862
917
  async createAccountCap(t) {
863
918
  if (!this.walletClient)
864
919
  throw new Error("Wallet client not found");
865
- const n = new h(), e = await Bt(n);
866
- return n.transferObjects([e], this.walletClient.address), await this.walletClient.signExecuteTransaction({
867
- transaction: n,
920
+ const e = new h(), n = await Pt(e);
921
+ return e.transferObjects([n], this.walletClient.address), await this.walletClient.signExecuteTransaction({
922
+ transaction: e,
868
923
  dryRun: t?.dryRun ?? !1
869
924
  });
870
925
  }
@@ -874,33 +929,33 @@ class At extends j {
874
929
  return;
875
930
  }
876
931
  const t = [];
877
- if (t.push(new xt(this.walletClient)), this.config.enableSuilend)
932
+ if (t.push(new _t(this.walletClient)), this.config.enableSuilend)
878
933
  try {
879
- const { default: n } = await import("./suilend-CWugUjwd.js");
934
+ const { default: e } = await import("./suilend-CWugUjwd.js");
880
935
  t.push(
881
- await n.create(this.walletClient, {
936
+ await e.create(this.walletClient, {
882
937
  grpcClient: this.config.suilendGrpcClient,
883
938
  grpcUrl: this.config.suilendGrpcUrl
884
939
  })
885
940
  );
886
- } catch (n) {
887
- console.warn("Failed to initialize SuilendProtocol:", n);
941
+ } catch (e) {
942
+ console.warn("Failed to initialize SuilendProtocol:", e);
888
943
  }
889
944
  this._protocols = t;
890
945
  }
891
946
  }
892
- class jt extends j {
947
+ class Wt extends k {
893
948
  constructor() {
894
949
  super(...arguments), this.name = "volo", this.defaultConfig = {
895
950
  packageId: "0x68d22cf8bdbcd11ecba1e094922873e4080d4d11133e2443fddda0bfd11dae20",
896
951
  poolId: "0x2d914e23d82fedef1b5f56a32d5c64bdcc3087ccfea2b4d6ea51a71f587840e5",
897
952
  metadataId: "0x680cd26af32b2bde8d3361e804c53ec1d1cfe24c7f039eb7f549e8dfde389a60",
898
953
  coinType: "0x549e8b69270defbfafd4f94e17ec44cdbdd99820b33bda2278dea3b9a32d3f55::cert::CERT"
899
- }, this.getStatsCached = rt(
900
- M(async (t) => {
901
- const n = { services: t?.services }, e = lt(n);
902
- return (await fetch(ct("/volo/stats", n), {
903
- headers: ut({}, e)
954
+ }, this.getStatsCached = lt(
955
+ Q(async (t) => {
956
+ const e = { services: t?.services }, n = ct(e);
957
+ return (await fetch(ut("/volo/stats", e), {
958
+ headers: ht({}, n)
904
959
  }).then((a) => a.json())).data;
905
960
  })
906
961
  );
@@ -917,18 +972,18 @@ class jt extends j {
917
972
  * @param suiCoin - The SUI coin object to stake
918
973
  * @returns The vSUI coin object received from staking
919
974
  */
920
- async stakePTB(t, n) {
921
- const [e] = t.moveCall({
975
+ async stakePTB(t, e) {
976
+ const [n] = t.moveCall({
922
977
  target: `${this.config.packageId}::stake_pool::stake`,
923
978
  arguments: [
924
979
  t.object(this.config.poolId),
925
980
  t.object(this.config.metadataId),
926
981
  t.object("0x05"),
927
- k(n, t.object)
982
+ F(e, t.object)
928
983
  ],
929
984
  typeArguments: []
930
985
  });
931
- return e;
986
+ return n;
932
987
  }
933
988
  /**
934
989
  * Adds unstaking operation to a transaction black
@@ -937,18 +992,18 @@ class jt extends j {
937
992
  * @param vSuiCoin - The vSUI coin object to unstake
938
993
  * @returns The SUI coin object received from unstaking
939
994
  */
940
- async unstakePTB(t, n) {
941
- const [e] = t.moveCall({
995
+ async unstakePTB(t, e) {
996
+ const [n] = t.moveCall({
942
997
  target: `${this.config.packageId}::stake_pool::unstake`,
943
998
  arguments: [
944
999
  t.object(this.config.poolId),
945
1000
  t.object(this.config.metadataId),
946
1001
  t.object("0x05"),
947
- k(n, t.object)
1002
+ F(e, t.object)
948
1003
  ],
949
1004
  typeArguments: []
950
1005
  });
951
- return e;
1006
+ return n;
952
1007
  }
953
1008
  /**
954
1009
  * Stake SUI tokens to receive vSUI tokens
@@ -958,23 +1013,23 @@ class jt extends j {
958
1013
  * @returns Transaction response or dry run response
959
1014
  * @throws Error if wallet client not found or stake amount is too low
960
1015
  */
961
- async stake(t, n) {
1016
+ async stake(t, e) {
962
1017
  if (!this.walletClient)
963
1018
  throw new Error("Wallet client not found");
964
1019
  if (t < 1e9)
965
1020
  throw new Error("Stake amount should be greater than 1Sui");
966
- const e = new h();
1021
+ const n = new h();
967
1022
  await this.walletClient.module("balance").waitForUpdate();
968
- const s = this.walletClient.module("balance").portfolio.getBalance("0x2::sui::SUI"), a = p(e, s.coins, {
1023
+ const s = this.walletClient.module("balance").portfolio.getBalance("0x2::sui::SUI"), a = m(n, s.coins, {
969
1024
  balance: t,
970
1025
  useGasCoin: !0
971
- }), r = await this.stakePTB(e, a);
972
- e.transferObjects([r], this.walletClient.address);
1026
+ }), r = await this.stakePTB(n, a);
1027
+ n.transferObjects([r], this.walletClient.address);
973
1028
  const o = await this.walletClient.signExecuteTransaction({
974
- transaction: e,
975
- dryRun: n?.dryRun ?? !1
1029
+ transaction: n,
1030
+ dryRun: e?.dryRun ?? !1
976
1031
  });
977
- return !n?.dryRun && o.effects?.status?.status === "success" && (this.emit("volo:stake-success", {
1032
+ return !e?.dryRun && p(o) && (this.emit("volo:stake-success", {
978
1033
  suiAmount: t
979
1034
  }), this.walletClient.module("balance").updatePortfolio()), o;
980
1035
  }
@@ -986,75 +1041,27 @@ class jt extends j {
986
1041
  * @returns Transaction response or dry run response
987
1042
  * @throws Error if wallet client not found or unstake amount is too low
988
1043
  */
989
- async unstake(t, n) {
1044
+ async unstake(t, e) {
990
1045
  if (!this.walletClient)
991
1046
  throw new Error("Wallet client not found");
992
1047
  if (t < 1e9)
993
1048
  throw new Error("Unstake amount should >= 1vSui");
994
1049
  await this.walletClient.module("balance").waitForUpdate();
995
- const e = new h(), s = this.walletClient.module("balance").portfolio.getBalance(this.config.coinType), a = p(e, s.coins, {
1050
+ const n = new h(), s = this.walletClient.module("balance").portfolio.getBalance(this.config.coinType), a = m(n, s.coins, {
996
1051
  balance: t
997
- }), r = await this.unstakePTB(e, a);
998
- e.transferObjects([r], this.walletClient.address);
1052
+ }), r = await this.unstakePTB(n, a);
1053
+ n.transferObjects([r], this.walletClient.address);
999
1054
  const o = await this.walletClient.signExecuteTransaction({
1000
- transaction: e,
1001
- dryRun: n?.dryRun ?? !1
1055
+ transaction: n,
1056
+ dryRun: e?.dryRun ?? !1
1002
1057
  });
1003
- return !n?.dryRun && o.effects?.status?.status === "success" && (this.emit("volo:unstake-success", {
1058
+ return !e?.dryRun && p(o) && (this.emit("volo:unstake-success", {
1004
1059
  vSuiAmount: t
1005
1060
  }), this.walletClient.module("balance").updatePortfolio()), o;
1006
1061
  }
1007
1062
  }
1008
- const K = {
1009
- showEffects: !0,
1010
- showEvents: !0,
1011
- showBalanceChanges: !0,
1012
- showObjectChanges: !0
1013
- };
1014
- function G(i) {
1015
- return {
1016
- ...K,
1017
- ...i
1018
- };
1019
- }
1020
- function R(i, t) {
1021
- const e = kt(t ?? {}), s = Ft(e);
1022
- return {
1023
- ...e,
1024
- kind: i,
1025
- effects: s,
1026
- events: Nt(e.events),
1027
- balanceChanges: Array.isArray(e.balanceChanges) ? e.balanceChanges : [],
1028
- objectChanges: Array.isArray(e.objectChanges) ? e.objectChanges : []
1029
- };
1030
- }
1031
- function kt(i) {
1032
- const t = i.Transaction;
1033
- if (A(t))
1034
- return t;
1035
- const n = i.FailedTransaction;
1036
- return A(n) ? n : i;
1037
- }
1038
- function Ft(i) {
1039
- if (A(i.effects))
1040
- return i.effects;
1041
- if (A(i.status))
1042
- return {
1043
- status: i.status
1044
- };
1045
- }
1046
- function Nt(i) {
1047
- return Array.isArray(i) ? i.map((t) => A(t) ? {
1048
- ...t,
1049
- type: t.type ?? t.eventType,
1050
- parsedJson: t.parsedJson ?? t.json
1051
- } : t) : [];
1052
- }
1053
- function A(i) {
1054
- return typeof i == "object" && i !== null;
1055
- }
1056
- function _t() {
1057
- const i = G(K);
1063
+ function It() {
1064
+ const i = H(G);
1058
1065
  return {
1059
1066
  effects: i.showEffects,
1060
1067
  events: i.showEvents,
@@ -1062,14 +1069,10 @@ function _t() {
1062
1069
  objectTypes: i.showObjectChanges
1063
1070
  };
1064
1071
  }
1065
- function Ut(i) {
1072
+ function Jt(i) {
1066
1073
  return i.core;
1067
1074
  }
1068
- function Wt(i) {
1069
- const t = i.effects?.status;
1070
- return t?.status === "success" || t?.success === !0;
1071
- }
1072
- class It extends j {
1075
+ class Lt extends k {
1073
1076
  constructor() {
1074
1077
  super(...arguments), this.name = "swap", this.defaultConfig = {
1075
1078
  apiKey: "",
@@ -1086,7 +1089,7 @@ class It extends j {
1086
1089
  * @returns Referral ID if API key is configured, otherwise 0
1087
1090
  */
1088
1091
  get referral() {
1089
- return this.config.apiKey ? St(this.config.apiKey) : 0;
1092
+ return this.config.apiKey ? Rt(this.config.apiKey) : 0;
1090
1093
  }
1091
1094
  /**
1092
1095
  * Get the swap options
@@ -1108,8 +1111,8 @@ class It extends j {
1108
1111
  * @param fromAmount - The amount of the coin being swapped from
1109
1112
  * @returns A promise that resolves with the quote
1110
1113
  */
1111
- async getQuote(t, n, e) {
1112
- return Ot(t, n, e, this.config.apiKey, this.swapOptions);
1114
+ async getQuote(t, e, n) {
1115
+ return xt(t, e, n, this.config.apiKey, this.swapOptions);
1113
1116
  }
1114
1117
  /**
1115
1118
  * Builds a swap transaction from a quote
@@ -1119,16 +1122,16 @@ class It extends j {
1119
1122
  * @param slippage - The slippage tolerance
1120
1123
  * @returns The swap transaction
1121
1124
  */
1122
- async buildSwapPTBFromQuote(t, n, e, s) {
1125
+ async buildSwapPTBFromQuote(t, e, n, s) {
1123
1126
  if (!this.walletClient)
1124
1127
  throw new Error("Wallet client not found");
1125
- const a = new O(n.amount_out).multipliedBy(1 - s).toFixed(0);
1128
+ const a = new E(e.amount_out).multipliedBy(1 - s).toFixed(0);
1126
1129
  return await z(
1127
1130
  this.walletClient.address,
1128
1131
  t,
1129
1132
  Number(a),
1130
- e,
1131
1133
  n,
1134
+ e,
1132
1135
  this.referral,
1133
1136
  !1,
1134
1137
  this.config.apiKey,
@@ -1152,14 +1155,14 @@ class It extends j {
1152
1155
  * @param options - Optional parameters including dry run mode
1153
1156
  * @returns Transaction response or dry run response
1154
1157
  */
1155
- async swap(t, n, e, s, a) {
1158
+ async swap(t, e, n, s, a) {
1156
1159
  if (!this.walletClient)
1157
1160
  throw new Error("Wallet client not found");
1158
1161
  await this.walletClient.module("balance").waitForUpdate();
1159
- const r = this.walletClient.module("balance").portfolio.getBalance(t), o = new h(), l = p(o, r.coins, {
1160
- balance: e,
1162
+ const r = this.walletClient.module("balance").portfolio.getBalance(t), o = new h(), l = m(o, r.coins, {
1163
+ balance: n,
1161
1164
  useGasCoin: !0
1162
- }), c = await this.getQuote(t, n, e), u = await this.buildSwapPTBFromQuote(o, c, l, s);
1165
+ }), c = await this.getQuote(t, e, n), u = await this.buildSwapPTBFromQuote(o, c, l, s);
1163
1166
  if (o.transferObjects([u], this.walletClient.address), o.setSender(this.walletClient.address), a?.dryRun)
1164
1167
  return await this.walletClient.signExecuteTransaction({
1165
1168
  transaction: o,
@@ -1169,14 +1172,14 @@ class It extends j {
1169
1172
  client: this.walletClient.client
1170
1173
  }), d = await this.walletClient.signer.signTransaction(w), f = [d.signature];
1171
1174
  try {
1172
- await Et(d.bytes, f);
1175
+ await At(d.bytes, f);
1173
1176
  } catch (g) {
1174
1177
  console.error(g);
1175
1178
  }
1176
- const m = Ut(this.walletClient.client), C = typeof m?.executeTransaction == "function" ? await m.executeTransaction({
1177
- transaction: ht(d.bytes),
1179
+ const C = Jt(this.walletClient.client), y = typeof C?.executeTransaction == "function" ? await C.executeTransaction({
1180
+ transaction: dt(d.bytes),
1178
1181
  signatures: f,
1179
- include: _t()
1182
+ include: It()
1180
1183
  }) : await (() => {
1181
1184
  const g = this.walletClient.clientBundle.legacyJsonRpc;
1182
1185
  if (!g)
@@ -1186,33 +1189,33 @@ class It extends j {
1186
1189
  return g.executeTransactionBlock({
1187
1190
  transactionBlock: d.bytes,
1188
1191
  signature: f,
1189
- options: K
1192
+ options: G
1190
1193
  });
1191
- })(), y = R("execute", C);
1192
- if (Wt(y)) {
1193
- const g = y.events?.find((B) => B.type?.includes("::slippage::SwapEvent"));
1194
+ })(), b = x("execute", y);
1195
+ if (p(b)) {
1196
+ const g = b.events?.find((T) => T.type?.includes("::slippage::SwapEvent"));
1194
1197
  g && this.emit("swap:swap-success", {
1195
1198
  fromCoinType: t,
1196
- toCoinType: n,
1197
- fromAmount: e,
1199
+ toCoinType: e,
1200
+ fromAmount: n,
1198
1201
  slippage: s,
1199
1202
  toAmount: Number(g.parsedJson.amount_out)
1200
1203
  }), this.walletClient.module("balance").updatePortfolio();
1201
1204
  }
1202
- return y;
1205
+ return b;
1203
1206
  }
1204
1207
  }
1205
- class Jt extends j {
1208
+ class Mt extends k {
1206
1209
  constructor() {
1207
1210
  super(...arguments), this.name = "haedal", this.defaultConfig = {
1208
1211
  packageId: "0x19e6ea7f5ced4f090e20da794cc80349a03e638940ddb95155a4e301f5f4967c",
1209
1212
  configId: "0x47b224762220393057ebf4f70501b6e657c3e56684737568439a04f80849b2ca",
1210
1213
  coinType: "0xbde4ba4c2e274a60ce15c1cfff9e5c42e41654ac8b6d906a57efa4bd3c29f47d::hasui::HASUI"
1211
- }, this.getApyCached = rt(
1212
- M(async (t) => {
1213
- const n = { services: t?.services }, e = lt(n);
1214
- return (await fetch(ct("/haedal/stats", n), {
1215
- headers: ut({}, e)
1214
+ }, this.getApyCached = lt(
1215
+ Q(async (t) => {
1216
+ const e = { services: t?.services }, n = ct(e);
1217
+ return (await fetch(ut("/haedal/stats", e), {
1218
+ headers: ht({}, n)
1216
1219
  }).then((a) => a.json())).data.apy;
1217
1220
  })
1218
1221
  );
@@ -1229,18 +1232,18 @@ class Jt extends j {
1229
1232
  * @param suiCoin - Sui coin object to stake
1230
1233
  * @returns haSUI coin object
1231
1234
  */
1232
- async stakePTB(t, n) {
1233
- const [e] = t.moveCall({
1235
+ async stakePTB(t, e) {
1236
+ const [n] = t.moveCall({
1234
1237
  target: `${this.config.packageId}::staking::request_stake_coin`,
1235
1238
  arguments: [
1236
1239
  t.object("0x05"),
1237
1240
  t.object(this.config.configId),
1238
- k(n, t.object),
1241
+ F(e, t.object),
1239
1242
  t.pure.address("0x0000000000000000000000000000000000000000000000000000000000000000")
1240
1243
  ],
1241
1244
  typeArguments: []
1242
1245
  });
1243
- return e;
1246
+ return n;
1244
1247
  }
1245
1248
  /**
1246
1249
  * Builds a transaction block for unstaking haSUI to SUI
@@ -1249,17 +1252,17 @@ class Jt extends j {
1249
1252
  * @param haSUICoin - haSUI coin object to unstake
1250
1253
  * @returns SUI coin object
1251
1254
  */
1252
- async unstakePTB(t, n) {
1253
- const [e] = t.moveCall({
1255
+ async unstakePTB(t, e) {
1256
+ const [n] = t.moveCall({
1254
1257
  target: `${this.config.packageId}::staking::request_unstake_instant_coin`,
1255
1258
  arguments: [
1256
1259
  t.object("0x05"),
1257
1260
  t.object(this.config.configId),
1258
- k(n, t.object)
1261
+ F(e, t.object)
1259
1262
  ],
1260
1263
  typeArguments: []
1261
1264
  });
1262
- return e;
1265
+ return n;
1263
1266
  }
1264
1267
  /**
1265
1268
  * Stake SUI for haSUI
@@ -1267,21 +1270,21 @@ class Jt extends j {
1267
1270
  * @param suiAmount - Amount of SUI to stake
1268
1271
  * @param options Optional dry run
1269
1272
  */
1270
- async stake(t, n) {
1273
+ async stake(t, e) {
1271
1274
  if (!this.walletClient)
1272
1275
  throw new Error("Wallet client not found");
1273
- const e = new h();
1276
+ const n = new h();
1274
1277
  await this.walletClient.module("balance").waitForUpdate();
1275
- const s = this.walletClient.module("balance").portfolio.getBalance("0x2::sui::SUI"), a = p(e, s.coins, {
1278
+ const s = this.walletClient.module("balance").portfolio.getBalance("0x2::sui::SUI"), a = m(n, s.coins, {
1276
1279
  balance: t,
1277
1280
  useGasCoin: !0
1278
- }), r = await this.stakePTB(e, a);
1279
- e.transferObjects([r], this.walletClient.address);
1281
+ }), r = await this.stakePTB(n, a);
1282
+ n.transferObjects([r], this.walletClient.address);
1280
1283
  const o = await this.walletClient.signExecuteTransaction({
1281
- transaction: e,
1282
- dryRun: n?.dryRun ?? !1
1284
+ transaction: n,
1285
+ dryRun: e?.dryRun ?? !1
1283
1286
  });
1284
- return !n?.dryRun && o.effects?.status?.status === "success" && (this.emit("haedal:stake-success", { suiAmount: t }), this.walletClient.module("balance").updatePortfolio()), o;
1287
+ return !e?.dryRun && p(o) && (this.emit("haedal:stake-success", { suiAmount: t }), this.walletClient.module("balance").updatePortfolio()), o;
1285
1288
  }
1286
1289
  /**
1287
1290
  * Unstake haSUI for SUI
@@ -1289,35 +1292,35 @@ class Jt extends j {
1289
1292
  * @param haSUIAmount - Amount of haSUI to unstake
1290
1293
  * @param options Optional dry run
1291
1294
  */
1292
- async unstake(t, n) {
1295
+ async unstake(t, e) {
1293
1296
  if (!this.walletClient)
1294
1297
  throw new Error("Wallet client not found");
1295
1298
  await this.walletClient.module("balance").waitForUpdate();
1296
- const e = new h(), s = this.walletClient.module("balance").portfolio.getBalance(this.config.coinType), a = p(e, s.coins, {
1299
+ const n = new h(), s = this.walletClient.module("balance").portfolio.getBalance(this.config.coinType), a = m(n, s.coins, {
1297
1300
  balance: t
1298
- }), r = await this.unstakePTB(e, a);
1299
- e.transferObjects([r], this.walletClient.address);
1301
+ }), r = await this.unstakePTB(n, a);
1302
+ n.transferObjects([r], this.walletClient.address);
1300
1303
  const o = await this.walletClient.signExecuteTransaction({
1301
- transaction: e,
1302
- dryRun: n?.dryRun ?? !1
1304
+ transaction: n,
1305
+ dryRun: e?.dryRun ?? !1
1303
1306
  });
1304
- return !n?.dryRun && o.effects?.status?.status === "success" && (this.emit("haedal:unstake-success", { haSUIAmount: t }), this.walletClient.module("balance").updatePortfolio()), o;
1307
+ return !e?.dryRun && p(o) && (this.emit("haedal:unstake-success", { haSUIAmount: t }), this.walletClient.module("balance").updatePortfolio()), o;
1305
1308
  }
1306
1309
  }
1307
- const Lt = {
1310
+ const Qt = {
1308
1311
  /** Balance management module */
1309
- balance: new Rt(),
1312
+ balance: new jt(),
1310
1313
  /** Lending protocol module */
1311
- lending: new At(),
1314
+ lending: new Ut(),
1312
1315
  /** Volo protocol module */
1313
- volo: new jt(),
1316
+ volo: new Wt(),
1314
1317
  /** DEX swapping module */
1315
- swap: new It(),
1318
+ swap: new Lt(),
1316
1319
  /** Haedal protocol module */
1317
- haedal: new Jt()
1320
+ haedal: new Mt()
1318
1321
  };
1319
- function Y(i) {
1320
- const t = G(i);
1322
+ function Z(i) {
1323
+ const t = H(i);
1321
1324
  return {
1322
1325
  effects: t.showEffects,
1323
1326
  events: t.showEvents,
@@ -1325,34 +1328,39 @@ function Y(i) {
1325
1328
  objectTypes: t.showObjectChanges
1326
1329
  };
1327
1330
  }
1328
- function Z(i) {
1331
+ function tt(i) {
1329
1332
  return i.core;
1330
1333
  }
1331
- function Mt(i) {
1334
+ function $t(i) {
1332
1335
  return "grpc" in i;
1333
1336
  }
1334
- function Qt(i) {
1335
- if (Mt(i))
1336
- return Tt(i);
1337
- const t = i.network ?? "mainnet", n = Pt(t, i.legacyJsonRpc);
1337
+ function Kt(i) {
1338
+ if ($t(i))
1339
+ return Ot(i);
1340
+ const t = i.network ?? "mainnet", e = Et(t, i.legacyJsonRpc);
1338
1341
  return {
1339
1342
  network: t,
1340
- coreClient: n,
1341
- grpc: n,
1342
- legacyJsonRpc: n,
1343
+ coreClient: e,
1344
+ grpc: e,
1345
+ legacyJsonRpc: e,
1343
1346
  services: i.services
1344
1347
  };
1345
1348
  }
1346
- class Xt {
1349
+ class Zt {
1347
1350
  /**
1348
1351
  * Creates a new wallet client instance
1349
1352
  * @param options - Configuration options for the wallet client
1350
1353
  */
1351
1354
  constructor(t) {
1352
- this.modules = Lt, this.userConfigs = {}, this.events = gt(), this.clientBundle = Qt(t.client), this.client = this.clientBundle.coreClient, this.clientUrl = "grpc" in t.client ? t.client.legacyJsonRpc && "url" in t.client.legacyJsonRpc ? t.client.legacyJsonRpc.url : void 0 : "url" in t.client.legacyJsonRpc ? t.client.legacyJsonRpc.url : void 0, this.signer = t.signer, this.userConfigs = t.configs || {}, Object.entries(this.modules).forEach(([n, e]) => {
1353
- if (n !== e.name)
1354
- throw new Error(`Module name ${n} does not match module name ${e.name}`);
1355
- e.install(this);
1355
+ this.modules = Qt, this.userConfigs = {}, this.events = mt();
1356
+ const e = t.client ?? {
1357
+ network: "mainnet",
1358
+ grpc: { url: St }
1359
+ };
1360
+ this.clientBundle = Kt(e), this.client = this.clientBundle.coreClient, this.clientUrl = "grpc" in e ? e.legacyJsonRpc && "url" in e.legacyJsonRpc ? e.legacyJsonRpc.url : void 0 : "url" in e.legacyJsonRpc ? e.legacyJsonRpc.url : void 0, this.signer = t.signer, this.userConfigs = t.configs || {}, Object.entries(this.modules).forEach(([n, s]) => {
1361
+ if (n !== s.name)
1362
+ throw new Error(`Module name ${n} does not match module name ${s.name}`);
1363
+ s.install(this);
1356
1364
  });
1357
1365
  }
1358
1366
  get lending() {
@@ -1376,16 +1384,16 @@ class Xt {
1376
1384
  * @returns Promise with transaction execution result
1377
1385
  */
1378
1386
  async signExecuteTransaction(t) {
1379
- const { dryRun: n = !1, ...e } = t;
1380
- if (n) {
1381
- const o = Z(this.client);
1387
+ const { dryRun: e = !1, ...n } = t;
1388
+ if (e) {
1389
+ const o = tt(this.client);
1382
1390
  if (typeof o?.simulateTransaction == "function") {
1383
1391
  t.transaction instanceof h && t.transaction.setSenderIfNotSet(this.address);
1384
1392
  const w = await o.simulateTransaction({
1385
1393
  transaction: t.transaction,
1386
- include: Y(e.options)
1394
+ include: Z(n.options)
1387
1395
  });
1388
- return R("dryRun", w);
1396
+ return x("dryRun", w);
1389
1397
  }
1390
1398
  const l = this.clientBundle.legacyJsonRpc;
1391
1399
  if (!l)
@@ -1399,20 +1407,20 @@ class Xt {
1399
1407
  const u = await l.dryRunTransactionBlock({
1400
1408
  transactionBlock: c
1401
1409
  });
1402
- return R("dryRun", u);
1410
+ return x("dryRun", u);
1403
1411
  }
1404
- const s = Z(this.client);
1412
+ const s = tt(this.client);
1405
1413
  if (typeof s?.executeTransaction == "function") {
1406
1414
  let o;
1407
1415
  t.transaction instanceof h ? (t.transaction.setSenderIfNotSet(this.address), o = await t.transaction.build({
1408
1416
  client: this.client
1409
1417
  })) : o = t.transaction;
1410
1418
  const l = await this.signer.signTransaction(o), c = await s.executeTransaction({
1411
- transaction: ht(l.bytes),
1419
+ transaction: dt(l.bytes),
1412
1420
  signatures: [l.signature],
1413
- include: Y(e.options)
1421
+ include: Z(n.options)
1414
1422
  });
1415
- return R("execute", c);
1423
+ return x("execute", c);
1416
1424
  }
1417
1425
  const a = this.clientBundle.legacyJsonRpc;
1418
1426
  if (!a)
@@ -1420,11 +1428,11 @@ class Xt {
1420
1428
  "WalletClient execution requires core.executeTransaction or an explicit legacyJsonRpc client"
1421
1429
  );
1422
1430
  const r = await a.signAndExecuteTransaction({
1423
- ...e,
1424
- options: G(e.options),
1431
+ ...n,
1432
+ options: H(n.options),
1425
1433
  signer: this.signer
1426
1434
  });
1427
- return R("execute", r);
1435
+ return x("execute", r);
1428
1436
  }
1429
1437
  /**
1430
1438
  * Gets the wallet address from the signer's public key
@@ -1461,7 +1469,16 @@ class Xt {
1461
1469
  return t in this.modules;
1462
1470
  }
1463
1471
  }
1464
- class Yt extends dt {
1472
+ function ft(i) {
1473
+ return {
1474
+ toSuiAddress: () => i,
1475
+ toBytes: () => new Uint8Array(32),
1476
+ toRawBytes: () => new Uint8Array(32),
1477
+ flag: () => 0,
1478
+ verify: async () => !1
1479
+ };
1480
+ }
1481
+ class te extends wt {
1465
1482
  /**
1466
1483
  * Creates a new watch-only signer
1467
1484
  *
@@ -1487,45 +1504,29 @@ class Yt extends dt {
1487
1504
  *
1488
1505
  * Returns a mock public key object that provides the wallet address
1489
1506
  * but cannot be used for actual cryptographic operations.
1490
- *
1491
- * @returns Mock public key object
1492
1507
  */
1493
1508
  getPublicKey() {
1494
- return {
1495
- /** Returns the wallet address */
1496
- toSuiAddress: () => this.address,
1497
- /** Returns empty bytes (not a real public key) */
1498
- toBytes: () => new Uint8Array(32),
1499
- /** Returns empty raw bytes (not a real public key) */
1500
- toRawBytes: () => new Uint8Array(32),
1501
- /** Public key flag (0 for mock) */
1502
- flag: 0,
1503
- /** Verification always returns false (not a real public key) */
1504
- verify: async () => !1
1505
- };
1509
+ return ft(this.address);
1506
1510
  }
1507
1511
  /**
1508
1512
  * Gets the key scheme for this signer
1509
1513
  *
1510
- * @returns Key scheme string (ed25519 for compatibility)
1514
+ * @returns Key scheme (ed25519 for compatibility)
1511
1515
  */
1512
1516
  getKeyScheme() {
1513
- return "ed25519";
1517
+ return "ED25519";
1514
1518
  }
1515
1519
  /**
1516
1520
  * Signs and executes a transaction (not implemented for watch-only mode)
1517
1521
  *
1518
1522
  * This method is required by the Signer interface but cannot
1519
1523
  * actually sign and execute transactions in watch-only mode.
1520
- *
1521
- * @param options - Sign and execute options
1522
- * @returns Promise<any> - Empty result (not a real transaction result)
1523
1524
  */
1524
- async signAndExecuteTransaction({ transaction: t, client: n }) {
1525
+ async signAndExecuteTransaction(t) {
1525
1526
  return {};
1526
1527
  }
1527
1528
  }
1528
- class Zt extends dt {
1529
+ class ee extends wt {
1529
1530
  /**
1530
1531
  * Creates a new watch-only signer
1531
1532
  *
@@ -1551,35 +1552,22 @@ class Zt extends dt {
1551
1552
  *
1552
1553
  * Returns a mock public key object that provides the wallet address
1553
1554
  * but cannot be used for actual cryptographic operations.
1554
- *
1555
- * @returns Mock public key object
1556
1555
  */
1557
1556
  getPublicKey() {
1558
- return {
1559
- /** Returns the wallet address */
1560
- toSuiAddress: () => this.address,
1561
- /** Returns empty bytes (not a real public key) */
1562
- toBytes: () => new Uint8Array(32),
1563
- /** Returns empty raw bytes (not a real public key) */
1564
- toRawBytes: () => new Uint8Array(32),
1565
- /** Public key flag (0 for mock) */
1566
- flag: 0,
1567
- /** Verification always returns false (not a real public key) */
1568
- verify: async () => !1
1569
- };
1557
+ return ft(this.address);
1570
1558
  }
1571
1559
  /**
1572
1560
  * Gets the key scheme for this signer
1573
1561
  *
1574
- * @returns Key scheme string (ed25519 for compatibility)
1562
+ * @returns Key scheme (ed25519 for compatibility)
1575
1563
  */
1576
1564
  getKeyScheme() {
1577
- return "ed25519";
1565
+ return "ED25519";
1578
1566
  }
1579
1567
  }
1580
1568
  export {
1581
- Xt as WalletClient,
1582
- Yt as WatchSigner,
1583
- Zt as WebSigner
1569
+ Zt as WalletClient,
1570
+ te as WatchSigner,
1571
+ ee as WebSigner
1584
1572
  };
1585
1573
  //# sourceMappingURL=index.esm.js.map