@rabby-wallet/rabby-api 0.9.61 → 0.9.63-0
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 +9 -1
- package/dist/index.js +55 -0
- package/dist/types.d.ts +191 -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, GetClientFeedbackMessagesParams, GetClientFeedbackMessagesResponse, GetClientFeedbackUnreadParams, GetClientFeedbackUnreadResponse, PostClientFeedbackMessageParams, PostClientFeedbackMessageResponse, UploadClientFeedbackParams, UploadClientFeedbackResponse, 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: {
|
|
@@ -1281,6 +1285,10 @@ export declare class OpenApiService {
|
|
|
1281
1285
|
}) => Promise<{
|
|
1282
1286
|
success: boolean;
|
|
1283
1287
|
}>;
|
|
1288
|
+
postClientFeedbackMessage: (data: PostClientFeedbackMessageParams) => Promise<PostClientFeedbackMessageResponse>;
|
|
1289
|
+
getClientFeedbackMessages: (params: GetClientFeedbackMessagesParams) => Promise<GetClientFeedbackMessagesResponse>;
|
|
1290
|
+
getClientFeedbackUnread: (params: GetClientFeedbackUnreadParams) => Promise<GetClientFeedbackUnreadResponse>;
|
|
1291
|
+
uploadClientFeedback: (params: UploadClientFeedbackParams) => Promise<UploadClientFeedbackResponse>;
|
|
1284
1292
|
/**
|
|
1285
1293
|
* @deprecated
|
|
1286
1294
|
*/
|
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;
|
|
@@ -1626,6 +1650,37 @@ export class OpenApiService {
|
|
|
1626
1650
|
text,
|
|
1627
1651
|
});
|
|
1628
1652
|
});
|
|
1653
|
+
this.postClientFeedbackMessage = (data) => __awaiter(this, void 0, void 0, function* () {
|
|
1654
|
+
const { data: response } = yield this.request.post('/v1/client_feedback/message', data);
|
|
1655
|
+
return response;
|
|
1656
|
+
});
|
|
1657
|
+
this.getClientFeedbackMessages = (params) => __awaiter(this, void 0, void 0, function* () {
|
|
1658
|
+
const { data } = yield this.request.get('/v1/client_feedback/messages', {
|
|
1659
|
+
params,
|
|
1660
|
+
});
|
|
1661
|
+
return data;
|
|
1662
|
+
});
|
|
1663
|
+
this.getClientFeedbackUnread = (params) => __awaiter(this, void 0, void 0, function* () {
|
|
1664
|
+
const { data } = yield this.request.get('/v1/client_feedback/unread', {
|
|
1665
|
+
params,
|
|
1666
|
+
});
|
|
1667
|
+
return data;
|
|
1668
|
+
});
|
|
1669
|
+
this.uploadClientFeedback = (params) => __awaiter(this, void 0, void 0, function* () {
|
|
1670
|
+
const isFormData = typeof FormData !== 'undefined' && params instanceof FormData;
|
|
1671
|
+
const formData = isFormData ? params : new FormData();
|
|
1672
|
+
if (!isFormData) {
|
|
1673
|
+
const { file, filename } = params;
|
|
1674
|
+
if (filename) {
|
|
1675
|
+
formData.append('file', file, filename);
|
|
1676
|
+
}
|
|
1677
|
+
else {
|
|
1678
|
+
formData.append('file', file);
|
|
1679
|
+
}
|
|
1680
|
+
}
|
|
1681
|
+
const { data } = yield this.request.post('/v1/client_feedback/upload', formData);
|
|
1682
|
+
return data;
|
|
1683
|
+
});
|
|
1629
1684
|
/**
|
|
1630
1685
|
* @deprecated
|
|
1631
1686
|
*/
|
package/dist/types.d.ts
CHANGED
|
@@ -1740,6 +1740,70 @@ export declare type UserFeedbackItem = {
|
|
|
1740
1740
|
comment_at: number | null;
|
|
1741
1741
|
extra?: any | null;
|
|
1742
1742
|
};
|
|
1743
|
+
export declare type ClientFeedbackSource = 'app-ios' | 'app-android' | 'app' | 'extension' | 'desktop' | '';
|
|
1744
|
+
export declare type ClientFeedbackStatus = 'pending' | 'replied' | 'closed';
|
|
1745
|
+
export declare type ClientFeedbackSender = 'user' | 'ops';
|
|
1746
|
+
export declare type ClientFeedbackExtra = Record<string, any>;
|
|
1747
|
+
export interface ClientFeedbackConversation {
|
|
1748
|
+
id: string;
|
|
1749
|
+
source: ClientFeedbackSource;
|
|
1750
|
+
status: ClientFeedbackStatus;
|
|
1751
|
+
last_message_at: number;
|
|
1752
|
+
client_read_at: number | null;
|
|
1753
|
+
comment_user_id: number | null;
|
|
1754
|
+
create_at: number;
|
|
1755
|
+
extra: ClientFeedbackExtra;
|
|
1756
|
+
}
|
|
1757
|
+
export interface ClientFeedbackMessage {
|
|
1758
|
+
id: string;
|
|
1759
|
+
conversation_id: string;
|
|
1760
|
+
sender: ClientFeedbackSender;
|
|
1761
|
+
ops_user_id: number | null;
|
|
1762
|
+
content: string;
|
|
1763
|
+
image_url_list: string[];
|
|
1764
|
+
video_url_list: string[];
|
|
1765
|
+
source: ClientFeedbackSource;
|
|
1766
|
+
create_at: number;
|
|
1767
|
+
}
|
|
1768
|
+
export interface PostClientFeedbackMessageParams {
|
|
1769
|
+
device_id: string;
|
|
1770
|
+
content?: string;
|
|
1771
|
+
image_url_list?: string[];
|
|
1772
|
+
video_url_list?: string[];
|
|
1773
|
+
extra?: ClientFeedbackExtra;
|
|
1774
|
+
}
|
|
1775
|
+
export interface PostClientFeedbackMessageResponse {
|
|
1776
|
+
conversation: ClientFeedbackConversation;
|
|
1777
|
+
message: ClientFeedbackMessage;
|
|
1778
|
+
}
|
|
1779
|
+
export interface GetClientFeedbackMessagesParams {
|
|
1780
|
+
device_id: string;
|
|
1781
|
+
start?: number;
|
|
1782
|
+
limit?: number;
|
|
1783
|
+
}
|
|
1784
|
+
export interface GetClientFeedbackMessagesResponse {
|
|
1785
|
+
conversation: ClientFeedbackConversation | null;
|
|
1786
|
+
messages: ClientFeedbackMessage[];
|
|
1787
|
+
total_count: number;
|
|
1788
|
+
}
|
|
1789
|
+
export interface GetClientFeedbackUnreadParams {
|
|
1790
|
+
device_id: string;
|
|
1791
|
+
}
|
|
1792
|
+
export interface GetClientFeedbackUnreadResponse {
|
|
1793
|
+
unread_count: number;
|
|
1794
|
+
status: ClientFeedbackStatus | null;
|
|
1795
|
+
}
|
|
1796
|
+
export declare type UploadClientFeedbackParams = FormData | {
|
|
1797
|
+
file: Blob;
|
|
1798
|
+
filename?: string;
|
|
1799
|
+
};
|
|
1800
|
+
export declare type UploadClientFeedbackResponse = {
|
|
1801
|
+
image_url: string;
|
|
1802
|
+
video_url?: never;
|
|
1803
|
+
} | {
|
|
1804
|
+
image_url?: never;
|
|
1805
|
+
video_url: string;
|
|
1806
|
+
};
|
|
1743
1807
|
export declare type CurrencyItem = {
|
|
1744
1808
|
symbol: string;
|
|
1745
1809
|
code: string;
|
|
@@ -2714,4 +2778,131 @@ export interface TokenMarketTokenListResponse {
|
|
|
2714
2778
|
next_cursor: string;
|
|
2715
2779
|
};
|
|
2716
2780
|
}
|
|
2781
|
+
export declare type StakingPoolType = 'erc4626' | 'univ2' | 'univ3';
|
|
2782
|
+
export declare type StakingPoolCurveMetric = 'tvl' | 'apr';
|
|
2783
|
+
export interface StakingLink {
|
|
2784
|
+
type: 'website' | 'twitter' | string;
|
|
2785
|
+
name: string;
|
|
2786
|
+
url: string;
|
|
2787
|
+
}
|
|
2788
|
+
export interface StakingProtocol {
|
|
2789
|
+
id: string;
|
|
2790
|
+
name?: string;
|
|
2791
|
+
logo_url?: string;
|
|
2792
|
+
is_holding?: boolean;
|
|
2793
|
+
site_url?: string;
|
|
2794
|
+
twitter_url?: string;
|
|
2795
|
+
about?: {
|
|
2796
|
+
description?: string;
|
|
2797
|
+
links?: StakingLink[];
|
|
2798
|
+
};
|
|
2799
|
+
}
|
|
2800
|
+
export interface StakingToken {
|
|
2801
|
+
id: string;
|
|
2802
|
+
chain_id?: string;
|
|
2803
|
+
chain?: string;
|
|
2804
|
+
symbol: string;
|
|
2805
|
+
logo_url?: string;
|
|
2806
|
+
price?: number;
|
|
2807
|
+
decimals?: number;
|
|
2808
|
+
}
|
|
2809
|
+
export interface StakingTokens {
|
|
2810
|
+
supplys?: StakingToken[];
|
|
2811
|
+
supplies?: StakingToken[];
|
|
2812
|
+
rewards?: StakingToken[];
|
|
2813
|
+
}
|
|
2814
|
+
export interface StakingTag {
|
|
2815
|
+
id?: string;
|
|
2816
|
+
name: string;
|
|
2817
|
+
}
|
|
2818
|
+
export interface StakingActionState {
|
|
2819
|
+
is_supported: boolean;
|
|
2820
|
+
reason?: string;
|
|
2821
|
+
}
|
|
2822
|
+
export interface StakingActions {
|
|
2823
|
+
deposit?: StakingActionState;
|
|
2824
|
+
withdraw?: StakingActionState;
|
|
2825
|
+
claim?: StakingActionState;
|
|
2826
|
+
}
|
|
2827
|
+
export interface StakingPool {
|
|
2828
|
+
id: string;
|
|
2829
|
+
pool_address?: string;
|
|
2830
|
+
chain_id: string;
|
|
2831
|
+
type: StakingPoolType;
|
|
2832
|
+
deployment_id?: string;
|
|
2833
|
+
deploymentId?: string;
|
|
2834
|
+
fee?: number | string;
|
|
2835
|
+
create_at?: number;
|
|
2836
|
+
protocol: StakingProtocol;
|
|
2837
|
+
name?: string;
|
|
2838
|
+
display_name?: string;
|
|
2839
|
+
metric_label?: string;
|
|
2840
|
+
tokens?: StakingTokens;
|
|
2841
|
+
tags?: StakingTag[];
|
|
2842
|
+
tvl?: number | null;
|
|
2843
|
+
apr?: number | null;
|
|
2844
|
+
is_holding?: boolean;
|
|
2845
|
+
user_position_usd_value?: number | null;
|
|
2846
|
+
user_position_indexes?: string[];
|
|
2847
|
+
actions?: StakingActions;
|
|
2848
|
+
}
|
|
2849
|
+
export declare type StakingPoolApi = StakingPool;
|
|
2850
|
+
export interface StakingPoolListParams {
|
|
2851
|
+
q?: string;
|
|
2852
|
+
chain_id?: string;
|
|
2853
|
+
protocol_id?: string;
|
|
2854
|
+
user_addr?: string;
|
|
2855
|
+
holding_only?: boolean;
|
|
2856
|
+
start?: number;
|
|
2857
|
+
limit?: number;
|
|
2858
|
+
order_by?: 'tvl' | string;
|
|
2859
|
+
order?: 'asc' | 'desc' | string;
|
|
2860
|
+
}
|
|
2861
|
+
export interface StakingFilterListParams {
|
|
2862
|
+
user_addr?: string;
|
|
2863
|
+
}
|
|
2864
|
+
export interface StakingPoolParams {
|
|
2865
|
+
pool_id: string;
|
|
2866
|
+
user_addr?: string;
|
|
2867
|
+
}
|
|
2868
|
+
export interface StakingPoolCurveParams {
|
|
2869
|
+
pool_id: string;
|
|
2870
|
+
metric?: StakingPoolCurveMetric;
|
|
2871
|
+
}
|
|
2872
|
+
export interface StakingPoolListResponse {
|
|
2873
|
+
pools?: StakingPool[];
|
|
2874
|
+
list?: StakingPool[];
|
|
2875
|
+
page?: {
|
|
2876
|
+
start?: number;
|
|
2877
|
+
limit?: number;
|
|
2878
|
+
total?: number;
|
|
2879
|
+
};
|
|
2880
|
+
}
|
|
2881
|
+
export declare type StakingPoolListResponseApi = StakingPoolListResponse;
|
|
2882
|
+
export interface StakingFilterItem {
|
|
2883
|
+
id: string;
|
|
2884
|
+
name?: string;
|
|
2885
|
+
logo_url?: string;
|
|
2886
|
+
}
|
|
2887
|
+
export interface StakingFilterListResponse {
|
|
2888
|
+
protocols?: StakingProtocol[];
|
|
2889
|
+
chains?: StakingFilterItem[];
|
|
2890
|
+
}
|
|
2891
|
+
export declare type StakingFilterListResponseApi = StakingFilterListResponse;
|
|
2892
|
+
export interface StakingPoolResponse {
|
|
2893
|
+
pool?: StakingPool;
|
|
2894
|
+
}
|
|
2895
|
+
export declare type StakingPoolDetailResponseApi = StakingPoolResponse;
|
|
2896
|
+
export declare type StakingPoolCurvePoint = [number, number] | {
|
|
2897
|
+
timestamp?: number;
|
|
2898
|
+
time_at?: number;
|
|
2899
|
+
date_at?: number;
|
|
2900
|
+
value?: number;
|
|
2901
|
+
};
|
|
2902
|
+
export declare type StakingPoolCurvePointApi = StakingPoolCurvePoint;
|
|
2903
|
+
export declare type StakingPoolCurveResponse = StakingPoolCurvePoint[] | {
|
|
2904
|
+
list?: StakingPoolCurvePoint[];
|
|
2905
|
+
data?: StakingPoolCurvePoint[];
|
|
2906
|
+
};
|
|
2907
|
+
export declare type StakingPoolCurveResponseApi = StakingPoolCurveResponse;
|
|
2717
2908
|
export {};
|