@rabby-wallet/rabby-api 0.7.9 → 0.7.10
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 +16 -1
- package/dist/index.js +12 -0
- package/dist/types.d.ts +12 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AxiosAdapter, AxiosRequestConfig } from 'axios';
|
|
2
2
|
import { RateLimitedAxiosInstance } from 'axios-rate-limit';
|
|
3
|
-
import { AddrDescResponse, ApprovalStatus, AssetItem, BasicDappInfo, CEXQuote, Cex, ChainWithPendingCount, Collection, CollectionList, CollectionWithFloorPrice, ComplexProtocol, ContractCredit, ExplainTxResponse, ExplainTypedDataResponse, GasLevel, GetTxResponse, HistoryCurve, LatestExplainTxResponse, MempoolCheckDetail, NFTApprovalResponse, NFTItem, ParseTextResponse, ParseTxResponse, ParseTypedDataResponse, PendingTxItem, Protocol, SecurityCheckResponse, ServerChain, SlippageStatus, Summary, SupportedChain, SwapTradeList, TokenApproval, TokenItem, TotalBalanceResponse, Tx, TxAllHistoryResult, TxHistoryResult, TxPushType, TxRequest, UsedChain } from './types';
|
|
3
|
+
import { AddrDescResponse, ApprovalStatus, AssetItem, BasicDappInfo, CEXQuote, Cex, ChainListItem, ChainWithPendingCount, Collection, CollectionList, CollectionWithFloorPrice, ComplexProtocol, ContractCredit, ExplainTxResponse, ExplainTypedDataResponse, GasLevel, GetTxResponse, HistoryCurve, LatestExplainTxResponse, MempoolCheckDetail, NFTApprovalResponse, NFTItem, ParseTextResponse, ParseTxResponse, ParseTypedDataResponse, PendingTxItem, Protocol, SecurityCheckResponse, ServerChain, SlippageStatus, Summary, SupportedChain, SwapTradeList, TokenApproval, TokenItem, TotalBalanceResponse, Tx, TxAllHistoryResult, TxHistoryResult, TxPushType, TxRequest, UsedChain } from './types';
|
|
4
4
|
import { InitOptions, RabbyApiPlugin } from './plugins/intf';
|
|
5
5
|
interface OpenApiStore {
|
|
6
6
|
host: string;
|
|
@@ -512,6 +512,21 @@ export declare class OpenApiService {
|
|
|
512
512
|
error_code: number;
|
|
513
513
|
}>;
|
|
514
514
|
getSupportedChains: () => Promise<SupportedChain[]>;
|
|
515
|
+
searchChainList: (params?: {
|
|
516
|
+
limit?: number;
|
|
517
|
+
start?: number;
|
|
518
|
+
q?: string;
|
|
519
|
+
}) => Promise<{
|
|
520
|
+
page: {
|
|
521
|
+
start: number;
|
|
522
|
+
limit: number;
|
|
523
|
+
total: number;
|
|
524
|
+
};
|
|
525
|
+
chain_list: ChainListItem[];
|
|
526
|
+
}>;
|
|
527
|
+
getChainListByIds: (params: {
|
|
528
|
+
ids: string;
|
|
529
|
+
}) => Promise<ChainListItem[]>;
|
|
515
530
|
getHistoryCurve: (addr: string) => Promise<HistoryCurve>;
|
|
516
531
|
getHistoryCurveSupportedList: () => Promise<{
|
|
517
532
|
supported_chains: string[];
|
package/dist/index.js
CHANGED
|
@@ -894,6 +894,18 @@ export class OpenApiService {
|
|
|
894
894
|
const { data } = yield this.request.get('/v1/wallet/supported_chains');
|
|
895
895
|
return data;
|
|
896
896
|
});
|
|
897
|
+
this.searchChainList = (params) => __awaiter(this, void 0, void 0, function* () {
|
|
898
|
+
const { data } = yield this.request.get('/v1/chain/total_list', {
|
|
899
|
+
params,
|
|
900
|
+
});
|
|
901
|
+
return data;
|
|
902
|
+
});
|
|
903
|
+
this.getChainListByIds = (params) => __awaiter(this, void 0, void 0, function* () {
|
|
904
|
+
const { data } = yield this.request.get('/v1/chain/get_list', {
|
|
905
|
+
params,
|
|
906
|
+
});
|
|
907
|
+
return data;
|
|
908
|
+
});
|
|
897
909
|
this.getHistoryCurve = (addr) => __awaiter(this, void 0, void 0, function* () {
|
|
898
910
|
const { data } = yield this.request.get('/v1/user/history_curve', {
|
|
899
911
|
params: { id: addr },
|
package/dist/types.d.ts
CHANGED
|
@@ -1148,6 +1148,18 @@ export interface SupportedChain {
|
|
|
1148
1148
|
is_disabled: boolean;
|
|
1149
1149
|
explorer_host: string;
|
|
1150
1150
|
}
|
|
1151
|
+
export interface ChainListItem {
|
|
1152
|
+
chain_id: number;
|
|
1153
|
+
name: string;
|
|
1154
|
+
short_name: string;
|
|
1155
|
+
native_currency: {
|
|
1156
|
+
name: string;
|
|
1157
|
+
symbol: string;
|
|
1158
|
+
decimals: number;
|
|
1159
|
+
};
|
|
1160
|
+
explorer: string | null;
|
|
1161
|
+
rpc: null | string;
|
|
1162
|
+
}
|
|
1151
1163
|
export interface HistoryCurve {
|
|
1152
1164
|
create_at: number;
|
|
1153
1165
|
executor_name: string;
|