@pyxisjs/core 0.2.7 → 0.3.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/LICENSE +1 -1
- package/dist/index.d.mts +62 -46
- package/dist/index.d.ts +62 -46
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/LICENSE
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -484,6 +484,67 @@ interface ApyDataPoint {
|
|
|
484
484
|
/** The timestamp in seconds */
|
|
485
485
|
timestamp: string;
|
|
486
486
|
}
|
|
487
|
+
/**
|
|
488
|
+
* Token transfer information for manage operations
|
|
489
|
+
*/
|
|
490
|
+
interface TokenTransfer {
|
|
491
|
+
/** Token address */
|
|
492
|
+
token_address: string;
|
|
493
|
+
/** Amount transferred (in token's smallest unit) */
|
|
494
|
+
amount: string;
|
|
495
|
+
}
|
|
496
|
+
/**
|
|
497
|
+
* Arguments for querying vault manage operations
|
|
498
|
+
*/
|
|
499
|
+
interface GetManageOperationsArgs {
|
|
500
|
+
/** The vault ID to filter operations by */
|
|
501
|
+
vaultId: string;
|
|
502
|
+
/** Start time for the query range (Unix timestamp in seconds) */
|
|
503
|
+
startTime: number;
|
|
504
|
+
/** End time for the query range (Unix timestamp in seconds) */
|
|
505
|
+
endTime: number;
|
|
506
|
+
/** Maximum number of operations to return */
|
|
507
|
+
limit?: number;
|
|
508
|
+
}
|
|
509
|
+
/**
|
|
510
|
+
* A vault manage operation representing a protocol interaction
|
|
511
|
+
*/
|
|
512
|
+
interface ManageOperation {
|
|
513
|
+
/** Unique identifier: "{tx_hash}:{log_index}" */
|
|
514
|
+
id: string;
|
|
515
|
+
/** Vault identifier */
|
|
516
|
+
vault_id: string;
|
|
517
|
+
/** Chain code (e.g., "arbitrum", "ethereum", "aptos") */
|
|
518
|
+
chain_code: string;
|
|
519
|
+
/** Protocol name (e.g., "aave", "uniswap", "erc20") */
|
|
520
|
+
protocol: string;
|
|
521
|
+
/** Operation type (e.g., "aave_supply", "erc20_approve", "uniswap_swap") */
|
|
522
|
+
operation: string;
|
|
523
|
+
/** Transaction hash */
|
|
524
|
+
tx_hash: string;
|
|
525
|
+
/** Event timestamp (Unix timestamp in seconds) */
|
|
526
|
+
event_timestamp: number;
|
|
527
|
+
/** Tokens transferred into the protocol */
|
|
528
|
+
tokens_in: TokenTransfer[];
|
|
529
|
+
/** Tokens transferred out of the protocol */
|
|
530
|
+
tokens_out: TokenTransfer[];
|
|
531
|
+
}
|
|
532
|
+
/**
|
|
533
|
+
* Response from manage operations API
|
|
534
|
+
*/
|
|
535
|
+
interface ManageOperationsResponse {
|
|
536
|
+
/** Response code (0 = success) */
|
|
537
|
+
code: number;
|
|
538
|
+
/** Response message */
|
|
539
|
+
message: string;
|
|
540
|
+
/** Response data */
|
|
541
|
+
data: {
|
|
542
|
+
/** List of manage operations */
|
|
543
|
+
items: ManageOperation[];
|
|
544
|
+
};
|
|
545
|
+
/** Request tracking ID */
|
|
546
|
+
request_id: string;
|
|
547
|
+
}
|
|
487
548
|
interface MultiChainVaultAPI {
|
|
488
549
|
quoteDeposit(args: QuoteDepositArgs): Promise<string>;
|
|
489
550
|
quoteWithdraw(args: QuoteWithdrawArgs): Promise<string>;
|
|
@@ -704,51 +765,6 @@ declare abstract class BaseChainAdapter<TClient> {
|
|
|
704
765
|
abstract queryIndexer<T extends {}>(params: QueryIndexerParams): Promise<T>;
|
|
705
766
|
}
|
|
706
767
|
|
|
707
|
-
/**
|
|
708
|
-
* Base interface for analytics client implementations
|
|
709
|
-
* Chain-specific analytics clients should implement this interface
|
|
710
|
-
*/
|
|
711
|
-
|
|
712
|
-
/**
|
|
713
|
-
* Base interface defining the analytics API contract
|
|
714
|
-
* All chain-specific analytics clients must implement this interface
|
|
715
|
-
*/
|
|
716
|
-
interface BaseAnalyticsClient {
|
|
717
|
-
/**
|
|
718
|
-
* Get vault activities with pagination
|
|
719
|
-
* @param args - Arguments for filtering and pagination
|
|
720
|
-
* @returns Promise with activities array and total count
|
|
721
|
-
*/
|
|
722
|
-
getActivities(args: GetActivitiesArgs): Promise<{
|
|
723
|
-
activities: VaultActivity[];
|
|
724
|
-
total: number;
|
|
725
|
-
}>;
|
|
726
|
-
/**
|
|
727
|
-
* Get total value locked in base asset
|
|
728
|
-
* @param args - Vault and asset information
|
|
729
|
-
* @returns Promise with TVL as string
|
|
730
|
-
*/
|
|
731
|
-
getTvlInBaseAsset(args: VaultTvlArgs): Promise<string>;
|
|
732
|
-
/**
|
|
733
|
-
* Get exchange rate update events within a time range
|
|
734
|
-
* @param args - Vault address and time range
|
|
735
|
-
* @returns Promise with array of exchange rate events
|
|
736
|
-
*/
|
|
737
|
-
getUpdateExchangeRateEvents(args: HistoricalApyArgs): Promise<ExchangeRateEvent[]>;
|
|
738
|
-
/**
|
|
739
|
-
* Get 30-day APY for a vault
|
|
740
|
-
* @param vault - Vault address
|
|
741
|
-
* @returns Promise with APY as string percentage
|
|
742
|
-
*/
|
|
743
|
-
get30DayApy(vault: string): Promise<string>;
|
|
744
|
-
/**
|
|
745
|
-
* Get historical APY data points
|
|
746
|
-
* @param args - Vault, time range, and optional window
|
|
747
|
-
* @returns Promise with array of APY data points
|
|
748
|
-
*/
|
|
749
|
-
getHistoricalApy(args: HistoricalApyArgs): Promise<ApyDataPoint[]>;
|
|
750
|
-
}
|
|
751
|
-
|
|
752
768
|
/**
|
|
753
769
|
* Base API interfaces
|
|
754
770
|
*/
|
|
@@ -915,4 +931,4 @@ declare namespace index {
|
|
|
915
931
|
export { index_FLAG_BITS as FLAG_BITS, type index_FlagBitKey as FlagBitKey, index_SamplingStrategy as SamplingStrategy, index_amountWithSlippage as amountWithSlippage, index_buildRequestFlags as buildRequestFlags, index_calculateApy as calculateApy, index_calculateMinimumReceiveAmount as calculateMinimumReceiveAmount, index_calculateWithdrawalAmount as calculateWithdrawalAmount, index_getActiveFlags as getActiveFlags, index_hasFlag as hasFlag, index_mapIndexerToExchangeRateEvent as mapIndexerToExchangeRateEvent, index_mapIndexerToVaultActivity as mapIndexerToVaultActivity, index_mapOnchainToWithdrawalRequest as mapOnchainToWithdrawalRequest, index_normalizeAddress as normalizeAddress, index_parseRequestFlags as parseRequestFlags, index_sampleEventsByDay as sampleEventsByDay };
|
|
916
932
|
}
|
|
917
933
|
|
|
918
|
-
export { type AnyTransaction, type AptosTransaction, type AptosTransactionPayload, type ApyDataPoint, type ApyWindow, type BaseAPI,
|
|
934
|
+
export { type AnyTransaction, type AptosTransaction, type AptosTransactionPayload, type ApyDataPoint, type ApyWindow, type BaseAPI, BaseChainAdapter, type BaseTransaction, BridgeMethod, type BridgeQuoteResponse, type BuildBridgeTxArgs, type BuildCancelWithdrawalRequestTxArgs, type BuildDepositTxArgs, type BuildReclaimWithdrawalRequestTxArgs, type BuildWithdrawTxArgs, CHAIN_CONFIGS, type Chain, type ChainConfig, ChainId, ChainType, ConfigError, ContractError, type Currency, ESTIMATED_BRIDGE_TIME, ErrorCodes, type EthereumContractCall, type EthereumTokenApprove, type EthereumTransaction, type EthereumTransactionMetadata, type EventParams, type ExchangeRateEvent, type GetActivitiesArgs, type GetDepositRateInQuoteSafeArgs, type GetManageOperationsArgs, type GetMinimumRequestAgeArgs, type GetWithdrawRateInQuoteSafeArgs, type GetWithdrawalRequestsOfUserArgs, type HistoricalApyArgs, type IndexerExchangeRateEvent, type IndexerVaultActivity, InsufficientFundsError, LAYERZERO_ENDPOINT_IDS, type ManageOperation, type ManageOperationsResponse, type MultiChainVaultAPI, NetworkError, NetworkType, PyxisError, type PyxisOnchainWithdrawalRequest, type PyxisRequestFlagState, type PyxisToken, index as PyxisUtils, type PyxisWithdrawalRequest, type QueryIndexerParams, type QuoteBridgeArgs, type QuoteDepositArgs, type QuoteWithdrawArgs, RateLimitError, type SDKConfig, type SignedTransaction, StrategyError, type TokenTransfer, TransactionError, type TransactionPayload, type TransactionResult, type TxParams, ValidationError, type VaultActivity, type VaultContractAddressConfig, VaultError, type VaultTvlArgs, type ViewParams, type WalletAccount, type WalletAdapter, WalletError, createError, getChainConfig, getEstimatedBridgeTime, getLayerZeroEndpointId, getLayerZeroGasLimit };
|
package/dist/index.d.ts
CHANGED
|
@@ -484,6 +484,67 @@ interface ApyDataPoint {
|
|
|
484
484
|
/** The timestamp in seconds */
|
|
485
485
|
timestamp: string;
|
|
486
486
|
}
|
|
487
|
+
/**
|
|
488
|
+
* Token transfer information for manage operations
|
|
489
|
+
*/
|
|
490
|
+
interface TokenTransfer {
|
|
491
|
+
/** Token address */
|
|
492
|
+
token_address: string;
|
|
493
|
+
/** Amount transferred (in token's smallest unit) */
|
|
494
|
+
amount: string;
|
|
495
|
+
}
|
|
496
|
+
/**
|
|
497
|
+
* Arguments for querying vault manage operations
|
|
498
|
+
*/
|
|
499
|
+
interface GetManageOperationsArgs {
|
|
500
|
+
/** The vault ID to filter operations by */
|
|
501
|
+
vaultId: string;
|
|
502
|
+
/** Start time for the query range (Unix timestamp in seconds) */
|
|
503
|
+
startTime: number;
|
|
504
|
+
/** End time for the query range (Unix timestamp in seconds) */
|
|
505
|
+
endTime: number;
|
|
506
|
+
/** Maximum number of operations to return */
|
|
507
|
+
limit?: number;
|
|
508
|
+
}
|
|
509
|
+
/**
|
|
510
|
+
* A vault manage operation representing a protocol interaction
|
|
511
|
+
*/
|
|
512
|
+
interface ManageOperation {
|
|
513
|
+
/** Unique identifier: "{tx_hash}:{log_index}" */
|
|
514
|
+
id: string;
|
|
515
|
+
/** Vault identifier */
|
|
516
|
+
vault_id: string;
|
|
517
|
+
/** Chain code (e.g., "arbitrum", "ethereum", "aptos") */
|
|
518
|
+
chain_code: string;
|
|
519
|
+
/** Protocol name (e.g., "aave", "uniswap", "erc20") */
|
|
520
|
+
protocol: string;
|
|
521
|
+
/** Operation type (e.g., "aave_supply", "erc20_approve", "uniswap_swap") */
|
|
522
|
+
operation: string;
|
|
523
|
+
/** Transaction hash */
|
|
524
|
+
tx_hash: string;
|
|
525
|
+
/** Event timestamp (Unix timestamp in seconds) */
|
|
526
|
+
event_timestamp: number;
|
|
527
|
+
/** Tokens transferred into the protocol */
|
|
528
|
+
tokens_in: TokenTransfer[];
|
|
529
|
+
/** Tokens transferred out of the protocol */
|
|
530
|
+
tokens_out: TokenTransfer[];
|
|
531
|
+
}
|
|
532
|
+
/**
|
|
533
|
+
* Response from manage operations API
|
|
534
|
+
*/
|
|
535
|
+
interface ManageOperationsResponse {
|
|
536
|
+
/** Response code (0 = success) */
|
|
537
|
+
code: number;
|
|
538
|
+
/** Response message */
|
|
539
|
+
message: string;
|
|
540
|
+
/** Response data */
|
|
541
|
+
data: {
|
|
542
|
+
/** List of manage operations */
|
|
543
|
+
items: ManageOperation[];
|
|
544
|
+
};
|
|
545
|
+
/** Request tracking ID */
|
|
546
|
+
request_id: string;
|
|
547
|
+
}
|
|
487
548
|
interface MultiChainVaultAPI {
|
|
488
549
|
quoteDeposit(args: QuoteDepositArgs): Promise<string>;
|
|
489
550
|
quoteWithdraw(args: QuoteWithdrawArgs): Promise<string>;
|
|
@@ -704,51 +765,6 @@ declare abstract class BaseChainAdapter<TClient> {
|
|
|
704
765
|
abstract queryIndexer<T extends {}>(params: QueryIndexerParams): Promise<T>;
|
|
705
766
|
}
|
|
706
767
|
|
|
707
|
-
/**
|
|
708
|
-
* Base interface for analytics client implementations
|
|
709
|
-
* Chain-specific analytics clients should implement this interface
|
|
710
|
-
*/
|
|
711
|
-
|
|
712
|
-
/**
|
|
713
|
-
* Base interface defining the analytics API contract
|
|
714
|
-
* All chain-specific analytics clients must implement this interface
|
|
715
|
-
*/
|
|
716
|
-
interface BaseAnalyticsClient {
|
|
717
|
-
/**
|
|
718
|
-
* Get vault activities with pagination
|
|
719
|
-
* @param args - Arguments for filtering and pagination
|
|
720
|
-
* @returns Promise with activities array and total count
|
|
721
|
-
*/
|
|
722
|
-
getActivities(args: GetActivitiesArgs): Promise<{
|
|
723
|
-
activities: VaultActivity[];
|
|
724
|
-
total: number;
|
|
725
|
-
}>;
|
|
726
|
-
/**
|
|
727
|
-
* Get total value locked in base asset
|
|
728
|
-
* @param args - Vault and asset information
|
|
729
|
-
* @returns Promise with TVL as string
|
|
730
|
-
*/
|
|
731
|
-
getTvlInBaseAsset(args: VaultTvlArgs): Promise<string>;
|
|
732
|
-
/**
|
|
733
|
-
* Get exchange rate update events within a time range
|
|
734
|
-
* @param args - Vault address and time range
|
|
735
|
-
* @returns Promise with array of exchange rate events
|
|
736
|
-
*/
|
|
737
|
-
getUpdateExchangeRateEvents(args: HistoricalApyArgs): Promise<ExchangeRateEvent[]>;
|
|
738
|
-
/**
|
|
739
|
-
* Get 30-day APY for a vault
|
|
740
|
-
* @param vault - Vault address
|
|
741
|
-
* @returns Promise with APY as string percentage
|
|
742
|
-
*/
|
|
743
|
-
get30DayApy(vault: string): Promise<string>;
|
|
744
|
-
/**
|
|
745
|
-
* Get historical APY data points
|
|
746
|
-
* @param args - Vault, time range, and optional window
|
|
747
|
-
* @returns Promise with array of APY data points
|
|
748
|
-
*/
|
|
749
|
-
getHistoricalApy(args: HistoricalApyArgs): Promise<ApyDataPoint[]>;
|
|
750
|
-
}
|
|
751
|
-
|
|
752
768
|
/**
|
|
753
769
|
* Base API interfaces
|
|
754
770
|
*/
|
|
@@ -915,4 +931,4 @@ declare namespace index {
|
|
|
915
931
|
export { index_FLAG_BITS as FLAG_BITS, type index_FlagBitKey as FlagBitKey, index_SamplingStrategy as SamplingStrategy, index_amountWithSlippage as amountWithSlippage, index_buildRequestFlags as buildRequestFlags, index_calculateApy as calculateApy, index_calculateMinimumReceiveAmount as calculateMinimumReceiveAmount, index_calculateWithdrawalAmount as calculateWithdrawalAmount, index_getActiveFlags as getActiveFlags, index_hasFlag as hasFlag, index_mapIndexerToExchangeRateEvent as mapIndexerToExchangeRateEvent, index_mapIndexerToVaultActivity as mapIndexerToVaultActivity, index_mapOnchainToWithdrawalRequest as mapOnchainToWithdrawalRequest, index_normalizeAddress as normalizeAddress, index_parseRequestFlags as parseRequestFlags, index_sampleEventsByDay as sampleEventsByDay };
|
|
916
932
|
}
|
|
917
933
|
|
|
918
|
-
export { type AnyTransaction, type AptosTransaction, type AptosTransactionPayload, type ApyDataPoint, type ApyWindow, type BaseAPI,
|
|
934
|
+
export { type AnyTransaction, type AptosTransaction, type AptosTransactionPayload, type ApyDataPoint, type ApyWindow, type BaseAPI, BaseChainAdapter, type BaseTransaction, BridgeMethod, type BridgeQuoteResponse, type BuildBridgeTxArgs, type BuildCancelWithdrawalRequestTxArgs, type BuildDepositTxArgs, type BuildReclaimWithdrawalRequestTxArgs, type BuildWithdrawTxArgs, CHAIN_CONFIGS, type Chain, type ChainConfig, ChainId, ChainType, ConfigError, ContractError, type Currency, ESTIMATED_BRIDGE_TIME, ErrorCodes, type EthereumContractCall, type EthereumTokenApprove, type EthereumTransaction, type EthereumTransactionMetadata, type EventParams, type ExchangeRateEvent, type GetActivitiesArgs, type GetDepositRateInQuoteSafeArgs, type GetManageOperationsArgs, type GetMinimumRequestAgeArgs, type GetWithdrawRateInQuoteSafeArgs, type GetWithdrawalRequestsOfUserArgs, type HistoricalApyArgs, type IndexerExchangeRateEvent, type IndexerVaultActivity, InsufficientFundsError, LAYERZERO_ENDPOINT_IDS, type ManageOperation, type ManageOperationsResponse, type MultiChainVaultAPI, NetworkError, NetworkType, PyxisError, type PyxisOnchainWithdrawalRequest, type PyxisRequestFlagState, type PyxisToken, index as PyxisUtils, type PyxisWithdrawalRequest, type QueryIndexerParams, type QuoteBridgeArgs, type QuoteDepositArgs, type QuoteWithdrawArgs, RateLimitError, type SDKConfig, type SignedTransaction, StrategyError, type TokenTransfer, TransactionError, type TransactionPayload, type TransactionResult, type TxParams, ValidationError, type VaultActivity, type VaultContractAddressConfig, VaultError, type VaultTvlArgs, type ViewParams, type WalletAccount, type WalletAdapter, WalletError, createError, getChainConfig, getEstimatedBridgeTime, getLayerZeroEndpointId, getLayerZeroGasLimit };
|