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