@rabby-wallet/rabby-api 0.9.13 → 0.9.14-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 +22 -8
- package/dist/index.js +23 -4
- package/dist/types.d.ts +9 -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;
|
|
@@ -481,8 +481,10 @@ export declare class OpenApiService {
|
|
|
481
481
|
log_id: string;
|
|
482
482
|
low_gas_deadline?: number;
|
|
483
483
|
origin?: string;
|
|
484
|
+
sig?: string;
|
|
484
485
|
}) => Promise<{
|
|
485
486
|
req: TxRequest;
|
|
487
|
+
access_token?: string;
|
|
486
488
|
}>;
|
|
487
489
|
getTxRequests: (ids: string | string[]) => Promise<TxRequest[]>;
|
|
488
490
|
getTxRequest: (id: string) => Promise<TxRequest>;
|
|
@@ -872,12 +874,24 @@ export declare class OpenApiService {
|
|
|
872
874
|
sig: string;
|
|
873
875
|
id: string;
|
|
874
876
|
}) => Promise<{
|
|
875
|
-
account:
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
877
|
+
account: GasAccountInfo;
|
|
878
|
+
}>;
|
|
879
|
+
getGasAccountInfoV2: (params: {
|
|
880
|
+
id: string;
|
|
881
|
+
}) => Promise<{
|
|
882
|
+
account: GasAccountInfo;
|
|
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;
|
|
881
895
|
}>;
|
|
882
896
|
loginGasAccount: (params: {
|
|
883
897
|
sig: string;
|
|
@@ -957,7 +971,7 @@ export declare class OpenApiService {
|
|
|
957
971
|
};
|
|
958
972
|
}>;
|
|
959
973
|
checkGasAccountTxs: (p: {
|
|
960
|
-
sig
|
|
974
|
+
sig?: string;
|
|
961
975
|
account_id: string;
|
|
962
976
|
tx_list: Tx[];
|
|
963
977
|
}) => Promise<GasAccountCheckResult>;
|
package/dist/index.js
CHANGED
|
@@ -899,7 +899,10 @@ export class OpenApiService {
|
|
|
899
899
|
return data;
|
|
900
900
|
});
|
|
901
901
|
this.submitTx = (postData) => __awaiter(this, void 0, void 0, function* () {
|
|
902
|
-
const {
|
|
902
|
+
const { sig } = postData, rest = __rest(postData, ["sig"]);
|
|
903
|
+
const { data } = yield this.request.post('/v1/wallet/submit_tx', Object.assign({}, rest), {
|
|
904
|
+
headers: sig ? { sig } : undefined,
|
|
905
|
+
});
|
|
903
906
|
return data;
|
|
904
907
|
});
|
|
905
908
|
this.getTxRequests = (ids) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -1245,6 +1248,20 @@ export class OpenApiService {
|
|
|
1245
1248
|
});
|
|
1246
1249
|
return data;
|
|
1247
1250
|
});
|
|
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
|
+
});
|
|
1248
1265
|
this.loginGasAccount = (params) => __awaiter(this, void 0, void 0, function* () {
|
|
1249
1266
|
const { sig } = params, others = __rest(params, ["sig"]);
|
|
1250
1267
|
const { data } = yield this.request.post('/v1/gas_account/login', Object.assign({}, others), {
|
|
@@ -1312,9 +1329,11 @@ export class OpenApiService {
|
|
|
1312
1329
|
this.checkGasAccountTxs = (p) => __awaiter(this, void 0, void 0, function* () {
|
|
1313
1330
|
const { sig } = p, params = __rest(p, ["sig"]);
|
|
1314
1331
|
const { data } = yield this.request.post('/v1/gas_account/check_txs', params, {
|
|
1315
|
-
headers:
|
|
1316
|
-
|
|
1317
|
-
|
|
1332
|
+
headers: sig
|
|
1333
|
+
? {
|
|
1334
|
+
sig,
|
|
1335
|
+
}
|
|
1336
|
+
: undefined,
|
|
1318
1337
|
});
|
|
1319
1338
|
return data;
|
|
1320
1339
|
});
|
package/dist/types.d.ts
CHANGED
|
@@ -1447,4 +1447,13 @@ 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
|
+
}
|
|
1450
1459
|
export {};
|