@rabby-wallet/rabby-api 0.9.14-beta.0 → 0.9.14-beta.1
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 +22 -8
- package/dist/index.js +23 -4
- package/dist/types.d.ts +10 -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, TotalBalanceResponse, Tx, TxAllHistoryResult, TxHistoryResult, TxPushType, TxRequest, UsedChain, BridgeTokenPair, BridgeQuote, BridgeHistory, ContractInfo, GasAccountCheckResult, ParseCommonResponse, WithdrawListAddressItem, BuyCountryItem, BuyQuoteItem, BuyHistoryList, BuyPaymentMethod } 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, GasAccountCheckResult, ParseCommonResponse, WithdrawListAddressItem, BuyCountryItem, BuyQuoteItem, BuyHistoryList, BuyPaymentMethod, GasAccountInfo } from './types';
|
|
5
5
|
interface OpenApiStore {
|
|
6
6
|
host: string;
|
|
7
7
|
testnetHost?: string;
|
|
@@ -484,8 +484,10 @@ export declare class OpenApiService {
|
|
|
484
484
|
log_id: string;
|
|
485
485
|
low_gas_deadline?: number;
|
|
486
486
|
origin?: string;
|
|
487
|
+
sig?: string;
|
|
487
488
|
}) => Promise<{
|
|
488
489
|
req: TxRequest;
|
|
490
|
+
access_token?: string;
|
|
489
491
|
}>;
|
|
490
492
|
getTxRequests: (ids: string | string[]) => Promise<TxRequest[]>;
|
|
491
493
|
getTxRequest: (id: string) => Promise<TxRequest>;
|
|
@@ -875,12 +877,24 @@ export declare class OpenApiService {
|
|
|
875
877
|
sig: string;
|
|
876
878
|
id: string;
|
|
877
879
|
}) => Promise<{
|
|
878
|
-
account:
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
880
|
+
account: GasAccountInfo;
|
|
881
|
+
}>;
|
|
882
|
+
getGasAccountInfoV2: (params: {
|
|
883
|
+
id: string;
|
|
884
|
+
}) => Promise<{
|
|
885
|
+
account: GasAccountInfo;
|
|
886
|
+
}>;
|
|
887
|
+
createGasAccountPayInfo: (postData: {
|
|
888
|
+
id: string;
|
|
889
|
+
}) => Promise<{
|
|
890
|
+
account: GasAccountInfo;
|
|
891
|
+
}>;
|
|
892
|
+
confirmIapOrder: (postData: {
|
|
893
|
+
transaction_id: string;
|
|
894
|
+
device_type: 'android' | 'ios';
|
|
895
|
+
product_id: string;
|
|
896
|
+
}) => Promise<{
|
|
897
|
+
req: TxRequest;
|
|
884
898
|
}>;
|
|
885
899
|
loginGasAccount: (params: {
|
|
886
900
|
sig: string;
|
|
@@ -960,7 +974,7 @@ export declare class OpenApiService {
|
|
|
960
974
|
};
|
|
961
975
|
}>;
|
|
962
976
|
checkGasAccountTxs: (p: {
|
|
963
|
-
sig
|
|
977
|
+
sig?: string;
|
|
964
978
|
account_id: string;
|
|
965
979
|
tx_list: Tx[];
|
|
966
980
|
}) => Promise<GasAccountCheckResult>;
|
package/dist/index.js
CHANGED
|
@@ -909,7 +909,10 @@ export class OpenApiService {
|
|
|
909
909
|
return data;
|
|
910
910
|
});
|
|
911
911
|
this.submitTx = (postData) => __awaiter(this, void 0, void 0, function* () {
|
|
912
|
-
const {
|
|
912
|
+
const { sig } = postData, rest = __rest(postData, ["sig"]);
|
|
913
|
+
const { data } = yield this.request.post('/v1/wallet/submit_tx', Object.assign({}, rest), {
|
|
914
|
+
headers: sig ? { sig } : undefined,
|
|
915
|
+
});
|
|
913
916
|
return data;
|
|
914
917
|
});
|
|
915
918
|
this.getTxRequests = (ids) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -1255,6 +1258,20 @@ export class OpenApiService {
|
|
|
1255
1258
|
});
|
|
1256
1259
|
return data;
|
|
1257
1260
|
});
|
|
1261
|
+
this.getGasAccountInfoV2 = (params) => __awaiter(this, void 0, void 0, function* () {
|
|
1262
|
+
const { data } = yield this.request.get('/v2/gas_account', {
|
|
1263
|
+
params,
|
|
1264
|
+
});
|
|
1265
|
+
return data;
|
|
1266
|
+
});
|
|
1267
|
+
this.createGasAccountPayInfo = (postData) => __awaiter(this, void 0, void 0, function* () {
|
|
1268
|
+
const { data } = yield this.request.post('/v2/gas_account/pay_info', postData);
|
|
1269
|
+
return data;
|
|
1270
|
+
});
|
|
1271
|
+
this.confirmIapOrder = (postData) => __awaiter(this, void 0, void 0, function* () {
|
|
1272
|
+
const { data } = yield this.request.post('/v1/gas_account/confirm_iap_order', postData);
|
|
1273
|
+
return data;
|
|
1274
|
+
});
|
|
1258
1275
|
this.loginGasAccount = (params) => __awaiter(this, void 0, void 0, function* () {
|
|
1259
1276
|
const { sig } = params, others = __rest(params, ["sig"]);
|
|
1260
1277
|
const { data } = yield this.request.post('/v1/gas_account/login', Object.assign({}, others), {
|
|
@@ -1322,9 +1339,11 @@ export class OpenApiService {
|
|
|
1322
1339
|
this.checkGasAccountTxs = (p) => __awaiter(this, void 0, void 0, function* () {
|
|
1323
1340
|
const { sig } = p, params = __rest(p, ["sig"]);
|
|
1324
1341
|
const { data } = yield this.request.post('/v1/gas_account/check_txs', params, {
|
|
1325
|
-
headers:
|
|
1326
|
-
|
|
1327
|
-
|
|
1342
|
+
headers: sig
|
|
1343
|
+
? {
|
|
1344
|
+
sig,
|
|
1345
|
+
}
|
|
1346
|
+
: undefined,
|
|
1328
1347
|
});
|
|
1329
1348
|
return data;
|
|
1330
1349
|
});
|
package/dist/types.d.ts
CHANGED
|
@@ -825,6 +825,7 @@ export interface AddrDescResponse {
|
|
|
825
825
|
born_at: number;
|
|
826
826
|
is_danger: boolean | null;
|
|
827
827
|
is_spam: boolean | null;
|
|
828
|
+
is_scam: boolean | null;
|
|
828
829
|
name: string;
|
|
829
830
|
};
|
|
830
831
|
}
|
|
@@ -1447,4 +1448,13 @@ export interface BuyPaymentMethod {
|
|
|
1447
1448
|
type: string;
|
|
1448
1449
|
logo_url: string;
|
|
1449
1450
|
}
|
|
1451
|
+
export interface GasAccountInfo {
|
|
1452
|
+
id: string;
|
|
1453
|
+
balance: number;
|
|
1454
|
+
create_at: number;
|
|
1455
|
+
nonce: number;
|
|
1456
|
+
uuid: string;
|
|
1457
|
+
has_iap_order: boolean;
|
|
1458
|
+
no_register: boolean;
|
|
1459
|
+
}
|
|
1450
1460
|
export {};
|