@story-protocol/ipkit 0.4.0-beta.9 → 0.4.1-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +183 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/stories/useLicenseTokens.stories.d.ts +38 -0
- package/dist/hooks/stories/useLicenseTokens.stories.d.ts.map +1 -0
- package/dist/hooks/useLicenseTokens.d.ts +12 -0
- package/dist/hooks/useLicenseTokens.d.ts.map +1 -0
- package/dist/lib/api/getCollections.d.ts +8 -8
- package/dist/lib/api/getIpAssetEdges.d.ts +3 -3
- package/dist/lib/api/getIpAssets.d.ts +6 -6
- package/dist/lib/api/getLicenseTokens.d.ts +273 -0
- package/dist/lib/api/getLicenseTokens.d.ts.map +1 -0
- package/dist/lib/api/getSearch.d.ts +3 -3
- package/dist/lib/api/getTransactions.d.ts +3 -3
- package/dist/lib/api/index.d.ts +1 -0
- package/dist/lib/api/index.d.ts.map +1 -1
- package/dist/lib/index.d.ts +0 -2
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/utils.d.ts +0 -8
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/providers/IpKitProvider/IpKitProvider.d.ts +1 -8
- package/dist/providers/IpKitProvider/IpKitProvider.d.ts.map +1 -1
- package/dist/providers/IpKitProvider/__docs__/Example.d.ts +0 -3
- package/dist/providers/IpKitProvider/__docs__/Example.d.ts.map +1 -1
- package/dist/providers/IpKitProvider/__docs__/IpKitProvider.stories.d.ts +0 -12
- package/dist/providers/IpKitProvider/__docs__/IpKitProvider.stories.d.ts.map +1 -1
- package/dist/server-types.d.ts +420 -45
- package/dist/server.cjs.js +1 -1
- package/dist/server.cjs.js.map +1 -1
- package/dist/server.esm.js +1 -1
- package/dist/server.esm.js.map +1 -1
- package/dist/storyprotocol-storykit.cjs.js +1 -1
- package/dist/storyprotocol-storykit.cjs.js.map +1 -1
- package/dist/storyprotocol-storykit.esm.js +1 -1
- package/dist/storyprotocol-storykit.esm.js.map +1 -1
- package/dist/types/openapi.d.ts +1 -0
- package/dist/types/openapi.d.ts.map +1 -1
- package/dist/types/schema.d.ts +123 -6
- package/dist/types/schema.d.ts.map +1 -1
- package/dist/types.d.ts +429 -53
- package/package.json +20 -31
- package/dist/lib/functions/convertLicenseTermObject.d.ts +0 -6
- package/dist/lib/functions/convertLicenseTermObject.d.ts.map +0 -1
package/README.md
ADDED
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
[](https://ipkit.vercel.app/) [](https://www.npmjs.com/package/@story-protocol/ipkit)
|
|
2
|
+
|
|
3
|
+
# IpKit
|
|
4
|
+
|
|
5
|
+
IpKit provides a number of convenient [tanstack-query](https://tanstack.com/query/latest) hooks to quickly access Story's on-chain data, including assets, collections, transactions and more, via the [Protocol V4 API](https://docs.story.foundation/api-reference/protocol/introduction).
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pnpm add @story-protocol/ipkit @tanstack/react-query
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## API Keys
|
|
14
|
+
|
|
15
|
+
To use IpKit you’ll need a Story Protocol API Key, you can request an API key by completing this [form](https://forms.gle/K6enzJw3cTK5sHYU7).
|
|
16
|
+
|
|
17
|
+
There is a public API key available in the [API docs](https://docs.story.foundation/api-reference/protocol/introduction) for testing mainnet requests.
|
|
18
|
+
|
|
19
|
+
## Getting Started
|
|
20
|
+
|
|
21
|
+
### Providers
|
|
22
|
+
|
|
23
|
+
To initialize IpKit in your project, you'll need to wrap your application in `QueryClientProvider` and `IpKitProvider`. The IpKit provider requires the `apiKey` as a prop. You can also choose to query the Aeneid testnet API by setting `isTestnet` to true.
|
|
24
|
+
|
|
25
|
+
```tsx
|
|
26
|
+
"use client"
|
|
27
|
+
|
|
28
|
+
import { IpKitProvider } from "@story-protocol/ipkit"
|
|
29
|
+
import { QueryClient, QueryClientProvider } from "@tanstack/react-query"
|
|
30
|
+
|
|
31
|
+
export default function Providers({ children }: { children: React.ReactNode }) {
|
|
32
|
+
const queryClient = new QueryClient()
|
|
33
|
+
return (
|
|
34
|
+
<QueryClientProvider client={queryClient}>
|
|
35
|
+
<IpKitProvider apiKey="YOUR_API_KEY">{children}</IpKitProvider>
|
|
36
|
+
</QueryClientProvider>
|
|
37
|
+
)
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Hooks
|
|
42
|
+
|
|
43
|
+
You can now use the IpKit hooks to fetch IP data. Hooks return a [tanstack-query](https://tanstack.com/query/latest) `useQuery` function, in each hook you can pass [useQuery options](https://tanstack.com/query/latest/docs/framework/react/reference/useQuery) via the `queryOptions` property.
|
|
44
|
+
|
|
45
|
+
For hooks that return lists, for example `useIpAssets`, you can pass the [POST request body](https://docs.story.foundation/api-reference/protocol-v4/list-ip-assets) options via the `options` parameter.
|
|
46
|
+
|
|
47
|
+
For convenience, hooks expose the most commonly required body options in their parameters:
|
|
48
|
+
|
|
49
|
+
```tsx
|
|
50
|
+
// simple use case
|
|
51
|
+
const { data, isLoading } = useIpAssets()
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
```tsx
|
|
55
|
+
// fetch a collection's assets
|
|
56
|
+
const { data, isLoading } = useIpAssets({ tokenContract: "0x123" })
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
```tsx
|
|
60
|
+
// fetch using options and queryOptions
|
|
61
|
+
const { data, isLoading } = useIpAssets({
|
|
62
|
+
queryOptions: {
|
|
63
|
+
enabled: true,
|
|
64
|
+
refetchInterval: 1000,
|
|
65
|
+
},
|
|
66
|
+
options: {
|
|
67
|
+
pagination: {
|
|
68
|
+
limit: 10,
|
|
69
|
+
offset: 0,
|
|
70
|
+
},
|
|
71
|
+
orderBy: "descendantCount",
|
|
72
|
+
where: {
|
|
73
|
+
ownerAddress: "0x123",
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
})
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
```tsx
|
|
80
|
+
// fetch a single asset
|
|
81
|
+
const { data, isLoading } = useIpAsset({ ipId: "0x123" })
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
See the storybook for more details for each hook. The full list of hooks are:
|
|
85
|
+
|
|
86
|
+
- [useCollection](https://ipkit.vercel.app/?path=/story/hooks-usecollection--default)
|
|
87
|
+
- [useCollections](https://ipkit.vercel.app/?path=/story/hooks-usecollections--default)
|
|
88
|
+
- [useDispute](https://ipkit.vercel.app/?path=/story/hooks-usedispute--default)
|
|
89
|
+
- [useDisputes](https://ipkit.vercel.app/?path=/story/hooks-usedisputes--default)
|
|
90
|
+
- [useIpAsset](https://ipkit.vercel.app/?path=/story/hooks-useipasset--default)
|
|
91
|
+
- [useIpAssetChildren](https://ipkit.vercel.app/?path=/story/hooks-useipassetchildren--default)
|
|
92
|
+
- [useIpAssetEdges](https://ipkit.vercel.app/?path=/story/hooks-useipassetedges--default)
|
|
93
|
+
- [useIpAssetLicenses](https://ipkit.vercel.app/?path=/story/hooks-useipassetlicenses--default)
|
|
94
|
+
- [useIpAssetParents](https://ipkit.vercel.app/?path=/story/hooks-useipassetparents--default)
|
|
95
|
+
- [useIpAssets](https://ipkit.vercel.app/?path=/story/hooks-useipassets--default)
|
|
96
|
+
- [useIpAssetsByOwner](https://ipkit.vercel.app/?path=/story/hooks-useipassetsbyowner--default)
|
|
97
|
+
- [useSearch](https://ipkit.vercel.app/?path=/story/hooks-usesearch--default)
|
|
98
|
+
- [useTransaction](https://ipkit.vercel.app/?path=/story/hooks-usetransaction--default)
|
|
99
|
+
- [useTransactions](https://ipkit.vercel.app/?path=/story/hooks-usetransactions--default)
|
|
100
|
+
|
|
101
|
+
### useIpKit
|
|
102
|
+
|
|
103
|
+
You can also use the `useIpKit` hook to access data such as `apiBaseUrl`, `apiClient` (an [openapi-fetch](https://openapi-ts.dev/openapi-fetch/) client) and `chain` which includes chain data such as `id`, `name`, `rpcUrl` and `blockExplorerUrl`. View the full list in [storybook](https://ipkit.vercel.app/?path=/docs/providers-ipkitprovider--docs).
|
|
104
|
+
|
|
105
|
+
```tsx
|
|
106
|
+
const { apiBaseUrl, chain } = useIpKit()
|
|
107
|
+
const { id, name, rpcUrl } = chain
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### Request functions
|
|
111
|
+
|
|
112
|
+
IpKit also exposes the functions used by each hook in case you require more flexibility, SSR or want to use a different kind of Tanstack Query hook. Since they're using openapi-fetch, each function requires both `apiKey` and the `apiClient`.
|
|
113
|
+
|
|
114
|
+
Create an API client with the `createApiClient` or import one for testnet or mainnet from IpKit.
|
|
115
|
+
|
|
116
|
+
```tsx
|
|
117
|
+
import { createApiClient } from "@story-protocol/ipkit"
|
|
118
|
+
|
|
119
|
+
const client = createApiClient(`https://api.storyapis.com/api/v4/`)
|
|
120
|
+
const assets = await getIpAssets({ apiKey: YOUR_API_KEY, apiClient: client })
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
```tsx
|
|
124
|
+
import { stagingClient } from "@story-protocol/ipkit"
|
|
125
|
+
|
|
126
|
+
const assets = await getIpAssets({
|
|
127
|
+
apiKey: YOUR_API_KEY,
|
|
128
|
+
apiClient: stagingClient,
|
|
129
|
+
ipIds: ["0x123"],
|
|
130
|
+
})
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
These functions also expose some of the POST request body options as function input for convenience. The full list of exported functions are:
|
|
134
|
+
|
|
135
|
+
- `getCollections`
|
|
136
|
+
- `getDispute`
|
|
137
|
+
- `getDisputes`
|
|
138
|
+
- `getIpAssetEdges`
|
|
139
|
+
- `getIpAssets`
|
|
140
|
+
- `getSearch`
|
|
141
|
+
- `getTransactions`
|
|
142
|
+
|
|
143
|
+
### SSR
|
|
144
|
+
|
|
145
|
+
If you want to use IpKit in a server component you should import from `@story-protocol/ipkit/server`, this also exports all the api functions and types, but omits hooks and providers which won't work server-side.
|
|
146
|
+
|
|
147
|
+
### TypeScript
|
|
148
|
+
|
|
149
|
+
IpKit uses [OpenAPI](https://www.openapis.org/) and [openapi-typescript](https://openapi-ts.dev/) to ensure up-to-date and consistent types, in-line with the API.
|
|
150
|
+
|
|
151
|
+
IpKit exports all the IP data types you would expect including:
|
|
152
|
+
|
|
153
|
+
`IPAsset` `IPAssetEdge` `IPTransaction` `IPSearchResult` `Collection` `CollectionMetadata` `License` `LicenseTerms` `LicensingConfig` `NFTMetadata` `InfringementStatus` `ModerationStatus` `ContractMetadata` `Dispute` `TransactionEventType`
|
|
154
|
+
|
|
155
|
+
The available options for each hook are exported as `[hookName]Options`, for example `UseIpAssetsOptions`
|
|
156
|
+
|
|
157
|
+
```ts
|
|
158
|
+
type UseIpAssetsOptions = {
|
|
159
|
+
ipIds?: Address[]
|
|
160
|
+
tokenContract?: Address
|
|
161
|
+
includeLicenses?: boolean
|
|
162
|
+
moderated?: boolean
|
|
163
|
+
options?: IpAssetsOptions
|
|
164
|
+
queryOptions?: IpQueryOptions
|
|
165
|
+
}
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
The options for each API request are exported as `[nameOfDataType]Options` for example `IpAssetsOptions`.
|
|
169
|
+
|
|
170
|
+
```ts
|
|
171
|
+
type IpAssetsOptions = {
|
|
172
|
+
includeLicenses?: boolean
|
|
173
|
+
moderated?: boolean
|
|
174
|
+
orderBy?: "blockNumber" | "descendantCount" | "createdAt"
|
|
175
|
+
orderDirection?: "desc" | "asc"
|
|
176
|
+
pagination?: { limit: number; offset: number }
|
|
177
|
+
where?: {
|
|
178
|
+
ipIds?: string[] | null
|
|
179
|
+
ownerAddress?: string
|
|
180
|
+
tokenContract?: string
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
```
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export * from "./useIpAssetLicenses";
|
|
|
9
9
|
export * from "./useIpAssetParents";
|
|
10
10
|
export * from "./useIpAssets";
|
|
11
11
|
export * from "./useIpAssetsByOwner";
|
|
12
|
+
export * from "./useLicenseTokens";
|
|
12
13
|
export * from "./useSearch";
|
|
13
14
|
export * from "./useTransaction";
|
|
14
15
|
export * from "./useTransactions";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,kBAAkB,CAAA;AAChC,cAAc,cAAc,CAAA;AAC5B,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,sBAAsB,CAAA;AACpC,cAAc,mBAAmB,CAAA;AACjC,cAAc,sBAAsB,CAAA;AACpC,cAAc,qBAAqB,CAAA;AACnC,cAAc,eAAe,CAAA;AAC7B,cAAc,sBAAsB,CAAA;AACpC,cAAc,aAAa,CAAA;AAC3B,cAAc,kBAAkB,CAAA;AAChC,cAAc,mBAAmB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,kBAAkB,CAAA;AAChC,cAAc,cAAc,CAAA;AAC5B,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,sBAAsB,CAAA;AACpC,cAAc,mBAAmB,CAAA;AACjC,cAAc,sBAAsB,CAAA;AACpC,cAAc,qBAAqB,CAAA;AACnC,cAAc,eAAe,CAAA;AAC7B,cAAc,sBAAsB,CAAA;AACpC,cAAc,oBAAoB,CAAA;AAClC,cAAc,aAAa,CAAA;AAC3B,cAAc,kBAAkB,CAAA;AAChC,cAAc,mBAAmB,CAAA"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { StoryObj } from "@storybook/react";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { UseLicenseTokensOptions } from "../useLicenseTokens";
|
|
4
|
+
declare const meta: {
|
|
5
|
+
title: string;
|
|
6
|
+
component: (args: UseLicenseTokensOptions) => React.JSX.Element;
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: string;
|
|
9
|
+
};
|
|
10
|
+
argTypes: {
|
|
11
|
+
ownerAddress: {
|
|
12
|
+
control: "text";
|
|
13
|
+
};
|
|
14
|
+
licensorIpId: {
|
|
15
|
+
control: "text";
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
args: {
|
|
19
|
+
ownerAddress: "0x9474F1E311671b1343118317C7691804c63eCAe6";
|
|
20
|
+
licensorIpId: undefined;
|
|
21
|
+
options: {
|
|
22
|
+
orderBy: "blockNumber";
|
|
23
|
+
orderDirection: "desc";
|
|
24
|
+
pagination: {
|
|
25
|
+
offset: number;
|
|
26
|
+
limit: number;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
queryOptions: {
|
|
30
|
+
enabled: true;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
export default meta;
|
|
35
|
+
type Story = StoryObj<typeof meta>;
|
|
36
|
+
export declare const Default: Story;
|
|
37
|
+
export declare const WithLicensorFilter: Story;
|
|
38
|
+
//# sourceMappingURL=useLicenseTokens.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLicenseTokens.stories.d.ts","sourceRoot":"","sources":["../../../src/hooks/stories/useLicenseTokens.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AACtD,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,uBAAuB,EAAoB,MAAM,qBAAqB,CAAA;AAiB/E,QAAA,MAAM,IAAI;;sBAda,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2Cd,CAAA;AAEhC,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAA;AAElC,eAAO,MAAM,OAAO,EAAE,KAErB,CAAA;AAED,eAAO,MAAM,kBAAkB,EAAE,KAIhC,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IpQueryOptions } from "@/types/openapi";
|
|
2
|
+
import { UseQueryResult } from "@tanstack/react-query";
|
|
3
|
+
import { Address } from "viem";
|
|
4
|
+
import { LicenseTokensOptions, LicenseTokensResponse } from "../lib/api/getLicenseTokens";
|
|
5
|
+
export type UseLicenseTokensOptions = {
|
|
6
|
+
ownerAddress?: Address;
|
|
7
|
+
licensorIpId?: Address;
|
|
8
|
+
options?: LicenseTokensOptions;
|
|
9
|
+
queryOptions?: IpQueryOptions;
|
|
10
|
+
};
|
|
11
|
+
export declare function useLicenseTokens({ ownerAddress, licensorIpId, options, queryOptions, }: UseLicenseTokensOptions): UseQueryResult<LicenseTokensResponse>;
|
|
12
|
+
//# sourceMappingURL=useLicenseTokens.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLicenseTokens.d.ts","sourceRoot":"","sources":["../../src/hooks/useLicenseTokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAAE,cAAc,EAAY,MAAM,uBAAuB,CAAA;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAE9B,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAoB,MAAM,6BAA6B,CAAA;AAG3G,MAAM,MAAM,uBAAuB,GAAG;IACpC,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,OAAO,CAAC,EAAE,oBAAoB,CAAA;IAC9B,YAAY,CAAC,EAAE,cAAc,CAAA;CAC9B,CAAA;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,YAAY,EACZ,YAAY,EACZ,OAAO,EACP,YAAY,GACb,EAAE,uBAAuB,GAAG,cAAc,CAAC,qBAAqB,CAAC,CAkBjE"}
|
|
@@ -20,7 +20,7 @@ export declare function getCollections({ collectionAddresses, apiClient, options
|
|
|
20
20
|
content: {
|
|
21
21
|
"application/json": {
|
|
22
22
|
readonly $schema?: string | undefined;
|
|
23
|
-
orderBy: "updatedAt";
|
|
23
|
+
orderBy: "updatedAt" | "assetCount" | "licensesCount";
|
|
24
24
|
orderDirection: "asc" | "desc";
|
|
25
25
|
pagination?: {
|
|
26
26
|
limit: number;
|
|
@@ -80,7 +80,7 @@ export declare function getCollections({ collectionAddresses, apiClient, options
|
|
|
80
80
|
hasMore: boolean;
|
|
81
81
|
limit: number;
|
|
82
82
|
offset: number;
|
|
83
|
-
total
|
|
83
|
+
total: number;
|
|
84
84
|
} | undefined;
|
|
85
85
|
};
|
|
86
86
|
};
|
|
@@ -116,7 +116,7 @@ export declare function getCollections({ collectionAddresses, apiClient, options
|
|
|
116
116
|
} & {
|
|
117
117
|
body: {
|
|
118
118
|
readonly $schema?: string | undefined;
|
|
119
|
-
orderBy: "updatedAt";
|
|
119
|
+
orderBy: "updatedAt" | "assetCount" | "licensesCount";
|
|
120
120
|
orderDirection: "asc" | "desc";
|
|
121
121
|
pagination?: {
|
|
122
122
|
limit: number;
|
|
@@ -141,7 +141,7 @@ export declare function getCollections({ collectionAddresses, apiClient, options
|
|
|
141
141
|
content: {
|
|
142
142
|
"application/json": {
|
|
143
143
|
readonly $schema?: string | undefined;
|
|
144
|
-
orderBy: "updatedAt";
|
|
144
|
+
orderBy: "updatedAt" | "assetCount" | "licensesCount";
|
|
145
145
|
orderDirection: "asc" | "desc";
|
|
146
146
|
pagination?: {
|
|
147
147
|
limit: number;
|
|
@@ -201,7 +201,7 @@ export declare function getCollections({ collectionAddresses, apiClient, options
|
|
|
201
201
|
hasMore: boolean;
|
|
202
202
|
limit: number;
|
|
203
203
|
offset: number;
|
|
204
|
-
total
|
|
204
|
+
total: number;
|
|
205
205
|
} | undefined;
|
|
206
206
|
};
|
|
207
207
|
};
|
|
@@ -239,7 +239,7 @@ export declare function getCollections({ collectionAddresses, apiClient, options
|
|
|
239
239
|
content: {
|
|
240
240
|
"application/json": {
|
|
241
241
|
readonly $schema?: string | undefined;
|
|
242
|
-
orderBy: "updatedAt";
|
|
242
|
+
orderBy: "updatedAt" | "assetCount" | "licensesCount";
|
|
243
243
|
orderDirection: "asc" | "desc";
|
|
244
244
|
pagination?: {
|
|
245
245
|
limit: number;
|
|
@@ -299,7 +299,7 @@ export declare function getCollections({ collectionAddresses, apiClient, options
|
|
|
299
299
|
hasMore: boolean;
|
|
300
300
|
limit: number;
|
|
301
301
|
offset: number;
|
|
302
|
-
total
|
|
302
|
+
total: number;
|
|
303
303
|
} | undefined;
|
|
304
304
|
};
|
|
305
305
|
};
|
|
@@ -331,7 +331,7 @@ export declare function getCollections({ collectionAddresses, apiClient, options
|
|
|
331
331
|
headers?: import("openapi-fetch").HeadersOptions | undefined;
|
|
332
332
|
} & Omit<RequestInit, "headers" | "body"> & {
|
|
333
333
|
readonly $schema?: string | undefined;
|
|
334
|
-
orderBy: "updatedAt";
|
|
334
|
+
orderBy: "updatedAt" | "assetCount" | "licensesCount";
|
|
335
335
|
orderDirection: "asc" | "desc";
|
|
336
336
|
pagination?: {
|
|
337
337
|
limit: number;
|
|
@@ -62,7 +62,7 @@ export declare function getIpAssetEdges({ apiClient, ipId, parentIpId, options,
|
|
|
62
62
|
hasMore: boolean;
|
|
63
63
|
limit: number;
|
|
64
64
|
offset: number;
|
|
65
|
-
total
|
|
65
|
+
total: number;
|
|
66
66
|
} | undefined;
|
|
67
67
|
};
|
|
68
68
|
};
|
|
@@ -165,7 +165,7 @@ export declare function getIpAssetEdges({ apiClient, ipId, parentIpId, options,
|
|
|
165
165
|
hasMore: boolean;
|
|
166
166
|
limit: number;
|
|
167
167
|
offset: number;
|
|
168
|
-
total
|
|
168
|
+
total: number;
|
|
169
169
|
} | undefined;
|
|
170
170
|
};
|
|
171
171
|
};
|
|
@@ -244,7 +244,7 @@ export declare function getIpAssetEdges({ apiClient, ipId, parentIpId, options,
|
|
|
244
244
|
hasMore: boolean;
|
|
245
245
|
limit: number;
|
|
246
246
|
offset: number;
|
|
247
|
-
total
|
|
247
|
+
total: number;
|
|
248
248
|
} | undefined;
|
|
249
249
|
};
|
|
250
250
|
};
|
|
@@ -83,7 +83,7 @@ export declare function getIpAssets({ apiClient, ownerAddress, tokenContract, in
|
|
|
83
83
|
hookData: string;
|
|
84
84
|
isSet: boolean;
|
|
85
85
|
licensingHook: string;
|
|
86
|
-
mintingFee:
|
|
86
|
+
mintingFee: string;
|
|
87
87
|
};
|
|
88
88
|
templateMetadataUri: string;
|
|
89
89
|
templateName: string;
|
|
@@ -191,7 +191,7 @@ export declare function getIpAssets({ apiClient, ownerAddress, tokenContract, in
|
|
|
191
191
|
hasMore: boolean;
|
|
192
192
|
limit: number;
|
|
193
193
|
offset: number;
|
|
194
|
-
total
|
|
194
|
+
total: number;
|
|
195
195
|
} | undefined;
|
|
196
196
|
};
|
|
197
197
|
};
|
|
@@ -313,7 +313,7 @@ export declare function getIpAssets({ apiClient, ownerAddress, tokenContract, in
|
|
|
313
313
|
hookData: string;
|
|
314
314
|
isSet: boolean;
|
|
315
315
|
licensingHook: string;
|
|
316
|
-
mintingFee:
|
|
316
|
+
mintingFee: string;
|
|
317
317
|
};
|
|
318
318
|
templateMetadataUri: string;
|
|
319
319
|
templateName: string;
|
|
@@ -421,7 +421,7 @@ export declare function getIpAssets({ apiClient, ownerAddress, tokenContract, in
|
|
|
421
421
|
hasMore: boolean;
|
|
422
422
|
limit: number;
|
|
423
423
|
offset: number;
|
|
424
|
-
total
|
|
424
|
+
total: number;
|
|
425
425
|
} | undefined;
|
|
426
426
|
};
|
|
427
427
|
};
|
|
@@ -518,7 +518,7 @@ export declare function getIpAssets({ apiClient, ownerAddress, tokenContract, in
|
|
|
518
518
|
hookData: string;
|
|
519
519
|
isSet: boolean;
|
|
520
520
|
licensingHook: string;
|
|
521
|
-
mintingFee:
|
|
521
|
+
mintingFee: string;
|
|
522
522
|
};
|
|
523
523
|
templateMetadataUri: string;
|
|
524
524
|
templateName: string;
|
|
@@ -626,7 +626,7 @@ export declare function getIpAssets({ apiClient, ownerAddress, tokenContract, in
|
|
|
626
626
|
hasMore: boolean;
|
|
627
627
|
limit: number;
|
|
628
628
|
offset: number;
|
|
629
|
-
total
|
|
629
|
+
total: number;
|
|
630
630
|
} | undefined;
|
|
631
631
|
};
|
|
632
632
|
};
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
import { paths } from "@/types/schema";
|
|
2
|
+
import { Address } from "viem";
|
|
3
|
+
import { ApiClient } from "./apiClient";
|
|
4
|
+
export type LicenseTokensResponse = paths["/licenses/tokens"]["post"]["responses"][200]["content"]["application/json"];
|
|
5
|
+
export type LicenseTokensOptions = Partial<paths["/licenses/tokens"]["post"]["requestBody"]["content"]["application/json"]>;
|
|
6
|
+
export type GetLicenseTokensOptions = {
|
|
7
|
+
apiClient: ApiClient;
|
|
8
|
+
ownerAddress?: Address;
|
|
9
|
+
licensorIpId?: Address;
|
|
10
|
+
options?: LicenseTokensOptions;
|
|
11
|
+
apiKey: string;
|
|
12
|
+
};
|
|
13
|
+
export declare function getLicenseTokens({ apiClient, ownerAddress, licensorIpId, options, apiKey }: GetLicenseTokensOptions): Promise<import("openapi-fetch").FetchResponse<{
|
|
14
|
+
parameters: {
|
|
15
|
+
query?: undefined;
|
|
16
|
+
header?: undefined;
|
|
17
|
+
path?: undefined;
|
|
18
|
+
cookie?: undefined;
|
|
19
|
+
};
|
|
20
|
+
requestBody: {
|
|
21
|
+
content: {
|
|
22
|
+
"application/json": {
|
|
23
|
+
readonly $schema?: string | undefined;
|
|
24
|
+
orderBy: "blockNumber";
|
|
25
|
+
orderDirection: "asc" | "desc";
|
|
26
|
+
pagination?: {
|
|
27
|
+
limit: number;
|
|
28
|
+
offset: number;
|
|
29
|
+
} | undefined;
|
|
30
|
+
where?: {
|
|
31
|
+
licensorIpId?: string | undefined;
|
|
32
|
+
ownerAddress?: string | undefined;
|
|
33
|
+
} | undefined;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
responses: {
|
|
38
|
+
200: {
|
|
39
|
+
headers: {
|
|
40
|
+
[name: string]: unknown;
|
|
41
|
+
};
|
|
42
|
+
content: {
|
|
43
|
+
"application/json": {
|
|
44
|
+
readonly $schema?: string | undefined;
|
|
45
|
+
data: {
|
|
46
|
+
blockNumber: string;
|
|
47
|
+
blockTime: string;
|
|
48
|
+
burntAt: string;
|
|
49
|
+
id: string;
|
|
50
|
+
licenseTemplate: string;
|
|
51
|
+
licenseTermsId: string;
|
|
52
|
+
licensorIpId: string;
|
|
53
|
+
owner: string;
|
|
54
|
+
transferable: string;
|
|
55
|
+
}[] | null;
|
|
56
|
+
pagination?: {
|
|
57
|
+
hasMore: boolean;
|
|
58
|
+
limit: number;
|
|
59
|
+
offset: number;
|
|
60
|
+
total: number;
|
|
61
|
+
} | undefined;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
default: {
|
|
66
|
+
headers: {
|
|
67
|
+
[name: string]: unknown;
|
|
68
|
+
};
|
|
69
|
+
content: {
|
|
70
|
+
"application/problem+json": {
|
|
71
|
+
readonly $schema?: string | undefined;
|
|
72
|
+
detail?: string | undefined;
|
|
73
|
+
errors?: {
|
|
74
|
+
location?: string | undefined;
|
|
75
|
+
message?: string | undefined;
|
|
76
|
+
value?: unknown;
|
|
77
|
+
}[] | null | undefined;
|
|
78
|
+
instance?: string | undefined;
|
|
79
|
+
status?: number | undefined;
|
|
80
|
+
title?: string | undefined;
|
|
81
|
+
type: string;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
}, {
|
|
87
|
+
params?: {
|
|
88
|
+
query?: undefined;
|
|
89
|
+
header?: undefined;
|
|
90
|
+
path?: undefined;
|
|
91
|
+
cookie?: undefined;
|
|
92
|
+
} | undefined;
|
|
93
|
+
} & {
|
|
94
|
+
body: {
|
|
95
|
+
readonly $schema?: string | undefined;
|
|
96
|
+
orderBy: "blockNumber";
|
|
97
|
+
orderDirection: "asc" | "desc";
|
|
98
|
+
pagination?: {
|
|
99
|
+
limit: number;
|
|
100
|
+
offset: number;
|
|
101
|
+
} | undefined;
|
|
102
|
+
where?: {
|
|
103
|
+
licensorIpId?: string | undefined;
|
|
104
|
+
ownerAddress?: string | undefined;
|
|
105
|
+
} | undefined;
|
|
106
|
+
};
|
|
107
|
+
} & {
|
|
108
|
+
baseUrl?: string | undefined;
|
|
109
|
+
querySerializer?: import("openapi-fetch").QuerySerializerOptions | import("openapi-fetch").QuerySerializer<{
|
|
110
|
+
parameters: {
|
|
111
|
+
query?: undefined;
|
|
112
|
+
header?: undefined;
|
|
113
|
+
path?: undefined;
|
|
114
|
+
cookie?: undefined;
|
|
115
|
+
};
|
|
116
|
+
requestBody: {
|
|
117
|
+
content: {
|
|
118
|
+
"application/json": {
|
|
119
|
+
readonly $schema?: string | undefined;
|
|
120
|
+
orderBy: "blockNumber";
|
|
121
|
+
orderDirection: "asc" | "desc";
|
|
122
|
+
pagination?: {
|
|
123
|
+
limit: number;
|
|
124
|
+
offset: number;
|
|
125
|
+
} | undefined;
|
|
126
|
+
where?: {
|
|
127
|
+
licensorIpId?: string | undefined;
|
|
128
|
+
ownerAddress?: string | undefined;
|
|
129
|
+
} | undefined;
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
responses: {
|
|
134
|
+
200: {
|
|
135
|
+
headers: {
|
|
136
|
+
[name: string]: unknown;
|
|
137
|
+
};
|
|
138
|
+
content: {
|
|
139
|
+
"application/json": {
|
|
140
|
+
readonly $schema?: string | undefined;
|
|
141
|
+
data: {
|
|
142
|
+
blockNumber: string;
|
|
143
|
+
blockTime: string;
|
|
144
|
+
burntAt: string;
|
|
145
|
+
id: string;
|
|
146
|
+
licenseTemplate: string;
|
|
147
|
+
licenseTermsId: string;
|
|
148
|
+
licensorIpId: string;
|
|
149
|
+
owner: string;
|
|
150
|
+
transferable: string;
|
|
151
|
+
}[] | null;
|
|
152
|
+
pagination?: {
|
|
153
|
+
hasMore: boolean;
|
|
154
|
+
limit: number;
|
|
155
|
+
offset: number;
|
|
156
|
+
total: number;
|
|
157
|
+
} | undefined;
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
};
|
|
161
|
+
default: {
|
|
162
|
+
headers: {
|
|
163
|
+
[name: string]: unknown;
|
|
164
|
+
};
|
|
165
|
+
content: {
|
|
166
|
+
"application/problem+json": {
|
|
167
|
+
readonly $schema?: string | undefined;
|
|
168
|
+
detail?: string | undefined;
|
|
169
|
+
errors?: {
|
|
170
|
+
location?: string | undefined;
|
|
171
|
+
message?: string | undefined;
|
|
172
|
+
value?: unknown;
|
|
173
|
+
}[] | null | undefined;
|
|
174
|
+
instance?: string | undefined;
|
|
175
|
+
status?: number | undefined;
|
|
176
|
+
title?: string | undefined;
|
|
177
|
+
type: string;
|
|
178
|
+
};
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
};
|
|
182
|
+
}> | undefined;
|
|
183
|
+
bodySerializer?: import("openapi-fetch").BodySerializer<{
|
|
184
|
+
parameters: {
|
|
185
|
+
query?: undefined;
|
|
186
|
+
header?: undefined;
|
|
187
|
+
path?: undefined;
|
|
188
|
+
cookie?: undefined;
|
|
189
|
+
};
|
|
190
|
+
requestBody: {
|
|
191
|
+
content: {
|
|
192
|
+
"application/json": {
|
|
193
|
+
readonly $schema?: string | undefined;
|
|
194
|
+
orderBy: "blockNumber";
|
|
195
|
+
orderDirection: "asc" | "desc";
|
|
196
|
+
pagination?: {
|
|
197
|
+
limit: number;
|
|
198
|
+
offset: number;
|
|
199
|
+
} | undefined;
|
|
200
|
+
where?: {
|
|
201
|
+
licensorIpId?: string | undefined;
|
|
202
|
+
ownerAddress?: string | undefined;
|
|
203
|
+
} | undefined;
|
|
204
|
+
};
|
|
205
|
+
};
|
|
206
|
+
};
|
|
207
|
+
responses: {
|
|
208
|
+
200: {
|
|
209
|
+
headers: {
|
|
210
|
+
[name: string]: unknown;
|
|
211
|
+
};
|
|
212
|
+
content: {
|
|
213
|
+
"application/json": {
|
|
214
|
+
readonly $schema?: string | undefined;
|
|
215
|
+
data: {
|
|
216
|
+
blockNumber: string;
|
|
217
|
+
blockTime: string;
|
|
218
|
+
burntAt: string;
|
|
219
|
+
id: string;
|
|
220
|
+
licenseTemplate: string;
|
|
221
|
+
licenseTermsId: string;
|
|
222
|
+
licensorIpId: string;
|
|
223
|
+
owner: string;
|
|
224
|
+
transferable: string;
|
|
225
|
+
}[] | null;
|
|
226
|
+
pagination?: {
|
|
227
|
+
hasMore: boolean;
|
|
228
|
+
limit: number;
|
|
229
|
+
offset: number;
|
|
230
|
+
total: number;
|
|
231
|
+
} | undefined;
|
|
232
|
+
};
|
|
233
|
+
};
|
|
234
|
+
};
|
|
235
|
+
default: {
|
|
236
|
+
headers: {
|
|
237
|
+
[name: string]: unknown;
|
|
238
|
+
};
|
|
239
|
+
content: {
|
|
240
|
+
"application/problem+json": {
|
|
241
|
+
readonly $schema?: string | undefined;
|
|
242
|
+
detail?: string | undefined;
|
|
243
|
+
errors?: {
|
|
244
|
+
location?: string | undefined;
|
|
245
|
+
message?: string | undefined;
|
|
246
|
+
value?: unknown;
|
|
247
|
+
}[] | null | undefined;
|
|
248
|
+
instance?: string | undefined;
|
|
249
|
+
status?: number | undefined;
|
|
250
|
+
title?: string | undefined;
|
|
251
|
+
type: string;
|
|
252
|
+
};
|
|
253
|
+
};
|
|
254
|
+
};
|
|
255
|
+
};
|
|
256
|
+
}> | undefined;
|
|
257
|
+
parseAs?: keyof import("openapi-fetch").BodyType<unknown> | undefined;
|
|
258
|
+
fetch?: ((input: Request) => Promise<Response>) | undefined;
|
|
259
|
+
headers?: import("openapi-fetch").HeadersOptions | undefined;
|
|
260
|
+
} & Omit<RequestInit, "headers" | "body"> & {
|
|
261
|
+
readonly $schema?: string | undefined;
|
|
262
|
+
orderBy: "blockNumber";
|
|
263
|
+
orderDirection: "asc" | "desc";
|
|
264
|
+
pagination?: {
|
|
265
|
+
limit: number;
|
|
266
|
+
offset: number;
|
|
267
|
+
} | undefined;
|
|
268
|
+
where?: {
|
|
269
|
+
licensorIpId?: string | undefined;
|
|
270
|
+
ownerAddress?: string | undefined;
|
|
271
|
+
} | undefined;
|
|
272
|
+
}, `${string}/${string}`>>;
|
|
273
|
+
//# sourceMappingURL=getLicenseTokens.d.ts.map
|