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