@t2000/sdk 1.0.0 → 1.0.1

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.
@@ -1,3 +1,3 @@
1
- export { d as ProtocolDescriptor, e as allDescriptors, n as naviDescriptor } from '../descriptors-3YmGYl63.cjs';
1
+ export { d as ProtocolDescriptor, e as allDescriptors, n as naviDescriptor } from '../descriptors-CDVXo3BM.cjs';
2
2
  import '@mysten/sui/transactions';
3
3
  import '@mysten/sui/jsonRpc';
@@ -1,3 +1,3 @@
1
- export { d as ProtocolDescriptor, e as allDescriptors, n as naviDescriptor } from '../descriptors-3YmGYl63.js';
1
+ export { d as ProtocolDescriptor, e as allDescriptors, n as naviDescriptor } from '../descriptors-CDVXo3BM.js';
2
2
  import '@mysten/sui/transactions';
3
3
  import '@mysten/sui/jsonRpc';
@@ -4467,7 +4467,7 @@ async function buildWithdrawTx(client, address, amount, options = {}) {
4467
4467
  }
4468
4468
  const tx = new transactions.Transaction();
4469
4469
  tx.setSender(address);
4470
- await refreshOracle(tx, client, address);
4470
+ await refreshOracle(tx, client, address, { skipPythUpdate: options.skipPythUpdate });
4471
4471
  try {
4472
4472
  const coin = await Qe(tx, assetInfo.type, rawAmount, sdkOptions(client));
4473
4473
  tx.transferObjects([coin], address);
@@ -4496,7 +4496,7 @@ async function addWithdrawToTx(tx, client, address, amount, options = {}) {
4496
4496
  });
4497
4497
  return { coin, effectiveAmount: 0 };
4498
4498
  }
4499
- await refreshOracle(tx, client, address);
4499
+ await refreshOracle(tx, client, address, { skipPythUpdate: options.skipPythUpdate });
4500
4500
  try {
4501
4501
  const coin = await Qe(tx, assetInfo.type, rawAmount, sdkOptions(client));
4502
4502
  return { coin, effectiveAmount };
@@ -4521,7 +4521,7 @@ async function addSaveToTx(tx, _client, _address, coin, options = {}) {
4521
4521
  async function addRepayToTx(tx, client, address, coin, options = {}) {
4522
4522
  const asset = options.asset ?? "USDC";
4523
4523
  const assetInfo = resolveAssetInfo(asset);
4524
- await refreshOracle(tx, client, address);
4524
+ await refreshOracle(tx, client, address, { skipPythUpdate: options.skipPythUpdate });
4525
4525
  try {
4526
4526
  await xe(tx, assetInfo.type, coin, { env: "prod" });
4527
4527
  } catch (err) {
@@ -4538,7 +4538,7 @@ async function buildBorrowTx(client, address, amount, options = {}) {
4538
4538
  const rawAmount = Number(stableToRaw(amount, assetInfo.decimals));
4539
4539
  const tx = new transactions.Transaction();
4540
4540
  tx.setSender(address);
4541
- await refreshOracle(tx, client, address);
4541
+ await refreshOracle(tx, client, address, { skipPythUpdate: options.skipPythUpdate });
4542
4542
  try {
4543
4543
  const borrowedCoin = await Xe(tx, assetInfo.type, rawAmount, sdkOptions(client));
4544
4544
  if (options.collectFee) {
@@ -4569,7 +4569,10 @@ async function buildRepayTx(client, address, amount, options = {}) {
4569
4569
  const coinObj = mergeCoins(tx, coins);
4570
4570
  const rawAmount = Math.min(rawRequested, Number(totalBalance));
4571
4571
  const [repayCoin] = tx.splitCoins(coinObj, [rawAmount]);
4572
- await refreshOracle(tx, client, address, { skipOracle: options.skipOracle });
4572
+ await refreshOracle(tx, client, address, {
4573
+ skipOracle: options.skipOracle,
4574
+ skipPythUpdate: options.skipPythUpdate
4575
+ });
4573
4576
  try {
4574
4577
  await xe(tx, assetInfo.type, repayCoin, {
4575
4578
  ...sdkOptions(client),
@@ -4732,9 +4735,12 @@ var NaviAdapter = class {
4732
4735
  const tx = await buildSaveTx(this.client, address, amount, { ...options, asset: normalized });
4733
4736
  return { tx };
4734
4737
  }
4735
- async buildWithdrawTx(address, amount, asset) {
4738
+ async buildWithdrawTx(address, amount, asset, options) {
4736
4739
  const normalized = normalizeAsset(asset);
4737
- const result = await buildWithdrawTx(this.client, address, amount, { asset: normalized });
4740
+ const result = await buildWithdrawTx(this.client, address, amount, {
4741
+ asset: normalized,
4742
+ skipPythUpdate: options?.skipPythUpdate
4743
+ });
4738
4744
  return { tx: result.tx, effectiveAmount: result.effectiveAmount };
4739
4745
  }
4740
4746
  async buildBorrowTx(address, amount, asset, options) {
@@ -4746,7 +4752,8 @@ var NaviAdapter = class {
4746
4752
  const normalized = normalizeAsset(asset);
4747
4753
  const tx = await buildRepayTx(this.client, address, amount, {
4748
4754
  asset: normalized,
4749
- skipOracle: options?.skipOracle
4755
+ skipOracle: options?.skipOracle,
4756
+ skipPythUpdate: options?.skipPythUpdate
4750
4757
  });
4751
4758
  return { tx };
4752
4759
  }
@@ -4756,17 +4763,23 @@ var NaviAdapter = class {
4756
4763
  async maxBorrow(address, _asset) {
4757
4764
  return maxBorrowAmount(this.client, address);
4758
4765
  }
4759
- async addWithdrawToTx(tx, address, amount, asset) {
4766
+ async addWithdrawToTx(tx, address, amount, asset, options) {
4760
4767
  const normalized = normalizeAsset(asset);
4761
- return addWithdrawToTx(tx, this.client, address, amount, { asset: normalized });
4768
+ return addWithdrawToTx(tx, this.client, address, amount, {
4769
+ asset: normalized,
4770
+ skipPythUpdate: options?.skipPythUpdate
4771
+ });
4762
4772
  }
4763
4773
  async addSaveToTx(tx, address, coin, asset, options) {
4764
4774
  const normalized = normalizeAsset(asset);
4765
4775
  return addSaveToTx(tx, this.client, address, coin, { ...options, asset: normalized });
4766
4776
  }
4767
- async addRepayToTx(tx, address, coin, asset) {
4777
+ async addRepayToTx(tx, address, coin, asset, options) {
4768
4778
  const normalized = normalizeAsset(asset);
4769
- return addRepayToTx(tx, this.client, address, coin, { asset: normalized });
4779
+ return addRepayToTx(tx, this.client, address, coin, {
4780
+ asset: normalized,
4781
+ skipPythUpdate: options?.skipPythUpdate
4782
+ });
4770
4783
  }
4771
4784
  async getPendingRewards(address) {
4772
4785
  return getPendingRewards(this.client, address);