@t2000/sdk 5.1.0 → 5.3.0
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/browser.cjs +0 -43
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.d.cts +1 -1
- package/dist/browser.d.ts +1 -1
- package/dist/browser.js +1 -42
- package/dist/browser.js.map +1 -1
- package/dist/index.cjs +198 -154
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +100 -19
- package/dist/index.d.ts +100 -19
- package/dist/index.js +187 -152
- package/dist/index.js.map +1 -1
- package/dist/{types-C01EGu76.d.cts → simulate-BTIIpnXc.d.cts} +3 -39
- package/dist/{types-C01EGu76.d.ts → simulate-BTIIpnXc.d.ts} +3 -39
- package/package.json +1 -1
package/dist/browser.cjs
CHANGED
|
@@ -994,53 +994,11 @@ async function buildSwapTx(params) {
|
|
|
994
994
|
return outputCoin;
|
|
995
995
|
}
|
|
996
996
|
|
|
997
|
-
// src/safeguards/errors.ts
|
|
998
|
-
init_errors();
|
|
999
|
-
var SafeguardError = class extends exports.T2000Error {
|
|
1000
|
-
rule;
|
|
1001
|
-
details;
|
|
1002
|
-
constructor(rule, details, message) {
|
|
1003
|
-
const msg = message ?? buildMessage(rule, details);
|
|
1004
|
-
super("SAFEGUARD_BLOCKED", msg, { rule, ...details });
|
|
1005
|
-
this.name = "SafeguardError";
|
|
1006
|
-
this.rule = rule;
|
|
1007
|
-
this.details = details;
|
|
1008
|
-
}
|
|
1009
|
-
toJSON() {
|
|
1010
|
-
return {
|
|
1011
|
-
error: "SAFEGUARD_BLOCKED",
|
|
1012
|
-
message: this.message,
|
|
1013
|
-
retryable: this.retryable,
|
|
1014
|
-
data: { rule: this.rule, ...this.details }
|
|
1015
|
-
};
|
|
1016
|
-
}
|
|
1017
|
-
};
|
|
1018
|
-
function buildMessage(rule, details) {
|
|
1019
|
-
switch (rule) {
|
|
1020
|
-
case "locked":
|
|
1021
|
-
return "Agent is locked. All operations are frozen.";
|
|
1022
|
-
case "maxPerTx":
|
|
1023
|
-
return `Amount $${(details.attempted ?? 0).toFixed(2)} exceeds per-transaction limit ($${(details.limit ?? 0).toFixed(2)})`;
|
|
1024
|
-
case "maxDailySend":
|
|
1025
|
-
return `Daily send limit reached ($${(details.current ?? 0).toFixed(2)}/$${(details.limit ?? 0).toFixed(2)} used today)`;
|
|
1026
|
-
}
|
|
1027
|
-
}
|
|
1028
|
-
|
|
1029
|
-
// src/safeguards/types.ts
|
|
1030
|
-
var DEFAULT_SAFEGUARD_CONFIG = {
|
|
1031
|
-
locked: false,
|
|
1032
|
-
maxPerTx: 0,
|
|
1033
|
-
maxDailySend: 0,
|
|
1034
|
-
dailyUsed: 0,
|
|
1035
|
-
dailyResetDate: ""
|
|
1036
|
-
};
|
|
1037
|
-
|
|
1038
997
|
// src/browser.ts
|
|
1039
998
|
init_token_registry();
|
|
1040
999
|
|
|
1041
1000
|
exports.CLOCK_ID = CLOCK_ID;
|
|
1042
1001
|
exports.DEFAULT_NETWORK = DEFAULT_NETWORK;
|
|
1043
|
-
exports.DEFAULT_SAFEGUARD_CONFIG = DEFAULT_SAFEGUARD_CONFIG;
|
|
1044
1002
|
exports.GAS_RESERVE_MIN = GAS_RESERVE_MIN;
|
|
1045
1003
|
exports.KNOWN_TARGETS = KNOWN_TARGETS;
|
|
1046
1004
|
exports.KeypairSigner = KeypairSigner;
|
|
@@ -1050,7 +1008,6 @@ exports.OVERLAY_FEE_RATE = OVERLAY_FEE_RATE;
|
|
|
1050
1008
|
exports.STABLE_ASSETS = STABLE_ASSETS;
|
|
1051
1009
|
exports.SUI_DECIMALS = SUI_DECIMALS;
|
|
1052
1010
|
exports.SUPPORTED_ASSETS = SUPPORTED_ASSETS;
|
|
1053
|
-
exports.SafeguardError = SafeguardError;
|
|
1054
1011
|
exports.T2000_OVERLAY_FEE_WALLET = T2000_OVERLAY_FEE_WALLET;
|
|
1055
1012
|
exports.USDC_DECIMALS = USDC_DECIMALS;
|
|
1056
1013
|
exports.ZkLoginSigner = ZkLoginSigner;
|