@0xsequence/metadata 1.9.6 → 1.9.8

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.
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable */
2
- // sequence-metadata v0.4.0 4abf3a2d23aa0f4c036e7392ac23919dc611f1c3
2
+ // sequence-metadata v0.4.0 ae7e843bd6e50f2634c3f663d49c5c7d1678c2b2
3
3
  // --
4
4
  // Code generated by webrpc-gen@v0.14.0-dev with typescript@v0.10.0 generator. DO NOT EDIT.
5
5
  //
@@ -12,7 +12,7 @@ export const WebRPCVersion = 'v1'
12
12
  export const WebRPCSchemaVersion = 'v0.4.0'
13
13
 
14
14
  // Schema hash generated from your RIDL schema
15
- export const WebRPCSchemaHash = '4abf3a2d23aa0f4c036e7392ac23919dc611f1c3'
15
+ export const WebRPCSchemaHash = 'ae7e843bd6e50f2634c3f663d49c5c7d1678c2b2'
16
16
 
17
17
  //
18
18
  // Types
@@ -35,10 +35,6 @@ export enum SwapType {
35
35
  BUY = 'BUY',
36
36
  SELL = 'SELL'
37
37
  }
38
- export enum SortOrder {
39
- DESC = 'DESC',
40
- ASC = 'ASC'
41
- }
42
38
  export enum TaskStatus {
43
39
  PENDING = 'PENDING',
44
40
  PAUSED = 'PAUSED',
@@ -67,6 +63,7 @@ export interface RuntimeStatus {
67
63
  export interface RuntimeChecks {}
68
64
 
69
65
  export interface ContractIndex {
66
+ collectionId?: number
70
67
  chainId: number
71
68
  address: string
72
69
  type: ContractType
@@ -120,20 +117,20 @@ export interface ContractInfoExtensions {
120
117
 
121
118
  export interface TokenMetadata {
122
119
  tokenId: string
123
- contractAddress: string
124
120
  name: string
125
121
  description: string
126
122
  image: string
127
- decimals: number
128
- properties: { [key: string]: any }
129
123
  video: string
130
124
  audio: string
125
+ properties: { [key: string]: any }
126
+ attributes: Array<{ [key: string]: any }>
131
127
  image_data: string
132
128
  external_url: string
133
129
  background_color: string
134
130
  animation_url: string
135
- attributes: Array<{ [key: string]: any }>
131
+ decimals?: number
136
132
  updatedAt: string
133
+ assets?: Array<Asset>
137
134
  }
138
135
 
139
136
  export interface PropertyFilter {
@@ -149,6 +146,55 @@ export interface Filter {
149
146
  properties?: Array<PropertyFilter>
150
147
  }
151
148
 
149
+ export interface Collection {
150
+ id: number
151
+ projectId: number
152
+ metadata: CollectionMetadata
153
+ private: boolean
154
+ revealKey: string
155
+ createdAt: string
156
+ updatedAt: string
157
+ deletedAt?: string
158
+ baseURIs?: CollectionBaseURIs
159
+ }
160
+
161
+ export interface CollectionMetadata {
162
+ name: string
163
+ description: string
164
+ image: string
165
+ externalLink: string
166
+ properties: { [key: string]: any }
167
+ attributes: Array<{ [key: string]: any }>
168
+ }
169
+
170
+ export interface CollectionBaseURIs {
171
+ contractMetadataURI: string
172
+ tokenMetadataURI: string
173
+ }
174
+
175
+ export interface Asset {
176
+ id: number
177
+ collectionId: number
178
+ tokenId: string
179
+ url: string
180
+ metadataField: string
181
+ name: string
182
+ filesize: number
183
+ mimeType: string
184
+ width?: number
185
+ height?: number
186
+ updatedAt: string
187
+ }
188
+
189
+ export interface Token {
190
+ collectionId: number
191
+ tokenId: string
192
+ metadata: TokenMetadata
193
+ private: boolean
194
+
195
+ updatedAt: string
196
+ }
197
+
152
198
  export interface GetNiftyswapUnitPricesRequest {
153
199
  swapType: SwapType
154
200
  ids: Array<string>
@@ -162,13 +208,12 @@ export interface GetNiftyswapUnitPricesResponse {
162
208
  }
163
209
 
164
210
  export interface Page {
165
- pageSize?: number
166
211
  page?: number
167
- }
168
-
169
- export interface SortBy {
170
- column: string
171
- order: SortOrder
212
+ column?: string
213
+ before?: any
214
+ after?: any
215
+ pageSize?: number
216
+ more?: boolean
172
217
  }
173
218
 
174
219
  export interface TaskRunner {
@@ -194,6 +239,7 @@ export interface Metadata {
194
239
  version(headers?: object): Promise<VersionReturn>
195
240
  runtimeStatus(headers?: object): Promise<RuntimeStatusReturn>
196
241
  getTokenMetadata(args: GetTokenMetadataArgs, headers?: object): Promise<GetTokenMetadataReturn>
242
+ refreshTokenMetadata(args: RefreshTokenMetadataArgs, headers?: object): Promise<RefreshTokenMetadataReturn>
197
243
  enqueueTokensForRefresh(args: EnqueueTokensForRefreshArgs, headers?: object): Promise<EnqueueTokensForRefreshReturn>
198
244
  getTokenRefreshStatus(args: GetTokenRefreshStatusArgs, headers?: object): Promise<GetTokenRefreshStatusReturn>
199
245
  getTokenRefreshResult(args: GetTokenRefreshResultArgs, headers?: object): Promise<GetTokenRefreshResultReturn>
@@ -207,7 +253,6 @@ export interface Metadata {
207
253
  searchContractInfo(args: SearchContractInfoArgs, headers?: object): Promise<SearchContractInfoReturn>
208
254
  searchContractInfoBatch(args: SearchContractInfoBatchArgs, headers?: object): Promise<SearchContractInfoBatchReturn>
209
255
  searchMetadata(args: SearchMetadataArgs, headers?: object): Promise<SearchMetadataReturn>
210
- projectSetTokenMetadata(args: ProjectSetTokenMetadataArgs, headers?: object): Promise<ProjectSetTokenMetadataReturn>
211
256
  getNiftyswapTokenQuantity(args: GetNiftyswapTokenQuantityArgs, headers?: object): Promise<GetNiftyswapTokenQuantityReturn>
212
257
  getNiftyswapUnitPrices(args: GetNiftyswapUnitPricesArgs, headers?: object): Promise<GetNiftyswapUnitPricesReturn>
213
258
  getNiftyswapUnitPricesWithQuantities(
@@ -247,6 +292,16 @@ export interface GetTokenMetadataArgs {
247
292
  export interface GetTokenMetadataReturn {
248
293
  tokenMetadata: Array<TokenMetadata>
249
294
  }
295
+ export interface RefreshTokenMetadataArgs {
296
+ chainID: string
297
+ contractAddress: string
298
+ tokenIDs?: Array<string>
299
+ refreshAll?: boolean
300
+ }
301
+
302
+ export interface RefreshTokenMetadataReturn {
303
+ taskId: number
304
+ }
250
305
  export interface EnqueueTokensForRefreshArgs {
251
306
  chainID: string
252
307
  contractAddress: string
@@ -359,15 +414,6 @@ export interface SearchMetadataReturn {
359
414
  tokenMetadata: Array<TokenMetadata>
360
415
  contractInfo: Array<ContractInfo>
361
416
  }
362
- export interface ProjectSetTokenMetadataArgs {
363
- projectID?: number
364
- chainID: string
365
- tokenMetadata: TokenMetadata
366
- }
367
-
368
- export interface ProjectSetTokenMetadataReturn {
369
- ok: boolean
370
- }
371
417
  export interface GetNiftyswapTokenQuantityArgs {
372
418
  chainID: string
373
419
  contractAddress: string
@@ -430,6 +476,166 @@ export interface MintMonitorTriggerJobReturn {
430
476
  ok: boolean
431
477
  }
432
478
 
479
+ export interface Collections {
480
+ createCollection(args: CreateCollectionArgs, headers?: object): Promise<CreateCollectionReturn>
481
+ getCollection(args: GetCollectionArgs, headers?: object): Promise<GetCollectionReturn>
482
+ listCollections(args: ListCollectionsArgs, headers?: object): Promise<ListCollectionsReturn>
483
+ updateCollection(args: UpdateCollectionArgs, headers?: object): Promise<UpdateCollectionReturn>
484
+ deleteCollection(args: DeleteCollectionArgs, headers?: object): Promise<DeleteCollectionReturn>
485
+ publishCollection(args: PublishCollectionArgs, headers?: object): Promise<PublishCollectionReturn>
486
+ unpublishCollection(args: UnpublishCollectionArgs, headers?: object): Promise<UnpublishCollectionReturn>
487
+ createToken(args: CreateTokenArgs, headers?: object): Promise<CreateTokenReturn>
488
+ getToken(args: GetTokenArgs, headers?: object): Promise<GetTokenReturn>
489
+ listTokens(args: ListTokensArgs, headers?: object): Promise<ListTokensReturn>
490
+ updateToken(args: UpdateTokenArgs, headers?: object): Promise<UpdateTokenReturn>
491
+ deleteToken(args: DeleteTokenArgs, headers?: object): Promise<DeleteTokenReturn>
492
+ createAsset(args: CreateAssetArgs, headers?: object): Promise<CreateAssetReturn>
493
+ getAsset(args: GetAssetArgs, headers?: object): Promise<GetAssetReturn>
494
+ updateAsset(args: UpdateAssetArgs, headers?: object): Promise<UpdateAssetReturn>
495
+ deleteAsset(args: DeleteAssetArgs, headers?: object): Promise<DeleteAssetReturn>
496
+ }
497
+
498
+ export interface CreateCollectionArgs {
499
+ projectId?: number
500
+ collection: Collection
501
+ }
502
+
503
+ export interface CreateCollectionReturn {
504
+ collection: Collection
505
+ }
506
+ export interface GetCollectionArgs {
507
+ projectId?: number
508
+ collectionId: number
509
+ }
510
+
511
+ export interface GetCollectionReturn {
512
+ collection: Collection
513
+ }
514
+ export interface ListCollectionsArgs {
515
+ projectId?: number
516
+ page?: Page
517
+ }
518
+
519
+ export interface ListCollectionsReturn {
520
+ page: Page
521
+ collections: Array<Collection>
522
+ }
523
+ export interface UpdateCollectionArgs {
524
+ projectId?: number
525
+ collection: Collection
526
+ }
527
+
528
+ export interface UpdateCollectionReturn {
529
+ collection: Collection
530
+ }
531
+ export interface DeleteCollectionArgs {
532
+ projectId?: number
533
+ collectionId: number
534
+ }
535
+
536
+ export interface DeleteCollectionReturn {
537
+ status: boolean
538
+ }
539
+ export interface PublishCollectionArgs {
540
+ projectId?: number
541
+ collectionId: number
542
+ }
543
+
544
+ export interface PublishCollectionReturn {
545
+ collection: Collection
546
+ }
547
+ export interface UnpublishCollectionArgs {
548
+ projectId?: number
549
+ collectionId: number
550
+ }
551
+
552
+ export interface UnpublishCollectionReturn {
553
+ collection: Collection
554
+ }
555
+ export interface CreateTokenArgs {
556
+ projectId?: number
557
+ collectionId: number
558
+ token: TokenMetadata
559
+ private?: boolean
560
+ }
561
+
562
+ export interface CreateTokenReturn {
563
+ token: TokenMetadata
564
+ assets: Array<Asset>
565
+ }
566
+ export interface GetTokenArgs {
567
+ projectId?: number
568
+ collectionId: number
569
+ tokenId: string
570
+ }
571
+
572
+ export interface GetTokenReturn {
573
+ token: TokenMetadata
574
+ assets: Array<Asset>
575
+ }
576
+ export interface ListTokensArgs {
577
+ projectId?: number
578
+ collectionId: number
579
+ page?: Page
580
+ }
581
+
582
+ export interface ListTokensReturn {
583
+ page: Page
584
+ tokens: Array<TokenMetadata>
585
+ }
586
+ export interface UpdateTokenArgs {
587
+ projectId?: number
588
+ collectionId: number
589
+ tokenId: string
590
+ token: TokenMetadata
591
+ private?: boolean
592
+ }
593
+
594
+ export interface UpdateTokenReturn {
595
+ token: TokenMetadata
596
+ }
597
+ export interface DeleteTokenArgs {
598
+ projectId?: number
599
+ collectionId: number
600
+ tokenId: string
601
+ }
602
+
603
+ export interface DeleteTokenReturn {
604
+ status: boolean
605
+ }
606
+ export interface CreateAssetArgs {
607
+ projectId?: number
608
+ asset: Asset
609
+ }
610
+
611
+ export interface CreateAssetReturn {
612
+ asset: Asset
613
+ }
614
+ export interface GetAssetArgs {
615
+ projectId?: number
616
+ assetId: number
617
+ }
618
+
619
+ export interface GetAssetReturn {
620
+ asset: Asset
621
+ }
622
+ export interface UpdateAssetArgs {
623
+ projectId?: number
624
+ asset: Asset
625
+ }
626
+
627
+ export interface UpdateAssetReturn {
628
+ asset: Asset
629
+ }
630
+ export interface DeleteAssetArgs {
631
+ projectId?: number
632
+ assetId: number
633
+ }
634
+
635
+ export interface DeleteAssetReturn {
636
+ status: boolean
637
+ }
638
+
433
639
  //
434
640
  // Client
435
641
  //
@@ -487,6 +693,16 @@ export class Metadata implements Metadata {
487
693
  })
488
694
  }
489
695
 
696
+ refreshTokenMetadata = (args: RefreshTokenMetadataArgs, headers?: object): Promise<RefreshTokenMetadataReturn> => {
697
+ return this.fetch(this.url('RefreshTokenMetadata'), createHTTPRequest(args, headers)).then(res => {
698
+ return buildResponse(res).then(_data => {
699
+ return {
700
+ taskId: <number>_data.taskId
701
+ }
702
+ })
703
+ })
704
+ }
705
+
490
706
  enqueueTokensForRefresh = (args: EnqueueTokensForRefreshArgs, headers?: object): Promise<EnqueueTokensForRefreshReturn> => {
491
707
  return this.fetch(this.url('EnqueueTokensForRefresh'), createHTTPRequest(args, headers)).then(res => {
492
708
  return buildResponse(res).then(_data => {
@@ -622,16 +838,6 @@ export class Metadata implements Metadata {
622
838
  })
623
839
  }
624
840
 
625
- projectSetTokenMetadata = (args: ProjectSetTokenMetadataArgs, headers?: object): Promise<ProjectSetTokenMetadataReturn> => {
626
- return this.fetch(this.url('ProjectSetTokenMetadata'), createHTTPRequest(args, headers)).then(res => {
627
- return buildResponse(res).then(_data => {
628
- return {
629
- ok: <boolean>_data.ok
630
- }
631
- })
632
- })
633
- }
634
-
635
841
  getNiftyswapTokenQuantity = (
636
842
  args: GetNiftyswapTokenQuantityArgs,
637
843
  headers?: object
@@ -712,6 +918,185 @@ export class Metadata implements Metadata {
712
918
  }
713
919
  }
714
920
 
921
+ export class Collections implements Collections {
922
+ protected hostname: string
923
+ protected fetch: Fetch
924
+ protected path = '/rpc/Collections/'
925
+
926
+ constructor(hostname: string, fetch: Fetch) {
927
+ this.hostname = hostname
928
+ this.fetch = (input: RequestInfo, init?: RequestInit) => fetch(input, init)
929
+ }
930
+
931
+ private url(name: string): string {
932
+ return this.hostname + this.path + name
933
+ }
934
+
935
+ createCollection = (args: CreateCollectionArgs, headers?: object): Promise<CreateCollectionReturn> => {
936
+ return this.fetch(this.url('CreateCollection'), createHTTPRequest(args, headers)).then(res => {
937
+ return buildResponse(res).then(_data => {
938
+ return {
939
+ collection: <Collection>_data.collection
940
+ }
941
+ })
942
+ })
943
+ }
944
+
945
+ getCollection = (args: GetCollectionArgs, headers?: object): Promise<GetCollectionReturn> => {
946
+ return this.fetch(this.url('GetCollection'), createHTTPRequest(args, headers)).then(res => {
947
+ return buildResponse(res).then(_data => {
948
+ return {
949
+ collection: <Collection>_data.collection
950
+ }
951
+ })
952
+ })
953
+ }
954
+
955
+ listCollections = (args: ListCollectionsArgs, headers?: object): Promise<ListCollectionsReturn> => {
956
+ return this.fetch(this.url('ListCollections'), createHTTPRequest(args, headers)).then(res => {
957
+ return buildResponse(res).then(_data => {
958
+ return {
959
+ page: <Page>_data.page,
960
+ collections: <Array<Collection>>_data.collections
961
+ }
962
+ })
963
+ })
964
+ }
965
+
966
+ updateCollection = (args: UpdateCollectionArgs, headers?: object): Promise<UpdateCollectionReturn> => {
967
+ return this.fetch(this.url('UpdateCollection'), createHTTPRequest(args, headers)).then(res => {
968
+ return buildResponse(res).then(_data => {
969
+ return {
970
+ collection: <Collection>_data.collection
971
+ }
972
+ })
973
+ })
974
+ }
975
+
976
+ deleteCollection = (args: DeleteCollectionArgs, headers?: object): Promise<DeleteCollectionReturn> => {
977
+ return this.fetch(this.url('DeleteCollection'), createHTTPRequest(args, headers)).then(res => {
978
+ return buildResponse(res).then(_data => {
979
+ return {
980
+ status: <boolean>_data.status
981
+ }
982
+ })
983
+ })
984
+ }
985
+
986
+ publishCollection = (args: PublishCollectionArgs, headers?: object): Promise<PublishCollectionReturn> => {
987
+ return this.fetch(this.url('PublishCollection'), createHTTPRequest(args, headers)).then(res => {
988
+ return buildResponse(res).then(_data => {
989
+ return {
990
+ collection: <Collection>_data.collection
991
+ }
992
+ })
993
+ })
994
+ }
995
+
996
+ unpublishCollection = (args: UnpublishCollectionArgs, headers?: object): Promise<UnpublishCollectionReturn> => {
997
+ return this.fetch(this.url('UnpublishCollection'), createHTTPRequest(args, headers)).then(res => {
998
+ return buildResponse(res).then(_data => {
999
+ return {
1000
+ collection: <Collection>_data.collection
1001
+ }
1002
+ })
1003
+ })
1004
+ }
1005
+
1006
+ createToken = (args: CreateTokenArgs, headers?: object): Promise<CreateTokenReturn> => {
1007
+ return this.fetch(this.url('CreateToken'), createHTTPRequest(args, headers)).then(res => {
1008
+ return buildResponse(res).then(_data => {
1009
+ return {
1010
+ token: <TokenMetadata>_data.token,
1011
+ assets: <Array<Asset>>_data.assets
1012
+ }
1013
+ })
1014
+ })
1015
+ }
1016
+
1017
+ getToken = (args: GetTokenArgs, headers?: object): Promise<GetTokenReturn> => {
1018
+ return this.fetch(this.url('GetToken'), createHTTPRequest(args, headers)).then(res => {
1019
+ return buildResponse(res).then(_data => {
1020
+ return {
1021
+ token: <TokenMetadata>_data.token,
1022
+ assets: <Array<Asset>>_data.assets
1023
+ }
1024
+ })
1025
+ })
1026
+ }
1027
+
1028
+ listTokens = (args: ListTokensArgs, headers?: object): Promise<ListTokensReturn> => {
1029
+ return this.fetch(this.url('ListTokens'), createHTTPRequest(args, headers)).then(res => {
1030
+ return buildResponse(res).then(_data => {
1031
+ return {
1032
+ page: <Page>_data.page,
1033
+ tokens: <Array<TokenMetadata>>_data.tokens
1034
+ }
1035
+ })
1036
+ })
1037
+ }
1038
+
1039
+ updateToken = (args: UpdateTokenArgs, headers?: object): Promise<UpdateTokenReturn> => {
1040
+ return this.fetch(this.url('UpdateToken'), createHTTPRequest(args, headers)).then(res => {
1041
+ return buildResponse(res).then(_data => {
1042
+ return {
1043
+ token: <TokenMetadata>_data.token
1044
+ }
1045
+ })
1046
+ })
1047
+ }
1048
+
1049
+ deleteToken = (args: DeleteTokenArgs, headers?: object): Promise<DeleteTokenReturn> => {
1050
+ return this.fetch(this.url('DeleteToken'), createHTTPRequest(args, headers)).then(res => {
1051
+ return buildResponse(res).then(_data => {
1052
+ return {
1053
+ status: <boolean>_data.status
1054
+ }
1055
+ })
1056
+ })
1057
+ }
1058
+
1059
+ createAsset = (args: CreateAssetArgs, headers?: object): Promise<CreateAssetReturn> => {
1060
+ return this.fetch(this.url('CreateAsset'), createHTTPRequest(args, headers)).then(res => {
1061
+ return buildResponse(res).then(_data => {
1062
+ return {
1063
+ asset: <Asset>_data.asset
1064
+ }
1065
+ })
1066
+ })
1067
+ }
1068
+
1069
+ getAsset = (args: GetAssetArgs, headers?: object): Promise<GetAssetReturn> => {
1070
+ return this.fetch(this.url('GetAsset'), createHTTPRequest(args, headers)).then(res => {
1071
+ return buildResponse(res).then(_data => {
1072
+ return {
1073
+ asset: <Asset>_data.asset
1074
+ }
1075
+ })
1076
+ })
1077
+ }
1078
+
1079
+ updateAsset = (args: UpdateAssetArgs, headers?: object): Promise<UpdateAssetReturn> => {
1080
+ return this.fetch(this.url('UpdateAsset'), createHTTPRequest(args, headers)).then(res => {
1081
+ return buildResponse(res).then(_data => {
1082
+ return {
1083
+ asset: <Asset>_data.asset
1084
+ }
1085
+ })
1086
+ })
1087
+ }
1088
+
1089
+ deleteAsset = (args: DeleteAssetArgs, headers?: object): Promise<DeleteAssetReturn> => {
1090
+ return this.fetch(this.url('DeleteAsset'), createHTTPRequest(args, headers)).then(res => {
1091
+ return buildResponse(res).then(_data => {
1092
+ return {
1093
+ status: <boolean>_data.status
1094
+ }
1095
+ })
1096
+ })
1097
+ }
1098
+ }
1099
+
715
1100
  export interface WebRPCError extends Error {
716
1101
  code: string
717
1102
  msg: string