@t2000/sdk 0.19.17 → 0.19.20
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 +4 -4
- package/dist/adapters/index.d.cts +1 -1
- package/dist/adapters/index.d.ts +1 -1
- package/dist/{index-Br3apJsB.d.cts → index-DAxuyiS2.d.cts} +7 -7
- package/dist/{index-Br3apJsB.d.ts → index-DAxuyiS2.d.ts} +7 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -8
- package/dist/index.d.ts +8 -8
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as TransactionSigner, I as
|
|
2
|
-
export { K as AdapterCapability, N as AdapterPositions, O as AdapterTxResult, Q as AssetRates, U as CetusAdapter, V as GasReserve, X as HealthInfo, Y as InvestRebalanceMove, Z as NaviAdapter, _ as PerpsAdapter, $ as PerpsPosition, a0 as
|
|
1
|
+
import { T as TransactionSigner, I as InvestmentRecord, S as StrategyDefinition, A as AutoInvestSchedule, a as AutoInvestStatus, b as T2000Options, P as PayOptions, c as PayResult, d as SendResult, B as BalanceResponse, e as TransactionRecord, D as DepositInfo, L as LendingAdapter, f as SwapAdapter, g as SaveResult, W as WithdrawResult, M as MaxWithdrawResult, h as BorrowResult, R as RepayResult, i as MaxBorrowResult, H as HealthFactorResult, j as SwapResult, k as InvestResult, l as InvestEarnResult, m as InvestRebalanceResult, n as PendingReward, C as ClaimRewardsResult, o as StrategyBuyResult, p as StrategySellResult, q as StrategyRebalanceResult, r as StrategyStatusResult, s as AutoInvestRunResult, t as PortfolioResult, u as InvestmentPosition, v as PositionsResult, w as RatesResult, x as LendingRates, y as RebalanceResult, E as EarningsResult, F as FundStatusResult, z as SentinelAgent, G as SentinelAttackResult, J as GasMethod } from './index-DAxuyiS2.cjs';
|
|
2
|
+
export { K as AdapterCapability, N as AdapterPositions, O as AdapterTxResult, Q as AssetRates, U as CetusAdapter, V as GasReserve, X as HealthInfo, Y as InvestRebalanceMove, Z as NaviAdapter, _ as PerpsAdapter, $ as PerpsPosition, a0 as PerpsPositionsResult, a1 as PerpsTradeResult, a2 as PositionEntry, a3 as PositionSide, a4 as ProtocolDescriptor, a5 as ProtocolRegistry, a6 as RebalanceStep, a7 as SentinelVerdict, a8 as SuilendAdapter, a9 as SwapQuote, aa as allDescriptors, ab as cetusDescriptor, ac as getSentinelInfo, ad as listSentinels, ae as naviDescriptor, af as requestAttack, ag as sentinelAttack, ah as sentinelDescriptor, ai as settleAttack, aj as submitPrompt, ak as suilendDescriptor } from './index-DAxuyiS2.cjs';
|
|
3
3
|
import { EventEmitter } from 'eventemitter3';
|
|
4
4
|
import { SuiJsonRpcClient } from '@mysten/sui/jsonRpc';
|
|
5
5
|
import { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519';
|
|
@@ -267,7 +267,7 @@ interface StoredPosition {
|
|
|
267
267
|
totalAmount: number;
|
|
268
268
|
costBasis: number;
|
|
269
269
|
avgPrice: number;
|
|
270
|
-
trades:
|
|
270
|
+
trades: InvestmentRecord[];
|
|
271
271
|
earning?: boolean;
|
|
272
272
|
earningProtocol?: string;
|
|
273
273
|
earningApy?: number;
|
|
@@ -279,8 +279,8 @@ declare class PortfolioManager {
|
|
|
279
279
|
constructor(configDir?: string);
|
|
280
280
|
private load;
|
|
281
281
|
private save;
|
|
282
|
-
recordBuy(trade:
|
|
283
|
-
recordSell(trade:
|
|
282
|
+
recordBuy(trade: InvestmentRecord): void;
|
|
283
|
+
recordSell(trade: InvestmentRecord): number;
|
|
284
284
|
getPosition(asset: string): StoredPosition | undefined;
|
|
285
285
|
getPositions(): Array<{
|
|
286
286
|
asset: string;
|
|
@@ -293,8 +293,8 @@ declare class PortfolioManager {
|
|
|
293
293
|
closePosition(asset: string): void;
|
|
294
294
|
isEarning(asset: string): boolean;
|
|
295
295
|
getRealizedPnL(): number;
|
|
296
|
-
recordStrategyBuy(strategyKey: string, trade:
|
|
297
|
-
recordStrategySell(strategyKey: string, trade:
|
|
296
|
+
recordStrategyBuy(strategyKey: string, trade: InvestmentRecord): void;
|
|
297
|
+
recordStrategySell(strategyKey: string, trade: InvestmentRecord): number;
|
|
298
298
|
getStrategyPositions(strategyKey: string): Array<{
|
|
299
299
|
asset: string;
|
|
300
300
|
} & StoredPosition>;
|
|
@@ -738,4 +738,4 @@ interface GasStatusResponse {
|
|
|
738
738
|
}
|
|
739
739
|
declare function getGasStatus(address?: string): Promise<GasStatusResponse>;
|
|
740
740
|
|
|
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,
|
|
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, SENTINEL, STABLE_ASSETS, SUI_DECIMALS, SUPPORTED_ASSETS, type SafeguardConfig, SafeguardEnforcer, SafeguardError, type SafeguardErrorDetails, type SafeguardRule, SaveResult, SendResult, SentinelAgent, SentinelAttackResult, type SimulationResult, type StableAsset, StrategyBuyResult, StrategyDefinition, StrategyManager, StrategyRebalanceResult, StrategySellResult, StrategyStatusResult, type SupportedAsset, SwapAdapter, SwapResult, T2000, T2000Error, type T2000ErrorCode, type T2000ErrorData, T2000Options, TransactionRecord, 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,5 +1,5 @@
|
|
|
1
|
-
import { T as TransactionSigner, I as
|
|
2
|
-
export { K as AdapterCapability, N as AdapterPositions, O as AdapterTxResult, Q as AssetRates, U as CetusAdapter, V as GasReserve, X as HealthInfo, Y as InvestRebalanceMove, Z as NaviAdapter, _ as PerpsAdapter, $ as PerpsPosition, a0 as
|
|
1
|
+
import { T as TransactionSigner, I as InvestmentRecord, S as StrategyDefinition, A as AutoInvestSchedule, a as AutoInvestStatus, b as T2000Options, P as PayOptions, c as PayResult, d as SendResult, B as BalanceResponse, e as TransactionRecord, D as DepositInfo, L as LendingAdapter, f as SwapAdapter, g as SaveResult, W as WithdrawResult, M as MaxWithdrawResult, h as BorrowResult, R as RepayResult, i as MaxBorrowResult, H as HealthFactorResult, j as SwapResult, k as InvestResult, l as InvestEarnResult, m as InvestRebalanceResult, n as PendingReward, C as ClaimRewardsResult, o as StrategyBuyResult, p as StrategySellResult, q as StrategyRebalanceResult, r as StrategyStatusResult, s as AutoInvestRunResult, t as PortfolioResult, u as InvestmentPosition, v as PositionsResult, w as RatesResult, x as LendingRates, y as RebalanceResult, E as EarningsResult, F as FundStatusResult, z as SentinelAgent, G as SentinelAttackResult, J as GasMethod } from './index-DAxuyiS2.js';
|
|
2
|
+
export { K as AdapterCapability, N as AdapterPositions, O as AdapterTxResult, Q as AssetRates, U as CetusAdapter, V as GasReserve, X as HealthInfo, Y as InvestRebalanceMove, Z as NaviAdapter, _ as PerpsAdapter, $ as PerpsPosition, a0 as PerpsPositionsResult, a1 as PerpsTradeResult, a2 as PositionEntry, a3 as PositionSide, a4 as ProtocolDescriptor, a5 as ProtocolRegistry, a6 as RebalanceStep, a7 as SentinelVerdict, a8 as SuilendAdapter, a9 as SwapQuote, aa as allDescriptors, ab as cetusDescriptor, ac as getSentinelInfo, ad as listSentinels, ae as naviDescriptor, af as requestAttack, ag as sentinelAttack, ah as sentinelDescriptor, ai as settleAttack, aj as submitPrompt, ak as suilendDescriptor } from './index-DAxuyiS2.js';
|
|
3
3
|
import { EventEmitter } from 'eventemitter3';
|
|
4
4
|
import { SuiJsonRpcClient } from '@mysten/sui/jsonRpc';
|
|
5
5
|
import { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519';
|
|
@@ -267,7 +267,7 @@ interface StoredPosition {
|
|
|
267
267
|
totalAmount: number;
|
|
268
268
|
costBasis: number;
|
|
269
269
|
avgPrice: number;
|
|
270
|
-
trades:
|
|
270
|
+
trades: InvestmentRecord[];
|
|
271
271
|
earning?: boolean;
|
|
272
272
|
earningProtocol?: string;
|
|
273
273
|
earningApy?: number;
|
|
@@ -279,8 +279,8 @@ declare class PortfolioManager {
|
|
|
279
279
|
constructor(configDir?: string);
|
|
280
280
|
private load;
|
|
281
281
|
private save;
|
|
282
|
-
recordBuy(trade:
|
|
283
|
-
recordSell(trade:
|
|
282
|
+
recordBuy(trade: InvestmentRecord): void;
|
|
283
|
+
recordSell(trade: InvestmentRecord): number;
|
|
284
284
|
getPosition(asset: string): StoredPosition | undefined;
|
|
285
285
|
getPositions(): Array<{
|
|
286
286
|
asset: string;
|
|
@@ -293,8 +293,8 @@ declare class PortfolioManager {
|
|
|
293
293
|
closePosition(asset: string): void;
|
|
294
294
|
isEarning(asset: string): boolean;
|
|
295
295
|
getRealizedPnL(): number;
|
|
296
|
-
recordStrategyBuy(strategyKey: string, trade:
|
|
297
|
-
recordStrategySell(strategyKey: string, trade:
|
|
296
|
+
recordStrategyBuy(strategyKey: string, trade: InvestmentRecord): void;
|
|
297
|
+
recordStrategySell(strategyKey: string, trade: InvestmentRecord): number;
|
|
298
298
|
getStrategyPositions(strategyKey: string): Array<{
|
|
299
299
|
asset: string;
|
|
300
300
|
} & StoredPosition>;
|
|
@@ -738,4 +738,4 @@ interface GasStatusResponse {
|
|
|
738
738
|
}
|
|
739
739
|
declare function getGasStatus(address?: string): Promise<GasStatusResponse>;
|
|
740
740
|
|
|
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,
|
|
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, SENTINEL, STABLE_ASSETS, SUI_DECIMALS, SUPPORTED_ASSETS, type SafeguardConfig, SafeguardEnforcer, SafeguardError, type SafeguardErrorDetails, type SafeguardRule, SaveResult, SendResult, SentinelAgent, SentinelAttackResult, type SimulationResult, type StableAsset, StrategyBuyResult, StrategyDefinition, StrategyManager, StrategyRebalanceResult, StrategySellResult, StrategyStatusResult, type SupportedAsset, SwapAdapter, SwapResult, T2000, T2000Error, type T2000ErrorCode, type T2000ErrorData, T2000Options, TransactionRecord, 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 };
|