@t2000/cli 0.35.2 → 0.36.1
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/{chunk-IEDON62D.js → chunk-FSSTF3LM.js} +2 -32
- package/dist/{chunk-IEDON62D.js.map → chunk-FSSTF3LM.js.map} +1 -1
- package/dist/{dist-YS7HI7LP.js → dist-4JQX7CWE.js} +2 -2
- package/dist/{dist-UOEUHDJW.js → dist-55H37ULN.js} +2 -2
- package/dist/index.js +4 -7
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- /package/dist/{dist-YS7HI7LP.js.map → dist-4JQX7CWE.js.map} +0 -0
- /package/dist/{dist-UOEUHDJW.js.map → dist-55H37ULN.js.map} +0 -0
|
@@ -65982,20 +65982,14 @@ var T2000 = class _T2000 extends import_index.default {
|
|
|
65982
65982
|
const agent = new _T2000(keypair, client, void 0, DEFAULT_CONFIG_DIR);
|
|
65983
65983
|
const address = agent.address();
|
|
65984
65984
|
let sponsored = false;
|
|
65985
|
-
let usdcSponsored = false;
|
|
65986
65985
|
if (options.sponsored !== false) {
|
|
65987
65986
|
try {
|
|
65988
65987
|
await callSponsorApi(address, options.name);
|
|
65989
65988
|
sponsored = true;
|
|
65990
65989
|
} catch {
|
|
65991
65990
|
}
|
|
65992
|
-
try {
|
|
65993
|
-
await callUsdcSponsorApi(address);
|
|
65994
|
-
usdcSponsored = true;
|
|
65995
|
-
} catch {
|
|
65996
|
-
}
|
|
65997
65991
|
}
|
|
65998
|
-
return { agent, address, sponsored
|
|
65992
|
+
return { agent, address, sponsored };
|
|
65999
65993
|
}
|
|
66000
65994
|
// -- Gas --
|
|
66001
65995
|
/** SuiJsonRpcClient used by this agent — exposed for integrations. */
|
|
@@ -67093,30 +67087,6 @@ async function callSponsorApi(address, name) {
|
|
|
67093
67087
|
throw new T2000Error("SPONSOR_FAILED", "Sponsor API unavailable");
|
|
67094
67088
|
}
|
|
67095
67089
|
}
|
|
67096
|
-
async function callUsdcSponsorApi(address) {
|
|
67097
|
-
const res = await fetch(`${API_BASE_URL}/api/sponsor/usdc`, {
|
|
67098
|
-
method: "POST",
|
|
67099
|
-
headers: { "Content-Type": "application/json" },
|
|
67100
|
-
body: JSON.stringify({ address, source: "cli" })
|
|
67101
|
-
});
|
|
67102
|
-
if (res.status === 429) {
|
|
67103
|
-
const data = await res.json();
|
|
67104
|
-
if (data.challenge) {
|
|
67105
|
-
const proof = solveHashcash(data.challenge);
|
|
67106
|
-
const retry = await fetch(`${API_BASE_URL}/api/sponsor/usdc`, {
|
|
67107
|
-
method: "POST",
|
|
67108
|
-
headers: { "Content-Type": "application/json" },
|
|
67109
|
-
body: JSON.stringify({ address, source: "cli", proof })
|
|
67110
|
-
});
|
|
67111
|
-
if (!retry.ok) throw new T2000Error("USDC_SPONSOR_RATE_LIMITED", "USDC sponsor rate limited");
|
|
67112
|
-
return;
|
|
67113
|
-
}
|
|
67114
|
-
}
|
|
67115
|
-
if (res.status === 409) return;
|
|
67116
|
-
if (!res.ok) {
|
|
67117
|
-
throw new T2000Error("USDC_SPONSOR_FAILED", "USDC sponsor unavailable");
|
|
67118
|
-
}
|
|
67119
|
-
}
|
|
67120
67090
|
init_errors();
|
|
67121
67091
|
var USDC_TYPE2 = SUPPORTED_ASSETS.USDC.type;
|
|
67122
67092
|
function buildCreateAllowanceTx(options = {}) {
|
|
@@ -67616,4 +67586,4 @@ axios/dist/node/axios.cjs:
|
|
|
67616
67586
|
@scure/bip39/index.js:
|
|
67617
67587
|
(*! scure-bip39 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) *)
|
|
67618
67588
|
*/
|
|
67619
|
-
//# sourceMappingURL=chunk-
|
|
67589
|
+
//# sourceMappingURL=chunk-FSSTF3LM.js.map
|