@t2000/sdk 0.1.8 → 0.1.9

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
@@ -797,8 +797,8 @@ async function executeAutoTopUp(client, keypair) {
797
797
  toAsset: "SUI",
798
798
  amount: topupAmountHuman
799
799
  });
800
- const txBytes = await tx.build({ client, onlyTransactionKind: true });
801
- const txBytesBase64 = Buffer.from(txBytes).toString("base64");
800
+ const txJson = tx.serialize();
801
+ const txBytesBase64 = Buffer.from(txJson).toString("base64");
802
802
  const sponsoredResult = await requestGasSponsorship(txBytesBase64, address, "auto-topup");
803
803
  const sponsoredTxBytes = Buffer.from(sponsoredResult.txBytes, "base64");
804
804
  const { signature: agentSig } = await keypair.signTransaction(sponsoredTxBytes);
@@ -874,8 +874,8 @@ async function tryAutoTopUpThenSelfFund(client, keypair, tx) {
874
874
  async function trySponsored(client, keypair, tx) {
875
875
  const address = keypair.getPublicKey().toSuiAddress();
876
876
  tx.setSender(address);
877
- const txBytes = await tx.build({ client, onlyTransactionKind: true });
878
- const txBytesBase64 = Buffer.from(txBytes).toString("base64");
877
+ const txJson = tx.serialize();
878
+ const txBytesBase64 = Buffer.from(txJson).toString("base64");
879
879
  const sponsoredResult = await requestGasSponsorship(txBytesBase64, address);
880
880
  const sponsoredTxBytes = Buffer.from(sponsoredResult.txBytes, "base64");
881
881
  const { signature: agentSig } = await keypair.signTransaction(sponsoredTxBytes);