@t2000/sdk 0.19.21 → 0.19.23
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 +0 -9
- package/dist/adapters/descriptors.cjs +68 -0
- package/dist/adapters/descriptors.cjs.map +1 -0
- package/dist/adapters/descriptors.d.cts +3 -0
- package/dist/adapters/descriptors.d.ts +3 -0
- package/dist/adapters/descriptors.js +63 -0
- package/dist/adapters/descriptors.js.map +1 -0
- package/dist/adapters/index.cjs +52 -60
- package/dist/adapters/index.cjs.map +1 -1
- package/dist/adapters/index.d.cts +171 -3
- package/dist/adapters/index.d.ts +171 -3
- package/dist/adapters/index.js +50 -57
- package/dist/adapters/index.js.map +1 -1
- package/dist/browser.js +4 -15
- package/dist/browser.js.map +1 -1
- package/dist/{index-CRyFiIZm.d.cts → descriptors-B6qt_mwi.d.cts} +4 -226
- package/dist/{index-CRyFiIZm.d.ts → descriptors-B6qt_mwi.d.ts} +4 -226
- package/dist/index.cjs +86 -282
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +19 -20
- package/dist/index.d.ts +19 -20
- package/dist/index.js +84 -272
- package/dist/index.js.map +1 -1
- package/package.json +7 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,9 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { I as InvestmentRecord, S as StrategyDefinition, A as AutoInvestSchedule, a as AutoInvestStatus, T as T2000Options, P as PayOptions, b as PayResult, c as SendResult, B as BalanceResponse, d as TransactionRecord, D as DepositInfo, L as LendingAdapter, e as SwapAdapter, f as SaveResult, W as WithdrawResult, M as MaxWithdrawResult, g as BorrowResult, R as RepayResult, h as MaxBorrowResult, H as HealthFactorResult, i as SwapResult, j as InvestResult, k as InvestEarnResult, l as InvestRebalanceResult, m as PendingReward, C as ClaimRewardsResult, n as StrategyBuyResult, o as StrategySellResult, p as StrategyRebalanceResult, q as StrategyStatusResult, r as AutoInvestRunResult, s as PortfolioResult, t as InvestmentPosition, u as PositionsResult, v as RatesResult, w as LendingRates, x as RebalanceResult, E as EarningsResult, F as FundStatusResult, G as GasMethod } from './descriptors-B6qt_mwi.cjs';
|
|
2
|
+
export { y as AdapterCapability, z as AdapterPositions, J as AdapterTxResult, K as AssetRates, N as GasReserve, O as HealthInfo, Q as InvestRebalanceMove, U as PerpsAdapter, V as PerpsPosition, X as PerpsPositionsResult, Y as PerpsTradeResult, Z as PositionEntry, _ as PositionSide, $ as ProtocolDescriptor, a0 as RebalanceStep, a1 as SwapQuote, a2 as allDescriptors, a3 as cetusDescriptor, a4 as naviDescriptor, a5 as suilendDescriptor } from './descriptors-B6qt_mwi.cjs';
|
|
3
3
|
import { EventEmitter } from 'eventemitter3';
|
|
4
4
|
import { SuiJsonRpcClient } from '@mysten/sui/jsonRpc';
|
|
5
5
|
import { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519';
|
|
6
6
|
import { Transaction, TransactionObjectArgument } from '@mysten/sui/transactions';
|
|
7
|
+
export { CetusAdapter, NaviAdapter, ProtocolRegistry, SuilendAdapter } from './adapters/index.cjs';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Abstract signing interface that decouples the SDK from any specific
|
|
11
|
+
* key management strategy (Ed25519 keypair, zkLogin, multisig, …).
|
|
12
|
+
*/
|
|
13
|
+
interface TransactionSigner {
|
|
14
|
+
getAddress(): string;
|
|
15
|
+
signTransaction(txBytes: Uint8Array): Promise<{
|
|
16
|
+
signature: string;
|
|
17
|
+
}>;
|
|
18
|
+
}
|
|
7
19
|
|
|
8
20
|
interface ZkLoginProof {
|
|
9
21
|
proofPoints: {
|
|
@@ -31,7 +43,7 @@ declare class ZkLoginSigner implements TransactionSigner {
|
|
|
31
43
|
isExpired(currentEpoch: number): boolean;
|
|
32
44
|
}
|
|
33
45
|
|
|
34
|
-
type T2000ErrorCode = 'INSUFFICIENT_BALANCE' | 'INSUFFICIENT_GAS' | 'INVALID_ADDRESS' | 'INVALID_AMOUNT' | 'WALLET_NOT_FOUND' | 'WALLET_LOCKED' | 'WALLET_EXISTS' | 'SPONSOR_FAILED' | 'SPONSOR_RATE_LIMITED' | 'GAS_STATION_UNAVAILABLE' | 'GAS_FEE_EXCEEDED' | 'SIMULATION_FAILED' | 'TRANSACTION_FAILED' | 'ASSET_NOT_SUPPORTED' | 'SWAP_FAILED' | 'SLIPPAGE_EXCEEDED' | 'HEALTH_FACTOR_TOO_LOW' | 'WITHDRAW_WOULD_LIQUIDATE' | 'WITHDRAW_FAILED' | 'NO_COLLATERAL' | 'PROTOCOL_PAUSED' | 'PROTOCOL_UNAVAILABLE' | 'RPC_ERROR' | 'RPC_UNREACHABLE' | 'SPONSOR_UNAVAILABLE' | 'AUTO_TOPUP_FAILED' | 'PRICE_EXCEEDS_LIMIT' | 'UNSUPPORTED_NETWORK' | 'PAYMENT_EXPIRED' | 'DUPLICATE_PAYMENT' | 'FACILITATOR_REJECTION' | 'CONTACT_NOT_FOUND' | 'INVALID_CONTACT_NAME' | 'FACILITATOR_TIMEOUT' | '
|
|
46
|
+
type T2000ErrorCode = 'INSUFFICIENT_BALANCE' | 'INSUFFICIENT_GAS' | 'INVALID_ADDRESS' | 'INVALID_AMOUNT' | 'WALLET_NOT_FOUND' | 'WALLET_LOCKED' | 'WALLET_EXISTS' | 'SPONSOR_FAILED' | 'SPONSOR_RATE_LIMITED' | 'USDC_SPONSOR_FAILED' | 'USDC_SPONSOR_RATE_LIMITED' | 'GAS_STATION_UNAVAILABLE' | 'GAS_FEE_EXCEEDED' | 'SIMULATION_FAILED' | 'TRANSACTION_FAILED' | 'ASSET_NOT_SUPPORTED' | 'SWAP_FAILED' | 'SLIPPAGE_EXCEEDED' | 'HEALTH_FACTOR_TOO_LOW' | 'WITHDRAW_WOULD_LIQUIDATE' | 'WITHDRAW_FAILED' | 'NO_COLLATERAL' | 'PROTOCOL_PAUSED' | 'PROTOCOL_UNAVAILABLE' | 'RPC_ERROR' | 'RPC_UNREACHABLE' | 'SPONSOR_UNAVAILABLE' | 'AUTO_TOPUP_FAILED' | 'PRICE_EXCEEDS_LIMIT' | 'UNSUPPORTED_NETWORK' | 'PAYMENT_EXPIRED' | 'DUPLICATE_PAYMENT' | 'FACILITATOR_REJECTION' | 'CONTACT_NOT_FOUND' | 'INVALID_CONTACT_NAME' | 'FACILITATOR_TIMEOUT' | 'SAFEGUARD_BLOCKED' | 'INSUFFICIENT_INVESTMENT' | 'INVESTMENT_LOCKED' | 'INVEST_ALREADY_EARNING' | 'INVEST_NOT_EARNING' | 'BORROW_GUARD_INVESTMENT' | 'STRATEGY_NOT_FOUND' | 'STRATEGY_INVALID_ALLOCATIONS' | 'STRATEGY_HAS_POSITIONS' | 'STRATEGY_BUILTIN' | 'STRATEGY_MIN_AMOUNT' | 'AUTO_INVEST_NOT_FOUND' | 'AUTO_INVEST_INSUFFICIENT' | 'MARKET_NOT_SUPPORTED' | 'LEVERAGE_EXCEEDED' | 'POSITION_SIZE_EXCEEDED' | 'BLUEFIN_AUTH_FAILED' | 'BLUEFIN_API_ERROR' | 'POSITION_NOT_FOUND' | 'UNKNOWN';
|
|
35
47
|
interface T2000ErrorData {
|
|
36
48
|
reason?: string;
|
|
37
49
|
[key: string]: unknown;
|
|
@@ -193,17 +205,6 @@ type PerpsMarket = (typeof PERPS_MARKETS)[number];
|
|
|
193
205
|
declare const DEFAULT_MAX_LEVERAGE = 5;
|
|
194
206
|
declare const DEFAULT_MAX_POSITION_SIZE = 1000;
|
|
195
207
|
declare const GAS_RESERVE_MIN = 0.05;
|
|
196
|
-
declare const SENTINEL: {
|
|
197
|
-
readonly PACKAGE: "0x88b83f36dafcd5f6dcdcf1d2cb5889b03f61264ab3cee9cae35db7aa940a21b7";
|
|
198
|
-
readonly AGENT_REGISTRY: "0xc47564f5f14c12b31e0dfa1a3dc99a6380a1edf8929c28cb0eaa3359c8db36ac";
|
|
199
|
-
readonly ENCLAVE: "0xfb1261aeb9583514cb1341a548a5ec12d1231bd96af22215f1792617a93e1213";
|
|
200
|
-
readonly PROTOCOL_CONFIG: "0x2fa4fa4a1dd0498612304635ff9334e1b922e78af325000e9d9c0e88adea459f";
|
|
201
|
-
readonly TEE_API: "https://app.suisentinel.xyz/api/consume-prompt";
|
|
202
|
-
readonly SENTINELS_API: "https://api.suisentinel.xyz/agents/mainnet";
|
|
203
|
-
readonly RANDOM: "0x8";
|
|
204
|
-
readonly MIN_FEE_MIST: 100000000n;
|
|
205
|
-
readonly MAX_PROMPT_TOKENS: 600;
|
|
206
|
-
};
|
|
207
208
|
|
|
208
209
|
interface SafeguardConfig {
|
|
209
210
|
locked: boolean;
|
|
@@ -215,10 +216,10 @@ interface SafeguardConfig {
|
|
|
215
216
|
maxPositionSize?: number;
|
|
216
217
|
}
|
|
217
218
|
interface TxMetadata {
|
|
218
|
-
operation: 'send' | 'save' | 'withdraw' | 'borrow' | 'repay' | 'exchange' | 'rebalance' | 'pay' | '
|
|
219
|
+
operation: 'send' | 'save' | 'withdraw' | 'borrow' | 'repay' | 'exchange' | 'rebalance' | 'pay' | 'invest' | 'trade';
|
|
219
220
|
amount?: number;
|
|
220
221
|
}
|
|
221
|
-
declare const OUTBOUND_OPS: Set<"save" | "borrow" | "withdraw" | "send" | "repay" | "
|
|
222
|
+
declare const OUTBOUND_OPS: Set<"save" | "borrow" | "withdraw" | "send" | "repay" | "exchange" | "rebalance" | "pay" | "invest" | "trade">;
|
|
222
223
|
declare const DEFAULT_SAFEGUARD_CONFIG: SafeguardConfig;
|
|
223
224
|
|
|
224
225
|
declare class SafeguardEnforcer {
|
|
@@ -411,6 +412,7 @@ declare class T2000 extends EventEmitter<T2000Events> {
|
|
|
411
412
|
agent: T2000;
|
|
412
413
|
address: string;
|
|
413
414
|
sponsored: boolean;
|
|
415
|
+
usdcSponsored: boolean;
|
|
414
416
|
}>;
|
|
415
417
|
/** SuiJsonRpcClient used by this agent — exposed for integrations. */
|
|
416
418
|
get suiClient(): SuiJsonRpcClient;
|
|
@@ -588,9 +590,6 @@ declare class T2000 extends EventEmitter<T2000Events> {
|
|
|
588
590
|
}): Promise<RebalanceResult>;
|
|
589
591
|
earnings(): Promise<EarningsResult>;
|
|
590
592
|
fundStatus(): Promise<FundStatusResult>;
|
|
591
|
-
sentinelList(): Promise<SentinelAgent[]>;
|
|
592
|
-
sentinelInfo(id: string): Promise<SentinelAgent>;
|
|
593
|
-
sentinelAttack(id: string, prompt: string, fee?: bigint): Promise<SentinelAttackResult>;
|
|
594
593
|
private getFreeBalance;
|
|
595
594
|
private resolveLending;
|
|
596
595
|
private emitBalanceChange;
|
|
@@ -738,4 +737,4 @@ interface GasStatusResponse {
|
|
|
738
737
|
}
|
|
739
738
|
declare function getGasStatus(address?: string): Promise<GasStatusResponse>;
|
|
740
739
|
|
|
741
|
-
export { AutoInvestManager, AutoInvestRunResult, AutoInvestSchedule, AutoInvestStatus, type AutoTopUpResult, BPS_DENOMINATOR, BalanceResponse, BorrowResult, CLOCK_ID, ClaimRewardsResult, type Contact, ContactManager, type ContactMap, DEFAULT_MAX_LEVERAGE, DEFAULT_MAX_POSITION_SIZE, DEFAULT_NETWORK, DEFAULT_SAFEGUARD_CONFIG, DEFAULT_STRATEGIES, DepositInfo, EarningsResult, type FeeOperation, FundStatusResult, GAS_RESERVE_MIN, type GasExecutionResult, GasMethod, type GasRequestType, type GasSponsorResponse, type GasStatusResponse, HealthFactorResult, INVESTMENT_ASSETS, InvestEarnResult, InvestRebalanceResult, InvestResult, type InvestmentAsset, InvestmentPosition, InvestmentRecord, KeypairSigner, LendingAdapter, LendingRates, MIST_PER_SUI, MaxBorrowResult, MaxWithdrawResult, OUTBOUND_OPS, PERPS_MARKETS, PayOptions, PayResult, PendingReward, type PerpsMarket, PortfolioManager, PortfolioResult, PositionsResult, type ProtocolFeeInfo, RatesResult, RebalanceResult, RepayResult,
|
|
740
|
+
export { AutoInvestManager, AutoInvestRunResult, AutoInvestSchedule, AutoInvestStatus, type AutoTopUpResult, BPS_DENOMINATOR, BalanceResponse, BorrowResult, CLOCK_ID, ClaimRewardsResult, type Contact, ContactManager, type ContactMap, DEFAULT_MAX_LEVERAGE, DEFAULT_MAX_POSITION_SIZE, DEFAULT_NETWORK, DEFAULT_SAFEGUARD_CONFIG, DEFAULT_STRATEGIES, DepositInfo, EarningsResult, type FeeOperation, FundStatusResult, GAS_RESERVE_MIN, type GasExecutionResult, GasMethod, type GasRequestType, type GasSponsorResponse, type GasStatusResponse, HealthFactorResult, INVESTMENT_ASSETS, InvestEarnResult, InvestRebalanceResult, InvestResult, type InvestmentAsset, InvestmentPosition, InvestmentRecord, KeypairSigner, LendingAdapter, LendingRates, MIST_PER_SUI, MaxBorrowResult, MaxWithdrawResult, OUTBOUND_OPS, PERPS_MARKETS, PayOptions, PayResult, PendingReward, type PerpsMarket, PortfolioManager, PortfolioResult, PositionsResult, type ProtocolFeeInfo, RatesResult, RebalanceResult, RepayResult, STABLE_ASSETS, SUI_DECIMALS, SUPPORTED_ASSETS, type SafeguardConfig, SafeguardEnforcer, SafeguardError, type SafeguardErrorDetails, type SafeguardRule, SaveResult, SendResult, type SimulationResult, type StableAsset, StrategyBuyResult, StrategyDefinition, StrategyManager, StrategyRebalanceResult, StrategySellResult, StrategyStatusResult, type SupportedAsset, SwapAdapter, SwapResult, T2000, T2000Error, type T2000ErrorCode, type T2000ErrorData, T2000Options, TransactionRecord, type TransactionSigner, type TxMetadata, USDC_DECIMALS, WithdrawResult, type ZkLoginProof, ZkLoginSigner, addCollectFeeToTx, calculateFee, executeAutoTopUp, executeWithGas, exportPrivateKey, formatAssetAmount, formatSui, formatUsd, generateKeypair, getAddress, getDecimals, getGasStatus, getPoolPrice, getRates, keypairFromPrivateKey, loadKey, mapMoveAbortCode, mapWalletError, mistToSui, rawToStable, rawToUsdc, saveKey, shouldAutoTopUp, simulateTransaction, solveHashcash, stableToRaw, suiToMist, throwIfSimulationFailed, truncateAddress, usdcToRaw, validateAddress, walletExists };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { I as InvestmentRecord, S as StrategyDefinition, A as AutoInvestSchedule, a as AutoInvestStatus, T as T2000Options, P as PayOptions, b as PayResult, c as SendResult, B as BalanceResponse, d as TransactionRecord, D as DepositInfo, L as LendingAdapter, e as SwapAdapter, f as SaveResult, W as WithdrawResult, M as MaxWithdrawResult, g as BorrowResult, R as RepayResult, h as MaxBorrowResult, H as HealthFactorResult, i as SwapResult, j as InvestResult, k as InvestEarnResult, l as InvestRebalanceResult, m as PendingReward, C as ClaimRewardsResult, n as StrategyBuyResult, o as StrategySellResult, p as StrategyRebalanceResult, q as StrategyStatusResult, r as AutoInvestRunResult, s as PortfolioResult, t as InvestmentPosition, u as PositionsResult, v as RatesResult, w as LendingRates, x as RebalanceResult, E as EarningsResult, F as FundStatusResult, G as GasMethod } from './descriptors-B6qt_mwi.js';
|
|
2
|
+
export { y as AdapterCapability, z as AdapterPositions, J as AdapterTxResult, K as AssetRates, N as GasReserve, O as HealthInfo, Q as InvestRebalanceMove, U as PerpsAdapter, V as PerpsPosition, X as PerpsPositionsResult, Y as PerpsTradeResult, Z as PositionEntry, _ as PositionSide, $ as ProtocolDescriptor, a0 as RebalanceStep, a1 as SwapQuote, a2 as allDescriptors, a3 as cetusDescriptor, a4 as naviDescriptor, a5 as suilendDescriptor } from './descriptors-B6qt_mwi.js';
|
|
3
3
|
import { EventEmitter } from 'eventemitter3';
|
|
4
4
|
import { SuiJsonRpcClient } from '@mysten/sui/jsonRpc';
|
|
5
5
|
import { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519';
|
|
6
6
|
import { Transaction, TransactionObjectArgument } from '@mysten/sui/transactions';
|
|
7
|
+
export { CetusAdapter, NaviAdapter, ProtocolRegistry, SuilendAdapter } from './adapters/index.js';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Abstract signing interface that decouples the SDK from any specific
|
|
11
|
+
* key management strategy (Ed25519 keypair, zkLogin, multisig, …).
|
|
12
|
+
*/
|
|
13
|
+
interface TransactionSigner {
|
|
14
|
+
getAddress(): string;
|
|
15
|
+
signTransaction(txBytes: Uint8Array): Promise<{
|
|
16
|
+
signature: string;
|
|
17
|
+
}>;
|
|
18
|
+
}
|
|
7
19
|
|
|
8
20
|
interface ZkLoginProof {
|
|
9
21
|
proofPoints: {
|
|
@@ -31,7 +43,7 @@ declare class ZkLoginSigner implements TransactionSigner {
|
|
|
31
43
|
isExpired(currentEpoch: number): boolean;
|
|
32
44
|
}
|
|
33
45
|
|
|
34
|
-
type T2000ErrorCode = 'INSUFFICIENT_BALANCE' | 'INSUFFICIENT_GAS' | 'INVALID_ADDRESS' | 'INVALID_AMOUNT' | 'WALLET_NOT_FOUND' | 'WALLET_LOCKED' | 'WALLET_EXISTS' | 'SPONSOR_FAILED' | 'SPONSOR_RATE_LIMITED' | 'GAS_STATION_UNAVAILABLE' | 'GAS_FEE_EXCEEDED' | 'SIMULATION_FAILED' | 'TRANSACTION_FAILED' | 'ASSET_NOT_SUPPORTED' | 'SWAP_FAILED' | 'SLIPPAGE_EXCEEDED' | 'HEALTH_FACTOR_TOO_LOW' | 'WITHDRAW_WOULD_LIQUIDATE' | 'WITHDRAW_FAILED' | 'NO_COLLATERAL' | 'PROTOCOL_PAUSED' | 'PROTOCOL_UNAVAILABLE' | 'RPC_ERROR' | 'RPC_UNREACHABLE' | 'SPONSOR_UNAVAILABLE' | 'AUTO_TOPUP_FAILED' | 'PRICE_EXCEEDS_LIMIT' | 'UNSUPPORTED_NETWORK' | 'PAYMENT_EXPIRED' | 'DUPLICATE_PAYMENT' | 'FACILITATOR_REJECTION' | 'CONTACT_NOT_FOUND' | 'INVALID_CONTACT_NAME' | 'FACILITATOR_TIMEOUT' | '
|
|
46
|
+
type T2000ErrorCode = 'INSUFFICIENT_BALANCE' | 'INSUFFICIENT_GAS' | 'INVALID_ADDRESS' | 'INVALID_AMOUNT' | 'WALLET_NOT_FOUND' | 'WALLET_LOCKED' | 'WALLET_EXISTS' | 'SPONSOR_FAILED' | 'SPONSOR_RATE_LIMITED' | 'USDC_SPONSOR_FAILED' | 'USDC_SPONSOR_RATE_LIMITED' | 'GAS_STATION_UNAVAILABLE' | 'GAS_FEE_EXCEEDED' | 'SIMULATION_FAILED' | 'TRANSACTION_FAILED' | 'ASSET_NOT_SUPPORTED' | 'SWAP_FAILED' | 'SLIPPAGE_EXCEEDED' | 'HEALTH_FACTOR_TOO_LOW' | 'WITHDRAW_WOULD_LIQUIDATE' | 'WITHDRAW_FAILED' | 'NO_COLLATERAL' | 'PROTOCOL_PAUSED' | 'PROTOCOL_UNAVAILABLE' | 'RPC_ERROR' | 'RPC_UNREACHABLE' | 'SPONSOR_UNAVAILABLE' | 'AUTO_TOPUP_FAILED' | 'PRICE_EXCEEDS_LIMIT' | 'UNSUPPORTED_NETWORK' | 'PAYMENT_EXPIRED' | 'DUPLICATE_PAYMENT' | 'FACILITATOR_REJECTION' | 'CONTACT_NOT_FOUND' | 'INVALID_CONTACT_NAME' | 'FACILITATOR_TIMEOUT' | 'SAFEGUARD_BLOCKED' | 'INSUFFICIENT_INVESTMENT' | 'INVESTMENT_LOCKED' | 'INVEST_ALREADY_EARNING' | 'INVEST_NOT_EARNING' | 'BORROW_GUARD_INVESTMENT' | 'STRATEGY_NOT_FOUND' | 'STRATEGY_INVALID_ALLOCATIONS' | 'STRATEGY_HAS_POSITIONS' | 'STRATEGY_BUILTIN' | 'STRATEGY_MIN_AMOUNT' | 'AUTO_INVEST_NOT_FOUND' | 'AUTO_INVEST_INSUFFICIENT' | 'MARKET_NOT_SUPPORTED' | 'LEVERAGE_EXCEEDED' | 'POSITION_SIZE_EXCEEDED' | 'BLUEFIN_AUTH_FAILED' | 'BLUEFIN_API_ERROR' | 'POSITION_NOT_FOUND' | 'UNKNOWN';
|
|
35
47
|
interface T2000ErrorData {
|
|
36
48
|
reason?: string;
|
|
37
49
|
[key: string]: unknown;
|
|
@@ -193,17 +205,6 @@ type PerpsMarket = (typeof PERPS_MARKETS)[number];
|
|
|
193
205
|
declare const DEFAULT_MAX_LEVERAGE = 5;
|
|
194
206
|
declare const DEFAULT_MAX_POSITION_SIZE = 1000;
|
|
195
207
|
declare const GAS_RESERVE_MIN = 0.05;
|
|
196
|
-
declare const SENTINEL: {
|
|
197
|
-
readonly PACKAGE: "0x88b83f36dafcd5f6dcdcf1d2cb5889b03f61264ab3cee9cae35db7aa940a21b7";
|
|
198
|
-
readonly AGENT_REGISTRY: "0xc47564f5f14c12b31e0dfa1a3dc99a6380a1edf8929c28cb0eaa3359c8db36ac";
|
|
199
|
-
readonly ENCLAVE: "0xfb1261aeb9583514cb1341a548a5ec12d1231bd96af22215f1792617a93e1213";
|
|
200
|
-
readonly PROTOCOL_CONFIG: "0x2fa4fa4a1dd0498612304635ff9334e1b922e78af325000e9d9c0e88adea459f";
|
|
201
|
-
readonly TEE_API: "https://app.suisentinel.xyz/api/consume-prompt";
|
|
202
|
-
readonly SENTINELS_API: "https://api.suisentinel.xyz/agents/mainnet";
|
|
203
|
-
readonly RANDOM: "0x8";
|
|
204
|
-
readonly MIN_FEE_MIST: 100000000n;
|
|
205
|
-
readonly MAX_PROMPT_TOKENS: 600;
|
|
206
|
-
};
|
|
207
208
|
|
|
208
209
|
interface SafeguardConfig {
|
|
209
210
|
locked: boolean;
|
|
@@ -215,10 +216,10 @@ interface SafeguardConfig {
|
|
|
215
216
|
maxPositionSize?: number;
|
|
216
217
|
}
|
|
217
218
|
interface TxMetadata {
|
|
218
|
-
operation: 'send' | 'save' | 'withdraw' | 'borrow' | 'repay' | 'exchange' | 'rebalance' | 'pay' | '
|
|
219
|
+
operation: 'send' | 'save' | 'withdraw' | 'borrow' | 'repay' | 'exchange' | 'rebalance' | 'pay' | 'invest' | 'trade';
|
|
219
220
|
amount?: number;
|
|
220
221
|
}
|
|
221
|
-
declare const OUTBOUND_OPS: Set<"save" | "borrow" | "withdraw" | "send" | "repay" | "
|
|
222
|
+
declare const OUTBOUND_OPS: Set<"save" | "borrow" | "withdraw" | "send" | "repay" | "exchange" | "rebalance" | "pay" | "invest" | "trade">;
|
|
222
223
|
declare const DEFAULT_SAFEGUARD_CONFIG: SafeguardConfig;
|
|
223
224
|
|
|
224
225
|
declare class SafeguardEnforcer {
|
|
@@ -411,6 +412,7 @@ declare class T2000 extends EventEmitter<T2000Events> {
|
|
|
411
412
|
agent: T2000;
|
|
412
413
|
address: string;
|
|
413
414
|
sponsored: boolean;
|
|
415
|
+
usdcSponsored: boolean;
|
|
414
416
|
}>;
|
|
415
417
|
/** SuiJsonRpcClient used by this agent — exposed for integrations. */
|
|
416
418
|
get suiClient(): SuiJsonRpcClient;
|
|
@@ -588,9 +590,6 @@ declare class T2000 extends EventEmitter<T2000Events> {
|
|
|
588
590
|
}): Promise<RebalanceResult>;
|
|
589
591
|
earnings(): Promise<EarningsResult>;
|
|
590
592
|
fundStatus(): Promise<FundStatusResult>;
|
|
591
|
-
sentinelList(): Promise<SentinelAgent[]>;
|
|
592
|
-
sentinelInfo(id: string): Promise<SentinelAgent>;
|
|
593
|
-
sentinelAttack(id: string, prompt: string, fee?: bigint): Promise<SentinelAttackResult>;
|
|
594
593
|
private getFreeBalance;
|
|
595
594
|
private resolveLending;
|
|
596
595
|
private emitBalanceChange;
|
|
@@ -738,4 +737,4 @@ interface GasStatusResponse {
|
|
|
738
737
|
}
|
|
739
738
|
declare function getGasStatus(address?: string): Promise<GasStatusResponse>;
|
|
740
739
|
|
|
741
|
-
export { AutoInvestManager, AutoInvestRunResult, AutoInvestSchedule, AutoInvestStatus, type AutoTopUpResult, BPS_DENOMINATOR, BalanceResponse, BorrowResult, CLOCK_ID, ClaimRewardsResult, type Contact, ContactManager, type ContactMap, DEFAULT_MAX_LEVERAGE, DEFAULT_MAX_POSITION_SIZE, DEFAULT_NETWORK, DEFAULT_SAFEGUARD_CONFIG, DEFAULT_STRATEGIES, DepositInfo, EarningsResult, type FeeOperation, FundStatusResult, GAS_RESERVE_MIN, type GasExecutionResult, GasMethod, type GasRequestType, type GasSponsorResponse, type GasStatusResponse, HealthFactorResult, INVESTMENT_ASSETS, InvestEarnResult, InvestRebalanceResult, InvestResult, type InvestmentAsset, InvestmentPosition, InvestmentRecord, KeypairSigner, LendingAdapter, LendingRates, MIST_PER_SUI, MaxBorrowResult, MaxWithdrawResult, OUTBOUND_OPS, PERPS_MARKETS, PayOptions, PayResult, PendingReward, type PerpsMarket, PortfolioManager, PortfolioResult, PositionsResult, type ProtocolFeeInfo, RatesResult, RebalanceResult, RepayResult,
|
|
740
|
+
export { AutoInvestManager, AutoInvestRunResult, AutoInvestSchedule, AutoInvestStatus, type AutoTopUpResult, BPS_DENOMINATOR, BalanceResponse, BorrowResult, CLOCK_ID, ClaimRewardsResult, type Contact, ContactManager, type ContactMap, DEFAULT_MAX_LEVERAGE, DEFAULT_MAX_POSITION_SIZE, DEFAULT_NETWORK, DEFAULT_SAFEGUARD_CONFIG, DEFAULT_STRATEGIES, DepositInfo, EarningsResult, type FeeOperation, FundStatusResult, GAS_RESERVE_MIN, type GasExecutionResult, GasMethod, type GasRequestType, type GasSponsorResponse, type GasStatusResponse, HealthFactorResult, INVESTMENT_ASSETS, InvestEarnResult, InvestRebalanceResult, InvestResult, type InvestmentAsset, InvestmentPosition, InvestmentRecord, KeypairSigner, LendingAdapter, LendingRates, MIST_PER_SUI, MaxBorrowResult, MaxWithdrawResult, OUTBOUND_OPS, PERPS_MARKETS, PayOptions, PayResult, PendingReward, type PerpsMarket, PortfolioManager, PortfolioResult, PositionsResult, type ProtocolFeeInfo, RatesResult, RebalanceResult, RepayResult, STABLE_ASSETS, SUI_DECIMALS, SUPPORTED_ASSETS, type SafeguardConfig, SafeguardEnforcer, SafeguardError, type SafeguardErrorDetails, type SafeguardRule, SaveResult, SendResult, type SimulationResult, type StableAsset, StrategyBuyResult, StrategyDefinition, StrategyManager, StrategyRebalanceResult, StrategySellResult, StrategyStatusResult, type SupportedAsset, SwapAdapter, SwapResult, T2000, T2000Error, type T2000ErrorCode, type T2000ErrorData, T2000Options, TransactionRecord, type TransactionSigner, type TxMetadata, USDC_DECIMALS, WithdrawResult, type ZkLoginProof, ZkLoginSigner, addCollectFeeToTx, calculateFee, executeAutoTopUp, executeWithGas, exportPrivateKey, formatAssetAmount, formatSui, formatUsd, generateKeypair, getAddress, getDecimals, getGasStatus, getPoolPrice, getRates, keypairFromPrivateKey, loadKey, mapMoveAbortCode, mapWalletError, mistToSui, rawToStable, rawToUsdc, saveKey, shouldAutoTopUp, simulateTransaction, solveHashcash, stableToRaw, suiToMist, throwIfSimulationFailed, truncateAddress, usdcToRaw, validateAddress, walletExists };
|