@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.
- package/LICENSE +7 -0
- package/README.md +70 -0
- package/lib/api/accounts.d.ts +27 -0
- package/lib/api/accounts.js +46 -0
- package/lib/api/accounts.js.map +1 -0
- package/lib/api/api.d.ts +489 -0
- package/lib/api/api.js +754 -0
- package/lib/api/api.js.map +1 -0
- package/lib/api/apiPaths.d.ts +46 -0
- package/lib/api/apiPaths.js +176 -0
- package/lib/api/apiPaths.js.map +1 -0
- package/lib/api/chains.d.ts +13 -0
- package/lib/api/chains.js +22 -0
- package/lib/api/chains.js.map +1 -0
- package/lib/api/collections.d.ts +34 -0
- package/lib/api/collections.js +80 -0
- package/lib/api/collections.js.map +1 -0
- package/lib/api/drops.d.ts +21 -0
- package/lib/api/drops.js +39 -0
- package/lib/api/drops.js.map +1 -0
- package/lib/api/events.d.ts +26 -0
- package/lib/api/events.js +43 -0
- package/lib/api/events.js.map +1 -0
- package/lib/api/fetcher.d.ts +24 -0
- package/lib/api/fetcher.js +3 -0
- package/lib/api/fetcher.js.map +1 -0
- package/lib/api/index.d.ts +2 -0
- package/lib/api/index.js +19 -0
- package/lib/api/index.js.map +1 -0
- package/lib/api/listings.d.ts +44 -0
- package/lib/api/listings.js +88 -0
- package/lib/api/listings.js.map +1 -0
- package/lib/api/nfts.d.ts +39 -0
- package/lib/api/nfts.js +79 -0
- package/lib/api/nfts.js.map +1 -0
- package/lib/api/offers.d.ts +54 -0
- package/lib/api/offers.js +124 -0
- package/lib/api/offers.js.map +1 -0
- package/lib/api/orders.d.ts +50 -0
- package/lib/api/orders.js +153 -0
- package/lib/api/orders.js.map +1 -0
- package/lib/api/search.d.ts +13 -0
- package/lib/api/search.js +22 -0
- package/lib/api/search.js.map +1 -0
- package/lib/api/tokens.d.ts +25 -0
- package/lib/api/tokens.js +43 -0
- package/lib/api/tokens.js.map +1 -0
- package/lib/api/types.d.ts +1113 -0
- package/lib/api/types.js +65 -0
- package/lib/api/types.js.map +1 -0
- package/lib/constants.d.ts +22 -0
- package/lib/constants.js +52 -0
- package/lib/constants.js.map +1 -0
- package/lib/index.d.ts +18 -0
- package/lib/index.js +24 -0
- package/lib/index.js.map +1 -0
- package/lib/orders/privateListings.d.ts +12 -0
- package/lib/orders/privateListings.js +130 -0
- package/lib/orders/privateListings.js.map +1 -0
- package/lib/orders/types.d.ts +160 -0
- package/lib/orders/types.js +10 -0
- package/lib/orders/types.js.map +1 -0
- package/lib/orders/utils.d.ts +89 -0
- package/lib/orders/utils.js +177 -0
- package/lib/orders/utils.js.map +1 -0
- package/lib/sdk/assets.d.ts +104 -0
- package/lib/sdk/assets.js +398 -0
- package/lib/sdk/assets.js.map +1 -0
- package/lib/sdk/cancellation.d.ts +97 -0
- package/lib/sdk/cancellation.js +235 -0
- package/lib/sdk/cancellation.js.map +1 -0
- package/lib/sdk/context.d.ts +28 -0
- package/lib/sdk/context.js +3 -0
- package/lib/sdk/context.js.map +1 -0
- package/lib/sdk/fulfillment.d.ts +153 -0
- package/lib/sdk/fulfillment.js +298 -0
- package/lib/sdk/fulfillment.js.map +1 -0
- package/lib/sdk/orders.d.ts +253 -0
- package/lib/sdk/orders.js +679 -0
- package/lib/sdk/orders.js.map +1 -0
- package/lib/sdk/tokens.d.ts +31 -0
- package/lib/sdk/tokens.js +65 -0
- package/lib/sdk/tokens.js.map +1 -0
- package/lib/sdk.d.ts +560 -0
- package/lib/sdk.js +693 -0
- package/lib/sdk.js.map +1 -0
- package/lib/src/api/accounts.d.ts +18 -0
- package/lib/src/api/accounts.js +30 -0
- package/lib/src/api/accounts.js.map +1 -0
- package/lib/src/api/api.d.ts +429 -0
- package/lib/src/api/api.js +652 -0
- package/lib/src/api/api.js.map +1 -0
- package/lib/src/api/apiPaths.d.ts +37 -0
- package/lib/src/api/apiPaths.js +140 -0
- package/lib/src/api/apiPaths.js.map +1 -0
- package/lib/src/api/collections.d.ts +26 -0
- package/lib/src/api/collections.js +57 -0
- package/lib/src/api/collections.js.map +1 -0
- package/lib/src/api/events.d.ts +26 -0
- package/lib/src/api/events.js +42 -0
- package/lib/src/api/events.js.map +1 -0
- package/lib/src/api/fetcher.d.ts +24 -0
- package/lib/src/api/fetcher.js +3 -0
- package/lib/src/api/fetcher.js.map +1 -0
- package/lib/src/api/index.d.ts +2 -0
- package/lib/src/api/index.js +19 -0
- package/lib/src/api/index.js.map +1 -0
- package/lib/src/api/listings.d.ts +44 -0
- package/lib/src/api/listings.js +86 -0
- package/lib/src/api/listings.js.map +1 -0
- package/lib/src/api/nfts.d.ts +35 -0
- package/lib/src/api/nfts.js +66 -0
- package/lib/src/api/nfts.js.map +1 -0
- package/lib/src/api/offers.d.ts +54 -0
- package/lib/src/api/offers.js +122 -0
- package/lib/src/api/offers.js.map +1 -0
- package/lib/src/api/orders.d.ts +50 -0
- package/lib/src/api/orders.js +151 -0
- package/lib/src/api/orders.js.map +1 -0
- package/lib/src/api/search.d.ts +13 -0
- package/lib/src/api/search.js +21 -0
- package/lib/src/api/search.js.map +1 -0
- package/lib/src/api/tokens.d.ts +25 -0
- package/lib/src/api/tokens.js +42 -0
- package/lib/src/api/tokens.js.map +1 -0
- package/lib/src/api/types.d.ts +840 -0
- package/lib/src/api/types.js +65 -0
- package/lib/src/api/types.js.map +1 -0
- package/lib/src/constants.d.ts +22 -0
- package/lib/src/constants.js +52 -0
- package/lib/src/constants.js.map +1 -0
- package/lib/src/index.d.ts +18 -0
- package/lib/src/index.js +24 -0
- package/lib/src/index.js.map +1 -0
- package/lib/src/orders/privateListings.d.ts +12 -0
- package/lib/src/orders/privateListings.js +130 -0
- package/lib/src/orders/privateListings.js.map +1 -0
- package/lib/src/orders/types.d.ts +160 -0
- package/lib/src/orders/types.js +10 -0
- package/lib/src/orders/types.js.map +1 -0
- package/lib/src/orders/utils.d.ts +89 -0
- package/lib/src/orders/utils.js +177 -0
- package/lib/src/orders/utils.js.map +1 -0
- package/lib/src/sdk/assets.d.ts +104 -0
- package/lib/src/sdk/assets.js +397 -0
- package/lib/src/sdk/assets.js.map +1 -0
- package/lib/src/sdk/cancellation.d.ts +97 -0
- package/lib/src/sdk/cancellation.js +234 -0
- package/lib/src/sdk/cancellation.js.map +1 -0
- package/lib/src/sdk/context.d.ts +28 -0
- package/lib/src/sdk/context.js +3 -0
- package/lib/src/sdk/context.js.map +1 -0
- package/lib/src/sdk/fulfillment.d.ts +153 -0
- package/lib/src/sdk/fulfillment.js +296 -0
- package/lib/src/sdk/fulfillment.js.map +1 -0
- package/lib/src/sdk/orders.d.ts +253 -0
- package/lib/src/sdk/orders.js +677 -0
- package/lib/src/sdk/orders.js.map +1 -0
- package/lib/src/sdk/tokens.d.ts +31 -0
- package/lib/src/sdk/tokens.js +64 -0
- package/lib/src/sdk/tokens.js.map +1 -0
- package/lib/src/sdk.d.ts +560 -0
- package/lib/src/sdk.js +675 -0
- package/lib/src/sdk.js.map +1 -0
- package/lib/src/typechain/contracts/ERC1155.d.ts +236 -0
- package/lib/src/typechain/contracts/ERC1155.js +3 -0
- package/lib/src/typechain/contracts/ERC1155.js.map +1 -0
- package/lib/src/typechain/contracts/ERC20.d.ts +141 -0
- package/lib/src/typechain/contracts/ERC20.js +3 -0
- package/lib/src/typechain/contracts/ERC20.js.map +1 -0
- package/lib/src/typechain/contracts/ERC721.d.ts +213 -0
- package/lib/src/typechain/contracts/ERC721.js +3 -0
- package/lib/src/typechain/contracts/ERC721.js.map +1 -0
- package/lib/src/typechain/contracts/Multicall3.d.ts +57 -0
- package/lib/src/typechain/contracts/Multicall3.js +3 -0
- package/lib/src/typechain/contracts/Multicall3.js.map +1 -0
- package/lib/src/typechain/contracts/TransferHelper.d.ts +55 -0
- package/lib/src/typechain/contracts/TransferHelper.js +3 -0
- package/lib/src/typechain/contracts/TransferHelper.js.map +1 -0
- package/lib/src/typechain/contracts/common.d.ts +50 -0
- package/lib/src/typechain/contracts/common.js +3 -0
- package/lib/src/typechain/contracts/common.js.map +1 -0
- package/lib/src/typechain/contracts/factories/ERC1155__factory.d.ts +250 -0
- package/lib/src/typechain/contracts/factories/ERC1155__factory.js +332 -0
- package/lib/src/typechain/contracts/factories/ERC1155__factory.js.map +1 -0
- package/lib/src/typechain/contracts/factories/ERC20__factory.d.ts +174 -0
- package/lib/src/typechain/contracts/factories/ERC20__factory.js +240 -0
- package/lib/src/typechain/contracts/factories/ERC20__factory.js.map +1 -0
- package/lib/src/typechain/contracts/factories/ERC721__factory.d.ts +268 -0
- package/lib/src/typechain/contracts/factories/ERC721__factory.js +351 -0
- package/lib/src/typechain/contracts/factories/ERC721__factory.js.map +1 -0
- package/lib/src/typechain/contracts/factories/Multicall3__factory.d.ts +43 -0
- package/lib/src/typechain/contracts/factories/Multicall3__factory.js +68 -0
- package/lib/src/typechain/contracts/factories/Multicall3__factory.js.map +1 -0
- package/lib/src/typechain/contracts/factories/TransferHelper__factory.d.ts +46 -0
- package/lib/src/typechain/contracts/factories/TransferHelper__factory.js +71 -0
- package/lib/src/typechain/contracts/factories/TransferHelper__factory.js.map +1 -0
- package/lib/src/typechain/contracts/factories/index.d.ts +5 -0
- package/lib/src/typechain/contracts/factories/index.js +17 -0
- package/lib/src/typechain/contracts/factories/index.js.map +1 -0
- package/lib/src/typechain/contracts/index.d.ts +11 -0
- package/lib/src/typechain/contracts/index.js +48 -0
- package/lib/src/typechain/contracts/index.js.map +1 -0
- package/lib/src/types.d.ts +387 -0
- package/lib/src/types.js +127 -0
- package/lib/src/types.js.map +1 -0
- package/lib/src/utils/chain.d.ts +60 -0
- package/lib/src/utils/chain.js +248 -0
- package/lib/src/utils/chain.js.map +1 -0
- package/lib/src/utils/converters.d.ts +37 -0
- package/lib/src/utils/converters.js +137 -0
- package/lib/src/utils/converters.js.map +1 -0
- package/lib/src/utils/dateHelper.d.ts +38 -0
- package/lib/src/utils/dateHelper.js +52 -0
- package/lib/src/utils/dateHelper.js.map +1 -0
- package/lib/src/utils/fees.d.ts +13 -0
- package/lib/src/utils/fees.js +29 -0
- package/lib/src/utils/fees.js.map +1 -0
- package/lib/src/utils/index.d.ts +2 -0
- package/lib/src/utils/index.js +19 -0
- package/lib/src/utils/index.js.map +1 -0
- package/lib/src/utils/protocol.d.ts +75 -0
- package/lib/src/utils/protocol.js +161 -0
- package/lib/src/utils/protocol.js.map +1 -0
- package/lib/src/utils/rateLimit.d.ts +34 -0
- package/lib/src/utils/rateLimit.js +97 -0
- package/lib/src/utils/rateLimit.js.map +1 -0
- package/lib/src/utils/stringHelper.d.ts +18 -0
- package/lib/src/utils/stringHelper.js +24 -0
- package/lib/src/utils/stringHelper.js.map +1 -0
- package/lib/src/utils/utils.d.ts +18 -0
- package/lib/src/utils/utils.js +45 -0
- package/lib/src/utils/utils.js.map +1 -0
- package/lib/typechain/contracts/ERC1155.d.ts +236 -0
- package/lib/typechain/contracts/ERC1155.js +3 -0
- package/lib/typechain/contracts/ERC1155.js.map +1 -0
- package/lib/typechain/contracts/ERC20.d.ts +141 -0
- package/lib/typechain/contracts/ERC20.js +3 -0
- package/lib/typechain/contracts/ERC20.js.map +1 -0
- package/lib/typechain/contracts/ERC721.d.ts +213 -0
- package/lib/typechain/contracts/ERC721.js +3 -0
- package/lib/typechain/contracts/ERC721.js.map +1 -0
- package/lib/typechain/contracts/Multicall3.d.ts +57 -0
- package/lib/typechain/contracts/Multicall3.js +3 -0
- package/lib/typechain/contracts/Multicall3.js.map +1 -0
- package/lib/typechain/contracts/TransferHelper.d.ts +55 -0
- package/lib/typechain/contracts/TransferHelper.js +3 -0
- package/lib/typechain/contracts/TransferHelper.js.map +1 -0
- package/lib/typechain/contracts/common.d.ts +50 -0
- package/lib/typechain/contracts/common.js +3 -0
- package/lib/typechain/contracts/common.js.map +1 -0
- package/lib/typechain/contracts/factories/ERC1155__factory.d.ts +250 -0
- package/lib/typechain/contracts/factories/ERC1155__factory.js +332 -0
- package/lib/typechain/contracts/factories/ERC1155__factory.js.map +1 -0
- package/lib/typechain/contracts/factories/ERC20__factory.d.ts +174 -0
- package/lib/typechain/contracts/factories/ERC20__factory.js +240 -0
- package/lib/typechain/contracts/factories/ERC20__factory.js.map +1 -0
- package/lib/typechain/contracts/factories/ERC721__factory.d.ts +268 -0
- package/lib/typechain/contracts/factories/ERC721__factory.js +351 -0
- package/lib/typechain/contracts/factories/ERC721__factory.js.map +1 -0
- package/lib/typechain/contracts/factories/Multicall3__factory.d.ts +43 -0
- package/lib/typechain/contracts/factories/Multicall3__factory.js +68 -0
- package/lib/typechain/contracts/factories/Multicall3__factory.js.map +1 -0
- package/lib/typechain/contracts/factories/TransferHelper__factory.d.ts +46 -0
- package/lib/typechain/contracts/factories/TransferHelper__factory.js +71 -0
- package/lib/typechain/contracts/factories/TransferHelper__factory.js.map +1 -0
- package/lib/typechain/contracts/factories/index.d.ts +5 -0
- package/lib/typechain/contracts/factories/index.js +17 -0
- package/lib/typechain/contracts/factories/index.js.map +1 -0
- package/lib/typechain/contracts/index.d.ts +11 -0
- package/lib/typechain/contracts/index.js +48 -0
- package/lib/typechain/contracts/index.js.map +1 -0
- package/lib/types.d.ts +389 -0
- package/lib/types.js +129 -0
- package/lib/types.js.map +1 -0
- package/lib/utils/chain.d.ts +64 -0
- package/lib/utils/chain.js +211 -0
- package/lib/utils/chain.js.map +1 -0
- package/lib/utils/chainIds.generated.d.ts +7 -0
- package/lib/utils/chainIds.generated.js +37 -0
- package/lib/utils/chainIds.generated.js.map +1 -0
- package/lib/utils/converters.d.ts +37 -0
- package/lib/utils/converters.js +137 -0
- package/lib/utils/converters.js.map +1 -0
- package/lib/utils/dateHelper.d.ts +38 -0
- package/lib/utils/dateHelper.js +52 -0
- package/lib/utils/dateHelper.js.map +1 -0
- package/lib/utils/fees.d.ts +13 -0
- package/lib/utils/fees.js +29 -0
- package/lib/utils/fees.js.map +1 -0
- package/lib/utils/index.d.ts +2 -0
- package/lib/utils/index.js +19 -0
- package/lib/utils/index.js.map +1 -0
- package/lib/utils/protocol.d.ts +75 -0
- package/lib/utils/protocol.js +161 -0
- package/lib/utils/protocol.js.map +1 -0
- package/lib/utils/rateLimit.d.ts +34 -0
- package/lib/utils/rateLimit.js +97 -0
- package/lib/utils/rateLimit.js.map +1 -0
- package/lib/utils/stringHelper.d.ts +18 -0
- package/lib/utils/stringHelper.js +24 -0
- package/lib/utils/stringHelper.js.map +1 -0
- package/lib/utils/utils.d.ts +18 -0
- package/lib/utils/utils.js +45 -0
- package/lib/utils/utils.js.map +1 -0
- package/package.json +72 -0
- package/src/abi/ERC1155.json +314 -0
- package/src/abi/ERC20.json +222 -0
- package/src/abi/ERC721.json +333 -0
- package/src/abi/Multicall3.json +50 -0
- package/src/abi/TransferHelper.json +53 -0
- package/src/api/accounts.ts +69 -0
- package/src/api/api.ts +1152 -0
- package/src/api/apiPaths.ts +208 -0
- package/src/api/chains.ts +18 -0
- package/src/api/collections.ts +120 -0
- package/src/api/drops.ts +49 -0
- package/src/api/events.ts +71 -0
- package/src/api/fetcher.ts +31 -0
- package/src/api/index.ts +2 -0
- package/src/api/listings.ts +126 -0
- package/src/api/nfts.ts +144 -0
- package/src/api/offers.ts +242 -0
- package/src/api/orders.ts +283 -0
- package/src/api/search.ts +21 -0
- package/src/api/tokens.ts +67 -0
- package/src/api/types.ts +1210 -0
- package/src/constants.ts +90 -0
- package/src/index.ts +22 -0
- package/src/orders/privateListings.ts +173 -0
- package/src/orders/types.ts +191 -0
- package/src/orders/utils.ts +253 -0
- package/src/sdk/assets.ts +591 -0
- package/src/sdk/cancellation.ts +346 -0
- package/src/sdk/context.ts +33 -0
- package/src/sdk/fulfillment.ts +478 -0
- package/src/sdk/orders.ts +1149 -0
- package/src/sdk/tokens.ts +95 -0
- package/src/sdk.ts +1051 -0
- package/src/typechain/contracts/ERC1155.ts +440 -0
- package/src/typechain/contracts/ERC20.ts +286 -0
- package/src/typechain/contracts/ERC721.ts +412 -0
- package/src/typechain/contracts/Multicall3.ts +117 -0
- package/src/typechain/contracts/TransferHelper.ts +122 -0
- package/src/typechain/contracts/common.ts +131 -0
- package/src/typechain/contracts/factories/ERC1155__factory.ts +331 -0
- package/src/typechain/contracts/factories/ERC20__factory.ts +239 -0
- package/src/typechain/contracts/factories/ERC721__factory.ts +350 -0
- package/src/typechain/contracts/factories/Multicall3__factory.ts +67 -0
- package/src/typechain/contracts/factories/TransferHelper__factory.ts +76 -0
- package/src/typechain/contracts/factories/index.ts +8 -0
- package/src/typechain/contracts/index.ts +14 -0
- package/src/types.ts +413 -0
- package/src/utils/chain.ts +224 -0
- package/src/utils/chainIds.generated.ts +34 -0
- package/src/utils/converters.ts +145 -0
- package/src/utils/dateHelper.ts +48 -0
- package/src/utils/fees.ts +31 -0
- package/src/utils/index.ts +2 -0
- package/src/utils/protocol.ts +185 -0
- package/src/utils/rateLimit.ts +147 -0
- package/src/utils/stringHelper.ts +25 -0
- package/src/utils/utils.ts +36 -0
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"constant": false,
|
|
4
|
+
"inputs": [
|
|
5
|
+
{
|
|
6
|
+
"internalType": "address",
|
|
7
|
+
"name": "to",
|
|
8
|
+
"type": "address"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"internalType": "uint256",
|
|
12
|
+
"name": "tokenId",
|
|
13
|
+
"type": "uint256"
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
"name": "approve",
|
|
17
|
+
"outputs": [],
|
|
18
|
+
"payable": false,
|
|
19
|
+
"stateMutability": "nonpayable",
|
|
20
|
+
"type": "function"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"constant": false,
|
|
24
|
+
"inputs": [
|
|
25
|
+
{
|
|
26
|
+
"internalType": "address",
|
|
27
|
+
"name": "to",
|
|
28
|
+
"type": "address"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"internalType": "uint256",
|
|
32
|
+
"name": "tokenId",
|
|
33
|
+
"type": "uint256"
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
"name": "mint",
|
|
37
|
+
"outputs": [],
|
|
38
|
+
"payable": false,
|
|
39
|
+
"stateMutability": "nonpayable",
|
|
40
|
+
"type": "function"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"constant": false,
|
|
44
|
+
"inputs": [
|
|
45
|
+
{
|
|
46
|
+
"internalType": "address",
|
|
47
|
+
"name": "from",
|
|
48
|
+
"type": "address"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"internalType": "address",
|
|
52
|
+
"name": "to",
|
|
53
|
+
"type": "address"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"internalType": "uint256",
|
|
57
|
+
"name": "tokenId",
|
|
58
|
+
"type": "uint256"
|
|
59
|
+
}
|
|
60
|
+
],
|
|
61
|
+
"name": "safeTransferFrom",
|
|
62
|
+
"outputs": [],
|
|
63
|
+
"payable": false,
|
|
64
|
+
"stateMutability": "nonpayable",
|
|
65
|
+
"type": "function"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"constant": false,
|
|
69
|
+
"inputs": [
|
|
70
|
+
{
|
|
71
|
+
"internalType": "address",
|
|
72
|
+
"name": "from",
|
|
73
|
+
"type": "address"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"internalType": "address",
|
|
77
|
+
"name": "to",
|
|
78
|
+
"type": "address"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"internalType": "uint256",
|
|
82
|
+
"name": "tokenId",
|
|
83
|
+
"type": "uint256"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"internalType": "bytes",
|
|
87
|
+
"name": "_data",
|
|
88
|
+
"type": "bytes"
|
|
89
|
+
}
|
|
90
|
+
],
|
|
91
|
+
"name": "safeTransferFrom",
|
|
92
|
+
"outputs": [],
|
|
93
|
+
"payable": false,
|
|
94
|
+
"stateMutability": "nonpayable",
|
|
95
|
+
"type": "function"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"constant": false,
|
|
99
|
+
"inputs": [
|
|
100
|
+
{
|
|
101
|
+
"internalType": "address",
|
|
102
|
+
"name": "to",
|
|
103
|
+
"type": "address"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"internalType": "bool",
|
|
107
|
+
"name": "approved",
|
|
108
|
+
"type": "bool"
|
|
109
|
+
}
|
|
110
|
+
],
|
|
111
|
+
"name": "setApprovalForAll",
|
|
112
|
+
"outputs": [],
|
|
113
|
+
"payable": false,
|
|
114
|
+
"stateMutability": "nonpayable",
|
|
115
|
+
"type": "function"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"constant": false,
|
|
119
|
+
"inputs": [
|
|
120
|
+
{
|
|
121
|
+
"internalType": "address",
|
|
122
|
+
"name": "from",
|
|
123
|
+
"type": "address"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"internalType": "address",
|
|
127
|
+
"name": "to",
|
|
128
|
+
"type": "address"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"internalType": "uint256",
|
|
132
|
+
"name": "tokenId",
|
|
133
|
+
"type": "uint256"
|
|
134
|
+
}
|
|
135
|
+
],
|
|
136
|
+
"name": "transferFrom",
|
|
137
|
+
"outputs": [],
|
|
138
|
+
"payable": false,
|
|
139
|
+
"stateMutability": "nonpayable",
|
|
140
|
+
"type": "function"
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"inputs": [],
|
|
144
|
+
"payable": false,
|
|
145
|
+
"stateMutability": "nonpayable",
|
|
146
|
+
"type": "constructor"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"anonymous": false,
|
|
150
|
+
"inputs": [
|
|
151
|
+
{
|
|
152
|
+
"indexed": true,
|
|
153
|
+
"internalType": "address",
|
|
154
|
+
"name": "from",
|
|
155
|
+
"type": "address"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"indexed": true,
|
|
159
|
+
"internalType": "address",
|
|
160
|
+
"name": "to",
|
|
161
|
+
"type": "address"
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"indexed": true,
|
|
165
|
+
"internalType": "uint256",
|
|
166
|
+
"name": "tokenId",
|
|
167
|
+
"type": "uint256"
|
|
168
|
+
}
|
|
169
|
+
],
|
|
170
|
+
"name": "Transfer",
|
|
171
|
+
"type": "event"
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"anonymous": false,
|
|
175
|
+
"inputs": [
|
|
176
|
+
{
|
|
177
|
+
"indexed": true,
|
|
178
|
+
"internalType": "address",
|
|
179
|
+
"name": "owner",
|
|
180
|
+
"type": "address"
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"indexed": true,
|
|
184
|
+
"internalType": "address",
|
|
185
|
+
"name": "approved",
|
|
186
|
+
"type": "address"
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
"indexed": true,
|
|
190
|
+
"internalType": "uint256",
|
|
191
|
+
"name": "tokenId",
|
|
192
|
+
"type": "uint256"
|
|
193
|
+
}
|
|
194
|
+
],
|
|
195
|
+
"name": "Approval",
|
|
196
|
+
"type": "event"
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"anonymous": false,
|
|
200
|
+
"inputs": [
|
|
201
|
+
{
|
|
202
|
+
"indexed": true,
|
|
203
|
+
"internalType": "address",
|
|
204
|
+
"name": "owner",
|
|
205
|
+
"type": "address"
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
"indexed": true,
|
|
209
|
+
"internalType": "address",
|
|
210
|
+
"name": "operator",
|
|
211
|
+
"type": "address"
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
"indexed": false,
|
|
215
|
+
"internalType": "bool",
|
|
216
|
+
"name": "approved",
|
|
217
|
+
"type": "bool"
|
|
218
|
+
}
|
|
219
|
+
],
|
|
220
|
+
"name": "ApprovalForAll",
|
|
221
|
+
"type": "event"
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
"constant": true,
|
|
225
|
+
"inputs": [
|
|
226
|
+
{
|
|
227
|
+
"internalType": "address",
|
|
228
|
+
"name": "owner",
|
|
229
|
+
"type": "address"
|
|
230
|
+
}
|
|
231
|
+
],
|
|
232
|
+
"name": "balanceOf",
|
|
233
|
+
"outputs": [
|
|
234
|
+
{
|
|
235
|
+
"internalType": "uint256",
|
|
236
|
+
"name": "",
|
|
237
|
+
"type": "uint256"
|
|
238
|
+
}
|
|
239
|
+
],
|
|
240
|
+
"payable": false,
|
|
241
|
+
"stateMutability": "view",
|
|
242
|
+
"type": "function"
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
"constant": true,
|
|
246
|
+
"inputs": [
|
|
247
|
+
{
|
|
248
|
+
"internalType": "uint256",
|
|
249
|
+
"name": "tokenId",
|
|
250
|
+
"type": "uint256"
|
|
251
|
+
}
|
|
252
|
+
],
|
|
253
|
+
"name": "getApproved",
|
|
254
|
+
"outputs": [
|
|
255
|
+
{
|
|
256
|
+
"internalType": "address",
|
|
257
|
+
"name": "",
|
|
258
|
+
"type": "address"
|
|
259
|
+
}
|
|
260
|
+
],
|
|
261
|
+
"payable": false,
|
|
262
|
+
"stateMutability": "view",
|
|
263
|
+
"type": "function"
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
"constant": true,
|
|
267
|
+
"inputs": [
|
|
268
|
+
{
|
|
269
|
+
"internalType": "address",
|
|
270
|
+
"name": "owner",
|
|
271
|
+
"type": "address"
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
"internalType": "address",
|
|
275
|
+
"name": "operator",
|
|
276
|
+
"type": "address"
|
|
277
|
+
}
|
|
278
|
+
],
|
|
279
|
+
"name": "isApprovedForAll",
|
|
280
|
+
"outputs": [
|
|
281
|
+
{
|
|
282
|
+
"internalType": "bool",
|
|
283
|
+
"name": "",
|
|
284
|
+
"type": "bool"
|
|
285
|
+
}
|
|
286
|
+
],
|
|
287
|
+
"payable": false,
|
|
288
|
+
"stateMutability": "view",
|
|
289
|
+
"type": "function"
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
"constant": true,
|
|
293
|
+
"inputs": [
|
|
294
|
+
{
|
|
295
|
+
"internalType": "uint256",
|
|
296
|
+
"name": "tokenId",
|
|
297
|
+
"type": "uint256"
|
|
298
|
+
}
|
|
299
|
+
],
|
|
300
|
+
"name": "ownerOf",
|
|
301
|
+
"outputs": [
|
|
302
|
+
{
|
|
303
|
+
"internalType": "address",
|
|
304
|
+
"name": "",
|
|
305
|
+
"type": "address"
|
|
306
|
+
}
|
|
307
|
+
],
|
|
308
|
+
"payable": false,
|
|
309
|
+
"stateMutability": "view",
|
|
310
|
+
"type": "function"
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
"constant": true,
|
|
314
|
+
"inputs": [
|
|
315
|
+
{
|
|
316
|
+
"internalType": "bytes4",
|
|
317
|
+
"name": "interfaceId",
|
|
318
|
+
"type": "bytes4"
|
|
319
|
+
}
|
|
320
|
+
],
|
|
321
|
+
"name": "supportsInterface",
|
|
322
|
+
"outputs": [
|
|
323
|
+
{
|
|
324
|
+
"internalType": "bool",
|
|
325
|
+
"name": "",
|
|
326
|
+
"type": "bool"
|
|
327
|
+
}
|
|
328
|
+
],
|
|
329
|
+
"payable": false,
|
|
330
|
+
"stateMutability": "view",
|
|
331
|
+
"type": "function"
|
|
332
|
+
}
|
|
333
|
+
]
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"inputs": [
|
|
4
|
+
{
|
|
5
|
+
"components": [
|
|
6
|
+
{
|
|
7
|
+
"internalType": "address",
|
|
8
|
+
"name": "target",
|
|
9
|
+
"type": "address"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"internalType": "bool",
|
|
13
|
+
"name": "allowFailure",
|
|
14
|
+
"type": "bool"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"internalType": "bytes",
|
|
18
|
+
"name": "callData",
|
|
19
|
+
"type": "bytes"
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"internalType": "struct Multicall3.Call3[]",
|
|
23
|
+
"name": "calls",
|
|
24
|
+
"type": "tuple[]"
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"name": "aggregate3",
|
|
28
|
+
"outputs": [
|
|
29
|
+
{
|
|
30
|
+
"components": [
|
|
31
|
+
{
|
|
32
|
+
"internalType": "bool",
|
|
33
|
+
"name": "success",
|
|
34
|
+
"type": "bool"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"internalType": "bytes",
|
|
38
|
+
"name": "returnData",
|
|
39
|
+
"type": "bytes"
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
"internalType": "struct Multicall3.Result[]",
|
|
43
|
+
"name": "returnData",
|
|
44
|
+
"type": "tuple[]"
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
"stateMutability": "payable",
|
|
48
|
+
"type": "function"
|
|
49
|
+
}
|
|
50
|
+
]
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"inputs": [
|
|
4
|
+
{
|
|
5
|
+
"components": [
|
|
6
|
+
{
|
|
7
|
+
"internalType": "enum ConduitItemType",
|
|
8
|
+
"name": "itemType",
|
|
9
|
+
"type": "uint8"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"internalType": "address",
|
|
13
|
+
"name": "token",
|
|
14
|
+
"type": "address"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"internalType": "uint256",
|
|
18
|
+
"name": "identifier",
|
|
19
|
+
"type": "uint256"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"internalType": "uint256",
|
|
23
|
+
"name": "amount",
|
|
24
|
+
"type": "uint256"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"internalType": "address",
|
|
28
|
+
"name": "recipient",
|
|
29
|
+
"type": "address"
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
"internalType": "struct TransferHelperItem[]",
|
|
33
|
+
"name": "items",
|
|
34
|
+
"type": "tuple[]"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"internalType": "bytes32",
|
|
38
|
+
"name": "conduitKey",
|
|
39
|
+
"type": "bytes32"
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
"name": "bulkTransfer",
|
|
43
|
+
"outputs": [
|
|
44
|
+
{
|
|
45
|
+
"internalType": "bytes4",
|
|
46
|
+
"name": "magicValue",
|
|
47
|
+
"type": "bytes4"
|
|
48
|
+
}
|
|
49
|
+
],
|
|
50
|
+
"stateMutability": "nonpayable",
|
|
51
|
+
"type": "function"
|
|
52
|
+
}
|
|
53
|
+
]
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { Chain, OpenSeaAccount, OpenSeaPaymentToken } from "../types"
|
|
2
|
+
import { accountFromJSON, paymentTokenFromJSON } from "../utils/converters"
|
|
3
|
+
import {
|
|
4
|
+
getAccountPath,
|
|
5
|
+
getAccountTokensPath,
|
|
6
|
+
getPaymentTokenPath,
|
|
7
|
+
getResolveAccountPath,
|
|
8
|
+
} from "./apiPaths"
|
|
9
|
+
import type { Fetcher } from "./fetcher"
|
|
10
|
+
import type {
|
|
11
|
+
GetAccountTokensArgs,
|
|
12
|
+
GetAccountTokensResponse,
|
|
13
|
+
ResolveAccountResponse,
|
|
14
|
+
} from "./types"
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Account and payment token related API operations
|
|
18
|
+
*/
|
|
19
|
+
export class AccountsAPI {
|
|
20
|
+
constructor(
|
|
21
|
+
private fetcher: Fetcher,
|
|
22
|
+
private chain: Chain,
|
|
23
|
+
) {}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Fetch a payment token.
|
|
27
|
+
*/
|
|
28
|
+
async getPaymentToken(
|
|
29
|
+
address: string,
|
|
30
|
+
chain = this.chain,
|
|
31
|
+
): Promise<OpenSeaPaymentToken> {
|
|
32
|
+
const json = await this.fetcher.get<OpenSeaPaymentToken>(
|
|
33
|
+
getPaymentTokenPath(chain, address),
|
|
34
|
+
)
|
|
35
|
+
return paymentTokenFromJSON(json)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Fetch account for an address.
|
|
40
|
+
*/
|
|
41
|
+
async getAccount(address: string): Promise<OpenSeaAccount> {
|
|
42
|
+
const json = await this.fetcher.get<OpenSeaAccount>(getAccountPath(address))
|
|
43
|
+
return accountFromJSON(json)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Fetch token balances for an account.
|
|
48
|
+
*/
|
|
49
|
+
async getAccountTokens(
|
|
50
|
+
address: string,
|
|
51
|
+
args?: GetAccountTokensArgs,
|
|
52
|
+
): Promise<GetAccountTokensResponse> {
|
|
53
|
+
const response = await this.fetcher.get<GetAccountTokensResponse>(
|
|
54
|
+
getAccountTokensPath(address),
|
|
55
|
+
args,
|
|
56
|
+
)
|
|
57
|
+
return response
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Resolve an ENS name, OpenSea username, or wallet address to canonical account info.
|
|
62
|
+
*/
|
|
63
|
+
async resolveAccount(identifier: string): Promise<ResolveAccountResponse> {
|
|
64
|
+
const response = await this.fetcher.get<ResolveAccountResponse>(
|
|
65
|
+
getResolveAccountPath(identifier),
|
|
66
|
+
)
|
|
67
|
+
return response
|
|
68
|
+
}
|
|
69
|
+
}
|