@rabby-wallet/rabby-api 0.9.48-3 → 0.9.49-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 CHANGED
@@ -1,7 +1,7 @@
1
- import { AxiosAdapter, AxiosRequestConfig } from 'axios';
1
+ import { 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, AppChainListResponse, CopyTradeTokenListV2Response, CopyTradeRecentBuyListV2Response, CopyTradeTokenItemV2, CopyTradeSameToken, DefaultRPCRes, TokenDetailWithPriceCurve, GiftEligibilityItem, UserFeedbackItem, PerpTopToken, KlineDataItem, TokenMarketInfo, TokenHolderInfo, TokenSupplyInfo, MarketSummary, MarketTradingHistoryItem, TokenHolderSummary, TokenHolderItem, CurrencyItem, PerpBridgeQuote, LiquidityPoolItem, LiquidityPoolHistoryItem, NFTDetail, NFTTradingConfig, PrepareAcceptNFTOfferResponse, PrepareListingNFTResponse, CreateListingNFTOfferResponse, NFTListingResponse } 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, AppChainListResponse, CopyTradeTokenListV2Response, CopyTradeRecentBuyListV2Response, CopyTradeTokenItemV2, CopyTradeSameToken, DefaultRPCRes, TokenDetailWithPriceCurve, GiftEligibilityItem, UserFeedbackItem, PerpTopToken, KlineDataItem, TokenMarketInfo, TokenHolderInfo, TokenSupplyInfo, MarketSummary, MarketTradingHistoryItem, TokenHolderSummary, TokenHolderItem, CurrencyItem, PerpBridgeQuote, LiquidityPoolItem, LiquidityPoolHistoryItem } from './types';
5
5
  interface OpenApiStore {
6
6
  host: string;
7
7
  testnetHost?: string;
@@ -11,7 +11,7 @@ interface OpenApiStore {
11
11
  interface Options {
12
12
  store: OpenApiStore | Promise<OpenApiStore>;
13
13
  plugin: RabbyApiPlugin;
14
- adapter?: AxiosAdapter;
14
+ adapter?: AxiosRequestConfig['adapter'];
15
15
  clientName?: string;
16
16
  clientVersion?: string;
17
17
  }
@@ -607,6 +607,7 @@ export declare class OpenApiService {
607
607
  }) => Promise<string[]>;
608
608
  getHotDapps: (params?: {
609
609
  limit: number;
610
+ order_by: string;
610
611
  }) => Promise<BasicDappInfo[]>;
611
612
  getRabbyClaimText: (params: {
612
613
  id: string;
@@ -1384,70 +1385,5 @@ export declare class OpenApiService {
1384
1385
  };
1385
1386
  data_list: LiquidityPoolHistoryItem[];
1386
1387
  }>;
1387
- getNFTTradingConfig: () => Promise<NFTTradingConfig>;
1388
- getNFTDetail: (params: {
1389
- chain_id: string;
1390
- id: string;
1391
- user_addr: string;
1392
- }) => Promise<NFTDetail>;
1393
- getNFTListingOrders: (params: {
1394
- maker: string;
1395
- chain_id: string;
1396
- collection_id: string;
1397
- inner_id: string;
1398
- limit?: number;
1399
- cursor?: string;
1400
- }) => Promise<NFTListingResponse>;
1401
- getNFTFees: (params: {
1402
- chain_id: string;
1403
- collection_id: string;
1404
- inner_id: string;
1405
- }) => Promise<{
1406
- marketplace_fees: {
1407
- recipient: string;
1408
- fee: number;
1409
- required: boolean;
1410
- }[];
1411
- custom_royalties: {
1412
- recipient: string;
1413
- fee: number;
1414
- required: boolean;
1415
- }[];
1416
- }>;
1417
- prepareListingNFT: (postData: {
1418
- maker: string;
1419
- chain_id: string;
1420
- collection_id: string;
1421
- inner_id: string;
1422
- wei_price: string;
1423
- quantity?: number;
1424
- marketplace_fees: {
1425
- recipient: string;
1426
- fee: number;
1427
- }[];
1428
- custom_royalties: {
1429
- recipient: string;
1430
- fee: number;
1431
- }[];
1432
- listing_time_at?: number;
1433
- expiration_time_at?: number;
1434
- currency: string;
1435
- salt?: string;
1436
- }) => Promise<PrepareListingNFTResponse>;
1437
- createListingNFT: (postData: {
1438
- chain_id: string;
1439
- order: PrepareListingNFTResponse['data']['post']['body']['order'];
1440
- signature: string;
1441
- protocol_address?: string;
1442
- }) => Promise<CreateListingNFTOfferResponse>;
1443
- prepareAcceptNFTOffer: (postData: {
1444
- chain_id: string;
1445
- order_hash: string;
1446
- fulfiller: string;
1447
- collection_id: string;
1448
- inner_id: string;
1449
- quantity?: number;
1450
- include_optional_creator_fees?: boolean;
1451
- }) => Promise<PrepareAcceptNFTOfferResponse>;
1452
1388
  }
1453
1389
  export {};
package/dist/index.js CHANGED
@@ -1777,40 +1777,6 @@ export class OpenApiService {
1777
1777
  });
1778
1778
  return data;
1779
1779
  });
1780
- this.getNFTTradingConfig = () => __awaiter(this, void 0, void 0, function* () {
1781
- const { data } = yield this.request.get('/v1/nft/trading_config');
1782
- return data;
1783
- });
1784
- this.getNFTDetail = (params) => __awaiter(this, void 0, void 0, function* () {
1785
- const { data } = yield this.request.get('/v1/nft', {
1786
- params,
1787
- });
1788
- return data;
1789
- });
1790
- this.getNFTListingOrders = (params) => __awaiter(this, void 0, void 0, function* () {
1791
- const { data } = yield this.request.get('/v1/nft/order/listing', {
1792
- params,
1793
- });
1794
- return data;
1795
- });
1796
- this.getNFTFees = (params) => __awaiter(this, void 0, void 0, function* () {
1797
- const { data } = yield this.request.get('/v1/nft/fee', {
1798
- params,
1799
- });
1800
- return data;
1801
- });
1802
- this.prepareListingNFT = (postData) => __awaiter(this, void 0, void 0, function* () {
1803
- const { data } = yield this.request.post('/v1/nft/order/listing/prepare', postData);
1804
- return data;
1805
- });
1806
- this.createListingNFT = (postData) => __awaiter(this, void 0, void 0, function* () {
1807
- const { data } = yield this.request.post('/v1/nft/order/listing/post', postData);
1808
- return data;
1809
- });
1810
- this.prepareAcceptNFTOffer = (postData) => __awaiter(this, void 0, void 0, function* () {
1811
- const { data } = yield this.request.post('/v1/nft/order/offer/accept/prepare', postData);
1812
- return data;
1813
- });
1814
1780
  if (store instanceof Promise) {
1815
1781
  store.then((resolvedStore) => {
1816
1782
  this.store = resolvedStore;
package/dist/types.d.ts CHANGED
@@ -411,18 +411,6 @@ export interface Collection {
411
411
  create_at: number;
412
412
  floor_price: number;
413
413
  is_scam: boolean;
414
- opensea_floor_price?: {
415
- price: number;
416
- token: {
417
- id: string;
418
- symbol: string;
419
- decimals: number;
420
- price: number;
421
- };
422
- };
423
- is_tradable?: boolean;
424
- is_erc721?: boolean;
425
- is_erc1155?: boolean;
426
414
  }
427
415
  export interface CollectionList {
428
416
  id: string;
@@ -439,8 +427,6 @@ export interface CollectionList {
439
427
  floor_price: number;
440
428
  nft_list: NFTItem[];
441
429
  native_token: TokenItem;
442
- is_hidden?: boolean;
443
- is_tradable?: boolean;
444
430
  }
445
431
  export interface TxDisplayItem extends TxHistoryItem {
446
432
  projectDict: TxHistoryResult['project_dict'];
@@ -1827,760 +1813,4 @@ export declare type LiquidityPoolHistoryItem = {
1827
1813
  usd_value: number;
1828
1814
  }[];
1829
1815
  };
1830
- export declare type NFTTradingConfig = Record<string, {
1831
- currency: string[];
1832
- seaport_v16_address: string;
1833
- opensea_chain_id: string;
1834
- opensea_fee_recipient: string;
1835
- opensea_conduit_address: string;
1836
- listing_currency: {
1837
- symbol: string;
1838
- token_id: string;
1839
- };
1840
- offer_currency: {
1841
- symbol: string;
1842
- token_id: string;
1843
- };
1844
- }>;
1845
- export interface NFTDetail extends NFTItem {
1846
- best_offer_order: {
1847
- order_hash: string;
1848
- chain: string;
1849
- protocol_data: {
1850
- parameters: {
1851
- offerer: string;
1852
- offer: Array<{
1853
- itemType: number;
1854
- token: string;
1855
- identifierOrCriteria: string;
1856
- startAmount: string;
1857
- endAmount: string;
1858
- }>;
1859
- consideration: Array<{
1860
- itemType: number;
1861
- token: string;
1862
- identifierOrCriteria: string;
1863
- startAmount: string;
1864
- endAmount: string;
1865
- recipient: string;
1866
- }>;
1867
- startTime: string;
1868
- endTime: string;
1869
- orderType: number;
1870
- zone: string;
1871
- zoneHash: string;
1872
- salt: string;
1873
- conduitKey: string;
1874
- totalOriginalConsiderationItems: number;
1875
- counter: number;
1876
- };
1877
- signature: null;
1878
- };
1879
- protocol_address: string;
1880
- remaining_quantity: number;
1881
- criteria: {
1882
- collection: {
1883
- slug: string;
1884
- };
1885
- contract: {
1886
- address: string;
1887
- };
1888
- trait: null;
1889
- traits: null;
1890
- encoded_token_ids: string;
1891
- };
1892
- price: {
1893
- currency: string;
1894
- decimals: number;
1895
- value: string;
1896
- };
1897
- status: 'ACTIVE' | string;
1898
- } | null;
1899
- rarity: {
1900
- strategy_id: 'openrarity' | string;
1901
- strategy_version: string;
1902
- rank: number;
1903
- } | null;
1904
- last_sale?: {
1905
- event_type: 'sale' | string;
1906
- event_timestamp: number;
1907
- transaction: string;
1908
- payment: {
1909
- quantity: string;
1910
- decimals: number;
1911
- symbol: string;
1912
- token_id: string;
1913
- price: number;
1914
- };
1915
- seller: string;
1916
- buyer: string;
1917
- quantity: number;
1918
- } | null;
1919
- }
1920
- export interface NFTListingOrder {
1921
- created_date: string;
1922
- closing_date: string;
1923
- listing_time: number;
1924
- expiration_time: number;
1925
- order_hash: string;
1926
- protocol_data: {
1927
- parameters: {
1928
- offerer: string;
1929
- offer: Array<{
1930
- itemType: number;
1931
- token: string;
1932
- identifierOrCriteria: string;
1933
- startAmount: string;
1934
- endAmount: string;
1935
- }>;
1936
- consideration: Array<{
1937
- itemType: number;
1938
- token: string;
1939
- identifierOrCriteria: string;
1940
- startAmount: string;
1941
- endAmount: string;
1942
- recipient: string;
1943
- }>;
1944
- startTime: string;
1945
- endTime: string;
1946
- orderType: number;
1947
- zone: string;
1948
- zoneHash: string;
1949
- salt: string;
1950
- conduitKey: string;
1951
- totalOriginalConsiderationItems: number;
1952
- counter: number;
1953
- };
1954
- signature: null;
1955
- };
1956
- protocol_address: string;
1957
- current_price: string;
1958
- maker: {
1959
- address: string;
1960
- profile_img_url: null;
1961
- config: null;
1962
- };
1963
- taker: null;
1964
- maker_fees: any[];
1965
- taker_fees: any[];
1966
- side: 'ask' | 'bid';
1967
- order_type: 'basic' | string;
1968
- cancelled: boolean;
1969
- finalized: boolean;
1970
- marked_invalid: boolean;
1971
- remaining_quantity: number;
1972
- maker_asset_bundle: {
1973
- assets: Array<{
1974
- id: null;
1975
- token_id: string;
1976
- num_sales: null;
1977
- background_color: null;
1978
- image_url: string | null;
1979
- image_preview_url: null;
1980
- image_thumbnail_url: null;
1981
- image_original_url: null;
1982
- animation_url: null;
1983
- animation_original_url: null;
1984
- name: string;
1985
- description: string | null;
1986
- external_link: null;
1987
- asset_contract: {
1988
- address: string;
1989
- chain_identifier: string;
1990
- schema_name: 'ERC721' | 'ERC1155' | 'NATIVE' | string;
1991
- asset_contract_type: 'non-fungible' | 'semi-fungible' | 'unknown';
1992
- };
1993
- permalink: string | null;
1994
- collection: {
1995
- collection: string;
1996
- name: string;
1997
- description: string;
1998
- image_url: string;
1999
- banner_image_url: string;
2000
- owner: string;
2001
- safelist_status: 'not_requested' | 'verified' | string;
2002
- category: string;
2003
- is_disabled: boolean;
2004
- is_nsfw: boolean;
2005
- trait_offers_enabled: boolean;
2006
- collection_offers_enabled: boolean;
2007
- opensea_url: string;
2008
- project_url: string;
2009
- wiki_url: string;
2010
- discord_url: string;
2011
- telegram_url: string;
2012
- twitter_username: string;
2013
- instagram_username: string;
2014
- contracts: Array<{
2015
- address: string;
2016
- chain: string;
2017
- }>;
2018
- } | null;
2019
- decimals: number | null;
2020
- token_metadata: null;
2021
- is_nsfw: boolean | null;
2022
- owner: {
2023
- address: string;
2024
- profile_img_url: null;
2025
- config: null;
2026
- } | null;
2027
- }>;
2028
- maker: null;
2029
- asset_contract: null;
2030
- slug: null;
2031
- name: null;
2032
- description: null;
2033
- external_link: null;
2034
- permalink: null;
2035
- seaport_sell_orders: null;
2036
- };
2037
- taker_asset_bundle: {
2038
- assets: Array<{
2039
- id: null;
2040
- token_id: string;
2041
- num_sales: null;
2042
- background_color: null;
2043
- image_url: string | null;
2044
- image_preview_url: null;
2045
- image_thumbnail_url: null;
2046
- image_original_url: null;
2047
- animation_url: null;
2048
- animation_original_url: null;
2049
- name: string;
2050
- description: string | null;
2051
- external_link: null;
2052
- asset_contract: {
2053
- address: string;
2054
- chain_identifier: string;
2055
- schema_name: 'ERC721' | 'ERC1155' | 'NATIVE' | string;
2056
- asset_contract_type: 'non-fungible' | 'semi-fungible' | 'unknown';
2057
- };
2058
- permalink: string | null;
2059
- collection: {
2060
- collection: string;
2061
- name: string;
2062
- description: string;
2063
- image_url: string;
2064
- banner_image_url: string;
2065
- owner: string;
2066
- safelist_status: 'not_requested' | 'verified' | string;
2067
- category: string;
2068
- is_disabled: boolean;
2069
- is_nsfw: boolean;
2070
- trait_offers_enabled: boolean;
2071
- collection_offers_enabled: boolean;
2072
- opensea_url: string;
2073
- project_url: string;
2074
- wiki_url: string;
2075
- discord_url: string;
2076
- telegram_url: string;
2077
- twitter_username: string;
2078
- instagram_username: string;
2079
- contracts: Array<{
2080
- address: string;
2081
- chain: string;
2082
- }>;
2083
- } | null;
2084
- decimals: number | null;
2085
- token_metadata: null;
2086
- is_nsfw: boolean | null;
2087
- owner: {
2088
- address: string;
2089
- profile_img_url: null;
2090
- config: null;
2091
- } | null;
2092
- }>;
2093
- maker: null;
2094
- asset_contract: null;
2095
- slug: null;
2096
- name: null;
2097
- description: null;
2098
- external_link: null;
2099
- permalink: null;
2100
- seaport_sell_orders: null;
2101
- };
2102
- }
2103
- export interface NFTListingResponse {
2104
- orders: NFTListingOrder[];
2105
- next: string | null;
2106
- }
2107
- export interface PrepareListingNFTResponse {
2108
- data: {
2109
- sign: {
2110
- signatureKind: string;
2111
- domain: {
2112
- name: string;
2113
- version: string;
2114
- chainId: number;
2115
- verifyingContract: string;
2116
- };
2117
- types: {
2118
- EIP712Domain: Array<{
2119
- name: string;
2120
- type: string;
2121
- }>;
2122
- OrderComponents: Array<{
2123
- name: string;
2124
- type: string;
2125
- }>;
2126
- OfferItem: Array<{
2127
- name: string;
2128
- type: string;
2129
- }>;
2130
- ConsiderationItem: Array<{
2131
- name: string;
2132
- type: string;
2133
- }>;
2134
- };
2135
- value: {
2136
- offerer: string;
2137
- zone: string;
2138
- offer: Array<{
2139
- itemType: number;
2140
- token: string;
2141
- identifierOrCriteria: string;
2142
- startAmount: string;
2143
- endAmount: string;
2144
- }>;
2145
- consideration: Array<{
2146
- itemType: number;
2147
- token: string;
2148
- identifierOrCriteria: string;
2149
- startAmount: string;
2150
- endAmount: string;
2151
- recipient: string;
2152
- }>;
2153
- orderType: number;
2154
- startTime: string;
2155
- endTime: string;
2156
- zoneHash: string;
2157
- salt: string;
2158
- conduitKey: string;
2159
- counter: string;
2160
- };
2161
- primaryType: string;
2162
- };
2163
- post: {
2164
- endpoint: string;
2165
- method: string;
2166
- body: {
2167
- order: {
2168
- kind: string;
2169
- data: {
2170
- offerer: string;
2171
- zone: string;
2172
- offer: Array<{
2173
- itemType: number;
2174
- token: string;
2175
- identifierOrCriteria: string;
2176
- startAmount: string;
2177
- endAmount: string;
2178
- }>;
2179
- consideration: Array<{
2180
- itemType: number;
2181
- token: string;
2182
- identifierOrCriteria: string;
2183
- startAmount: string;
2184
- endAmount: string;
2185
- recipient: string;
2186
- }>;
2187
- orderType: number;
2188
- startTime: string;
2189
- endTime: string;
2190
- zoneHash: string;
2191
- salt: string;
2192
- conduitKey: string;
2193
- counter: string;
2194
- };
2195
- };
2196
- };
2197
- };
2198
- };
2199
- }
2200
- export interface PrepareAcceptNFTOfferResponse {
2201
- data: {
2202
- protocol: string;
2203
- fulfillment_data: {
2204
- transaction: {
2205
- function: string;
2206
- chain: number;
2207
- to: string;
2208
- value: number;
2209
- input_data: {
2210
- advancedOrder: {
2211
- parameters: {
2212
- offerer: string;
2213
- zone: string;
2214
- zoneHash: string;
2215
- startTime: string;
2216
- endTime: string;
2217
- orderType: number;
2218
- salt: string;
2219
- conduitKey: string;
2220
- totalOriginalConsiderationItems: number;
2221
- offer: Array<{
2222
- itemType: number;
2223
- token: string;
2224
- identifierOrCriteria: string;
2225
- startAmount: string;
2226
- endAmount: string;
2227
- }>;
2228
- consideration: Array<{
2229
- itemType: number;
2230
- token: string;
2231
- identifierOrCriteria: string;
2232
- startAmount: string;
2233
- endAmount: string;
2234
- recipient: string;
2235
- }>;
2236
- counter: number;
2237
- };
2238
- numerator: string;
2239
- denominator: string;
2240
- signature: string;
2241
- extraData: string;
2242
- };
2243
- criteriaResolvers?: Array<{
2244
- orderIndex: number;
2245
- side: number;
2246
- index: number;
2247
- identifier: string;
2248
- criteriaProof: string[];
2249
- }>;
2250
- fulfillerConduitKey?: string;
2251
- recipient: string;
2252
- } | {
2253
- basicOrderParameters: {
2254
- considerationToken: string;
2255
- considerationIdentifier: string;
2256
- considerationAmount: string;
2257
- offerer: string;
2258
- zone: string;
2259
- offerToken: string;
2260
- offerIdentifier: string;
2261
- offerAmount: string;
2262
- basicOrderType: number;
2263
- startTime: string;
2264
- endTime: string;
2265
- zoneHash: string;
2266
- salt: string;
2267
- offererConduitKey: string;
2268
- fulfillerConduitKey: string;
2269
- totalOriginalAdditionalRecipients: number;
2270
- additionalRecipients: Array<{
2271
- amount: string;
2272
- recipient: string;
2273
- }>;
2274
- signature: string;
2275
- };
2276
- } | {
2277
- order: {
2278
- parameters: {
2279
- offerer: string;
2280
- zone: string;
2281
- zoneHash: string;
2282
- startTime: string;
2283
- endTime: string;
2284
- orderType: number;
2285
- salt: string;
2286
- conduitKey: string;
2287
- totalOriginalConsiderationItems: number;
2288
- offer: Array<{
2289
- itemType: number;
2290
- token: string;
2291
- identifierOrCriteria: string;
2292
- startAmount: string;
2293
- endAmount: string;
2294
- }>;
2295
- consideration: Array<{
2296
- itemType: number;
2297
- token: string;
2298
- identifierOrCriteria: string;
2299
- startAmount: string;
2300
- endAmount: string;
2301
- recipient: string;
2302
- }>;
2303
- counter: number;
2304
- };
2305
- signature: string;
2306
- };
2307
- fulfillerConduitKey?: string;
2308
- recipient: string;
2309
- } | {
2310
- orders: Array<{
2311
- parameters: {
2312
- offerer: string;
2313
- zone: string;
2314
- zoneHash: string;
2315
- startTime: string;
2316
- endTime: string;
2317
- orderType: number;
2318
- salt: string;
2319
- conduitKey: string;
2320
- totalOriginalConsiderationItems: number;
2321
- offer: Array<{
2322
- itemType: number;
2323
- token: string;
2324
- identifierOrCriteria: string;
2325
- startAmount: string;
2326
- endAmount: string;
2327
- }>;
2328
- consideration: Array<{
2329
- itemType: number;
2330
- token: string;
2331
- identifierOrCriteria: string;
2332
- startAmount: string;
2333
- endAmount: string;
2334
- recipient: string;
2335
- }>;
2336
- counter: number;
2337
- };
2338
- signature: string;
2339
- } | {
2340
- parameters: {
2341
- offerer: string;
2342
- zone: string;
2343
- zoneHash: string;
2344
- startTime: string;
2345
- endTime: string;
2346
- orderType: number;
2347
- salt: string;
2348
- conduitKey: string;
2349
- totalOriginalConsiderationItems: number;
2350
- offer: Array<{
2351
- itemType: number;
2352
- token: string;
2353
- identifierOrCriteria: string;
2354
- startAmount: string;
2355
- endAmount: string;
2356
- }>;
2357
- consideration: Array<{
2358
- itemType: number;
2359
- token: string;
2360
- identifierOrCriteria: string;
2361
- startAmount: string;
2362
- endAmount: string;
2363
- recipient: string;
2364
- }>;
2365
- counter: number;
2366
- };
2367
- numerator: string;
2368
- denominator: string;
2369
- signature: string;
2370
- extraData: string;
2371
- } | {
2372
- considerationToken: string;
2373
- considerationIdentifier: string;
2374
- considerationAmount: string;
2375
- offerer: string;
2376
- zone: string;
2377
- offerToken: string;
2378
- offerIdentifier: string;
2379
- offerAmount: string;
2380
- basicOrderType: number;
2381
- startTime: string;
2382
- endTime: string;
2383
- zoneHash: string;
2384
- salt: string;
2385
- offererConduitKey: string;
2386
- fulfillerConduitKey: string;
2387
- totalOriginalAdditionalRecipients: number;
2388
- additionalRecipients: Array<{
2389
- amount: string;
2390
- recipient: string;
2391
- }>;
2392
- signature: string;
2393
- }>;
2394
- };
2395
- };
2396
- orders: Array<{
2397
- parameters: {
2398
- offerer: string;
2399
- zone: string;
2400
- zoneHash: string;
2401
- startTime: string;
2402
- endTime: string;
2403
- orderType: number;
2404
- salt: string;
2405
- conduitKey: string;
2406
- totalOriginalConsiderationItems: number;
2407
- offer: Array<{
2408
- itemType: number;
2409
- token: string;
2410
- identifierOrCriteria: string;
2411
- startAmount: string;
2412
- endAmount: string;
2413
- }>;
2414
- consideration: Array<{
2415
- itemType: number;
2416
- token: string;
2417
- identifierOrCriteria: string;
2418
- startAmount: string;
2419
- endAmount: string;
2420
- recipient: string;
2421
- }>;
2422
- counter: number;
2423
- };
2424
- signature: string;
2425
- }>;
2426
- };
2427
- };
2428
- }
2429
- export interface CreateListingNFTOfferResponse {
2430
- order: {
2431
- created_date: string;
2432
- closing_date: string;
2433
- listing_time: number;
2434
- expiration_time: number;
2435
- order_hash: string;
2436
- protocol_data: {
2437
- parameters: {
2438
- offerer: string;
2439
- offer: Array<{
2440
- itemType: number;
2441
- token: string;
2442
- identifierOrCriteria: string;
2443
- startAmount: string;
2444
- endAmount: string;
2445
- }>;
2446
- consideration: Array<{
2447
- itemType: number;
2448
- token: string;
2449
- identifierOrCriteria: string;
2450
- startAmount: string;
2451
- endAmount: string;
2452
- recipient: string;
2453
- }>;
2454
- startTime: string;
2455
- endTime: string;
2456
- orderType: number;
2457
- zone: string;
2458
- zoneHash: string;
2459
- salt: string;
2460
- conduitKey: string;
2461
- totalOriginalConsiderationItems: number;
2462
- counter: number;
2463
- };
2464
- signature: null;
2465
- };
2466
- protocol_address: string;
2467
- current_price: string;
2468
- maker: {
2469
- address: string;
2470
- profile_img_url: null;
2471
- config: null;
2472
- };
2473
- taker: null;
2474
- maker_fees: any[];
2475
- taker_fees: any[];
2476
- side: 'ask' | 'bid';
2477
- order_type: 'basic' | string;
2478
- cancelled: boolean;
2479
- finalized: boolean;
2480
- marked_invalid: boolean;
2481
- remaining_quantity: number;
2482
- maker_asset_bundle: {
2483
- assets: Array<{
2484
- id: null;
2485
- token_id: string;
2486
- num_sales: null;
2487
- background_color: null;
2488
- image_url: string | null;
2489
- image_preview_url: null;
2490
- image_thumbnail_url: null;
2491
- image_original_url: null;
2492
- animation_url: null;
2493
- animation_original_url: null;
2494
- name: string;
2495
- description: string | null;
2496
- external_link: null;
2497
- asset_contract: {
2498
- address: string;
2499
- chain_identifier: string;
2500
- schema_name: 'ERC721' | 'ERC1155' | 'NATIVE' | string;
2501
- asset_contract_type: 'non-fungible' | 'semi-fungible' | 'unknown';
2502
- };
2503
- permalink: string | null;
2504
- collection: {
2505
- collection: string;
2506
- name: string;
2507
- description: string;
2508
- image_url: string;
2509
- banner_image_url: string;
2510
- owner: string;
2511
- safelist_status: 'not_requested' | 'verified' | string;
2512
- category: string;
2513
- is_disabled: boolean;
2514
- is_nsfw: boolean;
2515
- trait_offers_enabled: boolean;
2516
- collection_offers_enabled: boolean;
2517
- opensea_url: string;
2518
- project_url: string;
2519
- wiki_url: string;
2520
- discord_url: string;
2521
- telegram_url: string;
2522
- twitter_username: string;
2523
- instagram_username: string;
2524
- contracts: Array<{
2525
- address: string;
2526
- chain: string;
2527
- }>;
2528
- } | null;
2529
- decimals: number | null;
2530
- token_metadata: null;
2531
- is_nsfw: boolean | null;
2532
- owner: {
2533
- address: string;
2534
- profile_img_url: null;
2535
- config: null;
2536
- } | null;
2537
- }>;
2538
- maker: null;
2539
- asset_contract: null;
2540
- slug: null;
2541
- name: null;
2542
- description: null;
2543
- external_link: null;
2544
- permalink: null;
2545
- seaport_sell_orders: null;
2546
- };
2547
- taker_asset_bundle: {
2548
- assets: Array<{
2549
- id: null;
2550
- token_id: string;
2551
- num_sales: null;
2552
- background_color: null;
2553
- image_url: null;
2554
- image_preview_url: null;
2555
- image_thumbnail_url: null;
2556
- image_original_url: null;
2557
- animation_url: null;
2558
- animation_original_url: null;
2559
- name: string;
2560
- description: null;
2561
- external_link: null;
2562
- asset_contract: {
2563
- address: string;
2564
- chain_identifier: string;
2565
- schema_name: 'NATIVE' | string;
2566
- asset_contract_type: 'unknown';
2567
- };
2568
- permalink: null;
2569
- collection: null;
2570
- decimals: number;
2571
- token_metadata: null;
2572
- is_nsfw: null;
2573
- owner: null;
2574
- }>;
2575
- maker: null;
2576
- asset_contract: null;
2577
- slug: null;
2578
- name: null;
2579
- description: null;
2580
- external_link: null;
2581
- permalink: null;
2582
- seaport_sell_orders: null;
2583
- };
2584
- };
2585
- }
2586
1816
  export {};
package/dist/utils.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { CHAINS } from '@debank/common';
2
- import { AxiosRequestConfig } from 'axios';
2
+ import { AxiosRequestConfig, GenericAbortSignal } from 'axios';
3
3
  export declare const getChain: (chainId?: string) => import("@debank/common").Chain | null;
4
4
  export declare const getChainByNetwork: (network?: string | number) => import("@debank/common").Chain | null;
5
5
  export declare const INITIAL_OPENAPI_URL = "https://api.rabby.io";
@@ -10,4 +10,4 @@ export declare function genSignParams(config: AxiosRequestConfig): {
10
10
  url: string;
11
11
  params: Partial<any>;
12
12
  };
13
- export declare function sleep(ms?: number, signal?: AbortController['signal']): Promise<void>;
13
+ export declare function sleep(ms?: number, signal?: GenericAbortSignal): Promise<void>;
package/dist/utils.js CHANGED
@@ -41,15 +41,18 @@ export function sleep(ms = 0, signal) {
41
41
  return Promise.reject(new DOMException('Aborted', 'AbortError'));
42
42
  }
43
43
  return new Promise((resolve, reject) => {
44
+ var _a;
44
45
  const abortHandler = () => {
46
+ var _a;
45
47
  clearTimeout(timer);
46
48
  reject(new DOMException('Aborted', 'AbortError'));
47
- signal === null || signal === void 0 ? void 0 : signal.removeEventListener('abort', abortHandler);
49
+ (_a = signal === null || signal === void 0 ? void 0 : signal.removeEventListener) === null || _a === void 0 ? void 0 : _a.call(signal, 'abort', abortHandler);
48
50
  };
49
- signal === null || signal === void 0 ? void 0 : signal.addEventListener('abort', abortHandler);
51
+ (_a = signal === null || signal === void 0 ? void 0 : signal.addEventListener) === null || _a === void 0 ? void 0 : _a.call(signal, 'abort', abortHandler);
50
52
  const timer = setTimeout(() => {
53
+ var _a;
51
54
  resolve();
52
- signal === null || signal === void 0 ? void 0 : signal.removeEventListener('abort', abortHandler);
55
+ (_a = signal === null || signal === void 0 ? void 0 : signal.removeEventListener) === null || _a === void 0 ? void 0 : _a.call(signal, 'abort', abortHandler);
53
56
  }, ms);
54
57
  });
55
58
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rabby-wallet/rabby-api",
3
- "version": "0.9.48-3",
3
+ "version": "0.9.49-alpha.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [
@@ -11,8 +11,8 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "@rabby-wallet/rabby-sign": "0.4.0",
14
- "axios": "^0.27.2",
15
- "axios-rate-limit": "^1.3.0",
14
+ "axios": "1.12.2",
15
+ "axios-rate-limit": "1.4.0",
16
16
  "eth-rpc-errors": "^4.0.3",
17
17
  "lodash": "^4.17.21",
18
18
  "qss": "^2.0.3"