@opensea/sdk 9.0.0 → 10.1.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 (311) hide show
  1. package/README.md +35 -6
  2. package/lib/abi/abis.d.ts +301 -0
  3. package/lib/abi/abis.js +231 -0
  4. package/lib/abi/abis.js.map +1 -0
  5. package/lib/api/api.d.ts +26 -2
  6. package/lib/api/api.js +83 -51
  7. package/lib/api/api.js.map +1 -1
  8. package/lib/api/apiPaths.d.ts +2 -0
  9. package/lib/api/apiPaths.js +9 -1
  10. package/lib/api/apiPaths.js.map +1 -1
  11. package/lib/api/nfts.d.ts +13 -2
  12. package/lib/api/nfts.js +18 -0
  13. package/lib/api/nfts.js.map +1 -1
  14. package/lib/api/orders.js +2 -2
  15. package/lib/api/orders.js.map +1 -1
  16. package/lib/api/types.d.ts +7 -0
  17. package/lib/api/types.js.map +1 -1
  18. package/lib/constants.d.ts +2 -2
  19. package/lib/constants.js +7 -4
  20. package/lib/constants.js.map +1 -1
  21. package/lib/index.d.ts +2 -0
  22. package/lib/index.js +1 -0
  23. package/lib/index.js.map +1 -1
  24. package/lib/orders/privateListings.js +2 -2
  25. package/lib/orders/privateListings.js.map +1 -1
  26. package/lib/orders/utils.js +9 -1
  27. package/lib/orders/utils.js.map +1 -1
  28. package/lib/provider/ethers-adapter.d.ts +17 -0
  29. package/lib/provider/ethers-adapter.js +135 -0
  30. package/lib/provider/ethers-adapter.js.map +1 -0
  31. package/lib/provider/seaport-bridge.d.ts +11 -0
  32. package/lib/provider/seaport-bridge.js +130 -0
  33. package/lib/provider/seaport-bridge.js.map +1 -0
  34. package/lib/provider/types.d.ts +62 -0
  35. package/lib/provider/types.js +7 -0
  36. package/lib/provider/types.js.map +1 -0
  37. package/lib/provider/viem-adapter.d.ts +27 -0
  38. package/lib/provider/viem-adapter.js +122 -0
  39. package/lib/provider/viem-adapter.js.map +1 -0
  40. package/lib/sdk/assets.d.ts +7 -23
  41. package/lib/sdk/assets.js +101 -77
  42. package/lib/sdk/assets.js.map +1 -1
  43. package/lib/sdk/base.d.ts +350 -0
  44. package/lib/sdk/base.js +325 -0
  45. package/lib/sdk/base.js.map +1 -0
  46. package/lib/sdk/cancellation.d.ts +1 -2
  47. package/lib/sdk/cancellation.js +4 -4
  48. package/lib/sdk/cancellation.js.map +1 -1
  49. package/lib/sdk/context.d.ts +5 -5
  50. package/lib/sdk/fulfillment.d.ts +20 -59
  51. package/lib/sdk/fulfillment.js +18 -58
  52. package/lib/sdk/fulfillment.js.map +1 -1
  53. package/lib/sdk/orders.d.ts +25 -26
  54. package/lib/sdk/orders.js +8 -9
  55. package/lib/sdk/orders.js.map +1 -1
  56. package/lib/sdk/tokens.d.ts +3 -3
  57. package/lib/sdk/tokens.js +17 -7
  58. package/lib/sdk/tokens.js.map +1 -1
  59. package/lib/sdk.d.ts +16 -550
  60. package/lib/sdk.js +35 -663
  61. package/lib/sdk.js.map +1 -1
  62. package/lib/types.d.ts +11 -6
  63. package/lib/types.js +3 -3
  64. package/lib/types.js.map +1 -1
  65. package/lib/utils/address.d.ts +12 -0
  66. package/lib/utils/address.js +39 -0
  67. package/lib/utils/address.js.map +1 -0
  68. package/lib/utils/chain.d.ts +1 -1
  69. package/lib/utils/fees.d.ts +5 -0
  70. package/lib/utils/fees.js +24 -6
  71. package/lib/utils/fees.js.map +1 -1
  72. package/lib/utils/protocol.js +5 -5
  73. package/lib/utils/protocol.js.map +1 -1
  74. package/lib/utils/units.d.ts +12 -0
  75. package/lib/utils/units.js +43 -0
  76. package/lib/utils/units.js.map +1 -0
  77. package/lib/utils/utils.d.ts +2 -10
  78. package/lib/utils/utils.js +2 -17
  79. package/lib/utils/utils.js.map +1 -1
  80. package/lib/viem.d.ts +44 -0
  81. package/lib/viem.js +114 -0
  82. package/lib/viem.js.map +1 -0
  83. package/package.json +31 -13
  84. package/src/abi/abis.ts +236 -0
  85. package/src/api/api.ts +100 -59
  86. package/src/api/apiPaths.ts +16 -0
  87. package/src/api/nfts.ts +37 -1
  88. package/src/api/orders.ts +2 -2
  89. package/src/api/types.ts +8 -0
  90. package/src/constants.ts +7 -3
  91. package/src/index.ts +8 -0
  92. package/src/orders/privateListings.ts +2 -2
  93. package/src/orders/utils.ts +8 -1
  94. package/src/provider/ethers-adapter.ts +182 -0
  95. package/src/provider/seaport-bridge.ts +163 -0
  96. package/src/provider/types.ts +67 -0
  97. package/src/provider/viem-adapter.ts +165 -0
  98. package/src/sdk/assets.ts +128 -158
  99. package/src/sdk/base.ts +577 -0
  100. package/src/sdk/cancellation.ts +6 -9
  101. package/src/sdk/context.ts +5 -5
  102. package/src/sdk/fulfillment.ts +34 -73
  103. package/src/sdk/orders.ts +44 -44
  104. package/src/sdk/tokens.ts +18 -18
  105. package/src/sdk.ts +40 -1011
  106. package/src/types.ts +12 -6
  107. package/src/utils/address.ts +40 -0
  108. package/src/utils/fees.ts +28 -8
  109. package/src/utils/protocol.ts +5 -5
  110. package/src/utils/units.ts +47 -0
  111. package/src/utils/utils.ts +2 -22
  112. package/src/viem.ts +125 -0
  113. package/lib/src/api/accounts.d.ts +0 -18
  114. package/lib/src/api/accounts.js +0 -30
  115. package/lib/src/api/accounts.js.map +0 -1
  116. package/lib/src/api/api.d.ts +0 -429
  117. package/lib/src/api/api.js +0 -652
  118. package/lib/src/api/api.js.map +0 -1
  119. package/lib/src/api/apiPaths.d.ts +0 -37
  120. package/lib/src/api/apiPaths.js +0 -140
  121. package/lib/src/api/apiPaths.js.map +0 -1
  122. package/lib/src/api/collections.d.ts +0 -26
  123. package/lib/src/api/collections.js +0 -57
  124. package/lib/src/api/collections.js.map +0 -1
  125. package/lib/src/api/events.d.ts +0 -26
  126. package/lib/src/api/events.js +0 -42
  127. package/lib/src/api/events.js.map +0 -1
  128. package/lib/src/api/fetcher.d.ts +0 -24
  129. package/lib/src/api/fetcher.js +0 -3
  130. package/lib/src/api/fetcher.js.map +0 -1
  131. package/lib/src/api/index.d.ts +0 -2
  132. package/lib/src/api/index.js +0 -19
  133. package/lib/src/api/index.js.map +0 -1
  134. package/lib/src/api/listings.d.ts +0 -44
  135. package/lib/src/api/listings.js +0 -86
  136. package/lib/src/api/listings.js.map +0 -1
  137. package/lib/src/api/nfts.d.ts +0 -35
  138. package/lib/src/api/nfts.js +0 -66
  139. package/lib/src/api/nfts.js.map +0 -1
  140. package/lib/src/api/offers.d.ts +0 -54
  141. package/lib/src/api/offers.js +0 -122
  142. package/lib/src/api/offers.js.map +0 -1
  143. package/lib/src/api/orders.d.ts +0 -50
  144. package/lib/src/api/orders.js +0 -151
  145. package/lib/src/api/orders.js.map +0 -1
  146. package/lib/src/api/search.d.ts +0 -13
  147. package/lib/src/api/search.js +0 -21
  148. package/lib/src/api/search.js.map +0 -1
  149. package/lib/src/api/tokens.d.ts +0 -25
  150. package/lib/src/api/tokens.js +0 -42
  151. package/lib/src/api/tokens.js.map +0 -1
  152. package/lib/src/api/types.d.ts +0 -840
  153. package/lib/src/api/types.js +0 -65
  154. package/lib/src/api/types.js.map +0 -1
  155. package/lib/src/constants.d.ts +0 -22
  156. package/lib/src/constants.js +0 -52
  157. package/lib/src/constants.js.map +0 -1
  158. package/lib/src/index.d.ts +0 -18
  159. package/lib/src/index.js +0 -24
  160. package/lib/src/index.js.map +0 -1
  161. package/lib/src/orders/privateListings.d.ts +0 -12
  162. package/lib/src/orders/privateListings.js +0 -130
  163. package/lib/src/orders/privateListings.js.map +0 -1
  164. package/lib/src/orders/types.d.ts +0 -160
  165. package/lib/src/orders/types.js +0 -10
  166. package/lib/src/orders/types.js.map +0 -1
  167. package/lib/src/orders/utils.d.ts +0 -89
  168. package/lib/src/orders/utils.js +0 -177
  169. package/lib/src/orders/utils.js.map +0 -1
  170. package/lib/src/sdk/assets.d.ts +0 -104
  171. package/lib/src/sdk/assets.js +0 -397
  172. package/lib/src/sdk/assets.js.map +0 -1
  173. package/lib/src/sdk/cancellation.d.ts +0 -97
  174. package/lib/src/sdk/cancellation.js +0 -234
  175. package/lib/src/sdk/cancellation.js.map +0 -1
  176. package/lib/src/sdk/context.d.ts +0 -28
  177. package/lib/src/sdk/context.js +0 -3
  178. package/lib/src/sdk/context.js.map +0 -1
  179. package/lib/src/sdk/fulfillment.d.ts +0 -153
  180. package/lib/src/sdk/fulfillment.js +0 -296
  181. package/lib/src/sdk/fulfillment.js.map +0 -1
  182. package/lib/src/sdk/orders.d.ts +0 -253
  183. package/lib/src/sdk/orders.js +0 -677
  184. package/lib/src/sdk/orders.js.map +0 -1
  185. package/lib/src/sdk/tokens.d.ts +0 -31
  186. package/lib/src/sdk/tokens.js +0 -64
  187. package/lib/src/sdk/tokens.js.map +0 -1
  188. package/lib/src/sdk.d.ts +0 -560
  189. package/lib/src/sdk.js +0 -675
  190. package/lib/src/sdk.js.map +0 -1
  191. package/lib/src/typechain/contracts/ERC1155.d.ts +0 -236
  192. package/lib/src/typechain/contracts/ERC1155.js +0 -3
  193. package/lib/src/typechain/contracts/ERC1155.js.map +0 -1
  194. package/lib/src/typechain/contracts/ERC20.d.ts +0 -141
  195. package/lib/src/typechain/contracts/ERC20.js +0 -3
  196. package/lib/src/typechain/contracts/ERC20.js.map +0 -1
  197. package/lib/src/typechain/contracts/ERC721.d.ts +0 -213
  198. package/lib/src/typechain/contracts/ERC721.js +0 -3
  199. package/lib/src/typechain/contracts/ERC721.js.map +0 -1
  200. package/lib/src/typechain/contracts/Multicall3.d.ts +0 -57
  201. package/lib/src/typechain/contracts/Multicall3.js +0 -3
  202. package/lib/src/typechain/contracts/Multicall3.js.map +0 -1
  203. package/lib/src/typechain/contracts/TransferHelper.d.ts +0 -55
  204. package/lib/src/typechain/contracts/TransferHelper.js +0 -3
  205. package/lib/src/typechain/contracts/TransferHelper.js.map +0 -1
  206. package/lib/src/typechain/contracts/common.d.ts +0 -50
  207. package/lib/src/typechain/contracts/common.js +0 -3
  208. package/lib/src/typechain/contracts/common.js.map +0 -1
  209. package/lib/src/typechain/contracts/factories/ERC1155__factory.d.ts +0 -250
  210. package/lib/src/typechain/contracts/factories/ERC1155__factory.js +0 -332
  211. package/lib/src/typechain/contracts/factories/ERC1155__factory.js.map +0 -1
  212. package/lib/src/typechain/contracts/factories/ERC20__factory.d.ts +0 -174
  213. package/lib/src/typechain/contracts/factories/ERC20__factory.js +0 -240
  214. package/lib/src/typechain/contracts/factories/ERC20__factory.js.map +0 -1
  215. package/lib/src/typechain/contracts/factories/ERC721__factory.d.ts +0 -268
  216. package/lib/src/typechain/contracts/factories/ERC721__factory.js +0 -351
  217. package/lib/src/typechain/contracts/factories/ERC721__factory.js.map +0 -1
  218. package/lib/src/typechain/contracts/factories/Multicall3__factory.d.ts +0 -43
  219. package/lib/src/typechain/contracts/factories/Multicall3__factory.js +0 -68
  220. package/lib/src/typechain/contracts/factories/Multicall3__factory.js.map +0 -1
  221. package/lib/src/typechain/contracts/factories/TransferHelper__factory.d.ts +0 -46
  222. package/lib/src/typechain/contracts/factories/TransferHelper__factory.js +0 -71
  223. package/lib/src/typechain/contracts/factories/TransferHelper__factory.js.map +0 -1
  224. package/lib/src/typechain/contracts/factories/index.d.ts +0 -5
  225. package/lib/src/typechain/contracts/factories/index.js +0 -17
  226. package/lib/src/typechain/contracts/factories/index.js.map +0 -1
  227. package/lib/src/typechain/contracts/index.d.ts +0 -11
  228. package/lib/src/typechain/contracts/index.js +0 -48
  229. package/lib/src/typechain/contracts/index.js.map +0 -1
  230. package/lib/src/types.d.ts +0 -387
  231. package/lib/src/types.js +0 -127
  232. package/lib/src/types.js.map +0 -1
  233. package/lib/src/utils/chain.d.ts +0 -60
  234. package/lib/src/utils/chain.js +0 -248
  235. package/lib/src/utils/chain.js.map +0 -1
  236. package/lib/src/utils/converters.d.ts +0 -37
  237. package/lib/src/utils/converters.js +0 -137
  238. package/lib/src/utils/converters.js.map +0 -1
  239. package/lib/src/utils/dateHelper.d.ts +0 -38
  240. package/lib/src/utils/dateHelper.js +0 -52
  241. package/lib/src/utils/dateHelper.js.map +0 -1
  242. package/lib/src/utils/fees.d.ts +0 -13
  243. package/lib/src/utils/fees.js +0 -29
  244. package/lib/src/utils/fees.js.map +0 -1
  245. package/lib/src/utils/index.d.ts +0 -2
  246. package/lib/src/utils/index.js +0 -19
  247. package/lib/src/utils/index.js.map +0 -1
  248. package/lib/src/utils/protocol.d.ts +0 -75
  249. package/lib/src/utils/protocol.js +0 -161
  250. package/lib/src/utils/protocol.js.map +0 -1
  251. package/lib/src/utils/rateLimit.d.ts +0 -34
  252. package/lib/src/utils/rateLimit.js +0 -97
  253. package/lib/src/utils/rateLimit.js.map +0 -1
  254. package/lib/src/utils/stringHelper.d.ts +0 -18
  255. package/lib/src/utils/stringHelper.js +0 -24
  256. package/lib/src/utils/stringHelper.js.map +0 -1
  257. package/lib/src/utils/utils.d.ts +0 -18
  258. package/lib/src/utils/utils.js +0 -45
  259. package/lib/src/utils/utils.js.map +0 -1
  260. package/lib/typechain/contracts/ERC1155.d.ts +0 -236
  261. package/lib/typechain/contracts/ERC1155.js +0 -3
  262. package/lib/typechain/contracts/ERC1155.js.map +0 -1
  263. package/lib/typechain/contracts/ERC20.d.ts +0 -141
  264. package/lib/typechain/contracts/ERC20.js +0 -3
  265. package/lib/typechain/contracts/ERC20.js.map +0 -1
  266. package/lib/typechain/contracts/ERC721.d.ts +0 -213
  267. package/lib/typechain/contracts/ERC721.js +0 -3
  268. package/lib/typechain/contracts/ERC721.js.map +0 -1
  269. package/lib/typechain/contracts/Multicall3.d.ts +0 -57
  270. package/lib/typechain/contracts/Multicall3.js +0 -3
  271. package/lib/typechain/contracts/Multicall3.js.map +0 -1
  272. package/lib/typechain/contracts/TransferHelper.d.ts +0 -55
  273. package/lib/typechain/contracts/TransferHelper.js +0 -3
  274. package/lib/typechain/contracts/TransferHelper.js.map +0 -1
  275. package/lib/typechain/contracts/common.d.ts +0 -50
  276. package/lib/typechain/contracts/common.js +0 -3
  277. package/lib/typechain/contracts/common.js.map +0 -1
  278. package/lib/typechain/contracts/factories/ERC1155__factory.d.ts +0 -250
  279. package/lib/typechain/contracts/factories/ERC1155__factory.js +0 -332
  280. package/lib/typechain/contracts/factories/ERC1155__factory.js.map +0 -1
  281. package/lib/typechain/contracts/factories/ERC20__factory.d.ts +0 -174
  282. package/lib/typechain/contracts/factories/ERC20__factory.js +0 -240
  283. package/lib/typechain/contracts/factories/ERC20__factory.js.map +0 -1
  284. package/lib/typechain/contracts/factories/ERC721__factory.d.ts +0 -268
  285. package/lib/typechain/contracts/factories/ERC721__factory.js +0 -351
  286. package/lib/typechain/contracts/factories/ERC721__factory.js.map +0 -1
  287. package/lib/typechain/contracts/factories/Multicall3__factory.d.ts +0 -43
  288. package/lib/typechain/contracts/factories/Multicall3__factory.js +0 -68
  289. package/lib/typechain/contracts/factories/Multicall3__factory.js.map +0 -1
  290. package/lib/typechain/contracts/factories/TransferHelper__factory.d.ts +0 -46
  291. package/lib/typechain/contracts/factories/TransferHelper__factory.js +0 -71
  292. package/lib/typechain/contracts/factories/TransferHelper__factory.js.map +0 -1
  293. package/lib/typechain/contracts/factories/index.d.ts +0 -5
  294. package/lib/typechain/contracts/factories/index.js +0 -17
  295. package/lib/typechain/contracts/factories/index.js.map +0 -1
  296. package/lib/typechain/contracts/index.d.ts +0 -11
  297. package/lib/typechain/contracts/index.js +0 -48
  298. package/lib/typechain/contracts/index.js.map +0 -1
  299. package/src/typechain/contracts/ERC1155.ts +0 -440
  300. package/src/typechain/contracts/ERC20.ts +0 -286
  301. package/src/typechain/contracts/ERC721.ts +0 -412
  302. package/src/typechain/contracts/Multicall3.ts +0 -117
  303. package/src/typechain/contracts/TransferHelper.ts +0 -122
  304. package/src/typechain/contracts/common.ts +0 -131
  305. package/src/typechain/contracts/factories/ERC1155__factory.ts +0 -331
  306. package/src/typechain/contracts/factories/ERC20__factory.ts +0 -239
  307. package/src/typechain/contracts/factories/ERC721__factory.ts +0 -350
  308. package/src/typechain/contracts/factories/Multicall3__factory.ts +0 -67
  309. package/src/typechain/contracts/factories/TransferHelper__factory.ts +0 -76
  310. package/src/typechain/contracts/factories/index.ts +0 -8
  311. package/src/typechain/contracts/index.ts +0 -14
package/README.md CHANGED
@@ -12,16 +12,45 @@
12
12
 
13
13
  # @opensea/sdk <!-- omit in toc -->
14
14
 
15
- > **Note:** This package was previously published as `opensea-js`. The API is unchanged.
15
+ This is the TypeScript SDK for [OpenSea](https://opensea.io), the largest marketplace for NFTs and tokens.
16
16
 
17
- This is the TypeScript SDK for [OpenSea](https://opensea.io), the largest marketplace for NFTs.
17
+ It allows developers to access the official orderbook, filter it, create listings and offers, complete trades programmatically, and swap tokens across chains.
18
18
 
19
- It allows developers to access the official orderbook, filter it, create listings and offers, and complete trades programmatically.
19
+ Get started by getting an API key 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.
20
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.
21
+ Get an API key instantly (no signup needed):
22
+
23
+ ```bash
24
+ curl -s -X POST https://api.opensea.io/api/v2/auth/keys | jq -r '.api_key'
25
+ ```
26
+
27
+ Or get a full key at [opensea.io/settings/developer](https://opensea.io/settings/developer) for higher rate limits. See [API key docs](https://docs.opensea.io/reference/api-keys) for details.
22
28
 
23
29
  Happy seafaring!
24
30
 
31
+ ## Quick Start
32
+
33
+ ### With ethers.js
34
+
35
+ ```typescript
36
+ import { ethers } from "ethers";
37
+ import { OpenSeaSDK, Chain } from "@opensea/sdk";
38
+
39
+ const provider = new ethers.JsonRpcProvider("https://eth-mainnet.g.alchemy.com/v2/YOUR_ALCHEMY_API_KEY");
40
+ const sdk = new OpenSeaSDK(provider, { chain: Chain.Mainnet, apiKey: "YOUR_API_KEY" });
41
+ ```
42
+
43
+ ### With viem
44
+
45
+ ```typescript
46
+ import { createPublicClient, createWalletClient, http } from 'viem'
47
+ import { mainnet } from 'viem/chains'
48
+ import { OpenSeaSDK, Chain } from '@opensea/sdk/viem'
49
+
50
+ const publicClient = createPublicClient({ chain: mainnet, transport: http() })
51
+ const sdk = new OpenSeaSDK({ publicClient }, { chain: Chain.Mainnet, apiKey: 'YOUR_API_KEY' })
52
+ ```
53
+
25
54
  ## Documentation
26
55
 
27
56
  - [Quick Start Guide](developerDocs/quick-start.md)
@@ -58,8 +87,8 @@ The changelog for recent versions can be found at:
58
87
  [version-link]: https://github.com/ProjectOpenSea/opensea-js/releases
59
88
  [npm-badge]: https://img.shields.io/npm/v/@opensea/sdk?color=red
60
89
  [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
90
+ [ci-badge]: https://github.com/ProjectOpenSea/opensea-js/actions/workflows/ci.yml/badge.svg
91
+ [ci-link]: https://github.com/ProjectOpenSea/opensea-js/actions/workflows/ci.yml
63
92
  [coverage-badge]: https://coveralls.io/repos/github/ProjectOpenSea/opensea-js/badge.svg?branch=main
64
93
  [coverage-link]: https://coveralls.io/github/ProjectOpenSea/opensea-js?branch=main
65
94
  [license-badge]: https://img.shields.io/github/license/ProjectOpenSea/opensea-js
@@ -0,0 +1,301 @@
1
+ /**
2
+ * Minimal ABI definitions for the contract calls the SDK makes.
3
+ * These replace the TypeChain-generated factories from v9.
4
+ */
5
+ export declare const ERC20_ABI: readonly [{
6
+ readonly name: "balanceOf";
7
+ readonly type: "function";
8
+ readonly stateMutability: "view";
9
+ readonly inputs: readonly [{
10
+ readonly name: "account";
11
+ readonly type: "address";
12
+ }];
13
+ readonly outputs: readonly [{
14
+ readonly name: "";
15
+ readonly type: "uint256";
16
+ }];
17
+ }, {
18
+ readonly name: "transfer";
19
+ readonly type: "function";
20
+ readonly stateMutability: "nonpayable";
21
+ readonly inputs: readonly [{
22
+ readonly name: "to";
23
+ readonly type: "address";
24
+ }, {
25
+ readonly name: "amount";
26
+ readonly type: "uint256";
27
+ }];
28
+ readonly outputs: readonly [{
29
+ readonly name: "";
30
+ readonly type: "bool";
31
+ }];
32
+ }, {
33
+ readonly name: "allowance";
34
+ readonly type: "function";
35
+ readonly stateMutability: "view";
36
+ readonly inputs: readonly [{
37
+ readonly name: "owner";
38
+ readonly type: "address";
39
+ }, {
40
+ readonly name: "spender";
41
+ readonly type: "address";
42
+ }];
43
+ readonly outputs: readonly [{
44
+ readonly name: "";
45
+ readonly type: "uint256";
46
+ }];
47
+ }, {
48
+ readonly name: "approve";
49
+ readonly type: "function";
50
+ readonly stateMutability: "nonpayable";
51
+ readonly inputs: readonly [{
52
+ readonly name: "spender";
53
+ readonly type: "address";
54
+ }, {
55
+ readonly name: "amount";
56
+ readonly type: "uint256";
57
+ }];
58
+ readonly outputs: readonly [{
59
+ readonly name: "";
60
+ readonly type: "bool";
61
+ }];
62
+ }];
63
+ export declare const ERC721_ABI: readonly [{
64
+ readonly name: "ownerOf";
65
+ readonly type: "function";
66
+ readonly stateMutability: "view";
67
+ readonly inputs: readonly [{
68
+ readonly name: "tokenId";
69
+ readonly type: "uint256";
70
+ }];
71
+ readonly outputs: readonly [{
72
+ readonly name: "";
73
+ readonly type: "address";
74
+ }];
75
+ }, {
76
+ readonly name: "transferFrom";
77
+ readonly type: "function";
78
+ readonly stateMutability: "nonpayable";
79
+ readonly inputs: readonly [{
80
+ readonly name: "from";
81
+ readonly type: "address";
82
+ }, {
83
+ readonly name: "to";
84
+ readonly type: "address";
85
+ }, {
86
+ readonly name: "tokenId";
87
+ readonly type: "uint256";
88
+ }];
89
+ readonly outputs: readonly [];
90
+ }, {
91
+ readonly name: "isApprovedForAll";
92
+ readonly type: "function";
93
+ readonly stateMutability: "view";
94
+ readonly inputs: readonly [{
95
+ readonly name: "owner";
96
+ readonly type: "address";
97
+ }, {
98
+ readonly name: "operator";
99
+ readonly type: "address";
100
+ }];
101
+ readonly outputs: readonly [{
102
+ readonly name: "";
103
+ readonly type: "bool";
104
+ }];
105
+ }, {
106
+ readonly name: "getApproved";
107
+ readonly type: "function";
108
+ readonly stateMutability: "view";
109
+ readonly inputs: readonly [{
110
+ readonly name: "tokenId";
111
+ readonly type: "uint256";
112
+ }];
113
+ readonly outputs: readonly [{
114
+ readonly name: "";
115
+ readonly type: "address";
116
+ }];
117
+ }, {
118
+ readonly name: "setApprovalForAll";
119
+ readonly type: "function";
120
+ readonly stateMutability: "nonpayable";
121
+ readonly inputs: readonly [{
122
+ readonly name: "operator";
123
+ readonly type: "address";
124
+ }, {
125
+ readonly name: "approved";
126
+ readonly type: "bool";
127
+ }];
128
+ readonly outputs: readonly [];
129
+ }];
130
+ export declare const ERC1155_ABI: readonly [{
131
+ readonly name: "balanceOf";
132
+ readonly type: "function";
133
+ readonly stateMutability: "view";
134
+ readonly inputs: readonly [{
135
+ readonly name: "account";
136
+ readonly type: "address";
137
+ }, {
138
+ readonly name: "id";
139
+ readonly type: "uint256";
140
+ }];
141
+ readonly outputs: readonly [{
142
+ readonly name: "";
143
+ readonly type: "uint256";
144
+ }];
145
+ }, {
146
+ readonly name: "safeTransferFrom";
147
+ readonly type: "function";
148
+ readonly stateMutability: "nonpayable";
149
+ readonly inputs: readonly [{
150
+ readonly name: "from";
151
+ readonly type: "address";
152
+ }, {
153
+ readonly name: "to";
154
+ readonly type: "address";
155
+ }, {
156
+ readonly name: "id";
157
+ readonly type: "uint256";
158
+ }, {
159
+ readonly name: "amount";
160
+ readonly type: "uint256";
161
+ }, {
162
+ readonly name: "data";
163
+ readonly type: "bytes";
164
+ }];
165
+ readonly outputs: readonly [];
166
+ }, {
167
+ readonly name: "isApprovedForAll";
168
+ readonly type: "function";
169
+ readonly stateMutability: "view";
170
+ readonly inputs: readonly [{
171
+ readonly name: "owner";
172
+ readonly type: "address";
173
+ }, {
174
+ readonly name: "operator";
175
+ readonly type: "address";
176
+ }];
177
+ readonly outputs: readonly [{
178
+ readonly name: "";
179
+ readonly type: "bool";
180
+ }];
181
+ }, {
182
+ readonly name: "setApprovalForAll";
183
+ readonly type: "function";
184
+ readonly stateMutability: "nonpayable";
185
+ readonly inputs: readonly [{
186
+ readonly name: "operator";
187
+ readonly type: "address";
188
+ }, {
189
+ readonly name: "approved";
190
+ readonly type: "bool";
191
+ }];
192
+ readonly outputs: readonly [];
193
+ }];
194
+ export declare const WETH_DEPOSIT_ABI: readonly [{
195
+ readonly name: "deposit";
196
+ readonly type: "function";
197
+ readonly stateMutability: "payable";
198
+ readonly inputs: readonly [];
199
+ readonly outputs: readonly [];
200
+ }];
201
+ export declare const WETH_WITHDRAW_ABI: readonly [{
202
+ readonly name: "withdraw";
203
+ readonly type: "function";
204
+ readonly stateMutability: "nonpayable";
205
+ readonly inputs: readonly [{
206
+ readonly name: "wad";
207
+ readonly type: "uint256";
208
+ }];
209
+ readonly outputs: readonly [];
210
+ }];
211
+ export declare const TRANSFER_HELPER_ABI: readonly [{
212
+ readonly name: "bulkTransfer";
213
+ readonly type: "function";
214
+ readonly stateMutability: "nonpayable";
215
+ readonly inputs: readonly [{
216
+ readonly name: "items";
217
+ readonly type: "tuple[]";
218
+ readonly components: readonly [{
219
+ readonly name: "itemType";
220
+ readonly type: "uint8";
221
+ }, {
222
+ readonly name: "token";
223
+ readonly type: "address";
224
+ }, {
225
+ readonly name: "identifier";
226
+ readonly type: "uint256";
227
+ }, {
228
+ readonly name: "amount";
229
+ readonly type: "uint256";
230
+ }, {
231
+ readonly name: "recipient";
232
+ readonly type: "address";
233
+ }];
234
+ }, {
235
+ readonly name: "conduitKey";
236
+ readonly type: "bytes32";
237
+ }];
238
+ readonly outputs: readonly [{
239
+ readonly name: "";
240
+ readonly type: "bytes4";
241
+ }];
242
+ }];
243
+ export declare const MULTICALL3_ABI: readonly [{
244
+ readonly name: "aggregate3";
245
+ readonly type: "function";
246
+ readonly stateMutability: "payable";
247
+ readonly inputs: readonly [{
248
+ readonly name: "calls";
249
+ readonly type: "tuple[]";
250
+ readonly components: readonly [{
251
+ readonly name: "target";
252
+ readonly type: "address";
253
+ }, {
254
+ readonly name: "allowFailure";
255
+ readonly type: "bool";
256
+ }, {
257
+ readonly name: "callData";
258
+ readonly type: "bytes";
259
+ }];
260
+ }];
261
+ readonly outputs: readonly [{
262
+ readonly name: "returnData";
263
+ readonly type: "tuple[]";
264
+ readonly components: readonly [{
265
+ readonly name: "success";
266
+ readonly type: "bool";
267
+ }, {
268
+ readonly name: "returnData";
269
+ readonly type: "bytes";
270
+ }];
271
+ }];
272
+ }];
273
+ export declare const SET_APPROVAL_FOR_ALL_ABI: readonly [{
274
+ readonly name: "setApprovalForAll";
275
+ readonly type: "function";
276
+ readonly stateMutability: "nonpayable";
277
+ readonly inputs: readonly [{
278
+ readonly name: "operator";
279
+ readonly type: "address";
280
+ }, {
281
+ readonly name: "approved";
282
+ readonly type: "bool";
283
+ }];
284
+ readonly outputs: readonly [];
285
+ }];
286
+ export declare const APPROVE_ABI: readonly [{
287
+ readonly name: "approve";
288
+ readonly type: "function";
289
+ readonly stateMutability: "nonpayable";
290
+ readonly inputs: readonly [{
291
+ readonly name: "spender";
292
+ readonly type: "address";
293
+ }, {
294
+ readonly name: "amount";
295
+ readonly type: "uint256";
296
+ }];
297
+ readonly outputs: readonly [{
298
+ readonly name: "";
299
+ readonly type: "bool";
300
+ }];
301
+ }];
@@ -0,0 +1,231 @@
1
+ "use strict";
2
+ /**
3
+ * Minimal ABI definitions for the contract calls the SDK makes.
4
+ * These replace the TypeChain-generated factories from v9.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.APPROVE_ABI = exports.SET_APPROVAL_FOR_ALL_ABI = exports.MULTICALL3_ABI = exports.TRANSFER_HELPER_ABI = exports.WETH_WITHDRAW_ABI = exports.WETH_DEPOSIT_ABI = exports.ERC1155_ABI = exports.ERC721_ABI = exports.ERC20_ABI = void 0;
8
+ exports.ERC20_ABI = [
9
+ {
10
+ name: "balanceOf",
11
+ type: "function",
12
+ stateMutability: "view",
13
+ inputs: [{ name: "account", type: "address" }],
14
+ outputs: [{ name: "", type: "uint256" }],
15
+ },
16
+ {
17
+ name: "transfer",
18
+ type: "function",
19
+ stateMutability: "nonpayable",
20
+ inputs: [
21
+ { name: "to", type: "address" },
22
+ { name: "amount", type: "uint256" },
23
+ ],
24
+ outputs: [{ name: "", type: "bool" }],
25
+ },
26
+ {
27
+ name: "allowance",
28
+ type: "function",
29
+ stateMutability: "view",
30
+ inputs: [
31
+ { name: "owner", type: "address" },
32
+ { name: "spender", type: "address" },
33
+ ],
34
+ outputs: [{ name: "", type: "uint256" }],
35
+ },
36
+ {
37
+ name: "approve",
38
+ type: "function",
39
+ stateMutability: "nonpayable",
40
+ inputs: [
41
+ { name: "spender", type: "address" },
42
+ { name: "amount", type: "uint256" },
43
+ ],
44
+ outputs: [{ name: "", type: "bool" }],
45
+ },
46
+ ];
47
+ exports.ERC721_ABI = [
48
+ {
49
+ name: "ownerOf",
50
+ type: "function",
51
+ stateMutability: "view",
52
+ inputs: [{ name: "tokenId", type: "uint256" }],
53
+ outputs: [{ name: "", type: "address" }],
54
+ },
55
+ {
56
+ name: "transferFrom",
57
+ type: "function",
58
+ stateMutability: "nonpayable",
59
+ inputs: [
60
+ { name: "from", type: "address" },
61
+ { name: "to", type: "address" },
62
+ { name: "tokenId", type: "uint256" },
63
+ ],
64
+ outputs: [],
65
+ },
66
+ {
67
+ name: "isApprovedForAll",
68
+ type: "function",
69
+ stateMutability: "view",
70
+ inputs: [
71
+ { name: "owner", type: "address" },
72
+ { name: "operator", type: "address" },
73
+ ],
74
+ outputs: [{ name: "", type: "bool" }],
75
+ },
76
+ {
77
+ name: "getApproved",
78
+ type: "function",
79
+ stateMutability: "view",
80
+ inputs: [{ name: "tokenId", type: "uint256" }],
81
+ outputs: [{ name: "", type: "address" }],
82
+ },
83
+ {
84
+ name: "setApprovalForAll",
85
+ type: "function",
86
+ stateMutability: "nonpayable",
87
+ inputs: [
88
+ { name: "operator", type: "address" },
89
+ { name: "approved", type: "bool" },
90
+ ],
91
+ outputs: [],
92
+ },
93
+ ];
94
+ exports.ERC1155_ABI = [
95
+ {
96
+ name: "balanceOf",
97
+ type: "function",
98
+ stateMutability: "view",
99
+ inputs: [
100
+ { name: "account", type: "address" },
101
+ { name: "id", type: "uint256" },
102
+ ],
103
+ outputs: [{ name: "", type: "uint256" }],
104
+ },
105
+ {
106
+ name: "safeTransferFrom",
107
+ type: "function",
108
+ stateMutability: "nonpayable",
109
+ inputs: [
110
+ { name: "from", type: "address" },
111
+ { name: "to", type: "address" },
112
+ { name: "id", type: "uint256" },
113
+ { name: "amount", type: "uint256" },
114
+ { name: "data", type: "bytes" },
115
+ ],
116
+ outputs: [],
117
+ },
118
+ {
119
+ name: "isApprovedForAll",
120
+ type: "function",
121
+ stateMutability: "view",
122
+ inputs: [
123
+ { name: "owner", type: "address" },
124
+ { name: "operator", type: "address" },
125
+ ],
126
+ outputs: [{ name: "", type: "bool" }],
127
+ },
128
+ {
129
+ name: "setApprovalForAll",
130
+ type: "function",
131
+ stateMutability: "nonpayable",
132
+ inputs: [
133
+ { name: "operator", type: "address" },
134
+ { name: "approved", type: "bool" },
135
+ ],
136
+ outputs: [],
137
+ },
138
+ ];
139
+ exports.WETH_DEPOSIT_ABI = [
140
+ {
141
+ name: "deposit",
142
+ type: "function",
143
+ stateMutability: "payable",
144
+ inputs: [],
145
+ outputs: [],
146
+ },
147
+ ];
148
+ exports.WETH_WITHDRAW_ABI = [
149
+ {
150
+ name: "withdraw",
151
+ type: "function",
152
+ stateMutability: "nonpayable",
153
+ inputs: [{ name: "wad", type: "uint256" }],
154
+ outputs: [],
155
+ },
156
+ ];
157
+ exports.TRANSFER_HELPER_ABI = [
158
+ {
159
+ name: "bulkTransfer",
160
+ type: "function",
161
+ stateMutability: "nonpayable",
162
+ inputs: [
163
+ {
164
+ name: "items",
165
+ type: "tuple[]",
166
+ components: [
167
+ { name: "itemType", type: "uint8" },
168
+ { name: "token", type: "address" },
169
+ { name: "identifier", type: "uint256" },
170
+ { name: "amount", type: "uint256" },
171
+ { name: "recipient", type: "address" },
172
+ ],
173
+ },
174
+ { name: "conduitKey", type: "bytes32" },
175
+ ],
176
+ outputs: [{ name: "", type: "bytes4" }],
177
+ },
178
+ ];
179
+ exports.MULTICALL3_ABI = [
180
+ {
181
+ name: "aggregate3",
182
+ type: "function",
183
+ stateMutability: "payable",
184
+ inputs: [
185
+ {
186
+ name: "calls",
187
+ type: "tuple[]",
188
+ components: [
189
+ { name: "target", type: "address" },
190
+ { name: "allowFailure", type: "bool" },
191
+ { name: "callData", type: "bytes" },
192
+ ],
193
+ },
194
+ ],
195
+ outputs: [
196
+ {
197
+ name: "returnData",
198
+ type: "tuple[]",
199
+ components: [
200
+ { name: "success", type: "bool" },
201
+ { name: "returnData", type: "bytes" },
202
+ ],
203
+ },
204
+ ],
205
+ },
206
+ ];
207
+ exports.SET_APPROVAL_FOR_ALL_ABI = [
208
+ {
209
+ name: "setApprovalForAll",
210
+ type: "function",
211
+ stateMutability: "nonpayable",
212
+ inputs: [
213
+ { name: "operator", type: "address" },
214
+ { name: "approved", type: "bool" },
215
+ ],
216
+ outputs: [],
217
+ },
218
+ ];
219
+ exports.APPROVE_ABI = [
220
+ {
221
+ name: "approve",
222
+ type: "function",
223
+ stateMutability: "nonpayable",
224
+ inputs: [
225
+ { name: "spender", type: "address" },
226
+ { name: "amount", type: "uint256" },
227
+ ],
228
+ outputs: [{ name: "", type: "bool" }],
229
+ },
230
+ ];
231
+ //# sourceMappingURL=abis.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abis.js","sourceRoot":"","sources":["../../src/abi/abis.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEU,QAAA,SAAS,GAAG;IACvB;QACE,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,UAAU;QAChB,eAAe,EAAE,MAAM;QACvB,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;QAC9C,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,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Options, OrdersQueryOptions, OrderV2, ProtocolData } from "../orders/types";
2
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";
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 GetNFTMetadataResponse, 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
4
  /**
5
5
  * The API class for the OpenSea SDK.
6
6
  * @category Main Classes
@@ -443,6 +443,25 @@ export declare class OpenSeaAPI {
443
443
  * @returns The {@link ResolveAccountResponse} returned by the API.
444
444
  */
445
445
  resolveAccount(identifier: string): Promise<ResolveAccountResponse>;
446
+ /**
447
+ * Get the collection that an NFT belongs to.
448
+ * Useful for multi-contract collections where the token ID disambiguates
449
+ * which collection the NFT belongs to.
450
+ * @param address The NFT contract address.
451
+ * @param identifier The token identifier.
452
+ * @param chain The chain where the NFT is located. Defaults to the chain set in the constructor.
453
+ * @returns The {@link OpenSeaCollection} returned by the API.
454
+ */
455
+ getNFTCollection(address: string, identifier: string, chain?: Chain): Promise<OpenSeaCollection>;
456
+ /**
457
+ * Get detailed metadata for an NFT including name, description, image, traits,
458
+ * and external links.
459
+ * @param address The NFT contract address.
460
+ * @param tokenId The token identifier.
461
+ * @param chain The chain where the NFT is located. Defaults to the chain set in the constructor.
462
+ * @returns The {@link GetNFTMetadataResponse} returned by the API.
463
+ */
464
+ getNFTMetadata(address: string, tokenId: string, chain?: Chain): Promise<GetNFTMetadataResponse>;
446
465
  /**
447
466
  * Generic fetch method for any API endpoint with automatic rate limit retry
448
467
  * @param apiPath Path to URL endpoint under API
@@ -465,7 +484,9 @@ export declare class OpenSeaAPI {
465
484
  * Fetch from an API Endpoint, sending auth token in headers
466
485
  * @param url The URL to fetch
467
486
  * @param headers Additional headers to send with the request
468
- * @param body Optional body to send. If set, will POST, otherwise GET
487
+ * @param body Optional body to send. HTTP method is inferred: POST if body is
488
+ * provided (non-nullish), GET otherwise. This covers all OpenSea API
489
+ * endpoints which only use GET and POST.
469
490
  * @param options Request options like timeout and abort signal
470
491
  */
471
492
  private _fetch;
@@ -482,6 +503,9 @@ export declare class OpenSeaAPI {
482
503
  private _parseRetryAfter;
483
504
  /**
484
505
  * Creates a rate limit error with status code and retry-after information.
506
+ * This is async because it attempts to parse the response body. If the body
507
+ * is malformed JSON, responseBody will be undefined (intentional — the error
508
+ * itself is more important than the body).
485
509
  * @param response The HTTP response object from the API
486
510
  * @returns An enhanced Error object with statusCode, retryAfter and responseBody properties
487
511
  */