@t2000/sdk 2.11.1 → 2.13.0

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.
@@ -108,7 +108,7 @@ interface LendingAdapter {
108
108
  * [B5 v2] Add a borrow to an existing PTB and return the borrowed coin
109
109
  * WITHOUT transferring it to the user. Lets consumer apps wedge a fee
110
110
  * transfer between the borrow and the user transfer (see
111
- * `audric/apps/web/app/api/transactions/prepare/route.ts`).
111
+ * `audric/apps/web-v2/app/api/transactions/prepare/route.ts`).
112
112
  */
113
113
  addBorrowToTx?(tx: Transaction, address: string, amount: number, asset: string, options?: {
114
114
  skipPythUpdate?: boolean;
package/dist/index.cjs CHANGED
@@ -1423,6 +1423,9 @@ var KeypairSigner = class {
1423
1423
  async signTransaction(txBytes) {
1424
1424
  return this.keypair.signTransaction(txBytes);
1425
1425
  }
1426
+ async signPersonalMessage(messageBytes) {
1427
+ return this.keypair.signPersonalMessage(messageBytes);
1428
+ }
1426
1429
  /** Access the underlying keypair for APIs that still require it directly. */
1427
1430
  getKeypair() {
1428
1431
  return this.keypair;
@@ -1451,6 +1454,9 @@ var ZkLoginSigner = class {
1451
1454
  })
1452
1455
  };
1453
1456
  }
1457
+ async signPersonalMessage(_messageBytes) {
1458
+ throw new Error("ZkLoginSigner.signPersonalMessage is not yet implemented. Use KeypairSigner for sdk.pay() until grief-protection signing is wired for zkLogin.");
1459
+ }
1454
1460
  isExpired(currentEpoch) {
1455
1461
  return currentEpoch >= this.maxEpoch;
1456
1462
  }
@@ -6513,7 +6519,7 @@ var T2000 = class _T2000 extends eventemitter3.EventEmitter {
6513
6519
  this.enforcer.assertNotLocked();
6514
6520
  this.enforcer.check({ operation: "pay", amount: options.maxPrice ?? 1 });
6515
6521
  const { Mppx } = await import('mppx/client');
6516
- const { sui } = await import('@suimpp/mpp/client');
6522
+ const { sui, USDC } = await import('@suimpp/mpp/client');
6517
6523
  const client = this.client;
6518
6524
  const signer = this._signer;
6519
6525
  const signerAddress = signer.getAddress();
@@ -6521,10 +6527,14 @@ var T2000 = class _T2000 extends eventemitter3.EventEmitter {
6521
6527
  polyfill: false,
6522
6528
  methods: [sui({
6523
6529
  client,
6524
- signer: { toSuiAddress: () => signerAddress },
6530
+ currency: USDC,
6531
+ signer: {
6532
+ toSuiAddress: () => signerAddress,
6533
+ signPersonalMessage: (bytes) => signer.signPersonalMessage(bytes)
6534
+ },
6525
6535
  execute: async (tx) => {
6526
6536
  const result = await executeTx(client, signer, () => tx);
6527
- return { digest: result.digest, effects: result.effects };
6537
+ return { digest: result.digest };
6528
6538
  }
6529
6539
  })]
6530
6540
  });