@zoralabs/coins-sdk 0.7.0 → 0.8.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/CHANGELOG.md +17 -0
- package/dist/actions/updateCoinURI.d.ts +2 -0
- package/dist/actions/updateCoinURI.d.ts.map +1 -1
- package/dist/actions/updatePayoutRecipient.d.ts +2 -0
- package/dist/actions/updatePayoutRecipient.d.ts.map +1 -1
- package/dist/api/queries.d.ts +12 -1
- package/dist/api/queries.d.ts.map +1 -1
- package/dist/client/sdk.gen.d.ts +78 -1
- package/dist/client/sdk.gen.d.ts.map +1 -1
- package/dist/client/types.gen.d.ts +210 -1
- package/dist/client/types.gen.d.ts.map +1 -1
- package/dist/index.cjs +21 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/api/queries.ts +25 -0
- package/src/client/sdk.gen.ts +24 -0
- package/src/client/types.gen.ts +217 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zoralabs/coins-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"repository": "https://github.com/ourzora/zora-protocol",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@hey-api/client-fetch": "^0.8.3",
|
|
26
|
-
"@zoralabs/protocol-deployments": "^0.7.
|
|
26
|
+
"@zoralabs/protocol-deployments": "^0.7.6"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"abitype": "^1.0.8",
|
|
30
|
-
"viem": "2.
|
|
30
|
+
"viem": "2.53.1"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@hey-api/openapi-ts": "^0.64.10",
|
package/src/api/queries.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
GetCoinCommentsData,
|
|
3
3
|
GetCoinCommentsResponse,
|
|
4
|
+
GetCoinMergedCommentsData,
|
|
5
|
+
GetCoinMergedCommentsResponse,
|
|
4
6
|
GetCoinData,
|
|
5
7
|
GetCoinHoldersData,
|
|
6
8
|
GetCoinHoldersResponse,
|
|
@@ -38,6 +40,7 @@ import {
|
|
|
38
40
|
getCoin as getCoinSDK,
|
|
39
41
|
getCoins as getCoinsSDK,
|
|
40
42
|
getCoinComments as getCoinCommentsSDK,
|
|
43
|
+
getCoinMergedComments as getCoinMergedCommentsSDK,
|
|
41
44
|
getCoinHolders as getCoinHoldersSDK,
|
|
42
45
|
getCoinPriceHistory as getCoinPriceHistorySDK,
|
|
43
46
|
getCoinSwaps as getCoinSwapsSDK,
|
|
@@ -153,6 +156,28 @@ export const getCoinComments = async (
|
|
|
153
156
|
});
|
|
154
157
|
};
|
|
155
158
|
|
|
159
|
+
type GetCoinMergedCommentsQuery = GetCoinMergedCommentsData["query"];
|
|
160
|
+
export type { GetCoinMergedCommentsQuery, GetCoinMergedCommentsData };
|
|
161
|
+
export type { GetCoinMergedCommentsResponse } from "../client/types.gen";
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Fetches a coin's unified comment feed — on-chain, backfilled, and off-chain
|
|
165
|
+
* comments — pre-sorted newest-first under a single cursor. Mirrors the
|
|
166
|
+
* `GraphQLMergedComment` union that web and mobile consume. Unlike
|
|
167
|
+
* {@link getCoinComments} (on-chain `zoraComments` only), this includes
|
|
168
|
+
* off-chain comments.
|
|
169
|
+
*/
|
|
170
|
+
export const getCoinMergedComments = async (
|
|
171
|
+
query: GetCoinMergedCommentsQuery,
|
|
172
|
+
options?: RequestOptionsType<GetCoinMergedCommentsData>,
|
|
173
|
+
): Promise<RequestResult<GetCoinMergedCommentsResponse>> => {
|
|
174
|
+
return await getCoinMergedCommentsSDK({
|
|
175
|
+
query,
|
|
176
|
+
...getApiKeyMeta(),
|
|
177
|
+
...options,
|
|
178
|
+
});
|
|
179
|
+
};
|
|
180
|
+
|
|
156
181
|
type GetProfileQuery = GetProfileData["query"];
|
|
157
182
|
export type { GetProfileQuery, GetProfileData };
|
|
158
183
|
export type { GetProfileResponse } from "../client/types.gen";
|
package/src/client/sdk.gen.ts
CHANGED
|
@@ -14,6 +14,8 @@ import type {
|
|
|
14
14
|
GetCoinCommentsResponse,
|
|
15
15
|
GetCoinHoldersData,
|
|
16
16
|
GetCoinHoldersResponse,
|
|
17
|
+
GetCoinMergedCommentsData,
|
|
18
|
+
GetCoinMergedCommentsResponse,
|
|
17
19
|
GetCoinPriceHistoryData,
|
|
18
20
|
GetCoinPriceHistoryResponse,
|
|
19
21
|
GetCoinSwapsData,
|
|
@@ -172,6 +174,28 @@ export const getCoinHolders = <ThrowOnError extends boolean = false>(
|
|
|
172
174
|
});
|
|
173
175
|
};
|
|
174
176
|
|
|
177
|
+
/**
|
|
178
|
+
* zoraSDK_coinMergedComments query
|
|
179
|
+
*/
|
|
180
|
+
export const getCoinMergedComments = <ThrowOnError extends boolean = false>(
|
|
181
|
+
options: Options<GetCoinMergedCommentsData, ThrowOnError>,
|
|
182
|
+
) => {
|
|
183
|
+
return (options.client ?? _heyApiClient).get<
|
|
184
|
+
GetCoinMergedCommentsResponse,
|
|
185
|
+
unknown,
|
|
186
|
+
ThrowOnError
|
|
187
|
+
>({
|
|
188
|
+
security: [
|
|
189
|
+
{
|
|
190
|
+
name: "api-key",
|
|
191
|
+
type: "apiKey",
|
|
192
|
+
},
|
|
193
|
+
],
|
|
194
|
+
url: "/coinMergedComments",
|
|
195
|
+
...options,
|
|
196
|
+
});
|
|
197
|
+
};
|
|
198
|
+
|
|
175
199
|
/**
|
|
176
200
|
* zoraSDK_coinPriceHistory query
|
|
177
201
|
*/
|
package/src/client/types.gen.ts
CHANGED
|
@@ -653,6 +653,220 @@ export type GetCoinHoldersResponses = {
|
|
|
653
653
|
export type GetCoinHoldersResponse =
|
|
654
654
|
GetCoinHoldersResponses[keyof GetCoinHoldersResponses];
|
|
655
655
|
|
|
656
|
+
export type GetCoinMergedCommentsData = {
|
|
657
|
+
body?: never;
|
|
658
|
+
path?: never;
|
|
659
|
+
query: {
|
|
660
|
+
address: string;
|
|
661
|
+
chain?: number;
|
|
662
|
+
after?: string;
|
|
663
|
+
count?: number;
|
|
664
|
+
};
|
|
665
|
+
url: "/coinMergedComments";
|
|
666
|
+
};
|
|
667
|
+
|
|
668
|
+
export type GetCoinMergedCommentsErrors = {
|
|
669
|
+
/**
|
|
670
|
+
* Bad request
|
|
671
|
+
*/
|
|
672
|
+
400: unknown;
|
|
673
|
+
/**
|
|
674
|
+
* Internal server error
|
|
675
|
+
*/
|
|
676
|
+
500: unknown;
|
|
677
|
+
};
|
|
678
|
+
|
|
679
|
+
export type GetCoinMergedCommentsResponses = {
|
|
680
|
+
/**
|
|
681
|
+
* Successful operation
|
|
682
|
+
*/
|
|
683
|
+
200: {
|
|
684
|
+
zora20Token?: {
|
|
685
|
+
comments: {
|
|
686
|
+
pageInfo: {
|
|
687
|
+
/**
|
|
688
|
+
* When paginating forwards, the cursor to continue.
|
|
689
|
+
*/
|
|
690
|
+
endCursor?: string;
|
|
691
|
+
/**
|
|
692
|
+
* When paginating forwards, are there more items?
|
|
693
|
+
*/
|
|
694
|
+
hasNextPage: boolean;
|
|
695
|
+
};
|
|
696
|
+
/**
|
|
697
|
+
* The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.
|
|
698
|
+
*/
|
|
699
|
+
count: number;
|
|
700
|
+
edges: Array<{
|
|
701
|
+
/**
|
|
702
|
+
* A comment from any source in the merged feed: an on-chain comment (`GraphQLComment`), a backfilled on-chain comment (`GraphQLBackfilledComment`), or an off-chain comment (`GraphQLOffChainComment`).
|
|
703
|
+
*/
|
|
704
|
+
node: {
|
|
705
|
+
/**
|
|
706
|
+
* The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.
|
|
707
|
+
*/
|
|
708
|
+
commentId: string;
|
|
709
|
+
/**
|
|
710
|
+
* The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.
|
|
711
|
+
*/
|
|
712
|
+
nonce: string;
|
|
713
|
+
userAddress: string;
|
|
714
|
+
/**
|
|
715
|
+
* The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.
|
|
716
|
+
*/
|
|
717
|
+
txHash: string;
|
|
718
|
+
/**
|
|
719
|
+
* The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.
|
|
720
|
+
*/
|
|
721
|
+
comment: string;
|
|
722
|
+
/**
|
|
723
|
+
* The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.
|
|
724
|
+
*/
|
|
725
|
+
timestamp: number;
|
|
726
|
+
userProfile?: {
|
|
727
|
+
/**
|
|
728
|
+
* The Globally Unique ID of this object
|
|
729
|
+
*/
|
|
730
|
+
id: string;
|
|
731
|
+
/**
|
|
732
|
+
* Manually set username, or truncated wallet address if the profile isn't a GraphQLAccountProfile. For full wallet address, use the profile_id field instead.
|
|
733
|
+
*/
|
|
734
|
+
handle: string;
|
|
735
|
+
avatar?: {
|
|
736
|
+
previewImage: {
|
|
737
|
+
/**
|
|
738
|
+
* The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.
|
|
739
|
+
*/
|
|
740
|
+
blurhash?: string;
|
|
741
|
+
/**
|
|
742
|
+
* The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.
|
|
743
|
+
*/
|
|
744
|
+
small: string;
|
|
745
|
+
/**
|
|
746
|
+
* The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.
|
|
747
|
+
*/
|
|
748
|
+
medium: string;
|
|
749
|
+
};
|
|
750
|
+
};
|
|
751
|
+
};
|
|
752
|
+
replies: {
|
|
753
|
+
/**
|
|
754
|
+
* The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.
|
|
755
|
+
*/
|
|
756
|
+
count: number;
|
|
757
|
+
edges: Array<{
|
|
758
|
+
node: {
|
|
759
|
+
/**
|
|
760
|
+
* The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.
|
|
761
|
+
*/
|
|
762
|
+
commentId: string;
|
|
763
|
+
contractAddress: string;
|
|
764
|
+
/**
|
|
765
|
+
* The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.
|
|
766
|
+
*/
|
|
767
|
+
text: string;
|
|
768
|
+
/**
|
|
769
|
+
* Date with time (isoformat)
|
|
770
|
+
*/
|
|
771
|
+
commentedAt: string;
|
|
772
|
+
/**
|
|
773
|
+
* The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.
|
|
774
|
+
*/
|
|
775
|
+
replyToOnChainId?: string;
|
|
776
|
+
/**
|
|
777
|
+
* The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.
|
|
778
|
+
*/
|
|
779
|
+
replyToOffChainId?: string;
|
|
780
|
+
/**
|
|
781
|
+
* The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.
|
|
782
|
+
*/
|
|
783
|
+
sparkCount: number;
|
|
784
|
+
profile?: {
|
|
785
|
+
/**
|
|
786
|
+
* The Globally Unique ID of this object
|
|
787
|
+
*/
|
|
788
|
+
id: string;
|
|
789
|
+
/**
|
|
790
|
+
* Manually set username, or truncated wallet address if the profile isn't a GraphQLAccountProfile. For full wallet address, use the profile_id field instead.
|
|
791
|
+
*/
|
|
792
|
+
handle: string;
|
|
793
|
+
avatar?: {
|
|
794
|
+
previewImage: {
|
|
795
|
+
/**
|
|
796
|
+
* The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.
|
|
797
|
+
*/
|
|
798
|
+
blurhash?: string;
|
|
799
|
+
/**
|
|
800
|
+
* The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.
|
|
801
|
+
*/
|
|
802
|
+
small: string;
|
|
803
|
+
/**
|
|
804
|
+
* The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.
|
|
805
|
+
*/
|
|
806
|
+
medium: string;
|
|
807
|
+
};
|
|
808
|
+
};
|
|
809
|
+
};
|
|
810
|
+
};
|
|
811
|
+
}>;
|
|
812
|
+
};
|
|
813
|
+
contractAddress: string;
|
|
814
|
+
/**
|
|
815
|
+
* The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.
|
|
816
|
+
*/
|
|
817
|
+
text: string;
|
|
818
|
+
/**
|
|
819
|
+
* Date with time (isoformat)
|
|
820
|
+
*/
|
|
821
|
+
commentedAt: string;
|
|
822
|
+
/**
|
|
823
|
+
* The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.
|
|
824
|
+
*/
|
|
825
|
+
replyToOnChainId?: string;
|
|
826
|
+
/**
|
|
827
|
+
* The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.
|
|
828
|
+
*/
|
|
829
|
+
replyToOffChainId?: string;
|
|
830
|
+
/**
|
|
831
|
+
* The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.
|
|
832
|
+
*/
|
|
833
|
+
sparkCount: number;
|
|
834
|
+
profile?: {
|
|
835
|
+
/**
|
|
836
|
+
* The Globally Unique ID of this object
|
|
837
|
+
*/
|
|
838
|
+
id: string;
|
|
839
|
+
/**
|
|
840
|
+
* Manually set username, or truncated wallet address if the profile isn't a GraphQLAccountProfile. For full wallet address, use the profile_id field instead.
|
|
841
|
+
*/
|
|
842
|
+
handle: string;
|
|
843
|
+
avatar?: {
|
|
844
|
+
previewImage: {
|
|
845
|
+
/**
|
|
846
|
+
* The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.
|
|
847
|
+
*/
|
|
848
|
+
blurhash?: string;
|
|
849
|
+
/**
|
|
850
|
+
* The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.
|
|
851
|
+
*/
|
|
852
|
+
small: string;
|
|
853
|
+
/**
|
|
854
|
+
* The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.
|
|
855
|
+
*/
|
|
856
|
+
medium: string;
|
|
857
|
+
};
|
|
858
|
+
};
|
|
859
|
+
};
|
|
860
|
+
};
|
|
861
|
+
}>;
|
|
862
|
+
};
|
|
863
|
+
};
|
|
864
|
+
};
|
|
865
|
+
};
|
|
866
|
+
|
|
867
|
+
export type GetCoinMergedCommentsResponse =
|
|
868
|
+
GetCoinMergedCommentsResponses[keyof GetCoinMergedCommentsResponses];
|
|
869
|
+
|
|
656
870
|
export type GetCoinPriceHistoryData = {
|
|
657
871
|
body?: never;
|
|
658
872
|
path?: never;
|
|
@@ -1657,7 +1871,9 @@ export type GetExploreData = {
|
|
|
1657
1871
|
| "TRENDING_CREATORS"
|
|
1658
1872
|
| "TRENDING_ALL"
|
|
1659
1873
|
| "TOP_VOLUME_TRENDS_24H"
|
|
1660
|
-
| "MOST_VALUABLE_ALL"
|
|
1874
|
+
| "MOST_VALUABLE_ALL"
|
|
1875
|
+
| "TRENDING_AGENTS"
|
|
1876
|
+
| "MOST_VALUABLE_AGENTS";
|
|
1661
1877
|
count?: number;
|
|
1662
1878
|
after?: string;
|
|
1663
1879
|
};
|