@t2000/sdk 0.4.3 → 0.5.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/index.d.cts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { EventEmitter } from 'eventemitter3';
2
- import { SuiClient } from '@mysten/sui/client';
2
+ import { SuiJsonRpcClient } from '@mysten/sui/jsonRpc';
3
3
  import { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519';
4
- import { T as T2000Options, S as SendResult, B as BalanceResponse, a as TransactionRecord, D as DepositInfo, L as LendingAdapter, b as SwapAdapter, c as SaveResult, W as WithdrawResult, M as MaxWithdrawResult, d as BorrowResult, R as RepayResult, e as MaxBorrowResult, H as HealthFactorResult, f as SwapResult, P as PositionsResult, g as RatesResult, h as LendingRates, E as EarningsResult, F as FundStatusResult, i as SentinelAgent, j as SentinelAttackResult, k as SentinelVerdict, G as GasMethod } from './index-BuaGAa6b.cjs';
5
- export { A as AdapterCapability, l as AdapterPositions, m as AdapterTxResult, C as CetusAdapter, n as GasReserve, o as HealthInfo, N as NaviAdapter, p as PositionEntry, q as ProtocolRegistry, r as SuilendAdapter, s as SwapQuote } from './index-BuaGAa6b.cjs';
4
+ import { T as T2000Options, S as SendResult, B as BalanceResponse, a as TransactionRecord, D as DepositInfo, L as LendingAdapter, b as SwapAdapter, c as SaveResult, W as WithdrawResult, M as MaxWithdrawResult, d as BorrowResult, R as RepayResult, e as MaxBorrowResult, H as HealthFactorResult, f as SwapResult, P as PositionsResult, g as RatesResult, h as LendingRates, E as EarningsResult, F as FundStatusResult, i as SentinelAgent, j as SentinelAttackResult, k as SentinelVerdict, G as GasMethod } from './index-DMDq8uxe.cjs';
5
+ export { A as AdapterCapability, l as AdapterPositions, m as AdapterTxResult, C as CetusAdapter, n as GasReserve, o as HealthInfo, N as NaviAdapter, p as PositionEntry, q as ProtocolRegistry, r as SuilendAdapter, s as SwapQuote } from './index-DMDq8uxe.cjs';
6
6
  import { Transaction, TransactionObjectArgument } from '@mysten/sui/transactions';
7
7
 
8
8
  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' | 'SLIPPAGE_EXCEEDED' | 'HEALTH_FACTOR_TOO_LOW' | 'WITHDRAW_WOULD_LIQUIDATE' | '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' | 'FACILITATOR_TIMEOUT' | 'SENTINEL_API_ERROR' | 'SENTINEL_NOT_FOUND' | 'SENTINEL_TX_FAILED' | 'SENTINEL_TEE_ERROR' | 'UNKNOWN';
@@ -83,8 +83,8 @@ declare class T2000 extends EventEmitter<T2000Events> {
83
83
  address: string;
84
84
  sponsored: boolean;
85
85
  }>;
86
- /** SuiClient used by this agent — exposed for x402 and other integrations. */
87
- get suiClient(): SuiClient;
86
+ /** SuiJsonRpcClient used by this agent — exposed for x402 and other integrations. */
87
+ get suiClient(): SuiJsonRpcClient;
88
88
  /** Ed25519Keypair used by this agent — exposed for x402 and other integrations. */
89
89
  get signer(): Ed25519Keypair;
90
90
  address(): string;
@@ -235,30 +235,30 @@ interface SimulationResult {
235
235
  rawError: string;
236
236
  };
237
237
  }
238
- declare function simulateTransaction(client: SuiClient, tx: Transaction, sender: string): Promise<SimulationResult>;
238
+ declare function simulateTransaction(client: SuiJsonRpcClient, tx: Transaction, sender: string): Promise<SimulationResult>;
239
239
  declare function throwIfSimulationFailed(sim: SimulationResult): void;
240
240
 
241
- declare function getPoolPrice(client: SuiClient): Promise<number>;
242
- declare function getSwapQuote(client: SuiClient, fromAsset: 'USDC' | 'SUI', toAsset: 'USDC' | 'SUI', amount: number): Promise<{
241
+ declare function getPoolPrice(client: SuiJsonRpcClient): Promise<number>;
242
+ declare function getSwapQuote(client: SuiJsonRpcClient, fromAsset: 'USDC' | 'SUI', toAsset: 'USDC' | 'SUI', amount: number): Promise<{
243
243
  expectedOutput: number;
244
244
  priceImpact: number;
245
245
  poolPrice: number;
246
246
  }>;
247
247
 
248
- declare function getRates(client: SuiClient): Promise<RatesResult>;
248
+ declare function getRates(client: SuiJsonRpcClient): Promise<RatesResult>;
249
249
 
250
250
  declare function listSentinels(): Promise<SentinelAgent[]>;
251
- declare function getSentinelInfo(client: SuiClient, sentinelObjectId: string): Promise<SentinelAgent>;
252
- declare function requestAttack(client: SuiClient, signer: Ed25519Keypair, sentinelObjectId: string, feeMist: bigint): Promise<{
251
+ declare function getSentinelInfo(client: SuiJsonRpcClient, sentinelObjectId: string): Promise<SentinelAgent>;
252
+ declare function requestAttack(client: SuiJsonRpcClient, signer: Ed25519Keypair, sentinelObjectId: string, feeMist: bigint): Promise<{
253
253
  attackObjectId: string;
254
254
  digest: string;
255
255
  }>;
256
256
  declare function submitPrompt(agentId: string, attackObjectId: string, prompt: string): Promise<SentinelVerdict>;
257
- declare function settleAttack(client: SuiClient, signer: Ed25519Keypair, sentinelObjectId: string, attackObjectId: string, prompt: string, verdict: SentinelVerdict): Promise<{
257
+ declare function settleAttack(client: SuiJsonRpcClient, signer: Ed25519Keypair, sentinelObjectId: string, attackObjectId: string, prompt: string, verdict: SentinelVerdict): Promise<{
258
258
  digest: string;
259
259
  success: boolean;
260
260
  }>;
261
- declare function attack(client: SuiClient, signer: Ed25519Keypair, sentinelId: string, prompt: string, feeMist?: bigint): Promise<SentinelAttackResult>;
261
+ declare function attack(client: SuiJsonRpcClient, signer: Ed25519Keypair, sentinelId: string, prompt: string, feeMist?: bigint): Promise<SentinelAttackResult>;
262
262
 
263
263
  interface GasExecutionResult {
264
264
  digest: string;
@@ -273,7 +273,7 @@ interface GasExecutionResult {
273
273
  * 3. Gas Station sponsored (fallback)
274
274
  * 4. Fail with INSUFFICIENT_GAS
275
275
  */
276
- declare function executeWithGas(client: SuiClient, keypair: Ed25519Keypair, buildTx: () => Transaction | Promise<Transaction>): Promise<GasExecutionResult>;
276
+ declare function executeWithGas(client: SuiJsonRpcClient, keypair: Ed25519Keypair, buildTx: () => Transaction | Promise<Transaction>): Promise<GasExecutionResult>;
277
277
 
278
278
  interface AutoTopUpResult {
279
279
  success: boolean;
@@ -281,8 +281,8 @@ interface AutoTopUpResult {
281
281
  usdcSpent: number;
282
282
  suiReceived: number;
283
283
  }
284
- declare function shouldAutoTopUp(client: SuiClient, address: string): Promise<boolean>;
285
- declare function executeAutoTopUp(client: SuiClient, keypair: Ed25519Keypair): Promise<AutoTopUpResult>;
284
+ declare function shouldAutoTopUp(client: SuiJsonRpcClient, address: string): Promise<boolean>;
285
+ declare function executeAutoTopUp(client: SuiJsonRpcClient, keypair: Ed25519Keypair): Promise<AutoTopUpResult>;
286
286
 
287
287
  type GasRequestType = 'bootstrap' | 'auto-topup' | 'fallback';
288
288
  interface GasSponsorResponse {
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { EventEmitter } from 'eventemitter3';
2
- import { SuiClient } from '@mysten/sui/client';
2
+ import { SuiJsonRpcClient } from '@mysten/sui/jsonRpc';
3
3
  import { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519';
4
- import { T as T2000Options, S as SendResult, B as BalanceResponse, a as TransactionRecord, D as DepositInfo, L as LendingAdapter, b as SwapAdapter, c as SaveResult, W as WithdrawResult, M as MaxWithdrawResult, d as BorrowResult, R as RepayResult, e as MaxBorrowResult, H as HealthFactorResult, f as SwapResult, P as PositionsResult, g as RatesResult, h as LendingRates, E as EarningsResult, F as FundStatusResult, i as SentinelAgent, j as SentinelAttackResult, k as SentinelVerdict, G as GasMethod } from './index-BuaGAa6b.js';
5
- export { A as AdapterCapability, l as AdapterPositions, m as AdapterTxResult, C as CetusAdapter, n as GasReserve, o as HealthInfo, N as NaviAdapter, p as PositionEntry, q as ProtocolRegistry, r as SuilendAdapter, s as SwapQuote } from './index-BuaGAa6b.js';
4
+ import { T as T2000Options, S as SendResult, B as BalanceResponse, a as TransactionRecord, D as DepositInfo, L as LendingAdapter, b as SwapAdapter, c as SaveResult, W as WithdrawResult, M as MaxWithdrawResult, d as BorrowResult, R as RepayResult, e as MaxBorrowResult, H as HealthFactorResult, f as SwapResult, P as PositionsResult, g as RatesResult, h as LendingRates, E as EarningsResult, F as FundStatusResult, i as SentinelAgent, j as SentinelAttackResult, k as SentinelVerdict, G as GasMethod } from './index-DMDq8uxe.js';
5
+ export { A as AdapterCapability, l as AdapterPositions, m as AdapterTxResult, C as CetusAdapter, n as GasReserve, o as HealthInfo, N as NaviAdapter, p as PositionEntry, q as ProtocolRegistry, r as SuilendAdapter, s as SwapQuote } from './index-DMDq8uxe.js';
6
6
  import { Transaction, TransactionObjectArgument } from '@mysten/sui/transactions';
7
7
 
8
8
  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' | 'SLIPPAGE_EXCEEDED' | 'HEALTH_FACTOR_TOO_LOW' | 'WITHDRAW_WOULD_LIQUIDATE' | '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' | 'FACILITATOR_TIMEOUT' | 'SENTINEL_API_ERROR' | 'SENTINEL_NOT_FOUND' | 'SENTINEL_TX_FAILED' | 'SENTINEL_TEE_ERROR' | 'UNKNOWN';
@@ -83,8 +83,8 @@ declare class T2000 extends EventEmitter<T2000Events> {
83
83
  address: string;
84
84
  sponsored: boolean;
85
85
  }>;
86
- /** SuiClient used by this agent — exposed for x402 and other integrations. */
87
- get suiClient(): SuiClient;
86
+ /** SuiJsonRpcClient used by this agent — exposed for x402 and other integrations. */
87
+ get suiClient(): SuiJsonRpcClient;
88
88
  /** Ed25519Keypair used by this agent — exposed for x402 and other integrations. */
89
89
  get signer(): Ed25519Keypair;
90
90
  address(): string;
@@ -235,30 +235,30 @@ interface SimulationResult {
235
235
  rawError: string;
236
236
  };
237
237
  }
238
- declare function simulateTransaction(client: SuiClient, tx: Transaction, sender: string): Promise<SimulationResult>;
238
+ declare function simulateTransaction(client: SuiJsonRpcClient, tx: Transaction, sender: string): Promise<SimulationResult>;
239
239
  declare function throwIfSimulationFailed(sim: SimulationResult): void;
240
240
 
241
- declare function getPoolPrice(client: SuiClient): Promise<number>;
242
- declare function getSwapQuote(client: SuiClient, fromAsset: 'USDC' | 'SUI', toAsset: 'USDC' | 'SUI', amount: number): Promise<{
241
+ declare function getPoolPrice(client: SuiJsonRpcClient): Promise<number>;
242
+ declare function getSwapQuote(client: SuiJsonRpcClient, fromAsset: 'USDC' | 'SUI', toAsset: 'USDC' | 'SUI', amount: number): Promise<{
243
243
  expectedOutput: number;
244
244
  priceImpact: number;
245
245
  poolPrice: number;
246
246
  }>;
247
247
 
248
- declare function getRates(client: SuiClient): Promise<RatesResult>;
248
+ declare function getRates(client: SuiJsonRpcClient): Promise<RatesResult>;
249
249
 
250
250
  declare function listSentinels(): Promise<SentinelAgent[]>;
251
- declare function getSentinelInfo(client: SuiClient, sentinelObjectId: string): Promise<SentinelAgent>;
252
- declare function requestAttack(client: SuiClient, signer: Ed25519Keypair, sentinelObjectId: string, feeMist: bigint): Promise<{
251
+ declare function getSentinelInfo(client: SuiJsonRpcClient, sentinelObjectId: string): Promise<SentinelAgent>;
252
+ declare function requestAttack(client: SuiJsonRpcClient, signer: Ed25519Keypair, sentinelObjectId: string, feeMist: bigint): Promise<{
253
253
  attackObjectId: string;
254
254
  digest: string;
255
255
  }>;
256
256
  declare function submitPrompt(agentId: string, attackObjectId: string, prompt: string): Promise<SentinelVerdict>;
257
- declare function settleAttack(client: SuiClient, signer: Ed25519Keypair, sentinelObjectId: string, attackObjectId: string, prompt: string, verdict: SentinelVerdict): Promise<{
257
+ declare function settleAttack(client: SuiJsonRpcClient, signer: Ed25519Keypair, sentinelObjectId: string, attackObjectId: string, prompt: string, verdict: SentinelVerdict): Promise<{
258
258
  digest: string;
259
259
  success: boolean;
260
260
  }>;
261
- declare function attack(client: SuiClient, signer: Ed25519Keypair, sentinelId: string, prompt: string, feeMist?: bigint): Promise<SentinelAttackResult>;
261
+ declare function attack(client: SuiJsonRpcClient, signer: Ed25519Keypair, sentinelId: string, prompt: string, feeMist?: bigint): Promise<SentinelAttackResult>;
262
262
 
263
263
  interface GasExecutionResult {
264
264
  digest: string;
@@ -273,7 +273,7 @@ interface GasExecutionResult {
273
273
  * 3. Gas Station sponsored (fallback)
274
274
  * 4. Fail with INSUFFICIENT_GAS
275
275
  */
276
- declare function executeWithGas(client: SuiClient, keypair: Ed25519Keypair, buildTx: () => Transaction | Promise<Transaction>): Promise<GasExecutionResult>;
276
+ declare function executeWithGas(client: SuiJsonRpcClient, keypair: Ed25519Keypair, buildTx: () => Transaction | Promise<Transaction>): Promise<GasExecutionResult>;
277
277
 
278
278
  interface AutoTopUpResult {
279
279
  success: boolean;
@@ -281,8 +281,8 @@ interface AutoTopUpResult {
281
281
  usdcSpent: number;
282
282
  suiReceived: number;
283
283
  }
284
- declare function shouldAutoTopUp(client: SuiClient, address: string): Promise<boolean>;
285
- declare function executeAutoTopUp(client: SuiClient, keypair: Ed25519Keypair): Promise<AutoTopUpResult>;
284
+ declare function shouldAutoTopUp(client: SuiJsonRpcClient, address: string): Promise<boolean>;
285
+ declare function executeAutoTopUp(client: SuiJsonRpcClient, keypair: Ed25519Keypair): Promise<AutoTopUpResult>;
286
286
 
287
287
  type GasRequestType = 'bootstrap' | 'auto-topup' | 'fallback';
288
288
  interface GasSponsorResponse {