@t2000/sdk 0.19.1 → 0.19.2

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 CHANGED
@@ -57118,9 +57118,18 @@ var T2000 = class _T2000 extends eventemitter3.EventEmitter {
57118
57118
  this.enforcer.check({ operation: "pay", amount: options.maxPrice ?? 1 });
57119
57119
  const { Mppx } = await import('mppx/client');
57120
57120
  const { sui } = await import('@t2000/mpp-sui/client');
57121
+ const client = this.client;
57122
+ const keypair = this.keypair;
57121
57123
  const mppx = Mppx.create({
57122
57124
  polyfill: false,
57123
- methods: [sui({ client: this.client, signer: this.keypair })]
57125
+ methods: [sui({
57126
+ client,
57127
+ signer: keypair,
57128
+ execute: async (tx) => {
57129
+ const result = await executeWithGas(client, keypair, () => tx);
57130
+ return { digest: result.digest, effects: result.effects };
57131
+ }
57132
+ })]
57124
57133
  });
57125
57134
  const method = (options.method ?? "GET").toUpperCase();
57126
57135
  const canHaveBody = method !== "GET" && method !== "HEAD";
@@ -58188,7 +58197,7 @@ To sell investment: t2000 invest sell ${params.amount} ${fromAsset}`,
58188
58197
  await new Promise((r) => setTimeout(r, 1500));
58189
58198
  }
58190
58199
  const maxSellable = Math.max(0, walletAmount - gasReserve);
58191
- const trackedAmount = pos && pos.totalAmount > 0 ? pos.totalAmount : maxSellable;
58200
+ const trackedAmount = pos ? pos.totalAmount : maxSellable;
58192
58201
  if (trackedAmount <= 0) {
58193
58202
  throw new T2000Error("INSUFFICIENT_INVESTMENT", `No ${params.asset} position to sell`);
58194
58203
  }