@t2000/cli 0.22.23 → 0.22.24
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/README.md +1 -10
- package/dist/{chunk-RN7Z6TWD.js → chunk-BPTNEFB5.js} +69 -303
- package/dist/chunk-BPTNEFB5.js.map +1 -0
- package/dist/{chunk-KHIL2KNW.js → chunk-XOAZJ42V.js} +32 -32
- package/dist/{chunk-KHIL2KNW.js.map → chunk-XOAZJ42V.js.map} +1 -1
- package/dist/{client-I4SGZLVD.js → client-CK5OR2TP.js} +2 -2
- package/dist/{dist-FDS4MNUV.js → dist-MJOXMRDV.js} +3 -102
- package/dist/{dist-FDS4MNUV.js.map → dist-MJOXMRDV.js.map} +1 -1
- package/dist/{dist-G5YKLWC5.js → dist-TWST5EWE.js} +9 -25
- package/dist/index.js +81 -252
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/dist/chunk-RN7Z6TWD.js.map +0 -1
- /package/dist/{client-I4SGZLVD.js.map → client-CK5OR2TP.js.map} +0 -0
- /package/dist/{dist-G5YKLWC5.js.map → dist-TWST5EWE.js.map} +0 -0
package/README.md
CHANGED
|
@@ -222,16 +222,7 @@ t2000 init
|
|
|
222
222
|
|
|
223
223
|
| Command | Description |
|
|
224
224
|
|---------|-------------|
|
|
225
|
-
| `t2000 earn` | Show all earning opportunities — savings yield +
|
|
226
|
-
|
|
227
|
-
### Sentinel (Earn Bounties)
|
|
228
|
-
|
|
229
|
-
| Command | Description |
|
|
230
|
-
|---------|-------------|
|
|
231
|
-
| `t2000 sentinel list` | List active sentinels with prize pools and fees |
|
|
232
|
-
| `t2000 sentinel info <id>` | Show details for a specific sentinel |
|
|
233
|
-
| `t2000 sentinel attack <id> [prompt]` | Attack a sentinel with an adversarial prompt (costs SUI) |
|
|
234
|
-
| `t2000 sentinel attack <id> [prompt] --fee 0.5` | Override attack fee (default: sentinel's min fee) |
|
|
225
|
+
| `t2000 earn` | Show all earning opportunities — savings yield + investment yield |
|
|
235
226
|
|
|
236
227
|
### Contacts
|
|
237
228
|
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
isTransaction,
|
|
37
37
|
normalizeTypeTag,
|
|
38
38
|
suiBcs
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-XOAZJ42V.js";
|
|
40
40
|
import {
|
|
41
41
|
HashMD,
|
|
42
42
|
SHA512_IV,
|
|
@@ -13698,11 +13698,11 @@ var require_shams = __commonJS({
|
|
|
13698
13698
|
return false;
|
|
13699
13699
|
}
|
|
13700
13700
|
if (typeof Object.getOwnPropertyDescriptor === "function") {
|
|
13701
|
-
var
|
|
13701
|
+
var descriptor = (
|
|
13702
13702
|
/** @type {PropertyDescriptor} */
|
|
13703
13703
|
Object.getOwnPropertyDescriptor(obj2, sym)
|
|
13704
13704
|
);
|
|
13705
|
-
if (
|
|
13705
|
+
if (descriptor.value !== symVal || descriptor.enumerable !== true) {
|
|
13706
13706
|
return false;
|
|
13707
13707
|
}
|
|
13708
13708
|
}
|
|
@@ -16318,28 +16318,28 @@ var require_axios = __commonJS({
|
|
|
16318
16318
|
var reduceDescriptors2 = (obj2, reducer) => {
|
|
16319
16319
|
const descriptors = Object.getOwnPropertyDescriptors(obj2);
|
|
16320
16320
|
const reducedDescriptors = {};
|
|
16321
|
-
forEach2(descriptors, (
|
|
16321
|
+
forEach2(descriptors, (descriptor, name) => {
|
|
16322
16322
|
let ret;
|
|
16323
|
-
if ((ret = reducer(
|
|
16324
|
-
reducedDescriptors[name] = ret ||
|
|
16323
|
+
if ((ret = reducer(descriptor, name, obj2)) !== false) {
|
|
16324
|
+
reducedDescriptors[name] = ret || descriptor;
|
|
16325
16325
|
}
|
|
16326
16326
|
});
|
|
16327
16327
|
Object.defineProperties(obj2, reducedDescriptors);
|
|
16328
16328
|
};
|
|
16329
16329
|
var freezeMethods2 = (obj2) => {
|
|
16330
|
-
reduceDescriptors2(obj2, (
|
|
16330
|
+
reduceDescriptors2(obj2, (descriptor, name) => {
|
|
16331
16331
|
if (isFunction$1(obj2) && ["arguments", "caller", "callee"].indexOf(name) !== -1) {
|
|
16332
16332
|
return false;
|
|
16333
16333
|
}
|
|
16334
16334
|
const value = obj2[name];
|
|
16335
16335
|
if (!isFunction$1(value)) return;
|
|
16336
|
-
|
|
16337
|
-
if ("writable" in
|
|
16338
|
-
|
|
16336
|
+
descriptor.enumerable = false;
|
|
16337
|
+
if ("writable" in descriptor) {
|
|
16338
|
+
descriptor.writable = false;
|
|
16339
16339
|
return;
|
|
16340
16340
|
}
|
|
16341
|
-
if (!
|
|
16342
|
-
|
|
16341
|
+
if (!descriptor.set) {
|
|
16342
|
+
descriptor.set = () => {
|
|
16343
16343
|
throw Error("Can not rewrite read-only method '" + name + "'");
|
|
16344
16344
|
};
|
|
16345
16345
|
}
|
|
@@ -40798,9 +40798,6 @@ async function Ct(e, n, o) {
|
|
|
40798
40798
|
return a;
|
|
40799
40799
|
}
|
|
40800
40800
|
|
|
40801
|
-
// ../sdk/dist/index.js
|
|
40802
|
-
init_bcs();
|
|
40803
|
-
|
|
40804
40801
|
// ../../node_modules/.pnpm/@cetusprotocol+aggregator-sdk@1.4.6_axios@1.13.6_typescript@5.9.3/node_modules/@cetusprotocol/aggregator-sdk/dist/index.js
|
|
40805
40802
|
var import_json_bigint = __toESM(require_json_bigint(), 1);
|
|
40806
40803
|
init_utils2();
|
|
@@ -41496,28 +41493,28 @@ var isRegExp = kindOfTest("RegExp");
|
|
|
41496
41493
|
var reduceDescriptors = (obj2, reducer) => {
|
|
41497
41494
|
const descriptors = Object.getOwnPropertyDescriptors(obj2);
|
|
41498
41495
|
const reducedDescriptors = {};
|
|
41499
|
-
forEach(descriptors, (
|
|
41496
|
+
forEach(descriptors, (descriptor, name) => {
|
|
41500
41497
|
let ret;
|
|
41501
|
-
if ((ret = reducer(
|
|
41502
|
-
reducedDescriptors[name] = ret ||
|
|
41498
|
+
if ((ret = reducer(descriptor, name, obj2)) !== false) {
|
|
41499
|
+
reducedDescriptors[name] = ret || descriptor;
|
|
41503
41500
|
}
|
|
41504
41501
|
});
|
|
41505
41502
|
Object.defineProperties(obj2, reducedDescriptors);
|
|
41506
41503
|
};
|
|
41507
41504
|
var freezeMethods = (obj2) => {
|
|
41508
|
-
reduceDescriptors(obj2, (
|
|
41505
|
+
reduceDescriptors(obj2, (descriptor, name) => {
|
|
41509
41506
|
if (isFunction(obj2) && ["arguments", "caller", "callee"].indexOf(name) !== -1) {
|
|
41510
41507
|
return false;
|
|
41511
41508
|
}
|
|
41512
41509
|
const value = obj2[name];
|
|
41513
41510
|
if (!isFunction(value)) return;
|
|
41514
|
-
|
|
41515
|
-
if ("writable" in
|
|
41516
|
-
|
|
41511
|
+
descriptor.enumerable = false;
|
|
41512
|
+
if ("writable" in descriptor) {
|
|
41513
|
+
descriptor.writable = false;
|
|
41517
41514
|
return;
|
|
41518
41515
|
}
|
|
41519
|
-
if (!
|
|
41520
|
-
|
|
41516
|
+
if (!descriptor.set) {
|
|
41517
|
+
descriptor.set = () => {
|
|
41521
41518
|
throw Error("Can not rewrite read-only method '" + name + "'");
|
|
41522
41519
|
};
|
|
41523
41520
|
}
|
|
@@ -71845,18 +71842,6 @@ var PERPS_MARKETS = ["SUI-PERP"];
|
|
|
71845
71842
|
var DEFAULT_MAX_LEVERAGE = 5;
|
|
71846
71843
|
var DEFAULT_MAX_POSITION_SIZE = 1e3;
|
|
71847
71844
|
var GAS_RESERVE_MIN = 0.05;
|
|
71848
|
-
var SENTINEL = {
|
|
71849
|
-
PACKAGE: "0x88b83f36dafcd5f6dcdcf1d2cb5889b03f61264ab3cee9cae35db7aa940a21b7",
|
|
71850
|
-
AGENT_REGISTRY: "0xc47564f5f14c12b31e0dfa1a3dc99a6380a1edf8929c28cb0eaa3359c8db36ac",
|
|
71851
|
-
ENCLAVE: "0xfb1261aeb9583514cb1341a548a5ec12d1231bd96af22215f1792617a93e1213",
|
|
71852
|
-
PROTOCOL_CONFIG: "0x2fa4fa4a1dd0498612304635ff9334e1b922e78af325000e9d9c0e88adea459f",
|
|
71853
|
-
TEE_API: "https://app.suisentinel.xyz/api/consume-prompt",
|
|
71854
|
-
SENTINELS_API: "https://api.suisentinel.xyz/agents/mainnet",
|
|
71855
|
-
RANDOM: "0x8",
|
|
71856
|
-
MIN_FEE_MIST: 100000000n,
|
|
71857
|
-
// 0.1 SUI
|
|
71858
|
-
MAX_PROMPT_TOKENS: 600
|
|
71859
|
-
};
|
|
71860
71845
|
var T2000Error = class extends Error {
|
|
71861
71846
|
code;
|
|
71862
71847
|
data;
|
|
@@ -72621,6 +72606,7 @@ async function buildWithdrawTx(client, address, amount, options = {}) {
|
|
|
72621
72606
|
}
|
|
72622
72607
|
async function addWithdrawToTx(tx, client, address, amount, options = {}) {
|
|
72623
72608
|
const asset = options.asset ?? "USDC";
|
|
72609
|
+
const sponsored = options.sponsored ?? true;
|
|
72624
72610
|
const assetInfo = resolveAssetInfo(asset);
|
|
72625
72611
|
const posResult = await getPositions(client, address);
|
|
72626
72612
|
const supply = posResult.positions.find(
|
|
@@ -72638,7 +72624,7 @@ async function addWithdrawToTx(tx, client, address, amount, options = {}) {
|
|
|
72638
72624
|
});
|
|
72639
72625
|
return { coin, effectiveAmount: 0 };
|
|
72640
72626
|
}
|
|
72641
|
-
await refreshOracle(tx, client, address);
|
|
72627
|
+
await refreshOracle(tx, client, address, { skipPythUpdate: sponsored });
|
|
72642
72628
|
try {
|
|
72643
72629
|
const coin = await Qe(tx, assetInfo.type, rawAmount, sdkOptions(client));
|
|
72644
72630
|
return { coin, effectiveAmount };
|
|
@@ -72662,8 +72648,9 @@ async function addSaveToTx(tx, _client, _address, coin, options = {}) {
|
|
|
72662
72648
|
}
|
|
72663
72649
|
async function addRepayToTx(tx, client, address, coin, options = {}) {
|
|
72664
72650
|
const asset = options.asset ?? "USDC";
|
|
72651
|
+
const sponsored = options.sponsored ?? true;
|
|
72665
72652
|
const assetInfo = resolveAssetInfo(asset);
|
|
72666
|
-
await refreshOracle(tx, client, address);
|
|
72653
|
+
await refreshOracle(tx, client, address, { skipPythUpdate: sponsored });
|
|
72667
72654
|
try {
|
|
72668
72655
|
await xe(tx, assetInfo.type, coin, { env: "prod" });
|
|
72669
72656
|
} catch (err) {
|
|
@@ -72822,206 +72809,6 @@ async function getFundStatus(client, address) {
|
|
|
72822
72809
|
projectedMonthly: earnings.dailyEarning * 30
|
|
72823
72810
|
};
|
|
72824
72811
|
}
|
|
72825
|
-
var descriptor = {
|
|
72826
|
-
id: "sentinel",
|
|
72827
|
-
name: "Sui Sentinel",
|
|
72828
|
-
packages: [SENTINEL.PACKAGE],
|
|
72829
|
-
actionMap: {
|
|
72830
|
-
"sentinel::request_attack": "sentinel_attack",
|
|
72831
|
-
"sentinel::consume_prompt": "sentinel_settle"
|
|
72832
|
-
}
|
|
72833
|
-
};
|
|
72834
|
-
function mapAgent(raw) {
|
|
72835
|
-
return {
|
|
72836
|
-
id: raw.agent_id,
|
|
72837
|
-
objectId: raw.agent_object_id,
|
|
72838
|
-
name: raw.agent_name,
|
|
72839
|
-
model: raw.model ?? "unknown",
|
|
72840
|
-
systemPrompt: raw.prompt,
|
|
72841
|
-
attackFee: BigInt(raw.cost_per_message),
|
|
72842
|
-
prizePool: BigInt(raw.total_balance),
|
|
72843
|
-
totalAttacks: raw.total_attacks,
|
|
72844
|
-
successfulBreaches: raw.successful_breaches ?? 0,
|
|
72845
|
-
state: raw.state
|
|
72846
|
-
};
|
|
72847
|
-
}
|
|
72848
|
-
async function listSentinels() {
|
|
72849
|
-
const res = await fetch(SENTINEL.SENTINELS_API);
|
|
72850
|
-
if (!res.ok) {
|
|
72851
|
-
throw new T2000Error("SENTINEL_API_ERROR", `Sentinel API returned ${res.status}`);
|
|
72852
|
-
}
|
|
72853
|
-
const data = await res.json();
|
|
72854
|
-
if (!Array.isArray(data.agents)) {
|
|
72855
|
-
throw new T2000Error("SENTINEL_API_ERROR", "Unexpected API response shape");
|
|
72856
|
-
}
|
|
72857
|
-
return data.agents.filter((a) => a.state === "active").map(mapAgent);
|
|
72858
|
-
}
|
|
72859
|
-
async function getSentinelInfo(client, sentinelObjectId) {
|
|
72860
|
-
const agents = await listSentinels();
|
|
72861
|
-
const match = agents.find((a) => a.objectId === sentinelObjectId || a.id === sentinelObjectId);
|
|
72862
|
-
if (match) return match;
|
|
72863
|
-
const obj2 = await client.getObject({
|
|
72864
|
-
id: sentinelObjectId,
|
|
72865
|
-
options: { showContent: true, showType: true }
|
|
72866
|
-
});
|
|
72867
|
-
if (!obj2.data) {
|
|
72868
|
-
throw new T2000Error("SENTINEL_NOT_FOUND", `Sentinel ${sentinelObjectId} not found on-chain`);
|
|
72869
|
-
}
|
|
72870
|
-
const content = obj2.data.content;
|
|
72871
|
-
if (!content || content.dataType !== "moveObject") {
|
|
72872
|
-
throw new T2000Error("SENTINEL_NOT_FOUND", `Object ${sentinelObjectId} is not a Move object`);
|
|
72873
|
-
}
|
|
72874
|
-
const fields = content.fields;
|
|
72875
|
-
return {
|
|
72876
|
-
id: fields.id?.id ?? sentinelObjectId,
|
|
72877
|
-
objectId: sentinelObjectId,
|
|
72878
|
-
name: fields.name ?? "Unknown",
|
|
72879
|
-
model: fields.model ?? "unknown",
|
|
72880
|
-
systemPrompt: fields.system_prompt ?? "",
|
|
72881
|
-
attackFee: BigInt(fields.cost_per_message ?? "0"),
|
|
72882
|
-
prizePool: BigInt(fields.balance ?? "0"),
|
|
72883
|
-
totalAttacks: Number(fields.total_attacks ?? "0"),
|
|
72884
|
-
successfulBreaches: Number(fields.successful_breaches ?? "0"),
|
|
72885
|
-
state: fields.state ?? "unknown"
|
|
72886
|
-
};
|
|
72887
|
-
}
|
|
72888
|
-
async function requestAttack(client, signer, sentinelObjectId, feeMist) {
|
|
72889
|
-
if (feeMist < SENTINEL.MIN_FEE_MIST) {
|
|
72890
|
-
throw new T2000Error("INVALID_AMOUNT", `Attack fee must be at least 0.1 SUI (${SENTINEL.MIN_FEE_MIST} MIST)`);
|
|
72891
|
-
}
|
|
72892
|
-
const address = signer.getAddress();
|
|
72893
|
-
const tx = new Transaction();
|
|
72894
|
-
tx.setSender(address);
|
|
72895
|
-
const [coin] = tx.splitCoins(tx.gas, [Number(feeMist)]);
|
|
72896
|
-
const [attack2] = tx.moveCall({
|
|
72897
|
-
target: `${SENTINEL.PACKAGE}::sentinel::request_attack`,
|
|
72898
|
-
arguments: [
|
|
72899
|
-
tx.object(SENTINEL.AGENT_REGISTRY),
|
|
72900
|
-
tx.object(sentinelObjectId),
|
|
72901
|
-
tx.object(SENTINEL.PROTOCOL_CONFIG),
|
|
72902
|
-
coin,
|
|
72903
|
-
tx.object(SENTINEL.RANDOM),
|
|
72904
|
-
tx.object(CLOCK_ID)
|
|
72905
|
-
]
|
|
72906
|
-
});
|
|
72907
|
-
tx.transferObjects([attack2], address);
|
|
72908
|
-
const built = await tx.build({ client });
|
|
72909
|
-
const { signature } = await signer.signTransaction(built);
|
|
72910
|
-
const result = await client.executeTransactionBlock({
|
|
72911
|
-
transactionBlock: built,
|
|
72912
|
-
signature,
|
|
72913
|
-
options: { showObjectChanges: true, showEffects: true }
|
|
72914
|
-
});
|
|
72915
|
-
await client.waitForTransaction({ digest: result.digest });
|
|
72916
|
-
const attackObj = result.objectChanges?.find(
|
|
72917
|
-
(c) => c.type === "created" && c.objectType?.includes("::sentinel::Attack")
|
|
72918
|
-
);
|
|
72919
|
-
const attackObjectId = attackObj && "objectId" in attackObj ? attackObj.objectId : void 0;
|
|
72920
|
-
if (!attackObjectId) {
|
|
72921
|
-
throw new T2000Error("SENTINEL_TX_FAILED", "Attack object was not created \u2014 transaction may have failed");
|
|
72922
|
-
}
|
|
72923
|
-
return { attackObjectId, digest: result.digest };
|
|
72924
|
-
}
|
|
72925
|
-
async function submitPrompt(agentId, attackObjectId, prompt) {
|
|
72926
|
-
const res = await fetch(SENTINEL.TEE_API, {
|
|
72927
|
-
method: "POST",
|
|
72928
|
-
headers: { "Content-Type": "application/json" },
|
|
72929
|
-
body: JSON.stringify({
|
|
72930
|
-
agent_id: agentId,
|
|
72931
|
-
attack_object_id: attackObjectId,
|
|
72932
|
-
message: prompt
|
|
72933
|
-
})
|
|
72934
|
-
});
|
|
72935
|
-
if (!res.ok) {
|
|
72936
|
-
const body = await res.text().catch(() => "");
|
|
72937
|
-
throw new T2000Error("SENTINEL_TEE_ERROR", `TEE returned ${res.status}: ${body.slice(0, 200)}`);
|
|
72938
|
-
}
|
|
72939
|
-
const raw = await res.json();
|
|
72940
|
-
const envelope = raw.response ?? raw;
|
|
72941
|
-
const data = envelope.data ?? envelope;
|
|
72942
|
-
const signature = raw.signature ?? data.signature;
|
|
72943
|
-
const timestampMs = envelope.timestamp_ms ?? data.timestamp_ms;
|
|
72944
|
-
if (typeof signature !== "string") {
|
|
72945
|
-
throw new T2000Error("SENTINEL_TEE_ERROR", "TEE response missing signature");
|
|
72946
|
-
}
|
|
72947
|
-
return {
|
|
72948
|
-
success: data.success ?? data.is_success,
|
|
72949
|
-
score: data.score,
|
|
72950
|
-
agentResponse: data.agent_response,
|
|
72951
|
-
juryResponse: data.jury_response,
|
|
72952
|
-
funResponse: data.fun_response ?? "",
|
|
72953
|
-
signature,
|
|
72954
|
-
timestampMs
|
|
72955
|
-
};
|
|
72956
|
-
}
|
|
72957
|
-
async function settleAttack(client, signer, sentinelObjectId, attackObjectId, prompt, verdict) {
|
|
72958
|
-
const sigBytes = Array.from(Buffer.from(verdict.signature.replace(/^0x/, ""), "hex"));
|
|
72959
|
-
const address = signer.getAddress();
|
|
72960
|
-
const tx = new Transaction();
|
|
72961
|
-
tx.setSender(address);
|
|
72962
|
-
tx.moveCall({
|
|
72963
|
-
target: `${SENTINEL.PACKAGE}::sentinel::consume_prompt`,
|
|
72964
|
-
arguments: [
|
|
72965
|
-
tx.object(SENTINEL.AGENT_REGISTRY),
|
|
72966
|
-
tx.object(SENTINEL.PROTOCOL_CONFIG),
|
|
72967
|
-
tx.object(sentinelObjectId),
|
|
72968
|
-
tx.pure.bool(verdict.success),
|
|
72969
|
-
tx.pure.string(verdict.agentResponse),
|
|
72970
|
-
tx.pure.string(verdict.juryResponse),
|
|
72971
|
-
tx.pure.string(verdict.funResponse),
|
|
72972
|
-
tx.pure.string(prompt),
|
|
72973
|
-
tx.pure.u8(verdict.score),
|
|
72974
|
-
tx.pure.u64(verdict.timestampMs),
|
|
72975
|
-
tx.pure(suiBcs.vector(suiBcs.u8()).serialize(sigBytes)),
|
|
72976
|
-
tx.object(SENTINEL.ENCLAVE),
|
|
72977
|
-
tx.object(attackObjectId),
|
|
72978
|
-
tx.object(CLOCK_ID)
|
|
72979
|
-
]
|
|
72980
|
-
});
|
|
72981
|
-
const built = await tx.build({ client });
|
|
72982
|
-
const { signature } = await signer.signTransaction(built);
|
|
72983
|
-
const result = await client.executeTransactionBlock({
|
|
72984
|
-
transactionBlock: built,
|
|
72985
|
-
signature,
|
|
72986
|
-
options: { showEffects: true }
|
|
72987
|
-
});
|
|
72988
|
-
await client.waitForTransaction({ digest: result.digest });
|
|
72989
|
-
const txSuccess = result.effects?.status?.status === "success";
|
|
72990
|
-
return { digest: result.digest, success: txSuccess };
|
|
72991
|
-
}
|
|
72992
|
-
async function attack(client, signer, sentinelId, prompt, feeMist) {
|
|
72993
|
-
const sentinel = await getSentinelInfo(client, sentinelId);
|
|
72994
|
-
const fee = feeMist ?? sentinel.attackFee;
|
|
72995
|
-
if (fee < SENTINEL.MIN_FEE_MIST) {
|
|
72996
|
-
throw new T2000Error("INVALID_AMOUNT", `Attack fee must be at least 0.1 SUI`);
|
|
72997
|
-
}
|
|
72998
|
-
const { attackObjectId, digest: requestTx } = await requestAttack(
|
|
72999
|
-
client,
|
|
73000
|
-
signer,
|
|
73001
|
-
sentinel.objectId,
|
|
73002
|
-
fee
|
|
73003
|
-
);
|
|
73004
|
-
const verdict = await submitPrompt(sentinel.id, attackObjectId, prompt);
|
|
73005
|
-
const { digest: settleTx } = await settleAttack(
|
|
73006
|
-
client,
|
|
73007
|
-
signer,
|
|
73008
|
-
sentinel.objectId,
|
|
73009
|
-
attackObjectId,
|
|
73010
|
-
prompt,
|
|
73011
|
-
verdict
|
|
73012
|
-
);
|
|
73013
|
-
const won = verdict.success && verdict.score >= 70;
|
|
73014
|
-
return {
|
|
73015
|
-
attackObjectId,
|
|
73016
|
-
sentinelId: sentinel.id,
|
|
73017
|
-
prompt,
|
|
73018
|
-
verdict,
|
|
73019
|
-
requestTx,
|
|
73020
|
-
settleTx,
|
|
73021
|
-
won,
|
|
73022
|
-
feePaid: Number(fee) / Number(MIST_PER_SUI2)
|
|
73023
|
-
};
|
|
73024
|
-
}
|
|
73025
72812
|
var ProtocolRegistry = class {
|
|
73026
72813
|
lending = /* @__PURE__ */ new Map();
|
|
73027
72814
|
swap = /* @__PURE__ */ new Map();
|
|
@@ -73165,7 +72952,8 @@ var ProtocolRegistry = class {
|
|
|
73165
72952
|
return [...this.swap.values()];
|
|
73166
72953
|
}
|
|
73167
72954
|
};
|
|
73168
|
-
var
|
|
72955
|
+
var SUILEND_PACKAGE = "0xf95b06141ed4a174f239417323bde3f209b972f5930d8521ea38a52aff3a6ddf";
|
|
72956
|
+
var naviDescriptor = {
|
|
73169
72957
|
id: "navi",
|
|
73170
72958
|
name: "NAVI Protocol",
|
|
73171
72959
|
packages: [],
|
|
@@ -73181,6 +72969,40 @@ var descriptor2 = {
|
|
|
73181
72969
|
"incentive_v3::repay": "repay"
|
|
73182
72970
|
}
|
|
73183
72971
|
};
|
|
72972
|
+
var suilendDescriptor = {
|
|
72973
|
+
id: "suilend",
|
|
72974
|
+
name: "Suilend",
|
|
72975
|
+
packages: [SUILEND_PACKAGE],
|
|
72976
|
+
actionMap: {
|
|
72977
|
+
"lending_market::deposit_liquidity_and_mint_ctokens": "save",
|
|
72978
|
+
"lending_market::deposit_ctokens_into_obligation": "save",
|
|
72979
|
+
"lending_market::create_obligation": "save",
|
|
72980
|
+
"lending_market::withdraw_ctokens": "withdraw",
|
|
72981
|
+
"lending_market::redeem_ctokens_and_withdraw_liquidity": "withdraw",
|
|
72982
|
+
"lending_market::redeem_ctokens_and_withdraw_liquidity_request": "withdraw",
|
|
72983
|
+
"lending_market::fulfill_liquidity_request": "withdraw",
|
|
72984
|
+
"lending_market::unstake_sui_from_staker": "withdraw",
|
|
72985
|
+
"lending_market::borrow": "borrow",
|
|
72986
|
+
"lending_market::repay": "repay"
|
|
72987
|
+
}
|
|
72988
|
+
};
|
|
72989
|
+
var cetusDescriptor = {
|
|
72990
|
+
id: "cetus",
|
|
72991
|
+
name: "Cetus DEX",
|
|
72992
|
+
packages: [CETUS_PACKAGE],
|
|
72993
|
+
actionMap: {
|
|
72994
|
+
"router::swap": "swap",
|
|
72995
|
+
"router::swap_ab_bc": "swap",
|
|
72996
|
+
"router::swap_ab_cb": "swap",
|
|
72997
|
+
"router::swap_ba_bc": "swap",
|
|
72998
|
+
"router::swap_ba_cb": "swap"
|
|
72999
|
+
}
|
|
73000
|
+
};
|
|
73001
|
+
var allDescriptors = [
|
|
73002
|
+
naviDescriptor,
|
|
73003
|
+
suilendDescriptor,
|
|
73004
|
+
cetusDescriptor
|
|
73005
|
+
];
|
|
73184
73006
|
var NaviAdapter = class {
|
|
73185
73007
|
id = "navi";
|
|
73186
73008
|
name = "NAVI Protocol";
|
|
@@ -73458,18 +73280,6 @@ function fallbackQuote(fromAsset, amount, poolPrice) {
|
|
|
73458
73280
|
const expectedOutput = fromAsset === "USDC" ? amount / poolPrice : amount * poolPrice;
|
|
73459
73281
|
return { expectedOutput, priceImpact: 0, poolPrice };
|
|
73460
73282
|
}
|
|
73461
|
-
var descriptor3 = {
|
|
73462
|
-
id: "cetus",
|
|
73463
|
-
name: "Cetus DEX",
|
|
73464
|
-
packages: [CETUS_PACKAGE],
|
|
73465
|
-
actionMap: {
|
|
73466
|
-
"router::swap": "swap",
|
|
73467
|
-
"router::swap_ab_bc": "swap",
|
|
73468
|
-
"router::swap_ab_cb": "swap",
|
|
73469
|
-
"router::swap_ba_bc": "swap",
|
|
73470
|
-
"router::swap_ba_cb": "swap"
|
|
73471
|
-
}
|
|
73472
|
-
};
|
|
73473
73283
|
var CetusAdapter = class {
|
|
73474
73284
|
id = "cetus";
|
|
73475
73285
|
name = "Cetus";
|
|
@@ -73528,7 +73338,6 @@ var CetusAdapter = class {
|
|
|
73528
73338
|
});
|
|
73529
73339
|
}
|
|
73530
73340
|
};
|
|
73531
|
-
var SUILEND_PACKAGE = "0xf95b06141ed4a174f239417323bde3f209b972f5930d8521ea38a52aff3a6ddf";
|
|
73532
73341
|
var MIN_HEALTH_FACTOR2 = 1.5;
|
|
73533
73342
|
async function quietSuilend(fn) {
|
|
73534
73343
|
const origLog = console.log;
|
|
@@ -73545,23 +73354,6 @@ async function quietSuilend(fn) {
|
|
|
73545
73354
|
console.warn = origWarn;
|
|
73546
73355
|
});
|
|
73547
73356
|
}
|
|
73548
|
-
var descriptor4 = {
|
|
73549
|
-
id: "suilend",
|
|
73550
|
-
name: "Suilend",
|
|
73551
|
-
packages: [SUILEND_PACKAGE],
|
|
73552
|
-
actionMap: {
|
|
73553
|
-
"lending_market::deposit_liquidity_and_mint_ctokens": "save",
|
|
73554
|
-
"lending_market::deposit_ctokens_into_obligation": "save",
|
|
73555
|
-
"lending_market::create_obligation": "save",
|
|
73556
|
-
"lending_market::withdraw_ctokens": "withdraw",
|
|
73557
|
-
"lending_market::redeem_ctokens_and_withdraw_liquidity": "withdraw",
|
|
73558
|
-
"lending_market::redeem_ctokens_and_withdraw_liquidity_request": "withdraw",
|
|
73559
|
-
"lending_market::fulfill_liquidity_request": "withdraw",
|
|
73560
|
-
"lending_market::unstake_sui_from_staker": "withdraw",
|
|
73561
|
-
"lending_market::borrow": "borrow",
|
|
73562
|
-
"lending_market::repay": "repay"
|
|
73563
|
-
}
|
|
73564
|
-
};
|
|
73565
73357
|
var SuilendAdapter = class {
|
|
73566
73358
|
id = "suilend";
|
|
73567
73359
|
name = "Suilend";
|
|
@@ -74359,8 +74151,7 @@ async function resolveGas(client, signer, buildTx) {
|
|
|
74359
74151
|
}
|
|
74360
74152
|
var OUTBOUND_OPS = /* @__PURE__ */ new Set([
|
|
74361
74153
|
"send",
|
|
74362
|
-
"pay"
|
|
74363
|
-
"sentinel"
|
|
74154
|
+
"pay"
|
|
74364
74155
|
]);
|
|
74365
74156
|
var DEFAULT_SAFEGUARD_CONFIG = {
|
|
74366
74157
|
locked: false,
|
|
@@ -75186,7 +74977,7 @@ var T2000 = class _T2000 extends import_index.default {
|
|
|
75186
74977
|
this.enforcer.assertNotLocked();
|
|
75187
74978
|
this.enforcer.check({ operation: "pay", amount: options.maxPrice ?? 1 });
|
|
75188
74979
|
const { Mppx } = await import("./client-R3NRAXMD.js");
|
|
75189
|
-
const { sui } = await import("./client-
|
|
74980
|
+
const { sui } = await import("./client-CK5OR2TP.js");
|
|
75190
74981
|
const client = this.client;
|
|
75191
74982
|
const signer = this._signer;
|
|
75192
74983
|
const mppx = Mppx.create({
|
|
@@ -77624,17 +77415,6 @@ var T2000 = class _T2000 extends import_index.default {
|
|
|
77624
77415
|
async fundStatus() {
|
|
77625
77416
|
return getFundStatus(this.client, this._address);
|
|
77626
77417
|
}
|
|
77627
|
-
// -- Sentinel --
|
|
77628
|
-
async sentinelList() {
|
|
77629
|
-
return listSentinels();
|
|
77630
|
-
}
|
|
77631
|
-
async sentinelInfo(id) {
|
|
77632
|
-
return getSentinelInfo(this.client, id);
|
|
77633
|
-
}
|
|
77634
|
-
async sentinelAttack(id, prompt, fee) {
|
|
77635
|
-
this.enforcer.check({ operation: "sentinel", amount: fee ? Number(fee) / 1e9 : 0.1 });
|
|
77636
|
-
return attack(this.client, this._signer, id, prompt, fee);
|
|
77637
|
-
}
|
|
77638
77418
|
// -- Helpers --
|
|
77639
77419
|
async getFreeBalance(asset) {
|
|
77640
77420
|
if (!(asset in INVESTMENT_ASSETS)) return Infinity;
|
|
@@ -77784,12 +77564,6 @@ function parseMoveAbort(errorStr) {
|
|
|
77784
77564
|
}
|
|
77785
77565
|
return { reason: errorStr };
|
|
77786
77566
|
}
|
|
77787
|
-
var allDescriptors = [
|
|
77788
|
-
descriptor2,
|
|
77789
|
-
descriptor4,
|
|
77790
|
-
descriptor3,
|
|
77791
|
-
descriptor
|
|
77792
|
-
];
|
|
77793
77567
|
|
|
77794
77568
|
export {
|
|
77795
77569
|
ZodOptional,
|
|
@@ -77810,7 +77584,6 @@ export {
|
|
|
77810
77584
|
DEFAULT_MAX_LEVERAGE,
|
|
77811
77585
|
DEFAULT_MAX_POSITION_SIZE,
|
|
77812
77586
|
GAS_RESERVE_MIN,
|
|
77813
|
-
SENTINEL,
|
|
77814
77587
|
T2000Error,
|
|
77815
77588
|
mapWalletError,
|
|
77816
77589
|
mapMoveAbortCode,
|
|
@@ -77838,20 +77611,14 @@ export {
|
|
|
77838
77611
|
calculateFee,
|
|
77839
77612
|
addCollectFeeToTx,
|
|
77840
77613
|
getRates,
|
|
77841
|
-
descriptor,
|
|
77842
|
-
listSentinels,
|
|
77843
|
-
getSentinelInfo,
|
|
77844
|
-
requestAttack,
|
|
77845
|
-
submitPrompt,
|
|
77846
|
-
settleAttack,
|
|
77847
|
-
attack,
|
|
77848
77614
|
ProtocolRegistry,
|
|
77849
|
-
|
|
77615
|
+
naviDescriptor,
|
|
77616
|
+
suilendDescriptor,
|
|
77617
|
+
cetusDescriptor,
|
|
77618
|
+
allDescriptors,
|
|
77850
77619
|
NaviAdapter,
|
|
77851
77620
|
getPoolPrice,
|
|
77852
|
-
descriptor3,
|
|
77853
77621
|
CetusAdapter,
|
|
77854
|
-
descriptor4,
|
|
77855
77622
|
SuilendAdapter,
|
|
77856
77623
|
solveHashcash,
|
|
77857
77624
|
getGasStatus,
|
|
@@ -77868,8 +77635,7 @@ export {
|
|
|
77868
77635
|
AutoInvestManager,
|
|
77869
77636
|
T2000,
|
|
77870
77637
|
simulateTransaction,
|
|
77871
|
-
throwIfSimulationFailed
|
|
77872
|
-
allDescriptors
|
|
77638
|
+
throwIfSimulationFailed
|
|
77873
77639
|
};
|
|
77874
77640
|
/*! Bundled license information:
|
|
77875
77641
|
|
|
@@ -77928,4 +77694,4 @@ lodash/lodash.js:
|
|
|
77928
77694
|
*)
|
|
77929
77695
|
*)
|
|
77930
77696
|
*/
|
|
77931
|
-
//# sourceMappingURL=chunk-
|
|
77697
|
+
//# sourceMappingURL=chunk-BPTNEFB5.js.map
|