@rabby-wallet/rabby-api 0.9.14-0 → 0.9.14-beta.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 +11 -22
- package/dist/index.js +14 -23
- package/dist/types.d.ts +0 -9
- 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, ContractInfo, GasAccountCheckResult, ParseCommonResponse, WithdrawListAddressItem, BuyCountryItem, BuyQuoteItem, BuyHistoryList, BuyPaymentMethod
|
|
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, GasAccountCheckResult, ParseCommonResponse, WithdrawListAddressItem, BuyCountryItem, BuyQuoteItem, BuyHistoryList, BuyPaymentMethod } from './types';
|
|
5
5
|
interface OpenApiStore {
|
|
6
6
|
host: string;
|
|
7
7
|
testnetHost?: string;
|
|
@@ -349,6 +349,9 @@ export declare class OpenApiService {
|
|
|
349
349
|
hasTransfer: (chainId: string, from: string, to: string) => Promise<{
|
|
350
350
|
has_transfer: boolean;
|
|
351
351
|
}>;
|
|
352
|
+
hasTransferAllChain: (from: string, to: string) => Promise<{
|
|
353
|
+
has_transfer: boolean;
|
|
354
|
+
}>;
|
|
352
355
|
isTokenContract: (chainId: string, id: string) => Promise<{
|
|
353
356
|
is_token: boolean;
|
|
354
357
|
}>;
|
|
@@ -481,10 +484,8 @@ export declare class OpenApiService {
|
|
|
481
484
|
log_id: string;
|
|
482
485
|
low_gas_deadline?: number;
|
|
483
486
|
origin?: string;
|
|
484
|
-
sig?: string;
|
|
485
487
|
}) => Promise<{
|
|
486
488
|
req: TxRequest;
|
|
487
|
-
access_token?: string;
|
|
488
489
|
}>;
|
|
489
490
|
getTxRequests: (ids: string | string[]) => Promise<TxRequest[]>;
|
|
490
491
|
getTxRequest: (id: string) => Promise<TxRequest>;
|
|
@@ -874,24 +875,12 @@ export declare class OpenApiService {
|
|
|
874
875
|
sig: string;
|
|
875
876
|
id: string;
|
|
876
877
|
}) => Promise<{
|
|
877
|
-
account:
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
}>;
|
|
884
|
-
createGasAccountPayInfo: (postData: {
|
|
885
|
-
id: string;
|
|
886
|
-
}) => Promise<{
|
|
887
|
-
account: GasAccountInfo;
|
|
888
|
-
}>;
|
|
889
|
-
confirmIapOrder: (postData: {
|
|
890
|
-
transaction_id: string;
|
|
891
|
-
device_type: 'android' | 'ios';
|
|
892
|
-
product_id: string;
|
|
893
|
-
}) => Promise<{
|
|
894
|
-
req: TxRequest;
|
|
878
|
+
account: {
|
|
879
|
+
id: string;
|
|
880
|
+
balance: number;
|
|
881
|
+
create_at: number;
|
|
882
|
+
nonce: number;
|
|
883
|
+
};
|
|
895
884
|
}>;
|
|
896
885
|
loginGasAccount: (params: {
|
|
897
886
|
sig: string;
|
|
@@ -971,7 +960,7 @@ export declare class OpenApiService {
|
|
|
971
960
|
};
|
|
972
961
|
}>;
|
|
973
962
|
checkGasAccountTxs: (p: {
|
|
974
|
-
sig
|
|
963
|
+
sig: string;
|
|
975
964
|
account_id: string;
|
|
976
965
|
tx_list: Tx[];
|
|
977
966
|
}) => Promise<GasAccountCheckResult>;
|
package/dist/index.js
CHANGED
|
@@ -752,6 +752,16 @@ export class OpenApiService {
|
|
|
752
752
|
});
|
|
753
753
|
return data;
|
|
754
754
|
});
|
|
755
|
+
// 全链两个地址是否发生过转账
|
|
756
|
+
this.hasTransferAllChain = (from, to) => __awaiter(this, void 0, void 0, function* () {
|
|
757
|
+
const { data } = yield this.request.get('/v2/engine/addr/has_transfer', {
|
|
758
|
+
params: {
|
|
759
|
+
from_addr: from,
|
|
760
|
+
to_addr: to,
|
|
761
|
+
},
|
|
762
|
+
});
|
|
763
|
+
return data;
|
|
764
|
+
});
|
|
755
765
|
this.isTokenContract = (chainId, id) => __awaiter(this, void 0, void 0, function* () {
|
|
756
766
|
const { data } = yield this.request.get('/v1/engine/contract/is_token', {
|
|
757
767
|
params: {
|
|
@@ -899,10 +909,7 @@ export class OpenApiService {
|
|
|
899
909
|
return data;
|
|
900
910
|
});
|
|
901
911
|
this.submitTx = (postData) => __awaiter(this, void 0, void 0, function* () {
|
|
902
|
-
const {
|
|
903
|
-
const { data } = yield this.request.post('/v1/wallet/submit_tx', Object.assign({}, rest), {
|
|
904
|
-
headers: sig ? { sig } : undefined,
|
|
905
|
-
});
|
|
912
|
+
const { data } = yield this.request.post('/v1/wallet/submit_tx', Object.assign({}, postData));
|
|
906
913
|
return data;
|
|
907
914
|
});
|
|
908
915
|
this.getTxRequests = (ids) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -1248,20 +1255,6 @@ export class OpenApiService {
|
|
|
1248
1255
|
});
|
|
1249
1256
|
return data;
|
|
1250
1257
|
});
|
|
1251
|
-
this.getGasAccountInfoV2 = (params) => __awaiter(this, void 0, void 0, function* () {
|
|
1252
|
-
const { data } = yield this.request.get('/v2/gas_account', {
|
|
1253
|
-
params,
|
|
1254
|
-
});
|
|
1255
|
-
return data;
|
|
1256
|
-
});
|
|
1257
|
-
this.createGasAccountPayInfo = (postData) => __awaiter(this, void 0, void 0, function* () {
|
|
1258
|
-
const { data } = yield this.request.post('/v2/gas_account/pay_info', postData);
|
|
1259
|
-
return data;
|
|
1260
|
-
});
|
|
1261
|
-
this.confirmIapOrder = (postData) => __awaiter(this, void 0, void 0, function* () {
|
|
1262
|
-
const { data } = yield this.request.post('/v1/gas_account/confirm_iap_order', postData);
|
|
1263
|
-
return data;
|
|
1264
|
-
});
|
|
1265
1258
|
this.loginGasAccount = (params) => __awaiter(this, void 0, void 0, function* () {
|
|
1266
1259
|
const { sig } = params, others = __rest(params, ["sig"]);
|
|
1267
1260
|
const { data } = yield this.request.post('/v1/gas_account/login', Object.assign({}, others), {
|
|
@@ -1329,11 +1322,9 @@ export class OpenApiService {
|
|
|
1329
1322
|
this.checkGasAccountTxs = (p) => __awaiter(this, void 0, void 0, function* () {
|
|
1330
1323
|
const { sig } = p, params = __rest(p, ["sig"]);
|
|
1331
1324
|
const { data } = yield this.request.post('/v1/gas_account/check_txs', params, {
|
|
1332
|
-
headers:
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
}
|
|
1336
|
-
: undefined,
|
|
1325
|
+
headers: {
|
|
1326
|
+
sig,
|
|
1327
|
+
},
|
|
1337
1328
|
});
|
|
1338
1329
|
return data;
|
|
1339
1330
|
});
|
package/dist/types.d.ts
CHANGED
|
@@ -1447,13 +1447,4 @@ export interface BuyPaymentMethod {
|
|
|
1447
1447
|
type: string;
|
|
1448
1448
|
logo_url: string;
|
|
1449
1449
|
}
|
|
1450
|
-
export interface GasAccountInfo {
|
|
1451
|
-
id: string;
|
|
1452
|
-
balance: number;
|
|
1453
|
-
create_at: number;
|
|
1454
|
-
nonce: number;
|
|
1455
|
-
uuid: string;
|
|
1456
|
-
has_iap_order: boolean;
|
|
1457
|
-
no_register: boolean;
|
|
1458
|
-
}
|
|
1459
1450
|
export {};
|