@opensea/sdk 9.0.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.
Files changed (363) hide show
  1. package/LICENSE +7 -0
  2. package/README.md +70 -0
  3. package/lib/api/accounts.d.ts +27 -0
  4. package/lib/api/accounts.js +46 -0
  5. package/lib/api/accounts.js.map +1 -0
  6. package/lib/api/api.d.ts +489 -0
  7. package/lib/api/api.js +754 -0
  8. package/lib/api/api.js.map +1 -0
  9. package/lib/api/apiPaths.d.ts +46 -0
  10. package/lib/api/apiPaths.js +176 -0
  11. package/lib/api/apiPaths.js.map +1 -0
  12. package/lib/api/chains.d.ts +13 -0
  13. package/lib/api/chains.js +22 -0
  14. package/lib/api/chains.js.map +1 -0
  15. package/lib/api/collections.d.ts +34 -0
  16. package/lib/api/collections.js +80 -0
  17. package/lib/api/collections.js.map +1 -0
  18. package/lib/api/drops.d.ts +21 -0
  19. package/lib/api/drops.js +39 -0
  20. package/lib/api/drops.js.map +1 -0
  21. package/lib/api/events.d.ts +26 -0
  22. package/lib/api/events.js +43 -0
  23. package/lib/api/events.js.map +1 -0
  24. package/lib/api/fetcher.d.ts +24 -0
  25. package/lib/api/fetcher.js +3 -0
  26. package/lib/api/fetcher.js.map +1 -0
  27. package/lib/api/index.d.ts +2 -0
  28. package/lib/api/index.js +19 -0
  29. package/lib/api/index.js.map +1 -0
  30. package/lib/api/listings.d.ts +44 -0
  31. package/lib/api/listings.js +88 -0
  32. package/lib/api/listings.js.map +1 -0
  33. package/lib/api/nfts.d.ts +39 -0
  34. package/lib/api/nfts.js +79 -0
  35. package/lib/api/nfts.js.map +1 -0
  36. package/lib/api/offers.d.ts +54 -0
  37. package/lib/api/offers.js +124 -0
  38. package/lib/api/offers.js.map +1 -0
  39. package/lib/api/orders.d.ts +50 -0
  40. package/lib/api/orders.js +153 -0
  41. package/lib/api/orders.js.map +1 -0
  42. package/lib/api/search.d.ts +13 -0
  43. package/lib/api/search.js +22 -0
  44. package/lib/api/search.js.map +1 -0
  45. package/lib/api/tokens.d.ts +25 -0
  46. package/lib/api/tokens.js +43 -0
  47. package/lib/api/tokens.js.map +1 -0
  48. package/lib/api/types.d.ts +1113 -0
  49. package/lib/api/types.js +65 -0
  50. package/lib/api/types.js.map +1 -0
  51. package/lib/constants.d.ts +22 -0
  52. package/lib/constants.js +52 -0
  53. package/lib/constants.js.map +1 -0
  54. package/lib/index.d.ts +18 -0
  55. package/lib/index.js +24 -0
  56. package/lib/index.js.map +1 -0
  57. package/lib/orders/privateListings.d.ts +12 -0
  58. package/lib/orders/privateListings.js +130 -0
  59. package/lib/orders/privateListings.js.map +1 -0
  60. package/lib/orders/types.d.ts +160 -0
  61. package/lib/orders/types.js +10 -0
  62. package/lib/orders/types.js.map +1 -0
  63. package/lib/orders/utils.d.ts +89 -0
  64. package/lib/orders/utils.js +177 -0
  65. package/lib/orders/utils.js.map +1 -0
  66. package/lib/sdk/assets.d.ts +104 -0
  67. package/lib/sdk/assets.js +398 -0
  68. package/lib/sdk/assets.js.map +1 -0
  69. package/lib/sdk/cancellation.d.ts +97 -0
  70. package/lib/sdk/cancellation.js +235 -0
  71. package/lib/sdk/cancellation.js.map +1 -0
  72. package/lib/sdk/context.d.ts +28 -0
  73. package/lib/sdk/context.js +3 -0
  74. package/lib/sdk/context.js.map +1 -0
  75. package/lib/sdk/fulfillment.d.ts +153 -0
  76. package/lib/sdk/fulfillment.js +298 -0
  77. package/lib/sdk/fulfillment.js.map +1 -0
  78. package/lib/sdk/orders.d.ts +253 -0
  79. package/lib/sdk/orders.js +679 -0
  80. package/lib/sdk/orders.js.map +1 -0
  81. package/lib/sdk/tokens.d.ts +31 -0
  82. package/lib/sdk/tokens.js +65 -0
  83. package/lib/sdk/tokens.js.map +1 -0
  84. package/lib/sdk.d.ts +560 -0
  85. package/lib/sdk.js +693 -0
  86. package/lib/sdk.js.map +1 -0
  87. package/lib/src/api/accounts.d.ts +18 -0
  88. package/lib/src/api/accounts.js +30 -0
  89. package/lib/src/api/accounts.js.map +1 -0
  90. package/lib/src/api/api.d.ts +429 -0
  91. package/lib/src/api/api.js +652 -0
  92. package/lib/src/api/api.js.map +1 -0
  93. package/lib/src/api/apiPaths.d.ts +37 -0
  94. package/lib/src/api/apiPaths.js +140 -0
  95. package/lib/src/api/apiPaths.js.map +1 -0
  96. package/lib/src/api/collections.d.ts +26 -0
  97. package/lib/src/api/collections.js +57 -0
  98. package/lib/src/api/collections.js.map +1 -0
  99. package/lib/src/api/events.d.ts +26 -0
  100. package/lib/src/api/events.js +42 -0
  101. package/lib/src/api/events.js.map +1 -0
  102. package/lib/src/api/fetcher.d.ts +24 -0
  103. package/lib/src/api/fetcher.js +3 -0
  104. package/lib/src/api/fetcher.js.map +1 -0
  105. package/lib/src/api/index.d.ts +2 -0
  106. package/lib/src/api/index.js +19 -0
  107. package/lib/src/api/index.js.map +1 -0
  108. package/lib/src/api/listings.d.ts +44 -0
  109. package/lib/src/api/listings.js +86 -0
  110. package/lib/src/api/listings.js.map +1 -0
  111. package/lib/src/api/nfts.d.ts +35 -0
  112. package/lib/src/api/nfts.js +66 -0
  113. package/lib/src/api/nfts.js.map +1 -0
  114. package/lib/src/api/offers.d.ts +54 -0
  115. package/lib/src/api/offers.js +122 -0
  116. package/lib/src/api/offers.js.map +1 -0
  117. package/lib/src/api/orders.d.ts +50 -0
  118. package/lib/src/api/orders.js +151 -0
  119. package/lib/src/api/orders.js.map +1 -0
  120. package/lib/src/api/search.d.ts +13 -0
  121. package/lib/src/api/search.js +21 -0
  122. package/lib/src/api/search.js.map +1 -0
  123. package/lib/src/api/tokens.d.ts +25 -0
  124. package/lib/src/api/tokens.js +42 -0
  125. package/lib/src/api/tokens.js.map +1 -0
  126. package/lib/src/api/types.d.ts +840 -0
  127. package/lib/src/api/types.js +65 -0
  128. package/lib/src/api/types.js.map +1 -0
  129. package/lib/src/constants.d.ts +22 -0
  130. package/lib/src/constants.js +52 -0
  131. package/lib/src/constants.js.map +1 -0
  132. package/lib/src/index.d.ts +18 -0
  133. package/lib/src/index.js +24 -0
  134. package/lib/src/index.js.map +1 -0
  135. package/lib/src/orders/privateListings.d.ts +12 -0
  136. package/lib/src/orders/privateListings.js +130 -0
  137. package/lib/src/orders/privateListings.js.map +1 -0
  138. package/lib/src/orders/types.d.ts +160 -0
  139. package/lib/src/orders/types.js +10 -0
  140. package/lib/src/orders/types.js.map +1 -0
  141. package/lib/src/orders/utils.d.ts +89 -0
  142. package/lib/src/orders/utils.js +177 -0
  143. package/lib/src/orders/utils.js.map +1 -0
  144. package/lib/src/sdk/assets.d.ts +104 -0
  145. package/lib/src/sdk/assets.js +397 -0
  146. package/lib/src/sdk/assets.js.map +1 -0
  147. package/lib/src/sdk/cancellation.d.ts +97 -0
  148. package/lib/src/sdk/cancellation.js +234 -0
  149. package/lib/src/sdk/cancellation.js.map +1 -0
  150. package/lib/src/sdk/context.d.ts +28 -0
  151. package/lib/src/sdk/context.js +3 -0
  152. package/lib/src/sdk/context.js.map +1 -0
  153. package/lib/src/sdk/fulfillment.d.ts +153 -0
  154. package/lib/src/sdk/fulfillment.js +296 -0
  155. package/lib/src/sdk/fulfillment.js.map +1 -0
  156. package/lib/src/sdk/orders.d.ts +253 -0
  157. package/lib/src/sdk/orders.js +677 -0
  158. package/lib/src/sdk/orders.js.map +1 -0
  159. package/lib/src/sdk/tokens.d.ts +31 -0
  160. package/lib/src/sdk/tokens.js +64 -0
  161. package/lib/src/sdk/tokens.js.map +1 -0
  162. package/lib/src/sdk.d.ts +560 -0
  163. package/lib/src/sdk.js +675 -0
  164. package/lib/src/sdk.js.map +1 -0
  165. package/lib/src/typechain/contracts/ERC1155.d.ts +236 -0
  166. package/lib/src/typechain/contracts/ERC1155.js +3 -0
  167. package/lib/src/typechain/contracts/ERC1155.js.map +1 -0
  168. package/lib/src/typechain/contracts/ERC20.d.ts +141 -0
  169. package/lib/src/typechain/contracts/ERC20.js +3 -0
  170. package/lib/src/typechain/contracts/ERC20.js.map +1 -0
  171. package/lib/src/typechain/contracts/ERC721.d.ts +213 -0
  172. package/lib/src/typechain/contracts/ERC721.js +3 -0
  173. package/lib/src/typechain/contracts/ERC721.js.map +1 -0
  174. package/lib/src/typechain/contracts/Multicall3.d.ts +57 -0
  175. package/lib/src/typechain/contracts/Multicall3.js +3 -0
  176. package/lib/src/typechain/contracts/Multicall3.js.map +1 -0
  177. package/lib/src/typechain/contracts/TransferHelper.d.ts +55 -0
  178. package/lib/src/typechain/contracts/TransferHelper.js +3 -0
  179. package/lib/src/typechain/contracts/TransferHelper.js.map +1 -0
  180. package/lib/src/typechain/contracts/common.d.ts +50 -0
  181. package/lib/src/typechain/contracts/common.js +3 -0
  182. package/lib/src/typechain/contracts/common.js.map +1 -0
  183. package/lib/src/typechain/contracts/factories/ERC1155__factory.d.ts +250 -0
  184. package/lib/src/typechain/contracts/factories/ERC1155__factory.js +332 -0
  185. package/lib/src/typechain/contracts/factories/ERC1155__factory.js.map +1 -0
  186. package/lib/src/typechain/contracts/factories/ERC20__factory.d.ts +174 -0
  187. package/lib/src/typechain/contracts/factories/ERC20__factory.js +240 -0
  188. package/lib/src/typechain/contracts/factories/ERC20__factory.js.map +1 -0
  189. package/lib/src/typechain/contracts/factories/ERC721__factory.d.ts +268 -0
  190. package/lib/src/typechain/contracts/factories/ERC721__factory.js +351 -0
  191. package/lib/src/typechain/contracts/factories/ERC721__factory.js.map +1 -0
  192. package/lib/src/typechain/contracts/factories/Multicall3__factory.d.ts +43 -0
  193. package/lib/src/typechain/contracts/factories/Multicall3__factory.js +68 -0
  194. package/lib/src/typechain/contracts/factories/Multicall3__factory.js.map +1 -0
  195. package/lib/src/typechain/contracts/factories/TransferHelper__factory.d.ts +46 -0
  196. package/lib/src/typechain/contracts/factories/TransferHelper__factory.js +71 -0
  197. package/lib/src/typechain/contracts/factories/TransferHelper__factory.js.map +1 -0
  198. package/lib/src/typechain/contracts/factories/index.d.ts +5 -0
  199. package/lib/src/typechain/contracts/factories/index.js +17 -0
  200. package/lib/src/typechain/contracts/factories/index.js.map +1 -0
  201. package/lib/src/typechain/contracts/index.d.ts +11 -0
  202. package/lib/src/typechain/contracts/index.js +48 -0
  203. package/lib/src/typechain/contracts/index.js.map +1 -0
  204. package/lib/src/types.d.ts +387 -0
  205. package/lib/src/types.js +127 -0
  206. package/lib/src/types.js.map +1 -0
  207. package/lib/src/utils/chain.d.ts +60 -0
  208. package/lib/src/utils/chain.js +248 -0
  209. package/lib/src/utils/chain.js.map +1 -0
  210. package/lib/src/utils/converters.d.ts +37 -0
  211. package/lib/src/utils/converters.js +137 -0
  212. package/lib/src/utils/converters.js.map +1 -0
  213. package/lib/src/utils/dateHelper.d.ts +38 -0
  214. package/lib/src/utils/dateHelper.js +52 -0
  215. package/lib/src/utils/dateHelper.js.map +1 -0
  216. package/lib/src/utils/fees.d.ts +13 -0
  217. package/lib/src/utils/fees.js +29 -0
  218. package/lib/src/utils/fees.js.map +1 -0
  219. package/lib/src/utils/index.d.ts +2 -0
  220. package/lib/src/utils/index.js +19 -0
  221. package/lib/src/utils/index.js.map +1 -0
  222. package/lib/src/utils/protocol.d.ts +75 -0
  223. package/lib/src/utils/protocol.js +161 -0
  224. package/lib/src/utils/protocol.js.map +1 -0
  225. package/lib/src/utils/rateLimit.d.ts +34 -0
  226. package/lib/src/utils/rateLimit.js +97 -0
  227. package/lib/src/utils/rateLimit.js.map +1 -0
  228. package/lib/src/utils/stringHelper.d.ts +18 -0
  229. package/lib/src/utils/stringHelper.js +24 -0
  230. package/lib/src/utils/stringHelper.js.map +1 -0
  231. package/lib/src/utils/utils.d.ts +18 -0
  232. package/lib/src/utils/utils.js +45 -0
  233. package/lib/src/utils/utils.js.map +1 -0
  234. package/lib/typechain/contracts/ERC1155.d.ts +236 -0
  235. package/lib/typechain/contracts/ERC1155.js +3 -0
  236. package/lib/typechain/contracts/ERC1155.js.map +1 -0
  237. package/lib/typechain/contracts/ERC20.d.ts +141 -0
  238. package/lib/typechain/contracts/ERC20.js +3 -0
  239. package/lib/typechain/contracts/ERC20.js.map +1 -0
  240. package/lib/typechain/contracts/ERC721.d.ts +213 -0
  241. package/lib/typechain/contracts/ERC721.js +3 -0
  242. package/lib/typechain/contracts/ERC721.js.map +1 -0
  243. package/lib/typechain/contracts/Multicall3.d.ts +57 -0
  244. package/lib/typechain/contracts/Multicall3.js +3 -0
  245. package/lib/typechain/contracts/Multicall3.js.map +1 -0
  246. package/lib/typechain/contracts/TransferHelper.d.ts +55 -0
  247. package/lib/typechain/contracts/TransferHelper.js +3 -0
  248. package/lib/typechain/contracts/TransferHelper.js.map +1 -0
  249. package/lib/typechain/contracts/common.d.ts +50 -0
  250. package/lib/typechain/contracts/common.js +3 -0
  251. package/lib/typechain/contracts/common.js.map +1 -0
  252. package/lib/typechain/contracts/factories/ERC1155__factory.d.ts +250 -0
  253. package/lib/typechain/contracts/factories/ERC1155__factory.js +332 -0
  254. package/lib/typechain/contracts/factories/ERC1155__factory.js.map +1 -0
  255. package/lib/typechain/contracts/factories/ERC20__factory.d.ts +174 -0
  256. package/lib/typechain/contracts/factories/ERC20__factory.js +240 -0
  257. package/lib/typechain/contracts/factories/ERC20__factory.js.map +1 -0
  258. package/lib/typechain/contracts/factories/ERC721__factory.d.ts +268 -0
  259. package/lib/typechain/contracts/factories/ERC721__factory.js +351 -0
  260. package/lib/typechain/contracts/factories/ERC721__factory.js.map +1 -0
  261. package/lib/typechain/contracts/factories/Multicall3__factory.d.ts +43 -0
  262. package/lib/typechain/contracts/factories/Multicall3__factory.js +68 -0
  263. package/lib/typechain/contracts/factories/Multicall3__factory.js.map +1 -0
  264. package/lib/typechain/contracts/factories/TransferHelper__factory.d.ts +46 -0
  265. package/lib/typechain/contracts/factories/TransferHelper__factory.js +71 -0
  266. package/lib/typechain/contracts/factories/TransferHelper__factory.js.map +1 -0
  267. package/lib/typechain/contracts/factories/index.d.ts +5 -0
  268. package/lib/typechain/contracts/factories/index.js +17 -0
  269. package/lib/typechain/contracts/factories/index.js.map +1 -0
  270. package/lib/typechain/contracts/index.d.ts +11 -0
  271. package/lib/typechain/contracts/index.js +48 -0
  272. package/lib/typechain/contracts/index.js.map +1 -0
  273. package/lib/types.d.ts +389 -0
  274. package/lib/types.js +129 -0
  275. package/lib/types.js.map +1 -0
  276. package/lib/utils/chain.d.ts +64 -0
  277. package/lib/utils/chain.js +211 -0
  278. package/lib/utils/chain.js.map +1 -0
  279. package/lib/utils/chainIds.generated.d.ts +7 -0
  280. package/lib/utils/chainIds.generated.js +37 -0
  281. package/lib/utils/chainIds.generated.js.map +1 -0
  282. package/lib/utils/converters.d.ts +37 -0
  283. package/lib/utils/converters.js +137 -0
  284. package/lib/utils/converters.js.map +1 -0
  285. package/lib/utils/dateHelper.d.ts +38 -0
  286. package/lib/utils/dateHelper.js +52 -0
  287. package/lib/utils/dateHelper.js.map +1 -0
  288. package/lib/utils/fees.d.ts +13 -0
  289. package/lib/utils/fees.js +29 -0
  290. package/lib/utils/fees.js.map +1 -0
  291. package/lib/utils/index.d.ts +2 -0
  292. package/lib/utils/index.js +19 -0
  293. package/lib/utils/index.js.map +1 -0
  294. package/lib/utils/protocol.d.ts +75 -0
  295. package/lib/utils/protocol.js +161 -0
  296. package/lib/utils/protocol.js.map +1 -0
  297. package/lib/utils/rateLimit.d.ts +34 -0
  298. package/lib/utils/rateLimit.js +97 -0
  299. package/lib/utils/rateLimit.js.map +1 -0
  300. package/lib/utils/stringHelper.d.ts +18 -0
  301. package/lib/utils/stringHelper.js +24 -0
  302. package/lib/utils/stringHelper.js.map +1 -0
  303. package/lib/utils/utils.d.ts +18 -0
  304. package/lib/utils/utils.js +45 -0
  305. package/lib/utils/utils.js.map +1 -0
  306. package/package.json +72 -0
  307. package/src/abi/ERC1155.json +314 -0
  308. package/src/abi/ERC20.json +222 -0
  309. package/src/abi/ERC721.json +333 -0
  310. package/src/abi/Multicall3.json +50 -0
  311. package/src/abi/TransferHelper.json +53 -0
  312. package/src/api/accounts.ts +69 -0
  313. package/src/api/api.ts +1152 -0
  314. package/src/api/apiPaths.ts +208 -0
  315. package/src/api/chains.ts +18 -0
  316. package/src/api/collections.ts +120 -0
  317. package/src/api/drops.ts +49 -0
  318. package/src/api/events.ts +71 -0
  319. package/src/api/fetcher.ts +31 -0
  320. package/src/api/index.ts +2 -0
  321. package/src/api/listings.ts +126 -0
  322. package/src/api/nfts.ts +144 -0
  323. package/src/api/offers.ts +242 -0
  324. package/src/api/orders.ts +283 -0
  325. package/src/api/search.ts +21 -0
  326. package/src/api/tokens.ts +67 -0
  327. package/src/api/types.ts +1210 -0
  328. package/src/constants.ts +90 -0
  329. package/src/index.ts +22 -0
  330. package/src/orders/privateListings.ts +173 -0
  331. package/src/orders/types.ts +191 -0
  332. package/src/orders/utils.ts +253 -0
  333. package/src/sdk/assets.ts +591 -0
  334. package/src/sdk/cancellation.ts +346 -0
  335. package/src/sdk/context.ts +33 -0
  336. package/src/sdk/fulfillment.ts +478 -0
  337. package/src/sdk/orders.ts +1149 -0
  338. package/src/sdk/tokens.ts +95 -0
  339. package/src/sdk.ts +1051 -0
  340. package/src/typechain/contracts/ERC1155.ts +440 -0
  341. package/src/typechain/contracts/ERC20.ts +286 -0
  342. package/src/typechain/contracts/ERC721.ts +412 -0
  343. package/src/typechain/contracts/Multicall3.ts +117 -0
  344. package/src/typechain/contracts/TransferHelper.ts +122 -0
  345. package/src/typechain/contracts/common.ts +131 -0
  346. package/src/typechain/contracts/factories/ERC1155__factory.ts +331 -0
  347. package/src/typechain/contracts/factories/ERC20__factory.ts +239 -0
  348. package/src/typechain/contracts/factories/ERC721__factory.ts +350 -0
  349. package/src/typechain/contracts/factories/Multicall3__factory.ts +67 -0
  350. package/src/typechain/contracts/factories/TransferHelper__factory.ts +76 -0
  351. package/src/typechain/contracts/factories/index.ts +8 -0
  352. package/src/typechain/contracts/index.ts +14 -0
  353. package/src/types.ts +413 -0
  354. package/src/utils/chain.ts +224 -0
  355. package/src/utils/chainIds.generated.ts +34 -0
  356. package/src/utils/converters.ts +145 -0
  357. package/src/utils/dateHelper.ts +48 -0
  358. package/src/utils/fees.ts +31 -0
  359. package/src/utils/index.ts +2 -0
  360. package/src/utils/protocol.ts +185 -0
  361. package/src/utils/rateLimit.ts +147 -0
  362. package/src/utils/stringHelper.ts +25 -0
  363. package/src/utils/utils.ts +36 -0
package/LICENSE ADDED
@@ -0,0 +1,7 @@
1
+ Copyright 2019 Ozone Networks, Inc.
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,70 @@
1
+ <p align="center">
2
+ <img src="./img/banner.png" />
3
+ </p>
4
+
5
+ [![Version][version-badge]][version-link]
6
+ [![npm][npm-badge]][npm-link]
7
+ [![Test CI][ci-badge]][ci-link]
8
+ [![Coverage Status][coverage-badge]][coverage-link]
9
+ [![License][license-badge]][license-link]
10
+ [![Docs][docs-badge]][docs-link]
11
+ [![Discussions][discussions-badge]][discussions-link]
12
+
13
+ # @opensea/sdk <!-- omit in toc -->
14
+
15
+ > **Note:** This package was previously published as `opensea-js`. The API is unchanged.
16
+
17
+ This is the TypeScript SDK for [OpenSea](https://opensea.io), the largest marketplace for NFTs.
18
+
19
+ It allows developers to access the official orderbook, filter it, create listings and offers, and complete trades programmatically.
20
+
21
+ Get started by [requesting an API key](https://docs.opensea.io/reference/api-keys) and instantiating your own OpenSea SDK instance. Then you can create orders off-chain or fulfill orders onchain, and listen to events in the process.
22
+
23
+ Happy seafaring!
24
+
25
+ ## Documentation
26
+
27
+ - [Quick Start Guide](developerDocs/quick-start.md)
28
+ - [Getting Started Guide](developerDocs/getting-started.md)
29
+ - [API Reference](developerDocs/api-reference.md)
30
+ - [Advanced Use Cases](developerDocs/advanced-use-cases.md)
31
+ - [SDK Reference](https://projectopensea.github.io/opensea-js/)
32
+ - [Frequently Asked Questions](developerDocs/faq.md)
33
+ - [Contributing](CONTRIBUTING.md)
34
+
35
+ ### Security Warning
36
+
37
+ **Do not use this SDK directly in client-side/frontend applications.**
38
+
39
+ The OpenSea SDK requires an API key for initialization. If you embed your API key in frontend code (e.g., browser applications, mobile apps), it will be publicly exposed and could be extracted by anyone, leading to potential abuse and rate limit issues.
40
+
41
+ #### Recommended Architecture
42
+
43
+ For frontend applications that need to interact with OpenSea functionality:
44
+
45
+ 1. **Create a backend API wrapper**: Set up your own backend server that securely stores your OpenSea API key
46
+ 2. **Call OpenSea SDK server-side**: Use `@opensea/sdk` on your backend to interact with OpenSea's APIs
47
+ 3. **Return data to your frontend**: Send the necessary data (like transaction parameters) back to your frontend
48
+ 4. **Execute transactions in the browser**: Have users sign transactions with their own wallets (e.g., MetaMask) in the browser
49
+
50
+ ## Changelog
51
+
52
+ The changelog for recent versions can be found at:
53
+
54
+ - @opensea/sdk: https://github.com/ProjectOpenSea/opensea-js/releases
55
+ - OpenSea API: https://docs.opensea.io/changelog
56
+
57
+ [version-badge]: https://img.shields.io/github/package-json/v/ProjectOpenSea/opensea-js
58
+ [version-link]: https://github.com/ProjectOpenSea/opensea-js/releases
59
+ [npm-badge]: https://img.shields.io/npm/v/@opensea/sdk?color=red
60
+ [npm-link]: https://www.npmjs.com/package/@opensea/sdk
61
+ [ci-badge]: https://github.com/ProjectOpenSea/opensea-js/actions/workflows/code-quality.yml/badge.svg
62
+ [ci-link]: https://github.com/ProjectOpenSea/opensea-js/actions/workflows/code-quality.yml
63
+ [coverage-badge]: https://coveralls.io/repos/github/ProjectOpenSea/opensea-js/badge.svg?branch=main
64
+ [coverage-link]: https://coveralls.io/github/ProjectOpenSea/opensea-js?branch=main
65
+ [license-badge]: https://img.shields.io/github/license/ProjectOpenSea/opensea-js
66
+ [license-link]: https://github.com/ProjectOpenSea/opensea-js/blob/main/LICENSE
67
+ [docs-badge]: https://img.shields.io/badge/@opensea/sdk-documentation-informational
68
+ [docs-link]: https://github.com/ProjectOpenSea/opensea-js#documentation
69
+ [discussions-badge]: https://img.shields.io/badge/@opensea/sdk-discussions-blueviolet
70
+ [discussions-link]: https://github.com/ProjectOpenSea/opensea-js/discussions
@@ -0,0 +1,27 @@
1
+ import type { Chain, OpenSeaAccount, OpenSeaPaymentToken } from "../types";
2
+ import type { Fetcher } from "./fetcher";
3
+ import type { GetAccountTokensArgs, GetAccountTokensResponse, ResolveAccountResponse } from "./types";
4
+ /**
5
+ * Account and payment token related API operations
6
+ */
7
+ export declare class AccountsAPI {
8
+ private fetcher;
9
+ private chain;
10
+ constructor(fetcher: Fetcher, chain: Chain);
11
+ /**
12
+ * Fetch a payment token.
13
+ */
14
+ getPaymentToken(address: string, chain?: Chain): Promise<OpenSeaPaymentToken>;
15
+ /**
16
+ * Fetch account for an address.
17
+ */
18
+ getAccount(address: string): Promise<OpenSeaAccount>;
19
+ /**
20
+ * Fetch token balances for an account.
21
+ */
22
+ getAccountTokens(address: string, args?: GetAccountTokensArgs): Promise<GetAccountTokensResponse>;
23
+ /**
24
+ * Resolve an ENS name, OpenSea username, or wallet address to canonical account info.
25
+ */
26
+ resolveAccount(identifier: string): Promise<ResolveAccountResponse>;
27
+ }
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AccountsAPI = void 0;
4
+ const converters_1 = require("../utils/converters");
5
+ const apiPaths_1 = require("./apiPaths");
6
+ /**
7
+ * Account and payment token related API operations
8
+ */
9
+ class AccountsAPI {
10
+ fetcher;
11
+ chain;
12
+ constructor(fetcher, chain) {
13
+ this.fetcher = fetcher;
14
+ this.chain = chain;
15
+ }
16
+ /**
17
+ * Fetch a payment token.
18
+ */
19
+ async getPaymentToken(address, chain = this.chain) {
20
+ const json = await this.fetcher.get((0, apiPaths_1.getPaymentTokenPath)(chain, address));
21
+ return (0, converters_1.paymentTokenFromJSON)(json);
22
+ }
23
+ /**
24
+ * Fetch account for an address.
25
+ */
26
+ async getAccount(address) {
27
+ const json = await this.fetcher.get((0, apiPaths_1.getAccountPath)(address));
28
+ return (0, converters_1.accountFromJSON)(json);
29
+ }
30
+ /**
31
+ * Fetch token balances for an account.
32
+ */
33
+ async getAccountTokens(address, args) {
34
+ const response = await this.fetcher.get((0, apiPaths_1.getAccountTokensPath)(address), args);
35
+ return response;
36
+ }
37
+ /**
38
+ * Resolve an ENS name, OpenSea username, or wallet address to canonical account info.
39
+ */
40
+ async resolveAccount(identifier) {
41
+ const response = await this.fetcher.get((0, apiPaths_1.getResolveAccountPath)(identifier));
42
+ return response;
43
+ }
44
+ }
45
+ exports.AccountsAPI = AccountsAPI;
46
+ //# sourceMappingURL=accounts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accounts.js","sourceRoot":"","sources":["../../src/api/accounts.ts"],"names":[],"mappings":";;;AACA,oDAA2E;AAC3E,yCAKmB;AAQnB;;GAEG;AACH,MAAa,WAAW;IAEZ;IACA;IAFV,YACU,OAAgB,EAChB,KAAY;QADZ,YAAO,GAAP,OAAO,CAAS;QAChB,UAAK,GAAL,KAAK,CAAO;IACnB,CAAC;IAEJ;;OAEG;IACH,KAAK,CAAC,eAAe,CACnB,OAAe,EACf,KAAK,GAAG,IAAI,CAAC,KAAK;QAElB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,CACjC,IAAA,8BAAmB,EAAC,KAAK,EAAE,OAAO,CAAC,CACpC,CAAA;QACD,OAAO,IAAA,iCAAoB,EAAC,IAAI,CAAC,CAAA;IACnC,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,UAAU,CAAC,OAAe;QAC9B,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,CAAiB,IAAA,yBAAc,EAAC,OAAO,CAAC,CAAC,CAAA;QAC5E,OAAO,IAAA,4BAAe,EAAC,IAAI,CAAC,CAAA;IAC9B,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,gBAAgB,CACpB,OAAe,EACf,IAA2B;QAE3B,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,CACrC,IAAA,+BAAoB,EAAC,OAAO,CAAC,EAC7B,IAAI,CACL,CAAA;QACD,OAAO,QAAQ,CAAA;IACjB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,cAAc,CAAC,UAAkB;QACrC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,CACrC,IAAA,gCAAqB,EAAC,UAAU,CAAC,CAClC,CAAA;QACD,OAAO,QAAQ,CAAA;IACjB,CAAC;CACF;AAlDD,kCAkDC"}
@@ -0,0 +1,489 @@
1
+ import type { FulfillmentDataResponse, OrderAPIOptions, OrdersQueryOptions, OrderV2, ProtocolData } from "../orders/types";
2
+ import { Chain, type OpenSeaAccount, type OpenSeaAPIConfig, type OpenSeaCollection, type OpenSeaCollectionStats, type OpenSeaPaymentToken, type OrderSide, type RequestOptions } from "../types";
3
+ import { type BuildOfferResponse, type CancelOrderResponse, type CollectionOffer, CollectionOrderByOption, type DropMintRequest, type DropMintResponse, type GetAccountTokensArgs, type GetAccountTokensResponse, type GetBestListingResponse, type GetBestOfferResponse, type GetChainsResponse, type GetCollectionsPaginatedResponse, type GetCollectionsResponse, type GetContractResponse, type GetDropResponse, type GetDropsArgs, type GetDropsResponse, type GetEventsArgs, type GetEventsResponse, type GetListingsResponse, type GetNFTResponse, type GetOffersResponse, type GetOrderByHashResponse, type GetOrdersResponse, type GetSwapQuoteArgs, type GetSwapQuoteResponse, type GetTokenResponse, type GetTokensArgs, type GetTopCollectionsArgs, type GetTopTokensResponse, type GetTraitsResponse, type GetTrendingCollectionsArgs, type GetTrendingTokensResponse, type Listing, type ListNFTsResponse, type Offer, type ResolveAccountResponse, type SearchArgs, type SearchResponse, type ValidateMetadataResponse } from "./types";
4
+ /**
5
+ * The API class for the OpenSea SDK.
6
+ * @category Main Classes
7
+ */
8
+ export declare class OpenSeaAPI {
9
+ /**
10
+ * Base url for the API
11
+ */
12
+ readonly apiBaseUrl: string;
13
+ /**
14
+ * Default size to use for fetching orders
15
+ */
16
+ pageSize: number;
17
+ /**
18
+ * Logger function to use when debugging
19
+ */
20
+ logger: (arg: string) => void;
21
+ private apiKey;
22
+ private chain;
23
+ private ordersAPI;
24
+ private offersAPI;
25
+ private listingsAPI;
26
+ private collectionsAPI;
27
+ private nftsAPI;
28
+ private accountsAPI;
29
+ private eventsAPI;
30
+ private searchAPI;
31
+ private tokensAPI;
32
+ private chainsAPI;
33
+ private dropsAPI;
34
+ /**
35
+ * Create an instance of the OpenSeaAPI
36
+ * @param config OpenSeaAPIConfig for setting up the API, including an optional API key, Chain name, and base URL
37
+ * @param logger Optional function for logging debug strings before and after requests are made. Defaults to no logging
38
+ */
39
+ constructor(config: OpenSeaAPIConfig, logger?: (arg: string) => void);
40
+ /**
41
+ * Gets an order from API based on query options.
42
+ * @deprecated Use collection-based endpoints instead: getAllOffers, getAllListings, getBestOffer, getBestListing.
43
+ * @param options Query options for fetching an order
44
+ * @returns The first {@link OrderV2} returned by the API
45
+ *
46
+ * @throws An error if there are no matching orders.
47
+ */
48
+ getOrder(options: Omit<OrdersQueryOptions, "limit">): Promise<OrderV2>;
49
+ /**
50
+ * Gets a single order by its order hash.
51
+ * @param orderHash The hash of the order to fetch
52
+ * @param protocolAddress The address of the seaport contract
53
+ * @param chain The chain where the order is located. Defaults to the chain set in the constructor.
54
+ * @returns The {@link GetOrderByHashResponse} returned by the API (can be Offer or Listing)
55
+ * @throws An error if the order is not found
56
+ */
57
+ getOrderByHash(orderHash: string, protocolAddress: string, chain?: Chain): Promise<GetOrderByHashResponse>;
58
+ /**
59
+ * Gets a list of orders from API based on query options.
60
+ * @deprecated Use collection-based endpoints instead: getAllOffers, getAllListings, getBestOffer, getBestListing.
61
+ * @param options Query options for fetching orders
62
+ * @returns The {@link GetOrdersResponse} returned by the API.
63
+ */
64
+ getOrders(options: Omit<OrdersQueryOptions, "limit">): Promise<GetOrdersResponse>;
65
+ /**
66
+ * Gets all offers for a given collection.
67
+ * @param collectionSlug The slug of the collection.
68
+ * @param limit The number of offers to return. Must be between 1 and 100. Default: 100
69
+ * @param next The cursor for the next page of results. This is returned from a previous request.
70
+ * @returns The {@link GetOffersResponse} returned by the API.
71
+ */
72
+ getAllOffers(collectionSlug: string, limit?: number, next?: string): Promise<GetOffersResponse>;
73
+ /**
74
+ * Gets all listings for a given collection.
75
+ * @param collectionSlug The slug of the collection.
76
+ * @param limit The number of listings to return. Must be between 1 and 100. Default: 100
77
+ * @param next The cursor for the next page of results. This is returned from a previous request.
78
+ * @param includePrivateListings Whether to include private listings (default: false)
79
+ * @returns The {@link GetListingsResponse} returned by the API.
80
+ */
81
+ getAllListings(collectionSlug: string, limit?: number, next?: string, includePrivateListings?: boolean): Promise<GetListingsResponse>;
82
+ /**
83
+ * Gets trait offers for a given collection.
84
+ * @param collectionSlug The slug of the collection.
85
+ * @param type The name of the trait (e.g. 'Background').
86
+ * @param value The value of the trait (e.g. 'Red').
87
+ * @param limit The number of offers to return. Must be between 1 and 100. Default: 100
88
+ * @param next The cursor for the next page of results. This is returned from a previous request.
89
+ * @param floatValue The value of the trait for decimal-based numeric traits.
90
+ * @param intValue The value of the trait for integer-based numeric traits.
91
+ * @returns The {@link GetOffersResponse} returned by the API.
92
+ */
93
+ getTraitOffers(collectionSlug: string, type: string, value: string, limit?: number, next?: string, floatValue?: number, intValue?: number): Promise<GetOffersResponse>;
94
+ /**
95
+ * Gets the best offer for a given token.
96
+ * @param collectionSlug The slug of the collection.
97
+ * @param tokenId The token identifier.
98
+ * @returns The {@link GetBestOfferResponse} returned by the API.
99
+ */
100
+ getBestOffer(collectionSlug: string, tokenId: string | number): Promise<GetBestOfferResponse>;
101
+ /**
102
+ * Gets the best listing for a given token.
103
+ * @param collectionSlug The slug of the collection.
104
+ * @param tokenId The token identifier.
105
+ * @param includePrivateListings Whether to include private listings (default: false)
106
+ * @returns The {@link GetBestListingResponse} returned by the API.
107
+ */
108
+ getBestListing(collectionSlug: string, tokenId: string | number, includePrivateListings?: boolean): Promise<GetBestListingResponse>;
109
+ /**
110
+ * Gets the best listings for a given collection.
111
+ * @param collectionSlug The slug of the collection.
112
+ * @param limit The number of listings to return. Must be between 1 and 100. Default: 100
113
+ * @param next The cursor for the next page of results. This is returned from a previous request.
114
+ * @param includePrivateListings Whether to include private listings (default: false)
115
+ * @returns The {@link GetListingsResponse} returned by the API.
116
+ */
117
+ getBestListings(collectionSlug: string, limit?: number, next?: string, includePrivateListings?: boolean): Promise<GetListingsResponse>;
118
+ /**
119
+ * Generate the data needed to fulfill a listing or an offer onchain.
120
+ * @param fulfillerAddress The wallet address which will be used to fulfill the order
121
+ * @param orderHash The hash of the order to fulfill
122
+ * @param protocolAddress The address of the seaport contract
123
+ * @param side The side of the order (buy or sell)
124
+ * @param assetContractAddress Optional address of the NFT contract for criteria offers (e.g., collection offers)
125
+ * @param tokenId Optional token ID for criteria offers (e.g., collection offers)
126
+ * @param unitsToFill Optional number of units to fill. Defaults to 1 for both listings and offers.
127
+ * @param recipientAddress Optional recipient address for the NFT when fulfilling a listing. Not applicable for offers.
128
+ * @param includeOptionalCreatorFees Whether to include optional creator fees in the fulfillment. If creator fees are already required, this is a no-op. Defaults to false.
129
+ * @returns The {@link FulfillmentDataResponse}
130
+ */
131
+ generateFulfillmentData(fulfillerAddress: string, orderHash: string, protocolAddress: string, side: OrderSide, assetContractAddress?: string, tokenId?: string, unitsToFill?: string, recipientAddress?: string, includeOptionalCreatorFees?: boolean): Promise<FulfillmentDataResponse>;
132
+ /**
133
+ * Post an order to OpenSea.
134
+ * @deprecated Use postListing or postOffer instead.
135
+ * @param order The order to post
136
+ * @param apiOptions API options for the order
137
+ * @returns The {@link OrderV2} posted to the API.
138
+ */
139
+ postOrder(order: ProtocolData, apiOptions: OrderAPIOptions): Promise<OrderV2>;
140
+ /**
141
+ * Post a listing to OpenSea. Returns the new v2 Listing response format.
142
+ * @param order The order to post
143
+ * @param protocolAddress The contract address of the seaport protocol
144
+ * @returns The {@link Listing} posted to the API.
145
+ */
146
+ postListing(order: ProtocolData, protocolAddress: string): Promise<Listing>;
147
+ /**
148
+ * Post an offer to OpenSea. Returns the new v2 Offer response format.
149
+ * @param order The order to post
150
+ * @param protocolAddress The contract address of the seaport protocol
151
+ * @returns The {@link Offer} posted to the API.
152
+ */
153
+ postOffer(order: ProtocolData, protocolAddress: string): Promise<Offer>;
154
+ /**
155
+ * Build a OpenSea collection offer.
156
+ * @param offererAddress The wallet address which is creating the offer.
157
+ * @param quantity The number of NFTs requested in the offer.
158
+ * @param collectionSlug The slug (identifier) of the collection to build the offer for.
159
+ * @param offerProtectionEnabled Build the offer on OpenSea's signed zone to provide offer protections from receiving an item which is disabled from trading.
160
+ * @param traitType If defined, the trait name to create the collection offer for.
161
+ * @param traitValue If defined, the trait value to create the collection offer for.
162
+ * @param traits If defined, an array of traits to create the multi-trait collection offer for.
163
+ * @param numericTraits If defined, an array of numeric trait criteria with min/max ranges.
164
+ * @returns The {@link BuildOfferResponse} returned by the API.
165
+ */
166
+ buildOffer(offererAddress: string, quantity: number, collectionSlug: string, offerProtectionEnabled?: boolean, traitType?: string, traitValue?: string, traits?: Array<{
167
+ type: string;
168
+ value: string;
169
+ }>, numericTraits?: Array<{
170
+ type: string;
171
+ min?: number;
172
+ max?: number;
173
+ }>): Promise<BuildOfferResponse>;
174
+ /**
175
+ * Get a list collection offers for a given slug.
176
+ * @param slug The slug (identifier) of the collection to list offers for
177
+ * @param limit Optional limit for number of results.
178
+ * @param next Optional cursor for pagination.
179
+ * @returns The {@link GetOffersResponse} returned by the API.
180
+ */
181
+ getCollectionOffers(slug: string, limit?: number, next?: string): Promise<GetOffersResponse>;
182
+ /**
183
+ * Post a collection offer to OpenSea.
184
+ * @param order The collection offer to post.
185
+ * @param slug The slug (identifier) of the collection to post the offer for.
186
+ * @param traitType If defined, the trait name to create the collection offer for.
187
+ * @param traitValue If defined, the trait value to create the collection offer for.
188
+ * @param traits If defined, an array of traits to create the multi-trait collection offer for.
189
+ * @param numericTraits If defined, an array of numeric trait criteria with min/max ranges.
190
+ * @returns The {@link Offer} returned to the API.
191
+ */
192
+ postCollectionOffer(order: ProtocolData, slug: string, traitType?: string, traitValue?: string, traits?: Array<{
193
+ type: string;
194
+ value: string;
195
+ }>, numericTraits?: Array<{
196
+ type: string;
197
+ min?: number;
198
+ max?: number;
199
+ }>): Promise<CollectionOffer | null>;
200
+ /**
201
+ * Fetch multiple NFTs for a collection.
202
+ * @param slug The slug (identifier) of the collection
203
+ * @param limit The number of NFTs to retrieve. Must be greater than 0 and less than 51.
204
+ * @param next Cursor to retrieve the next page of NFTs
205
+ * @returns The {@link ListNFTsResponse} returned by the API.
206
+ */
207
+ getNFTsByCollection(slug: string, limit?: number | undefined, next?: string | undefined): Promise<ListNFTsResponse>;
208
+ /**
209
+ * Fetch multiple NFTs for a contract.
210
+ * @param address The NFT's contract address.
211
+ * @param limit The number of NFTs to retrieve. Must be greater than 0 and less than 51.
212
+ * @param next Cursor to retrieve the next page of NFTs.
213
+ * @param chain The NFT's chain.
214
+ * @returns The {@link ListNFTsResponse} returned by the API.
215
+ */
216
+ getNFTsByContract(address: string, limit?: number | undefined, next?: string | undefined, chain?: Chain): Promise<ListNFTsResponse>;
217
+ /**
218
+ * Fetch NFTs owned by an account.
219
+ * @param address The address of the account
220
+ * @param limit The number of NFTs to retrieve. Must be greater than 0 and less than 51.
221
+ * @param next Cursor to retrieve the next page of NFTs
222
+ * @param chain The chain to query. Defaults to the chain set in the constructor.
223
+ * @returns The {@link ListNFTsResponse} returned by the API.
224
+ */
225
+ getNFTsByAccount(address: string, limit?: number | undefined, next?: string | undefined, chain?: Chain): Promise<ListNFTsResponse>;
226
+ /**
227
+ * Fetch metadata, traits, ownership information, and rarity for a single NFT.
228
+ * @param address The NFT's contract address.
229
+ * @param identifier the identifier of the NFT (i.e. Token ID)
230
+ * @param chain The NFT's chain.
231
+ * @returns The {@link GetNFTResponse} returned by the API.
232
+ */
233
+ getNFT(address: string, identifier: string, chain?: Chain): Promise<GetNFTResponse>;
234
+ /**
235
+ * Fetch an OpenSea collection.
236
+ * @param slug The slug (identifier) of the collection.
237
+ * @returns The {@link OpenSeaCollection} returned by the API.
238
+ */
239
+ getCollection(slug: string): Promise<OpenSeaCollection>;
240
+ /**
241
+ * Fetch a list of OpenSea collections.
242
+ * @param orderBy The order to return the collections in. Default: CREATED_DATE
243
+ * @param chain The chain to filter the collections on. Default: all chains
244
+ * @param creatorUsername The creator's OpenSea username to filter the collections on.
245
+ * @param includeHidden If hidden collections should be returned. Default: false
246
+ * @param limit The limit of collections to return.
247
+ * @param next The cursor for the next page of results. This is returned from a previous request.
248
+ * @returns List of {@link OpenSeaCollection} returned by the API.
249
+ */
250
+ getCollections(orderBy?: CollectionOrderByOption, chain?: Chain, creatorUsername?: string, includeHidden?: boolean, limit?: number, next?: string): Promise<GetCollectionsResponse>;
251
+ /**
252
+ * Fetch stats for an OpenSea collection.
253
+ * @param slug The slug (identifier) of the collection.
254
+ * @returns The {@link OpenSeaCollection} returned by the API.
255
+ */
256
+ getCollectionStats(slug: string): Promise<OpenSeaCollectionStats>;
257
+ /**
258
+ * Fetch a payment token.
259
+ * @param address The address of the payment token
260
+ * @param chain The chain of the payment token
261
+ * @returns The {@link OpenSeaPaymentToken} returned by the API.
262
+ */
263
+ getPaymentToken(address: string, chain?: Chain): Promise<OpenSeaPaymentToken>;
264
+ /**
265
+ * Fetch account for an address.
266
+ * @param address The address to fetch the account for
267
+ * @returns The {@link OpenSeaAccount} returned by the API.
268
+ */
269
+ getAccount(address: string): Promise<OpenSeaAccount>;
270
+ /**
271
+ * Force refresh the metadata for an NFT.
272
+ * @param address The address of the NFT's contract.
273
+ * @param identifier The identifier of the NFT.
274
+ * @param chain The chain where the NFT is located.
275
+ * @returns The response from the API.
276
+ */
277
+ refreshNFTMetadata(address: string, identifier: string, chain?: Chain): Promise<Response>;
278
+ /**
279
+ * Offchain cancel an order, offer or listing, by its order hash when protected by the SignedZone.
280
+ * Protocol and Chain are required to prevent hash collisions.
281
+ * Please note cancellation is only assured if a fulfillment signature was not vended prior to cancellation.
282
+ * @param protocolAddress The Seaport address for the order.
283
+ * @param orderHash The order hash, or external identifier, of the order.
284
+ * @param chain The chain where the order is located.
285
+ * @param offererSignature An EIP-712 signature from the offerer of the order.
286
+ * If this is not provided, the user associated with the API Key will be checked instead.
287
+ * The signature must be a EIP-712 signature consisting of the order's Seaport contract's
288
+ * name, version, address, and chain. The struct to sign is `OrderHash` containing a
289
+ * single bytes32 field.
290
+ * @returns The response from the API.
291
+ */
292
+ offchainCancelOrder(protocolAddress: string, orderHash: string, chain?: Chain, offererSignature?: string): Promise<CancelOrderResponse>;
293
+ /**
294
+ * Gets a list of events based on query parameters.
295
+ * @param args Query parameters for filtering events.
296
+ * @returns The {@link GetEventsResponse} returned by the API.
297
+ */
298
+ getEvents(args?: GetEventsArgs): Promise<GetEventsResponse>;
299
+ /**
300
+ * Gets a list of events for a specific account.
301
+ * @param address The account address.
302
+ * @param args Query parameters for filtering events.
303
+ * @returns The {@link GetEventsResponse} returned by the API.
304
+ */
305
+ getEventsByAccount(address: string, args?: GetEventsArgs): Promise<GetEventsResponse>;
306
+ /**
307
+ * Gets a list of events for a specific collection.
308
+ * @param collectionSlug The slug (identifier) of the collection.
309
+ * @param args Query parameters for filtering events.
310
+ * @returns The {@link GetEventsResponse} returned by the API.
311
+ */
312
+ getEventsByCollection(collectionSlug: string, args?: GetEventsArgs): Promise<GetEventsResponse>;
313
+ /**
314
+ * Gets a list of events for a specific NFT.
315
+ * @param chain The chain where the NFT is located.
316
+ * @param address The contract address of the NFT.
317
+ * @param identifier The token identifier.
318
+ * @param args Query parameters for filtering events.
319
+ * @returns The {@link GetEventsResponse} returned by the API.
320
+ */
321
+ getEventsByNFT(chain: Chain, address: string, identifier: string, args?: GetEventsArgs): Promise<GetEventsResponse>;
322
+ /**
323
+ * Fetch smart contract information for a given chain and address.
324
+ * @param address The contract address.
325
+ * @param chain The chain where the contract is deployed. Defaults to the chain set in the constructor.
326
+ * @returns The {@link GetContractResponse} returned by the API.
327
+ */
328
+ getContract(address: string, chain?: Chain): Promise<GetContractResponse>;
329
+ /**
330
+ * Fetch all traits for a collection with their possible values and counts.
331
+ * @param collectionSlug The slug (identifier) of the collection.
332
+ * @returns The {@link GetTraitsResponse} returned by the API.
333
+ */
334
+ getTraits(collectionSlug: string): Promise<GetTraitsResponse>;
335
+ /**
336
+ * Gets a list of trending tokens.
337
+ * @param args Optional query parameters for pagination.
338
+ * @returns The {@link GetTrendingTokensResponse} returned by the API.
339
+ */
340
+ getTrendingTokens(args?: GetTokensArgs): Promise<GetTrendingTokensResponse>;
341
+ /**
342
+ * Gets a list of top tokens.
343
+ * @param args Optional query parameters for pagination.
344
+ * @returns The {@link GetTopTokensResponse} returned by the API.
345
+ */
346
+ getTopTokens(args?: GetTokensArgs): Promise<GetTopTokensResponse>;
347
+ /**
348
+ * Gets a swap quote for exchanging tokens.
349
+ * @param args Query parameters for the swap quote including token addresses, amount, and chain.
350
+ * @returns The {@link GetSwapQuoteResponse} returned by the API.
351
+ */
352
+ getSwapQuote(args: GetSwapQuoteArgs): Promise<GetSwapQuoteResponse>;
353
+ /**
354
+ * Gets details for a specific token.
355
+ * @param chain The chain the token is on.
356
+ * @param address The token contract address.
357
+ * @returns The {@link GetTokenResponse} returned by the API.
358
+ */
359
+ getToken(chain: string, address: string): Promise<GetTokenResponse>;
360
+ /**
361
+ * Search across collections, tokens, NFTs, and accounts.
362
+ * Results are ranked by relevance.
363
+ * @param args Query parameters including query text, optional chain/asset type filters, and limit.
364
+ * @returns The {@link SearchResponse} returned by the API.
365
+ */
366
+ search(args: SearchArgs): Promise<SearchResponse>;
367
+ /**
368
+ * Gets the list of supported blockchains and their capabilities.
369
+ * @returns The {@link GetChainsResponse} returned by the API.
370
+ */
371
+ getChains(): Promise<GetChainsResponse>;
372
+ /**
373
+ * Gets token balances for a given account.
374
+ * @param address The wallet address to fetch token balances for.
375
+ * @param args Optional query parameters for filtering and pagination.
376
+ * @returns The {@link GetAccountTokensResponse} returned by the API.
377
+ */
378
+ getAccountTokens(address: string, args?: GetAccountTokensArgs): Promise<GetAccountTokensResponse>;
379
+ /**
380
+ * Validate NFT metadata by fetching and parsing it.
381
+ * @param address The NFT contract address.
382
+ * @param identifier The token identifier.
383
+ * @param chain The chain where the NFT is located. Defaults to the chain set in the constructor.
384
+ * @param ignoreCachedItemUrls Whether to ignore cached item URLs and re-fetch from source.
385
+ * @returns The {@link ValidateMetadataResponse} returned by the API.
386
+ */
387
+ validateNFTMetadata(address: string, identifier: string, chain?: Chain, ignoreCachedItemUrls?: boolean): Promise<ValidateMetadataResponse>;
388
+ /**
389
+ * Gets all active offers for a specific NFT (not just the best offer).
390
+ * @param assetContractAddress The NFT contract address.
391
+ * @param tokenId The token identifier.
392
+ * @param limit The number of offers to return. Must be between 1 and 100.
393
+ * @param next The cursor for the next page of results. This is returned from a previous request.
394
+ * @param chain The chain where the NFT is located. Defaults to the chain set in the constructor.
395
+ * @returns The {@link GetOffersResponse} returned by the API.
396
+ */
397
+ getNFTOffers(assetContractAddress: string, tokenId: string, limit?: number, next?: string, chain?: Chain): Promise<GetOffersResponse>;
398
+ /**
399
+ * Gets all active listings for a specific NFT (not just the best listing).
400
+ * @param assetContractAddress The NFT contract address.
401
+ * @param tokenId The token identifier.
402
+ * @param limit The number of listings to return. Must be between 1 and 100.
403
+ * @param next The cursor for the next page of results. This is returned from a previous request.
404
+ * @param chain The chain where the NFT is located. Defaults to the chain set in the constructor.
405
+ * @param includePrivateListings Whether to include private listings (default: false)
406
+ * @returns The {@link GetListingsResponse} returned by the API.
407
+ */
408
+ getNFTListings(assetContractAddress: string, tokenId: string, limit?: number, next?: string, chain?: Chain, includePrivateListings?: boolean): Promise<GetListingsResponse>;
409
+ /**
410
+ * Gets a list of drops (mints).
411
+ * @param args Optional query parameters for filtering and pagination.
412
+ * @returns The {@link GetDropsResponse} returned by the API.
413
+ */
414
+ getDrops(args?: GetDropsArgs): Promise<GetDropsResponse>;
415
+ /**
416
+ * Gets detailed drop information for a collection.
417
+ * @param slug The collection slug identifying the drop.
418
+ * @returns The {@link GetDropResponse} returned by the API.
419
+ */
420
+ getDrop(slug: string): Promise<GetDropResponse>;
421
+ /**
422
+ * Builds a mint transaction for a drop.
423
+ * @param slug The collection slug identifying the drop.
424
+ * @param request The mint request containing minter address and quantity.
425
+ * @returns The {@link DropMintResponse} with ready-to-sign transaction data.
426
+ */
427
+ buildDropMintTransaction(slug: string, request: DropMintRequest): Promise<DropMintResponse>;
428
+ /**
429
+ * Gets trending collections sorted by sales activity.
430
+ * @param args Optional query parameters for timeframe, chain, category, and pagination.
431
+ * @returns The {@link GetCollectionsPaginatedResponse} returned by the API.
432
+ */
433
+ getTrendingCollections(args?: GetTrendingCollectionsArgs): Promise<GetCollectionsPaginatedResponse>;
434
+ /**
435
+ * Gets top collections ranked by various stats.
436
+ * @param args Optional query parameters for sort_by, chain, category, and pagination.
437
+ * @returns The {@link GetCollectionsPaginatedResponse} returned by the API.
438
+ */
439
+ getTopCollections(args?: GetTopCollectionsArgs): Promise<GetCollectionsPaginatedResponse>;
440
+ /**
441
+ * Resolve an ENS name, OpenSea username, or wallet address to canonical account info.
442
+ * @param identifier An ENS name (e.g. vitalik.eth), OpenSea username, or wallet address.
443
+ * @returns The {@link ResolveAccountResponse} returned by the API.
444
+ */
445
+ resolveAccount(identifier: string): Promise<ResolveAccountResponse>;
446
+ /**
447
+ * Generic fetch method for any API endpoint with automatic rate limit retry
448
+ * @param apiPath Path to URL endpoint under API
449
+ * @param query URL query params. Will be used to create a URLSearchParams object.
450
+ * @param options Request options like timeout and abort signal.
451
+ * @returns @typeParam T The response from the API.
452
+ */
453
+ get<T>(apiPath: string, query?: object, options?: RequestOptions): Promise<T>;
454
+ /**
455
+ * Generic post method for any API endpoint with automatic rate limit retry
456
+ * @param apiPath Path to URL endpoint under API
457
+ * @param body Data to send.
458
+ * @param headers Additional headers to send with the request.
459
+ * @param options Request options like timeout and abort signal.
460
+ * @returns @typeParam T The response from the API.
461
+ */
462
+ post<T>(apiPath: string, body?: object, headers?: object, options?: RequestOptions): Promise<T>;
463
+ private objectToSearchParams;
464
+ /**
465
+ * Fetch from an API Endpoint, sending auth token in headers
466
+ * @param url The URL to fetch
467
+ * @param headers Additional headers to send with the request
468
+ * @param body Optional body to send. If set, will POST, otherwise GET
469
+ * @param options Request options like timeout and abort signal
470
+ */
471
+ private _fetch;
472
+ /**
473
+ * Maximum retry-after value in seconds (5 minutes).
474
+ * Prevents excessively long waits from buggy or malicious servers.
475
+ */
476
+ private static readonly MAX_RETRY_AFTER_SECONDS;
477
+ /**
478
+ * Parses the retry-after header from the response with robust error handling.
479
+ * @param response The HTTP response object from the API
480
+ * @returns The retry-after value in seconds (capped at 5 minutes), or undefined if not present or invalid
481
+ */
482
+ private _parseRetryAfter;
483
+ /**
484
+ * Creates a rate limit error with status code and retry-after information.
485
+ * @param response The HTTP response object from the API
486
+ * @returns An enhanced Error object with statusCode, retryAfter and responseBody properties
487
+ */
488
+ private _createRateLimitError;
489
+ }