@t2000/sdk 0.1.6 → 0.1.7

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
@@ -890,11 +890,7 @@ async function tryAutoTopUpThenSelfFund(client, keypair, tx) {
890
890
  const address = keypair.getPublicKey().toSuiAddress();
891
891
  const canTopUp = await shouldAutoTopUp(client, address);
892
892
  if (!canTopUp) return null;
893
- try {
894
- await executeAutoTopUp(client, keypair);
895
- } catch {
896
- return null;
897
- }
893
+ await executeAutoTopUp(client, keypair);
898
894
  tx.setSender(address);
899
895
  const result = await client.signAndExecuteTransaction({
900
896
  signer: keypair,
@@ -912,19 +908,9 @@ async function tryAutoTopUpThenSelfFund(client, keypair, tx) {
912
908
  async function trySponsored(client, keypair, tx) {
913
909
  const address = keypair.getPublicKey().toSuiAddress();
914
910
  tx.setSender(address);
915
- let txBytes;
916
- try {
917
- txBytes = await tx.build({ client, onlyTransactionKind: true });
918
- } catch {
919
- return null;
920
- }
911
+ const txBytes = await tx.build({ client, onlyTransactionKind: true });
921
912
  const txBytesBase64 = Buffer.from(txBytes).toString("base64");
922
- let sponsoredResult;
923
- try {
924
- sponsoredResult = await requestGasSponsorship(txBytesBase64, address);
925
- } catch {
926
- return null;
927
- }
913
+ const sponsoredResult = await requestGasSponsorship(txBytesBase64, address);
928
914
  const sponsoredTxBytes = Buffer.from(sponsoredResult.txBytes, "base64");
929
915
  const { signature: agentSig } = await keypair.signTransaction(sponsoredTxBytes);
930
916
  const result = await client.executeTransactionBlock({