@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.
- package/README.md +35 -6
- package/lib/abi/abis.d.ts +301 -0
- package/lib/abi/abis.js +231 -0
- package/lib/abi/abis.js.map +1 -0
- package/lib/api/api.d.ts +26 -2
- package/lib/api/api.js +83 -51
- package/lib/api/api.js.map +1 -1
- package/lib/api/apiPaths.d.ts +2 -0
- package/lib/api/apiPaths.js +9 -1
- package/lib/api/apiPaths.js.map +1 -1
- package/lib/api/nfts.d.ts +13 -2
- package/lib/api/nfts.js +18 -0
- package/lib/api/nfts.js.map +1 -1
- package/lib/api/orders.js +2 -2
- package/lib/api/orders.js.map +1 -1
- package/lib/api/types.d.ts +7 -0
- package/lib/api/types.js.map +1 -1
- package/lib/constants.d.ts +2 -2
- package/lib/constants.js +7 -4
- package/lib/constants.js.map +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/orders/privateListings.js +2 -2
- package/lib/orders/privateListings.js.map +1 -1
- package/lib/orders/utils.js +9 -1
- package/lib/orders/utils.js.map +1 -1
- package/lib/provider/ethers-adapter.d.ts +17 -0
- package/lib/provider/ethers-adapter.js +135 -0
- package/lib/provider/ethers-adapter.js.map +1 -0
- package/lib/provider/seaport-bridge.d.ts +11 -0
- package/lib/provider/seaport-bridge.js +130 -0
- package/lib/provider/seaport-bridge.js.map +1 -0
- package/lib/provider/types.d.ts +62 -0
- package/lib/provider/types.js +7 -0
- package/lib/provider/types.js.map +1 -0
- package/lib/provider/viem-adapter.d.ts +27 -0
- package/lib/provider/viem-adapter.js +122 -0
- package/lib/provider/viem-adapter.js.map +1 -0
- package/lib/sdk/assets.d.ts +7 -23
- package/lib/sdk/assets.js +101 -77
- package/lib/sdk/assets.js.map +1 -1
- package/lib/sdk/base.d.ts +350 -0
- package/lib/sdk/base.js +325 -0
- package/lib/sdk/base.js.map +1 -0
- package/lib/sdk/cancellation.d.ts +1 -2
- package/lib/sdk/cancellation.js +4 -4
- package/lib/sdk/cancellation.js.map +1 -1
- package/lib/sdk/context.d.ts +5 -5
- package/lib/sdk/fulfillment.d.ts +20 -59
- package/lib/sdk/fulfillment.js +18 -58
- package/lib/sdk/fulfillment.js.map +1 -1
- package/lib/sdk/orders.d.ts +25 -26
- package/lib/sdk/orders.js +8 -9
- package/lib/sdk/orders.js.map +1 -1
- package/lib/sdk/tokens.d.ts +3 -3
- package/lib/sdk/tokens.js +17 -7
- package/lib/sdk/tokens.js.map +1 -1
- package/lib/sdk.d.ts +16 -550
- package/lib/sdk.js +35 -663
- package/lib/sdk.js.map +1 -1
- package/lib/types.d.ts +11 -6
- package/lib/types.js +3 -3
- package/lib/types.js.map +1 -1
- package/lib/utils/address.d.ts +12 -0
- package/lib/utils/address.js +39 -0
- package/lib/utils/address.js.map +1 -0
- package/lib/utils/chain.d.ts +1 -1
- package/lib/utils/fees.d.ts +5 -0
- package/lib/utils/fees.js +24 -6
- package/lib/utils/fees.js.map +1 -1
- package/lib/utils/protocol.js +5 -5
- package/lib/utils/protocol.js.map +1 -1
- package/lib/utils/units.d.ts +12 -0
- package/lib/utils/units.js +43 -0
- package/lib/utils/units.js.map +1 -0
- package/lib/utils/utils.d.ts +2 -10
- package/lib/utils/utils.js +2 -17
- package/lib/utils/utils.js.map +1 -1
- package/lib/viem.d.ts +44 -0
- package/lib/viem.js +114 -0
- package/lib/viem.js.map +1 -0
- package/package.json +31 -13
- package/src/abi/abis.ts +236 -0
- package/src/api/api.ts +100 -59
- package/src/api/apiPaths.ts +16 -0
- package/src/api/nfts.ts +37 -1
- package/src/api/orders.ts +2 -2
- package/src/api/types.ts +8 -0
- package/src/constants.ts +7 -3
- package/src/index.ts +8 -0
- package/src/orders/privateListings.ts +2 -2
- package/src/orders/utils.ts +8 -1
- package/src/provider/ethers-adapter.ts +182 -0
- package/src/provider/seaport-bridge.ts +163 -0
- package/src/provider/types.ts +67 -0
- package/src/provider/viem-adapter.ts +165 -0
- package/src/sdk/assets.ts +128 -158
- package/src/sdk/base.ts +577 -0
- package/src/sdk/cancellation.ts +6 -9
- package/src/sdk/context.ts +5 -5
- package/src/sdk/fulfillment.ts +34 -73
- package/src/sdk/orders.ts +44 -44
- package/src/sdk/tokens.ts +18 -18
- package/src/sdk.ts +40 -1011
- package/src/types.ts +12 -6
- package/src/utils/address.ts +40 -0
- package/src/utils/fees.ts +28 -8
- package/src/utils/protocol.ts +5 -5
- package/src/utils/units.ts +47 -0
- package/src/utils/utils.ts +2 -22
- package/src/viem.ts +125 -0
- package/lib/src/api/accounts.d.ts +0 -18
- package/lib/src/api/accounts.js +0 -30
- package/lib/src/api/accounts.js.map +0 -1
- package/lib/src/api/api.d.ts +0 -429
- package/lib/src/api/api.js +0 -652
- package/lib/src/api/api.js.map +0 -1
- package/lib/src/api/apiPaths.d.ts +0 -37
- package/lib/src/api/apiPaths.js +0 -140
- package/lib/src/api/apiPaths.js.map +0 -1
- package/lib/src/api/collections.d.ts +0 -26
- package/lib/src/api/collections.js +0 -57
- package/lib/src/api/collections.js.map +0 -1
- package/lib/src/api/events.d.ts +0 -26
- package/lib/src/api/events.js +0 -42
- package/lib/src/api/events.js.map +0 -1
- package/lib/src/api/fetcher.d.ts +0 -24
- package/lib/src/api/fetcher.js +0 -3
- package/lib/src/api/fetcher.js.map +0 -1
- package/lib/src/api/index.d.ts +0 -2
- package/lib/src/api/index.js +0 -19
- package/lib/src/api/index.js.map +0 -1
- package/lib/src/api/listings.d.ts +0 -44
- package/lib/src/api/listings.js +0 -86
- package/lib/src/api/listings.js.map +0 -1
- package/lib/src/api/nfts.d.ts +0 -35
- package/lib/src/api/nfts.js +0 -66
- package/lib/src/api/nfts.js.map +0 -1
- package/lib/src/api/offers.d.ts +0 -54
- package/lib/src/api/offers.js +0 -122
- package/lib/src/api/offers.js.map +0 -1
- package/lib/src/api/orders.d.ts +0 -50
- package/lib/src/api/orders.js +0 -151
- package/lib/src/api/orders.js.map +0 -1
- package/lib/src/api/search.d.ts +0 -13
- package/lib/src/api/search.js +0 -21
- package/lib/src/api/search.js.map +0 -1
- package/lib/src/api/tokens.d.ts +0 -25
- package/lib/src/api/tokens.js +0 -42
- package/lib/src/api/tokens.js.map +0 -1
- package/lib/src/api/types.d.ts +0 -840
- package/lib/src/api/types.js +0 -65
- package/lib/src/api/types.js.map +0 -1
- package/lib/src/constants.d.ts +0 -22
- package/lib/src/constants.js +0 -52
- package/lib/src/constants.js.map +0 -1
- package/lib/src/index.d.ts +0 -18
- package/lib/src/index.js +0 -24
- package/lib/src/index.js.map +0 -1
- package/lib/src/orders/privateListings.d.ts +0 -12
- package/lib/src/orders/privateListings.js +0 -130
- package/lib/src/orders/privateListings.js.map +0 -1
- package/lib/src/orders/types.d.ts +0 -160
- package/lib/src/orders/types.js +0 -10
- package/lib/src/orders/types.js.map +0 -1
- package/lib/src/orders/utils.d.ts +0 -89
- package/lib/src/orders/utils.js +0 -177
- package/lib/src/orders/utils.js.map +0 -1
- package/lib/src/sdk/assets.d.ts +0 -104
- package/lib/src/sdk/assets.js +0 -397
- package/lib/src/sdk/assets.js.map +0 -1
- package/lib/src/sdk/cancellation.d.ts +0 -97
- package/lib/src/sdk/cancellation.js +0 -234
- package/lib/src/sdk/cancellation.js.map +0 -1
- package/lib/src/sdk/context.d.ts +0 -28
- package/lib/src/sdk/context.js +0 -3
- package/lib/src/sdk/context.js.map +0 -1
- package/lib/src/sdk/fulfillment.d.ts +0 -153
- package/lib/src/sdk/fulfillment.js +0 -296
- package/lib/src/sdk/fulfillment.js.map +0 -1
- package/lib/src/sdk/orders.d.ts +0 -253
- package/lib/src/sdk/orders.js +0 -677
- package/lib/src/sdk/orders.js.map +0 -1
- package/lib/src/sdk/tokens.d.ts +0 -31
- package/lib/src/sdk/tokens.js +0 -64
- package/lib/src/sdk/tokens.js.map +0 -1
- package/lib/src/sdk.d.ts +0 -560
- package/lib/src/sdk.js +0 -675
- package/lib/src/sdk.js.map +0 -1
- package/lib/src/typechain/contracts/ERC1155.d.ts +0 -236
- package/lib/src/typechain/contracts/ERC1155.js +0 -3
- package/lib/src/typechain/contracts/ERC1155.js.map +0 -1
- package/lib/src/typechain/contracts/ERC20.d.ts +0 -141
- package/lib/src/typechain/contracts/ERC20.js +0 -3
- package/lib/src/typechain/contracts/ERC20.js.map +0 -1
- package/lib/src/typechain/contracts/ERC721.d.ts +0 -213
- package/lib/src/typechain/contracts/ERC721.js +0 -3
- package/lib/src/typechain/contracts/ERC721.js.map +0 -1
- package/lib/src/typechain/contracts/Multicall3.d.ts +0 -57
- package/lib/src/typechain/contracts/Multicall3.js +0 -3
- package/lib/src/typechain/contracts/Multicall3.js.map +0 -1
- package/lib/src/typechain/contracts/TransferHelper.d.ts +0 -55
- package/lib/src/typechain/contracts/TransferHelper.js +0 -3
- package/lib/src/typechain/contracts/TransferHelper.js.map +0 -1
- package/lib/src/typechain/contracts/common.d.ts +0 -50
- package/lib/src/typechain/contracts/common.js +0 -3
- package/lib/src/typechain/contracts/common.js.map +0 -1
- package/lib/src/typechain/contracts/factories/ERC1155__factory.d.ts +0 -250
- package/lib/src/typechain/contracts/factories/ERC1155__factory.js +0 -332
- package/lib/src/typechain/contracts/factories/ERC1155__factory.js.map +0 -1
- package/lib/src/typechain/contracts/factories/ERC20__factory.d.ts +0 -174
- package/lib/src/typechain/contracts/factories/ERC20__factory.js +0 -240
- package/lib/src/typechain/contracts/factories/ERC20__factory.js.map +0 -1
- package/lib/src/typechain/contracts/factories/ERC721__factory.d.ts +0 -268
- package/lib/src/typechain/contracts/factories/ERC721__factory.js +0 -351
- package/lib/src/typechain/contracts/factories/ERC721__factory.js.map +0 -1
- package/lib/src/typechain/contracts/factories/Multicall3__factory.d.ts +0 -43
- package/lib/src/typechain/contracts/factories/Multicall3__factory.js +0 -68
- package/lib/src/typechain/contracts/factories/Multicall3__factory.js.map +0 -1
- package/lib/src/typechain/contracts/factories/TransferHelper__factory.d.ts +0 -46
- package/lib/src/typechain/contracts/factories/TransferHelper__factory.js +0 -71
- package/lib/src/typechain/contracts/factories/TransferHelper__factory.js.map +0 -1
- package/lib/src/typechain/contracts/factories/index.d.ts +0 -5
- package/lib/src/typechain/contracts/factories/index.js +0 -17
- package/lib/src/typechain/contracts/factories/index.js.map +0 -1
- package/lib/src/typechain/contracts/index.d.ts +0 -11
- package/lib/src/typechain/contracts/index.js +0 -48
- package/lib/src/typechain/contracts/index.js.map +0 -1
- package/lib/src/types.d.ts +0 -387
- package/lib/src/types.js +0 -127
- package/lib/src/types.js.map +0 -1
- package/lib/src/utils/chain.d.ts +0 -60
- package/lib/src/utils/chain.js +0 -248
- package/lib/src/utils/chain.js.map +0 -1
- package/lib/src/utils/converters.d.ts +0 -37
- package/lib/src/utils/converters.js +0 -137
- package/lib/src/utils/converters.js.map +0 -1
- package/lib/src/utils/dateHelper.d.ts +0 -38
- package/lib/src/utils/dateHelper.js +0 -52
- package/lib/src/utils/dateHelper.js.map +0 -1
- package/lib/src/utils/fees.d.ts +0 -13
- package/lib/src/utils/fees.js +0 -29
- package/lib/src/utils/fees.js.map +0 -1
- package/lib/src/utils/index.d.ts +0 -2
- package/lib/src/utils/index.js +0 -19
- package/lib/src/utils/index.js.map +0 -1
- package/lib/src/utils/protocol.d.ts +0 -75
- package/lib/src/utils/protocol.js +0 -161
- package/lib/src/utils/protocol.js.map +0 -1
- package/lib/src/utils/rateLimit.d.ts +0 -34
- package/lib/src/utils/rateLimit.js +0 -97
- package/lib/src/utils/rateLimit.js.map +0 -1
- package/lib/src/utils/stringHelper.d.ts +0 -18
- package/lib/src/utils/stringHelper.js +0 -24
- package/lib/src/utils/stringHelper.js.map +0 -1
- package/lib/src/utils/utils.d.ts +0 -18
- package/lib/src/utils/utils.js +0 -45
- package/lib/src/utils/utils.js.map +0 -1
- package/lib/typechain/contracts/ERC1155.d.ts +0 -236
- package/lib/typechain/contracts/ERC1155.js +0 -3
- package/lib/typechain/contracts/ERC1155.js.map +0 -1
- package/lib/typechain/contracts/ERC20.d.ts +0 -141
- package/lib/typechain/contracts/ERC20.js +0 -3
- package/lib/typechain/contracts/ERC20.js.map +0 -1
- package/lib/typechain/contracts/ERC721.d.ts +0 -213
- package/lib/typechain/contracts/ERC721.js +0 -3
- package/lib/typechain/contracts/ERC721.js.map +0 -1
- package/lib/typechain/contracts/Multicall3.d.ts +0 -57
- package/lib/typechain/contracts/Multicall3.js +0 -3
- package/lib/typechain/contracts/Multicall3.js.map +0 -1
- package/lib/typechain/contracts/TransferHelper.d.ts +0 -55
- package/lib/typechain/contracts/TransferHelper.js +0 -3
- package/lib/typechain/contracts/TransferHelper.js.map +0 -1
- package/lib/typechain/contracts/common.d.ts +0 -50
- package/lib/typechain/contracts/common.js +0 -3
- package/lib/typechain/contracts/common.js.map +0 -1
- package/lib/typechain/contracts/factories/ERC1155__factory.d.ts +0 -250
- package/lib/typechain/contracts/factories/ERC1155__factory.js +0 -332
- package/lib/typechain/contracts/factories/ERC1155__factory.js.map +0 -1
- package/lib/typechain/contracts/factories/ERC20__factory.d.ts +0 -174
- package/lib/typechain/contracts/factories/ERC20__factory.js +0 -240
- package/lib/typechain/contracts/factories/ERC20__factory.js.map +0 -1
- package/lib/typechain/contracts/factories/ERC721__factory.d.ts +0 -268
- package/lib/typechain/contracts/factories/ERC721__factory.js +0 -351
- package/lib/typechain/contracts/factories/ERC721__factory.js.map +0 -1
- package/lib/typechain/contracts/factories/Multicall3__factory.d.ts +0 -43
- package/lib/typechain/contracts/factories/Multicall3__factory.js +0 -68
- package/lib/typechain/contracts/factories/Multicall3__factory.js.map +0 -1
- package/lib/typechain/contracts/factories/TransferHelper__factory.d.ts +0 -46
- package/lib/typechain/contracts/factories/TransferHelper__factory.js +0 -71
- package/lib/typechain/contracts/factories/TransferHelper__factory.js.map +0 -1
- package/lib/typechain/contracts/factories/index.d.ts +0 -5
- package/lib/typechain/contracts/factories/index.js +0 -17
- package/lib/typechain/contracts/factories/index.js.map +0 -1
- package/lib/typechain/contracts/index.d.ts +0 -11
- package/lib/typechain/contracts/index.js +0 -48
- package/lib/typechain/contracts/index.js.map +0 -1
- package/src/typechain/contracts/ERC1155.ts +0 -440
- package/src/typechain/contracts/ERC20.ts +0 -286
- package/src/typechain/contracts/ERC721.ts +0 -412
- package/src/typechain/contracts/Multicall3.ts +0 -117
- package/src/typechain/contracts/TransferHelper.ts +0 -122
- package/src/typechain/contracts/common.ts +0 -131
- package/src/typechain/contracts/factories/ERC1155__factory.ts +0 -331
- package/src/typechain/contracts/factories/ERC20__factory.ts +0 -239
- package/src/typechain/contracts/factories/ERC721__factory.ts +0 -350
- package/src/typechain/contracts/factories/Multicall3__factory.ts +0 -67
- package/src/typechain/contracts/factories/TransferHelper__factory.ts +0 -76
- package/src/typechain/contracts/factories/index.ts +0 -8
- 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
|
-
|
|
15
|
+
This is the TypeScript SDK for [OpenSea](https://opensea.io), the largest marketplace for NFTs and tokens.
|
|
16
16
|
|
|
17
|
-
|
|
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
|
-
|
|
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
|
|
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/
|
|
62
|
-
[ci-link]: https://github.com/ProjectOpenSea/opensea-js/actions/workflows/
|
|
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
|
+
}];
|
package/lib/abi/abis.js
ADDED
|
@@ -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,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;KACzC;IACD;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,UAAU;QAChB,eAAe,EAAE,YAAY;QAC7B,MAAM,EAAE;YACN,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE;YAC/B,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE;SACpC;QACD,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;KACtC;IACD;QACE,IAAI,EAAE,WAAW;QACjB,IAAI,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AS,EAAE,IAAI,EAAE,MAAM,EAAE;oBACjC,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,OAAO,EAAE;iBACtC;aACF;SACF;KACF;CACO,CAAA;AAEG,QAAA,wBAAwB,GAAG;IACtC;QACE,IAAI,EAAE,mBAAmB;QACzB,IAAI,EAAE,UAAU;QAChB,eAAe,EAAE,YAAY;QAC7B,MAAM,EAAE;YACN,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE;YACrC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE;SACnC;QACD,OAAO,EAAE,EAAE;KACZ;CACO,CAAA;AAEG,QAAA,WAAW,GAAG;IACzB;QACE,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,UAAU;QAChB,eAAe,EAAE,YAAY;QAC7B,MAAM,EAAE;YACN,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE;YACpC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE;SACpC;QACD,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;KACtC;CACO,CAAA"}
|
package/lib/api/api.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { FulfillmentDataResponse, OrderAPIOptions, 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.
|
|
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
|
*/
|