@rabby-wallet/rabby-api 0.9.61 → 0.9.62
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.ts +5 -1
- package/dist/index.js +24 -0
- package/dist/types.d.ts +127 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AxiosAdapter, AxiosRequestConfig } from 'axios';
|
|
2
2
|
import { RateLimitedAxiosInstance } from 'axios-rate-limit';
|
|
3
3
|
import { InitOptions, RabbyApiPlugin } from './plugins/intf';
|
|
4
|
-
import { AddrDescResponse, BridgeAggregator, ApprovalStatus, AssetItem, BasicDappInfo, CEXQuote, Cex, ChainListItem, ChainWithPendingCount, Collection, CollectionList, CollectionWithFloorPrice, ComplexProtocol, ContractCredit, DbkBridgeHistoryItem, ExplainTxResponse, ExplainTypedDataResponse, GasLevel, GetTxResponse, HistoryCurve, LatestExplainTxResponse, MempoolCheckDetail, NFTApprovalResponse, NFTItem, NodeStatus, NodeStatusDetail, ParseTextResponse, ParseTxResponse, ParseTypedDataResponse, PendingTxItem, Protocol, SecurityCheckResponse, ServerChain, SlippageStatus, Summary, SupportedChain, SwapTradeList, TokenApproval, TokenItem, TokenPriceListResponse, TotalBalanceResponse, Tx, TxAllHistoryResult, TxHistoryResult, TxPushType, TxRequest, UsedChain, BridgeTokenPair, BridgeQuote, BridgeHistory, ContractInfo, GasAccountCheckResult, ParseCommonResponse, WithdrawListAddressItem, BuyCountryItem, BuyQuoteItem, BuyHistoryList, BuyPaymentMethod, GasAccountInfo, GasAccountBridgeSupportTokenList, GasAccountBridgeQuote, GasAccountBridgeCreateResponse, GasAccountRechargeStatus, TokenEntityDetail, TokenItemWithEntity, ProjectItem, CopyTradeTokenListResponse, CopyTradeRecentBuyListResponse, CopyTradePnlListResponse, AppChainListResponse, CopyTradeTokenListV2Response, CopyTradeRecentBuyListV2Response, CopyTradeTokenItemV2, CopyTradeSameToken, DefaultRPCRes, TokenDetailWithPriceCurve, GiftEligibilityItem, UserFeedbackItem, PerpTopToken, KlineDataItem, TokenMarketInfo, TokenHolderInfo, TokenSupplyInfo, MarketSummary, MarketTradingHistoryItem, TokenHolderSummary, TokenHolderItem, CurrencyItem, PerpBridgeQuote, LiquidityPoolItem, LiquidityPoolHistoryItem, NFTDetail, NFTTradingConfig, PrepareAcceptNFTOfferResponse, PrepareListingNFTResponse, CreateListingNFTOfferResponse, NFTListingResponse, MemeListResponse, TokenMarketCategoryListResponse, TokenMarketTokenListResponse, PerpTopTokenV3, PerpTopTokenCategory } from './types';
|
|
4
|
+
import { AddrDescResponse, BridgeAggregator, ApprovalStatus, AssetItem, BasicDappInfo, CEXQuote, Cex, ChainListItem, ChainWithPendingCount, Collection, CollectionList, CollectionWithFloorPrice, ComplexProtocol, ContractCredit, DbkBridgeHistoryItem, ExplainTxResponse, ExplainTypedDataResponse, GasLevel, GetTxResponse, HistoryCurve, LatestExplainTxResponse, MempoolCheckDetail, NFTApprovalResponse, NFTItem, NodeStatus, NodeStatusDetail, ParseTextResponse, ParseTxResponse, ParseTypedDataResponse, PendingTxItem, Protocol, SecurityCheckResponse, ServerChain, SlippageStatus, Summary, SupportedChain, SwapTradeList, TokenApproval, TokenItem, TokenPriceListResponse, TotalBalanceResponse, Tx, TxAllHistoryResult, TxHistoryResult, TxPushType, TxRequest, UsedChain, BridgeTokenPair, BridgeQuote, BridgeHistory, ContractInfo, GasAccountCheckResult, ParseCommonResponse, WithdrawListAddressItem, BuyCountryItem, BuyQuoteItem, BuyHistoryList, BuyPaymentMethod, GasAccountInfo, GasAccountBridgeSupportTokenList, GasAccountBridgeQuote, GasAccountBridgeCreateResponse, GasAccountRechargeStatus, TokenEntityDetail, TokenItemWithEntity, ProjectItem, CopyTradeTokenListResponse, CopyTradeRecentBuyListResponse, CopyTradePnlListResponse, AppChainListResponse, CopyTradeTokenListV2Response, CopyTradeRecentBuyListV2Response, CopyTradeTokenItemV2, CopyTradeSameToken, DefaultRPCRes, TokenDetailWithPriceCurve, GiftEligibilityItem, UserFeedbackItem, PerpTopToken, KlineDataItem, TokenMarketInfo, TokenHolderInfo, TokenSupplyInfo, MarketSummary, MarketTradingHistoryItem, TokenHolderSummary, TokenHolderItem, CurrencyItem, PerpBridgeQuote, LiquidityPoolItem, LiquidityPoolHistoryItem, NFTDetail, NFTTradingConfig, PrepareAcceptNFTOfferResponse, PrepareListingNFTResponse, CreateListingNFTOfferResponse, NFTListingResponse, MemeListResponse, TokenMarketCategoryListResponse, TokenMarketTokenListResponse, PerpTopTokenV3, PerpTopTokenCategory, StakingFilterListParams, StakingFilterListResponse, StakingPoolCurveParams, StakingPoolCurveResponse, StakingPoolListParams, StakingPoolListResponse, StakingPoolParams, StakingPoolResponse } from './types';
|
|
5
5
|
interface OpenApiStore {
|
|
6
6
|
host: string;
|
|
7
7
|
testnetHost?: string;
|
|
@@ -908,6 +908,10 @@ export declare class OpenApiService {
|
|
|
908
908
|
addr: string;
|
|
909
909
|
web3_id: string;
|
|
910
910
|
}>;
|
|
911
|
+
getStakingPoolList: (params: StakingPoolListParams) => Promise<StakingPoolListResponse>;
|
|
912
|
+
getStakingFilterList: (params?: StakingFilterListParams) => Promise<StakingFilterListResponse>;
|
|
913
|
+
getStakingPool: (params: StakingPoolParams) => Promise<StakingPoolResponse>;
|
|
914
|
+
getStakingPoolCurve: (params: StakingPoolCurveParams) => Promise<StakingPoolCurveResponse>;
|
|
911
915
|
getBridgeSupportChain: () => Promise<string[]>;
|
|
912
916
|
getBridgeAggregatorList: () => Promise<BridgeAggregator[]>;
|
|
913
917
|
getBridgePairList: (params: {
|
package/dist/index.js
CHANGED
|
@@ -1296,6 +1296,30 @@ export class OpenApiService {
|
|
|
1296
1296
|
});
|
|
1297
1297
|
return data;
|
|
1298
1298
|
});
|
|
1299
|
+
this.getStakingPoolList = (params) => __awaiter(this, void 0, void 0, function* () {
|
|
1300
|
+
const { data } = yield this.request.get('/v1/staking/pool_list', {
|
|
1301
|
+
params,
|
|
1302
|
+
});
|
|
1303
|
+
return data;
|
|
1304
|
+
});
|
|
1305
|
+
this.getStakingFilterList = (params = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
1306
|
+
const { data } = yield this.request.get('/v1/staking/filter_list', {
|
|
1307
|
+
params,
|
|
1308
|
+
});
|
|
1309
|
+
return data;
|
|
1310
|
+
});
|
|
1311
|
+
this.getStakingPool = (params) => __awaiter(this, void 0, void 0, function* () {
|
|
1312
|
+
const { data } = yield this.request.get('/v1/staking/pool', {
|
|
1313
|
+
params,
|
|
1314
|
+
});
|
|
1315
|
+
return data;
|
|
1316
|
+
});
|
|
1317
|
+
this.getStakingPoolCurve = (params) => __awaiter(this, void 0, void 0, function* () {
|
|
1318
|
+
const { data } = yield this.request.get('/v1/staking/pool_curve', {
|
|
1319
|
+
params,
|
|
1320
|
+
});
|
|
1321
|
+
return data;
|
|
1322
|
+
});
|
|
1299
1323
|
this.getBridgeSupportChain = () => __awaiter(this, void 0, void 0, function* () {
|
|
1300
1324
|
const { data } = yield this.request.get('/v1/bridge/supported_chains');
|
|
1301
1325
|
return data;
|
package/dist/types.d.ts
CHANGED
|
@@ -2714,4 +2714,131 @@ export interface TokenMarketTokenListResponse {
|
|
|
2714
2714
|
next_cursor: string;
|
|
2715
2715
|
};
|
|
2716
2716
|
}
|
|
2717
|
+
export declare type StakingPoolType = 'erc4626' | 'univ2' | 'univ3';
|
|
2718
|
+
export declare type StakingPoolCurveMetric = 'tvl' | 'apr';
|
|
2719
|
+
export interface StakingLink {
|
|
2720
|
+
type: 'website' | 'twitter' | string;
|
|
2721
|
+
name: string;
|
|
2722
|
+
url: string;
|
|
2723
|
+
}
|
|
2724
|
+
export interface StakingProtocol {
|
|
2725
|
+
id: string;
|
|
2726
|
+
name?: string;
|
|
2727
|
+
logo_url?: string;
|
|
2728
|
+
is_holding?: boolean;
|
|
2729
|
+
site_url?: string;
|
|
2730
|
+
twitter_url?: string;
|
|
2731
|
+
about?: {
|
|
2732
|
+
description?: string;
|
|
2733
|
+
links?: StakingLink[];
|
|
2734
|
+
};
|
|
2735
|
+
}
|
|
2736
|
+
export interface StakingToken {
|
|
2737
|
+
id: string;
|
|
2738
|
+
chain_id?: string;
|
|
2739
|
+
chain?: string;
|
|
2740
|
+
symbol: string;
|
|
2741
|
+
logo_url?: string;
|
|
2742
|
+
price?: number;
|
|
2743
|
+
decimals?: number;
|
|
2744
|
+
}
|
|
2745
|
+
export interface StakingTokens {
|
|
2746
|
+
supplys?: StakingToken[];
|
|
2747
|
+
supplies?: StakingToken[];
|
|
2748
|
+
rewards?: StakingToken[];
|
|
2749
|
+
}
|
|
2750
|
+
export interface StakingTag {
|
|
2751
|
+
id?: string;
|
|
2752
|
+
name: string;
|
|
2753
|
+
}
|
|
2754
|
+
export interface StakingActionState {
|
|
2755
|
+
is_supported: boolean;
|
|
2756
|
+
reason?: string;
|
|
2757
|
+
}
|
|
2758
|
+
export interface StakingActions {
|
|
2759
|
+
deposit?: StakingActionState;
|
|
2760
|
+
withdraw?: StakingActionState;
|
|
2761
|
+
claim?: StakingActionState;
|
|
2762
|
+
}
|
|
2763
|
+
export interface StakingPool {
|
|
2764
|
+
id: string;
|
|
2765
|
+
pool_address?: string;
|
|
2766
|
+
chain_id: string;
|
|
2767
|
+
type: StakingPoolType;
|
|
2768
|
+
deployment_id?: string;
|
|
2769
|
+
deploymentId?: string;
|
|
2770
|
+
fee?: number | string;
|
|
2771
|
+
create_at?: number;
|
|
2772
|
+
protocol: StakingProtocol;
|
|
2773
|
+
name?: string;
|
|
2774
|
+
display_name?: string;
|
|
2775
|
+
metric_label?: string;
|
|
2776
|
+
tokens?: StakingTokens;
|
|
2777
|
+
tags?: StakingTag[];
|
|
2778
|
+
tvl?: number | null;
|
|
2779
|
+
apr?: number | null;
|
|
2780
|
+
is_holding?: boolean;
|
|
2781
|
+
user_position_usd_value?: number | null;
|
|
2782
|
+
user_position_indexes?: string[];
|
|
2783
|
+
actions?: StakingActions;
|
|
2784
|
+
}
|
|
2785
|
+
export declare type StakingPoolApi = StakingPool;
|
|
2786
|
+
export interface StakingPoolListParams {
|
|
2787
|
+
q?: string;
|
|
2788
|
+
chain_id?: string;
|
|
2789
|
+
protocol_id?: string;
|
|
2790
|
+
user_addr?: string;
|
|
2791
|
+
holding_only?: boolean;
|
|
2792
|
+
start?: number;
|
|
2793
|
+
limit?: number;
|
|
2794
|
+
order_by?: 'tvl' | string;
|
|
2795
|
+
order?: 'asc' | 'desc' | string;
|
|
2796
|
+
}
|
|
2797
|
+
export interface StakingFilterListParams {
|
|
2798
|
+
user_addr?: string;
|
|
2799
|
+
}
|
|
2800
|
+
export interface StakingPoolParams {
|
|
2801
|
+
pool_id: string;
|
|
2802
|
+
user_addr?: string;
|
|
2803
|
+
}
|
|
2804
|
+
export interface StakingPoolCurveParams {
|
|
2805
|
+
pool_id: string;
|
|
2806
|
+
metric?: StakingPoolCurveMetric;
|
|
2807
|
+
}
|
|
2808
|
+
export interface StakingPoolListResponse {
|
|
2809
|
+
pools?: StakingPool[];
|
|
2810
|
+
list?: StakingPool[];
|
|
2811
|
+
page?: {
|
|
2812
|
+
start?: number;
|
|
2813
|
+
limit?: number;
|
|
2814
|
+
total?: number;
|
|
2815
|
+
};
|
|
2816
|
+
}
|
|
2817
|
+
export declare type StakingPoolListResponseApi = StakingPoolListResponse;
|
|
2818
|
+
export interface StakingFilterItem {
|
|
2819
|
+
id: string;
|
|
2820
|
+
name?: string;
|
|
2821
|
+
logo_url?: string;
|
|
2822
|
+
}
|
|
2823
|
+
export interface StakingFilterListResponse {
|
|
2824
|
+
protocols?: StakingProtocol[];
|
|
2825
|
+
chains?: StakingFilterItem[];
|
|
2826
|
+
}
|
|
2827
|
+
export declare type StakingFilterListResponseApi = StakingFilterListResponse;
|
|
2828
|
+
export interface StakingPoolResponse {
|
|
2829
|
+
pool?: StakingPool;
|
|
2830
|
+
}
|
|
2831
|
+
export declare type StakingPoolDetailResponseApi = StakingPoolResponse;
|
|
2832
|
+
export declare type StakingPoolCurvePoint = [number, number] | {
|
|
2833
|
+
timestamp?: number;
|
|
2834
|
+
time_at?: number;
|
|
2835
|
+
date_at?: number;
|
|
2836
|
+
value?: number;
|
|
2837
|
+
};
|
|
2838
|
+
export declare type StakingPoolCurvePointApi = StakingPoolCurvePoint;
|
|
2839
|
+
export declare type StakingPoolCurveResponse = StakingPoolCurvePoint[] | {
|
|
2840
|
+
list?: StakingPoolCurvePoint[];
|
|
2841
|
+
data?: StakingPoolCurvePoint[];
|
|
2842
|
+
};
|
|
2843
|
+
export declare type StakingPoolCurveResponseApi = StakingPoolCurveResponse;
|
|
2717
2844
|
export {};
|