@rabby-wallet/rabby-api 0.9.25 → 0.9.26-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 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, GasAccountInfo, TokenEntityDetail, TokenItemWithEntity, ProjectItem, CopyTradeTokenListResponse, CopyTradeRecentBuyListResponse, CopyTradePnlListResponse } 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, TokenEntityDetail, TokenItemWithEntity, ProjectItem, CopyTradeTokenListResponse, CopyTradeRecentBuyListResponse, CopyTradePnlListResponse, DefaultRPCRes } from './types';
5
5
  interface OpenApiStore {
6
6
  host: string;
7
7
  testnetHost?: string;
@@ -500,6 +500,35 @@ export declare class OpenApiService {
500
500
  req: TxRequest;
501
501
  access_token?: string;
502
502
  }>;
503
+ submitTxV2: (postData: {
504
+ frontend_push_result?: {
505
+ success: true;
506
+ has_pushed: true;
507
+ raw_tx: string;
508
+ url: string;
509
+ return_tx_id: string;
510
+ } | {
511
+ success: false;
512
+ has_pushed: true;
513
+ url: string;
514
+ error_msg: string;
515
+ };
516
+ backend_push_require: {
517
+ gas_type: 'gas_account' | 'gasless' | null;
518
+ };
519
+ context: {
520
+ tx: Tx;
521
+ origin?: string;
522
+ log_id: string;
523
+ };
524
+ mev_share_model: 'user' | 'rabby';
525
+ sig?: string;
526
+ }) => Promise<{
527
+ tx_id?: string;
528
+ access_token?: string;
529
+ err?: string;
530
+ }>;
531
+ getDefaultRPCs: () => Promise<DefaultRPCRes>;
503
532
  getTxRequests: (ids: string | string[]) => Promise<TxRequest[]>;
504
533
  getTxRequest: (id: string) => Promise<TxRequest>;
505
534
  withdrawTx: (reqId: string) => Promise<{
package/dist/index.js CHANGED
@@ -933,6 +933,17 @@ export class OpenApiService {
933
933
  });
934
934
  return data;
935
935
  });
936
+ this.submitTxV2 = (postData) => __awaiter(this, void 0, void 0, function* () {
937
+ const { sig } = postData, rest = __rest(postData, ["sig"]);
938
+ const { data } = yield this.request.post('/v2/wallet/submit_tx', Object.assign({}, rest), {
939
+ headers: sig ? { sig } : undefined,
940
+ });
941
+ return data;
942
+ });
943
+ this.getDefaultRPCs = () => __awaiter(this, void 0, void 0, function* () {
944
+ const { data } = yield this.request.get('/v1/chainrpc');
945
+ return data;
946
+ });
936
947
  this.getTxRequests = (ids) => __awaiter(this, void 0, void 0, function* () {
937
948
  const { data } = yield this.request.get('/v1/wallet/get_tx_requests', {
938
949
  params: {
package/dist/types.d.ts CHANGED
@@ -1537,4 +1537,14 @@ export interface GasAccountInfo {
1537
1537
  has_iap_order: boolean;
1538
1538
  no_register: boolean;
1539
1539
  }
1540
+ export declare type DefaultRPCRes = {
1541
+ message: string;
1542
+ status: string;
1543
+ stats: RPCDefaultItem[];
1544
+ };
1545
+ declare type RPCDefaultItem = {
1546
+ chainId: string;
1547
+ rpcUrl: string[];
1548
+ txPushToRPC: boolean;
1549
+ };
1540
1550
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rabby-wallet/rabby-api",
3
- "version": "0.9.25",
3
+ "version": "0.9.26-beta.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [