@rabby-wallet/rabby-api 0.7.25 → 0.7.26
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 +2 -1
- package/dist/index.js +9 -0
- package/dist/types.d.ts +20 -1
- 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, TotalBalanceResponse, Tx, TxAllHistoryResult, TxHistoryResult, TxPushType, TxRequest, UsedChain, BridgeTokenPair, BridgeQuote, BridgeHistory } 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, TotalBalanceResponse, Tx, TxAllHistoryResult, TxHistoryResult, TxPushType, TxRequest, UsedChain, BridgeTokenPair, BridgeQuote, BridgeHistory, ContractInfo } from './types';
|
|
5
5
|
interface OpenApiStore {
|
|
6
6
|
host: string;
|
|
7
7
|
testnetHost?: string;
|
|
@@ -299,6 +299,7 @@ export declare class OpenApiService {
|
|
|
299
299
|
tokenApproveTrustValue: (id: string, chainId: string) => Promise<{
|
|
300
300
|
usd_value: number;
|
|
301
301
|
}>;
|
|
302
|
+
getContractInfo: (id: string, chainId: string) => Promise<ContractInfo | null>;
|
|
302
303
|
addrDesc: (id: string) => Promise<AddrDescResponse>;
|
|
303
304
|
hasTransfer: (chainId: string, from: string, to: string) => Promise<{
|
|
304
305
|
has_transfer: boolean;
|
package/dist/index.js
CHANGED
|
@@ -663,6 +663,15 @@ export class OpenApiService {
|
|
|
663
663
|
});
|
|
664
664
|
return data;
|
|
665
665
|
});
|
|
666
|
+
this.getContractInfo = (id, chainId) => __awaiter(this, void 0, void 0, function* () {
|
|
667
|
+
const { data } = yield this.request.get('/v1/contract', {
|
|
668
|
+
params: {
|
|
669
|
+
chain_id: chainId,
|
|
670
|
+
id,
|
|
671
|
+
},
|
|
672
|
+
});
|
|
673
|
+
return data.contract;
|
|
674
|
+
});
|
|
666
675
|
// 地址描述
|
|
667
676
|
this.addrDesc = (id) => __awaiter(this, void 0, void 0, function* () {
|
|
668
677
|
const { data } = yield this.request.get('/v1/engine/addr/desc', {
|
package/dist/types.d.ts
CHANGED
|
@@ -796,7 +796,6 @@ export interface Cex {
|
|
|
796
796
|
}
|
|
797
797
|
export interface ContractCredit {
|
|
798
798
|
value: null | number;
|
|
799
|
-
popularity_level: 'very_low' | 'low' | 'medium' | 'high';
|
|
800
799
|
rank_at: number | null;
|
|
801
800
|
}
|
|
802
801
|
export interface ContractDesc {
|
|
@@ -1320,4 +1319,24 @@ export interface DbkBridgeHistoryItem {
|
|
|
1320
1319
|
from_token_amount: number;
|
|
1321
1320
|
from_token_id: string;
|
|
1322
1321
|
}
|
|
1322
|
+
export interface ContractInfo {
|
|
1323
|
+
id: string;
|
|
1324
|
+
credit: ContractCredit;
|
|
1325
|
+
is_token: boolean;
|
|
1326
|
+
token_approval_exposure: number;
|
|
1327
|
+
top_nft_approval_exposure: number;
|
|
1328
|
+
spend_usd_value: number;
|
|
1329
|
+
top_nft_spend_usd_value: number;
|
|
1330
|
+
create_at: number;
|
|
1331
|
+
name: string | null;
|
|
1332
|
+
protocol: {
|
|
1333
|
+
id: string;
|
|
1334
|
+
logo_url: string;
|
|
1335
|
+
name: string;
|
|
1336
|
+
} | null;
|
|
1337
|
+
is_danger: {
|
|
1338
|
+
auto: null | boolean;
|
|
1339
|
+
edit: null | boolean;
|
|
1340
|
+
};
|
|
1341
|
+
}
|
|
1323
1342
|
export {};
|