@rabby-wallet/rabby-api 0.7.0-alpha.5 → 0.7.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  import { AxiosAdapter, AxiosRequestConfig } from 'axios';
2
2
  import { RateLimitedAxiosInstance } from 'axios-rate-limit';
3
- import { AddrDescResponse, ApprovalStatus, AssetItem, CEXQuote, Cex, ChainWithPendingCount, Collection, CollectionList, CollectionWithFloorPrice, ComplexProtocol, ContractCredit, ExplainTxResponse, ExplainTypedDataResponse, GasLevel, GetTxResponse, LatestExplainTxResponse, MempoolCheckDetail, NFTApprovalResponse, NFTItem, ParseTextResponse, ParseTxResponse, ParseTypedDataResponse, PendingTxItem, Protocol, SecurityCheckResponse, ServerChain, SlippageStatus, Summary, SwapTradeList, TokenApproval, TokenItem, TotalBalanceResponse, Tx, TxAllHistoryResult, TxHistoryResult, TxPushType, TxRequest, UsedChain } from './types';
3
+ import { AddrDescResponse, ApprovalStatus, AssetItem, BasicDappInfo, CEXQuote, Cex, ChainWithPendingCount, Collection, CollectionList, CollectionWithFloorPrice, ComplexProtocol, ContractCredit, ExplainTxResponse, ExplainTypedDataResponse, GasLevel, GetTxResponse, LatestExplainTxResponse, MempoolCheckDetail, NFTApprovalResponse, NFTItem, ParseTextResponse, ParseTxResponse, ParseTypedDataResponse, PendingTxItem, Protocol, SecurityCheckResponse, ServerChain, SlippageStatus, Summary, SwapTradeList, TokenApproval, TokenItem, TotalBalanceResponse, Tx, TxAllHistoryResult, TxHistoryResult, TxPushType, TxRequest, UsedChain } from './types';
4
4
  import { InitOptions, RabbyApiPlugin } from './plugins/intf';
5
5
  interface OpenApiStore {
6
6
  host: string;
@@ -393,5 +393,112 @@ export declare class OpenApiService {
393
393
  is_success: boolean;
394
394
  count: number;
395
395
  }>;
396
+ searchDapp: (params?: {
397
+ q?: string;
398
+ chain_id?: string;
399
+ start?: number;
400
+ limit?: number;
401
+ }) => Promise<{
402
+ page: {
403
+ limit: number;
404
+ start: number;
405
+ total: number;
406
+ };
407
+ dapps: BasicDappInfo[];
408
+ }>;
409
+ getDappsInfo: (params: {
410
+ ids: string[];
411
+ }) => Promise<BasicDappInfo[]>;
412
+ getHotDapps: (params?: {
413
+ limit: number;
414
+ }) => Promise<BasicDappInfo[]>;
415
+ getRabbyClaimText: (params: {
416
+ id: string;
417
+ invite_code?: string;
418
+ }) => Promise<{
419
+ id: string;
420
+ text: string;
421
+ }>;
422
+ getRabbySignatureText: (params: {
423
+ id: string;
424
+ }) => Promise<{
425
+ id: string;
426
+ text: string;
427
+ }>;
428
+ getRabbyPoints: (params: {
429
+ id: string;
430
+ }) => Promise<{
431
+ id: string;
432
+ invite_code?: string;
433
+ logo_url: string;
434
+ logo_thumbnail_url: string;
435
+ web3_id: string;
436
+ claimed_points: number;
437
+ total_claimed_points: number;
438
+ }>;
439
+ checkRabbyPointsInviteCode: (params: {
440
+ code: string;
441
+ }) => Promise<{
442
+ invite_code_exist: boolean;
443
+ }>;
444
+ setRabbyPointsInviteCode: (params: {
445
+ id: string;
446
+ signature: string;
447
+ invite_code: string;
448
+ }) => Promise<{
449
+ code: number;
450
+ }>;
451
+ checkRabbyPointClaimable: (params: {
452
+ id: string;
453
+ }) => Promise<{
454
+ claimable: boolean;
455
+ }>;
456
+ getRabbyPointsSnapshot: (params: {
457
+ id: string;
458
+ }) => Promise<{
459
+ id: string;
460
+ address_balance: number;
461
+ metamask_swap: number;
462
+ rabby_old_user: number;
463
+ rabby_nadge: number;
464
+ rabby_nft: number;
465
+ extra_bouns: number;
466
+ claimed: boolean;
467
+ snapshot_at: number;
468
+ }>;
469
+ claimRabbyPointsSnapshot: (params: {
470
+ id: string;
471
+ signature: string;
472
+ invite_code?: string;
473
+ }) => Promise<{
474
+ error_code: number;
475
+ error_msg?: string;
476
+ }>;
477
+ getRabbyPointsTopUsers: (params: {
478
+ id: string;
479
+ }) => Promise<{
480
+ id: string;
481
+ logo_url: string;
482
+ logo_thumbnail_url: string;
483
+ web3_id: string;
484
+ claimed_points: number;
485
+ }[]>;
486
+ getRabbyPointsList: (params: {
487
+ id: string;
488
+ }) => Promise<{
489
+ id: number;
490
+ title: string;
491
+ description: string;
492
+ start_at: number;
493
+ end_at: number;
494
+ claimable_points: number;
495
+ }[]>;
496
+ claimRabbyPointsById: (params: {
497
+ campaign_id: number;
498
+ user_id: string;
499
+ signature: string;
500
+ }) => Promise<{
501
+ error_code: number;
502
+ }>;
396
503
  }
397
504
  export {};
package/dist/index.js CHANGED
@@ -806,6 +806,75 @@ export class OpenApiService {
806
806
  const { data } = yield this.request.post('/v1/wallet/support_selector', params);
807
807
  return data;
808
808
  });
809
+ this.searchDapp = (params) => __awaiter(this, void 0, void 0, function* () {
810
+ const { data } = yield this.request.get('/v1/dapp/search', { params });
811
+ return data;
812
+ });
813
+ this.getDappsInfo = (params) => __awaiter(this, void 0, void 0, function* () {
814
+ var _s;
815
+ const { data } = yield this.request.get('/v1/dapp/list', {
816
+ params: {
817
+ ids: (_s = params === null || params === void 0 ? void 0 : params.ids) === null || _s === void 0 ? void 0 : _s.join(','),
818
+ },
819
+ });
820
+ return data;
821
+ });
822
+ this.getHotDapps = (params) => __awaiter(this, void 0, void 0, function* () {
823
+ const { data } = yield this.request.get('/v1/dapp/hot_list', { params });
824
+ return data;
825
+ });
826
+ this.getRabbyClaimText = (params) => __awaiter(this, void 0, void 0, function* () {
827
+ const { data } = yield this.request.get('/v1/points/user/claim_text', {
828
+ params,
829
+ });
830
+ return data;
831
+ });
832
+ this.getRabbySignatureText = (params) => __awaiter(this, void 0, void 0, function* () {
833
+ const { data } = yield this.request.get('/v1/points/user/sign_text', {
834
+ params,
835
+ });
836
+ return data;
837
+ });
838
+ this.getRabbyPoints = (params) => __awaiter(this, void 0, void 0, function* () {
839
+ const { data } = yield this.request.get('/v1/points/user', { params });
840
+ return data;
841
+ });
842
+ this.checkRabbyPointsInviteCode = (params) => __awaiter(this, void 0, void 0, function* () {
843
+ const { data } = yield this.request.get('/v1/points/user/invite_code_exist', { params });
844
+ return data;
845
+ });
846
+ this.setRabbyPointsInviteCode = (params) => __awaiter(this, void 0, void 0, function* () {
847
+ const { data } = yield this.request.post('/v1/points/user/invite_code', params);
848
+ return data;
849
+ });
850
+ this.checkRabbyPointClaimable = (params) => __awaiter(this, void 0, void 0, function* () {
851
+ const { data } = yield this.request.get('/v1/points/user/claimable', {
852
+ params,
853
+ });
854
+ return data;
855
+ });
856
+ this.getRabbyPointsSnapshot = (params) => __awaiter(this, void 0, void 0, function* () {
857
+ const { data } = yield this.request.get('/v1/points/snapshot', { params });
858
+ return data;
859
+ });
860
+ this.claimRabbyPointsSnapshot = (params) => __awaiter(this, void 0, void 0, function* () {
861
+ const { data } = yield this.request.post('/v1/points/claim_snapshot', params);
862
+ return data;
863
+ });
864
+ this.getRabbyPointsTopUsers = (params) => __awaiter(this, void 0, void 0, function* () {
865
+ const { data } = yield this.request.get('/v1/points/top_user', { params });
866
+ return data;
867
+ });
868
+ this.getRabbyPointsList = (params) => __awaiter(this, void 0, void 0, function* () {
869
+ const { data } = yield this.request.get('/v1/points/campaign_list', {
870
+ params,
871
+ });
872
+ return data;
873
+ });
874
+ this.claimRabbyPointsById = (params) => __awaiter(this, void 0, void 0, function* () {
875
+ const { data } = yield this.request.post('/v1/points/claim_campaign', params);
876
+ return data;
877
+ });
809
878
  if (store instanceof Promise) {
810
879
  store.then((resolvedStore) => {
811
880
  this.store = resolvedStore;
package/dist/types.d.ts CHANGED
@@ -1109,4 +1109,13 @@ export interface PendingTxItem {
1109
1109
  };
1110
1110
  };
1111
1111
  }
1112
+ export interface BasicDappInfo {
1113
+ id: string;
1114
+ name: string;
1115
+ logo_url: string | null;
1116
+ description: string;
1117
+ user_range: string;
1118
+ tags: string[];
1119
+ chain_ids: string[];
1120
+ }
1112
1121
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rabby-wallet/rabby-api",
3
- "version": "0.7.0-alpha.5",
3
+ "version": "0.7.1",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [