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