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