@rabby-wallet/rabby-api 0.9.10 → 0.9.12-alpha.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 +26 -1
- package/dist/index.js +25 -4
- package/dist/types.d.ts +4 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -117,6 +117,7 @@ export declare class OpenApiService {
|
|
|
117
117
|
getAllTxHistory: (params: {
|
|
118
118
|
id: string;
|
|
119
119
|
start_time?: number;
|
|
120
|
+
page_count?: number;
|
|
120
121
|
}, options?: Parameters<typeof this.asyncJob>[1]) => Promise<TxAllHistoryResult>;
|
|
121
122
|
tokenPrice: (tokenName: string) => Promise<{
|
|
122
123
|
change_percent: number;
|
|
@@ -229,6 +230,11 @@ export declare class OpenApiService {
|
|
|
229
230
|
start: string;
|
|
230
231
|
limit: string;
|
|
231
232
|
}) => Promise<SwapTradeList>;
|
|
233
|
+
getSwapTradeListV2: (params: {
|
|
234
|
+
user_addr: string;
|
|
235
|
+
limit: number;
|
|
236
|
+
start_time?: number;
|
|
237
|
+
}) => Promise<SwapTradeList>;
|
|
232
238
|
postSwap: (params: {
|
|
233
239
|
quote: {
|
|
234
240
|
pay_token_id: string;
|
|
@@ -475,6 +481,7 @@ export declare class OpenApiService {
|
|
|
475
481
|
log_id: string;
|
|
476
482
|
low_gas_deadline?: number;
|
|
477
483
|
origin?: string;
|
|
484
|
+
sig?: string;
|
|
478
485
|
}) => Promise<{
|
|
479
486
|
req: TxRequest;
|
|
480
487
|
}>;
|
|
@@ -873,6 +880,24 @@ export declare class OpenApiService {
|
|
|
873
880
|
nonce: number;
|
|
874
881
|
};
|
|
875
882
|
}>;
|
|
883
|
+
getGasAccountInfoV2: (params: {
|
|
884
|
+
id: string;
|
|
885
|
+
}) => Promise<{
|
|
886
|
+
account: {
|
|
887
|
+
id: string;
|
|
888
|
+
balance: number;
|
|
889
|
+
create_at: number;
|
|
890
|
+
nonce: number;
|
|
891
|
+
};
|
|
892
|
+
}>;
|
|
893
|
+
confirmIapOrder: (postData: {
|
|
894
|
+
user_id: string;
|
|
895
|
+
transaction_id: string;
|
|
896
|
+
device_type: 'android' | 'ios';
|
|
897
|
+
product_id: string;
|
|
898
|
+
}) => Promise<{
|
|
899
|
+
req: TxRequest;
|
|
900
|
+
}>;
|
|
876
901
|
loginGasAccount: (params: {
|
|
877
902
|
sig: string;
|
|
878
903
|
account_id: string;
|
|
@@ -951,7 +976,7 @@ export declare class OpenApiService {
|
|
|
951
976
|
};
|
|
952
977
|
}>;
|
|
953
978
|
checkGasAccountTxs: (p: {
|
|
954
|
-
sig
|
|
979
|
+
sig?: string;
|
|
955
980
|
account_id: string;
|
|
956
981
|
tx_list: Tx[];
|
|
957
982
|
}) => Promise<GasAccountCheckResult>;
|
package/dist/index.js
CHANGED
|
@@ -570,6 +570,12 @@ export class OpenApiService {
|
|
|
570
570
|
});
|
|
571
571
|
return data;
|
|
572
572
|
});
|
|
573
|
+
this.getSwapTradeListV2 = (params) => __awaiter(this, void 0, void 0, function* () {
|
|
574
|
+
const { data } = yield this.request.get('/v2/wallet/swap_trade_list', {
|
|
575
|
+
params,
|
|
576
|
+
});
|
|
577
|
+
return data;
|
|
578
|
+
});
|
|
573
579
|
this.postSwap = (params) => __awaiter(this, void 0, void 0, function* () {
|
|
574
580
|
const { data } = yield this.request.post('/v1/wallet/swap_trade', params);
|
|
575
581
|
return data;
|
|
@@ -893,7 +899,10 @@ export class OpenApiService {
|
|
|
893
899
|
return data;
|
|
894
900
|
});
|
|
895
901
|
this.submitTx = (postData) => __awaiter(this, void 0, void 0, function* () {
|
|
896
|
-
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
|
+
});
|
|
897
906
|
return data;
|
|
898
907
|
});
|
|
899
908
|
this.getTxRequests = (ids) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -1239,6 +1248,16 @@ export class OpenApiService {
|
|
|
1239
1248
|
});
|
|
1240
1249
|
return data;
|
|
1241
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.confirmIapOrder = (postData) => __awaiter(this, void 0, void 0, function* () {
|
|
1258
|
+
const { data } = yield this.request.post('/v1/gas_account/confirm_iap_order', postData);
|
|
1259
|
+
return data;
|
|
1260
|
+
});
|
|
1242
1261
|
this.loginGasAccount = (params) => __awaiter(this, void 0, void 0, function* () {
|
|
1243
1262
|
const { sig } = params, others = __rest(params, ["sig"]);
|
|
1244
1263
|
const { data } = yield this.request.post('/v1/gas_account/login', Object.assign({}, others), {
|
|
@@ -1306,9 +1325,11 @@ export class OpenApiService {
|
|
|
1306
1325
|
this.checkGasAccountTxs = (p) => __awaiter(this, void 0, void 0, function* () {
|
|
1307
1326
|
const { sig } = p, params = __rest(p, ["sig"]);
|
|
1308
1327
|
const { data } = yield this.request.post('/v1/gas_account/check_txs', params, {
|
|
1309
|
-
headers:
|
|
1310
|
-
|
|
1311
|
-
|
|
1328
|
+
headers: sig
|
|
1329
|
+
? {
|
|
1330
|
+
sig,
|
|
1331
|
+
}
|
|
1332
|
+
: undefined,
|
|
1312
1333
|
});
|
|
1313
1334
|
return data;
|
|
1314
1335
|
});
|
package/dist/types.d.ts
CHANGED
|
@@ -265,6 +265,8 @@ export interface NFTItem {
|
|
|
265
265
|
usd_price?: number;
|
|
266
266
|
amount: number;
|
|
267
267
|
collection_id?: string;
|
|
268
|
+
collection_name?: string;
|
|
269
|
+
is_core?: boolean;
|
|
268
270
|
pay_token?: {
|
|
269
271
|
id: string;
|
|
270
272
|
name: string;
|
|
@@ -370,6 +372,7 @@ export interface TxHistoryResult {
|
|
|
370
372
|
}
|
|
371
373
|
export interface TxAllHistoryResult extends Omit<TxHistoryResult, 'token_dict'> {
|
|
372
374
|
token_uuid_dict: Record<string, TokenItem>;
|
|
375
|
+
project_dict: TxHistoryResult['project_dict'];
|
|
373
376
|
}
|
|
374
377
|
export interface GasResult {
|
|
375
378
|
estimated_gas_cost_usd_value: number;
|
|
@@ -1073,6 +1076,7 @@ export interface TxRequest {
|
|
|
1073
1076
|
predict_packed_at?: number;
|
|
1074
1077
|
predict_err_code?: number;
|
|
1075
1078
|
push_at_list?: number[];
|
|
1079
|
+
access_token?: string;
|
|
1076
1080
|
}
|
|
1077
1081
|
export interface MempoolCheckDetail {
|
|
1078
1082
|
id: string;
|