@0xsequence/marketplace 2.2.13 → 2.2.15
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/src/marketplace.gen.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
|
-
// marketplace-api
|
|
2
|
+
// marketplace-api 8c729a93a7f162793cbc496f93aeecae1ab4eeaf
|
|
3
3
|
// --
|
|
4
|
-
// Code generated by webrpc-gen@v0.
|
|
4
|
+
// Code generated by webrpc-gen@v0.24.0 with typescript generator. DO NOT EDIT.
|
|
5
5
|
//
|
|
6
6
|
// webrpc-gen -schema=marketplace.ridl -target=typescript -client -out=./clients/marketplace.gen.ts
|
|
7
7
|
|
|
8
8
|
export const WebrpcHeader = 'Webrpc'
|
|
9
9
|
|
|
10
10
|
export const WebrpcHeaderValue =
|
|
11
|
-
'webrpc@v0.
|
|
11
|
+
'webrpc@v0.24.0;gen-typescript@v0.16.3;marketplace-api@v0.0.0-8c729a93a7f162793cbc496f93aeecae1ab4eeaf'
|
|
12
12
|
|
|
13
13
|
// WebRPC description and code-gen version
|
|
14
14
|
export const WebRPCVersion = 'v1'
|
|
@@ -17,7 +17,7 @@ export const WebRPCVersion = 'v1'
|
|
|
17
17
|
export const WebRPCSchemaVersion = ''
|
|
18
18
|
|
|
19
19
|
// Schema hash generated from your RIDL schema
|
|
20
|
-
export const WebRPCSchemaHash = '
|
|
20
|
+
export const WebRPCSchemaHash = '8c729a93a7f162793cbc496f93aeecae1ab4eeaf'
|
|
21
21
|
|
|
22
22
|
type WebrpcGenVersions = {
|
|
23
23
|
webrpcGenVersion: string
|
|
@@ -54,16 +54,16 @@ function parseWebrpcGenVersions(header: string): WebrpcGenVersions {
|
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
const [_, webrpcGenVersion] = versions[0]
|
|
58
|
-
const [codeGenName, codeGenVersion] = versions[1]
|
|
59
|
-
const [schemaName, schemaVersion] = versions[2]
|
|
57
|
+
const [_, webrpcGenVersion] = versions[0]!.split('@')
|
|
58
|
+
const [codeGenName, codeGenVersion] = versions[1]!.split('@')
|
|
59
|
+
const [schemaName, schemaVersion] = versions[2]!.split('@')
|
|
60
60
|
|
|
61
61
|
return {
|
|
62
|
-
webrpcGenVersion,
|
|
63
|
-
codeGenName,
|
|
64
|
-
codeGenVersion,
|
|
65
|
-
schemaName,
|
|
66
|
-
schemaVersion
|
|
62
|
+
webrpcGenVersion: webrpcGenVersion ?? '',
|
|
63
|
+
codeGenName: codeGenName ?? '',
|
|
64
|
+
codeGenVersion: codeGenVersion ?? '',
|
|
65
|
+
schemaName: schemaName ?? '',
|
|
66
|
+
schemaVersion: schemaVersion ?? ''
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
|
|
@@ -119,24 +119,14 @@ export enum MarketplaceKind {
|
|
|
119
119
|
unknown = 'unknown',
|
|
120
120
|
sequence_marketplace_v1 = 'sequence_marketplace_v1',
|
|
121
121
|
sequence_marketplace_v2 = 'sequence_marketplace_v2',
|
|
122
|
+
blur = 'blur',
|
|
123
|
+
zerox = 'zerox',
|
|
122
124
|
opensea = 'opensea',
|
|
123
|
-
magic_eden = 'magic_eden',
|
|
124
|
-
mintify = 'mintify',
|
|
125
125
|
looks_rare = 'looks_rare',
|
|
126
126
|
x2y2 = 'x2y2',
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
nftx = 'nftx',
|
|
131
|
-
foundation = 'foundation',
|
|
132
|
-
manifold = 'manifold',
|
|
133
|
-
zora = 'zora',
|
|
134
|
-
blur = 'blur',
|
|
135
|
-
super_rare = 'super_rare',
|
|
136
|
-
okx = 'okx',
|
|
137
|
-
element = 'element',
|
|
138
|
-
aqua_xyz = 'aqua_xyz',
|
|
139
|
-
auranft_co = 'auranft_co'
|
|
127
|
+
alienswap = 'alienswap',
|
|
128
|
+
payment_processor = 'payment_processor',
|
|
129
|
+
mintify = 'mintify'
|
|
140
130
|
}
|
|
141
131
|
|
|
142
132
|
export enum OrderbookKind {
|
|
@@ -169,7 +159,8 @@ export enum OrderStatus {
|
|
|
169
159
|
inactive = 'inactive',
|
|
170
160
|
expired = 'expired',
|
|
171
161
|
cancelled = 'cancelled',
|
|
172
|
-
filled = 'filled'
|
|
162
|
+
filled = 'filled',
|
|
163
|
+
decimals_missing = 'decimals_missing'
|
|
173
164
|
}
|
|
174
165
|
|
|
175
166
|
export enum ContractType {
|
|
@@ -179,9 +170,18 @@ export enum ContractType {
|
|
|
179
170
|
ERC1155 = 'ERC1155'
|
|
180
171
|
}
|
|
181
172
|
|
|
173
|
+
export enum CollectionPriority {
|
|
174
|
+
unknown = 'unknown',
|
|
175
|
+
low = 'low',
|
|
176
|
+
normal = 'normal',
|
|
177
|
+
high = 'high'
|
|
178
|
+
}
|
|
179
|
+
|
|
182
180
|
export enum CollectionStatus {
|
|
183
181
|
unknown = 'unknown',
|
|
184
182
|
created = 'created',
|
|
183
|
+
syncing_contract_metadata = 'syncing_contract_metadata',
|
|
184
|
+
synced_contract_metadata = 'synced_contract_metadata',
|
|
185
185
|
syncing_metadata = 'syncing_metadata',
|
|
186
186
|
synced_metadata = 'synced_metadata',
|
|
187
187
|
syncing_tokens = 'syncing_tokens',
|
|
@@ -189,7 +189,8 @@ export enum CollectionStatus {
|
|
|
189
189
|
syncing_orders = 'syncing_orders',
|
|
190
190
|
active = 'active',
|
|
191
191
|
failed = 'failed',
|
|
192
|
-
inactive = 'inactive'
|
|
192
|
+
inactive = 'inactive',
|
|
193
|
+
incompatible_type = 'incompatible_type'
|
|
193
194
|
}
|
|
194
195
|
|
|
195
196
|
export enum ProjectStatus {
|
|
@@ -204,6 +205,14 @@ export enum CollectibleStatus {
|
|
|
204
205
|
inactive = 'inactive'
|
|
205
206
|
}
|
|
206
207
|
|
|
208
|
+
export enum CurrencyStatus {
|
|
209
|
+
unknown = 'unknown',
|
|
210
|
+
created = 'created',
|
|
211
|
+
syncing_metadata = 'syncing_metadata',
|
|
212
|
+
active = 'active',
|
|
213
|
+
failed = 'failed'
|
|
214
|
+
}
|
|
215
|
+
|
|
207
216
|
export enum WalletKind {
|
|
208
217
|
unknown = 'unknown',
|
|
209
218
|
sequence = 'sequence'
|
|
@@ -217,7 +226,8 @@ export enum StepType {
|
|
|
217
226
|
createListing = 'createListing',
|
|
218
227
|
createOffer = 'createOffer',
|
|
219
228
|
signEIP712 = 'signEIP712',
|
|
220
|
-
signEIP191 = 'signEIP191'
|
|
229
|
+
signEIP191 = 'signEIP191',
|
|
230
|
+
cancel = 'cancel'
|
|
221
231
|
}
|
|
222
232
|
|
|
223
233
|
export enum TransactionCrypto {
|
|
@@ -248,6 +258,17 @@ export enum ExecuteType {
|
|
|
248
258
|
order = 'order'
|
|
249
259
|
}
|
|
250
260
|
|
|
261
|
+
export enum ActivityAction {
|
|
262
|
+
unknown = 'unknown',
|
|
263
|
+
listing = 'listing',
|
|
264
|
+
offer = 'offer',
|
|
265
|
+
mint = 'mint',
|
|
266
|
+
sale = 'sale',
|
|
267
|
+
listingCancel = 'listingCancel',
|
|
268
|
+
offerCancel = 'offerCancel',
|
|
269
|
+
transfer = 'transfer'
|
|
270
|
+
}
|
|
271
|
+
|
|
251
272
|
export interface Page {
|
|
252
273
|
page: number
|
|
253
274
|
pageSize: number
|
|
@@ -282,6 +303,8 @@ export interface CollectiblesFilter {
|
|
|
282
303
|
notInAccounts?: Array<string>
|
|
283
304
|
ordersCreatedBy?: Array<string>
|
|
284
305
|
ordersNotCreatedBy?: Array<string>
|
|
306
|
+
inCurrencyAddresses?: Array<string>
|
|
307
|
+
notInCurrencyAddresses?: Array<string>
|
|
285
308
|
}
|
|
286
309
|
|
|
287
310
|
export interface Order {
|
|
@@ -290,8 +313,9 @@ export interface Order {
|
|
|
290
313
|
side: OrderSide
|
|
291
314
|
status: OrderStatus
|
|
292
315
|
chainId: number
|
|
316
|
+
originName: string
|
|
293
317
|
collectionContractAddress: string
|
|
294
|
-
tokenId
|
|
318
|
+
tokenId?: string
|
|
295
319
|
createdBy: string
|
|
296
320
|
priceAmount: string
|
|
297
321
|
priceAmountFormatted: string
|
|
@@ -300,6 +324,7 @@ export interface Order {
|
|
|
300
324
|
priceCurrencyAddress: string
|
|
301
325
|
priceDecimals: number
|
|
302
326
|
priceUSD: number
|
|
327
|
+
priceUSDFormatted: string
|
|
303
328
|
quantityInitial: string
|
|
304
329
|
quantityInitialFormatted: string
|
|
305
330
|
quantityRemaining: string
|
|
@@ -328,6 +353,8 @@ export interface FeeBreakdown {
|
|
|
328
353
|
export interface CollectibleOrder {
|
|
329
354
|
metadata: TokenMetadata
|
|
330
355
|
order?: Order
|
|
356
|
+
listing?: Order
|
|
357
|
+
offer?: Order
|
|
331
358
|
}
|
|
332
359
|
|
|
333
360
|
export interface OrderFilter {
|
|
@@ -336,23 +363,12 @@ export interface OrderFilter {
|
|
|
336
363
|
currencies?: Array<string>
|
|
337
364
|
}
|
|
338
365
|
|
|
339
|
-
export interface Activity {
|
|
340
|
-
type: string
|
|
341
|
-
fromAddress: string
|
|
342
|
-
toAddress: string
|
|
343
|
-
txHash: string
|
|
344
|
-
timestamp: number
|
|
345
|
-
tokenId: string
|
|
346
|
-
tokenImage: string
|
|
347
|
-
tokenName: string
|
|
348
|
-
currency?: Currency
|
|
349
|
-
}
|
|
350
|
-
|
|
351
366
|
export interface Collection {
|
|
352
367
|
status: CollectionStatus
|
|
353
368
|
chainId: number
|
|
354
369
|
contractAddress: string
|
|
355
370
|
contractType: ContractType
|
|
371
|
+
priority: CollectionPriority
|
|
356
372
|
tokenQuantityDecimals: number
|
|
357
373
|
config: CollectionConfig
|
|
358
374
|
createdAt: string
|
|
@@ -363,6 +379,8 @@ export interface Collection {
|
|
|
363
379
|
export interface CollectionConfig {
|
|
364
380
|
lastSynced: { [key: string]: CollectionLastSynced }
|
|
365
381
|
collectiblesSynced: string
|
|
382
|
+
activitiesSynced: string
|
|
383
|
+
activitiesSyncedContinuity: string
|
|
366
384
|
}
|
|
367
385
|
|
|
368
386
|
export interface CollectionLastSynced {
|
|
@@ -385,6 +403,7 @@ export interface Collectible {
|
|
|
385
403
|
contractAddress: string
|
|
386
404
|
status: CollectibleStatus
|
|
387
405
|
tokenId: string
|
|
406
|
+
decimals: number
|
|
388
407
|
createdAt: string
|
|
389
408
|
updatedAt: string
|
|
390
409
|
deletedAt?: string
|
|
@@ -393,6 +412,7 @@ export interface Collectible {
|
|
|
393
412
|
export interface Currency {
|
|
394
413
|
chainId: number
|
|
395
414
|
contractAddress: string
|
|
415
|
+
status: CurrencyStatus
|
|
396
416
|
name: string
|
|
397
417
|
symbol: string
|
|
398
418
|
decimals: number
|
|
@@ -420,6 +440,7 @@ export interface Step {
|
|
|
420
440
|
data: string
|
|
421
441
|
to: string
|
|
422
442
|
value: string
|
|
443
|
+
price: string
|
|
423
444
|
signature?: Signature
|
|
424
445
|
post?: PostRequest
|
|
425
446
|
executeType?: ExecuteType
|
|
@@ -477,9 +498,31 @@ export interface CheckoutOptions {
|
|
|
477
498
|
onRamp: Array<TransactionOnRampProvider>
|
|
478
499
|
}
|
|
479
500
|
|
|
501
|
+
export interface Activity {
|
|
502
|
+
chainId: number
|
|
503
|
+
contractAddress: string
|
|
504
|
+
tokenId: string
|
|
505
|
+
action: ActivityAction
|
|
506
|
+
txHash: string
|
|
507
|
+
from: string
|
|
508
|
+
to?: string
|
|
509
|
+
quantity: string
|
|
510
|
+
quantityDecimals: number
|
|
511
|
+
priceAmount?: string
|
|
512
|
+
priceAmountFormatted?: string
|
|
513
|
+
priceCurrencyAddress?: string
|
|
514
|
+
priceDecimals?: number
|
|
515
|
+
activityCreatedAt: string
|
|
516
|
+
uniqueHash: string
|
|
517
|
+
createdAt: string
|
|
518
|
+
updatedAt: string
|
|
519
|
+
deletedAt?: string
|
|
520
|
+
}
|
|
521
|
+
|
|
480
522
|
export interface Admin {
|
|
481
523
|
createCollection(args: CreateCollectionArgs, headers?: object, signal?: AbortSignal): Promise<CreateCollectionReturn>
|
|
482
524
|
getCollection(args: GetCollectionArgs, headers?: object, signal?: AbortSignal): Promise<GetCollectionReturn>
|
|
525
|
+
updateCollection(args: UpdateCollectionArgs, headers?: object, signal?: AbortSignal): Promise<UpdateCollectionReturn>
|
|
483
526
|
listCollections(args: ListCollectionsArgs, headers?: object, signal?: AbortSignal): Promise<ListCollectionsReturn>
|
|
484
527
|
deleteCollection(args: DeleteCollectionArgs, headers?: object, signal?: AbortSignal): Promise<DeleteCollectionReturn>
|
|
485
528
|
syncCollection(args: SyncCollectionArgs, headers?: object, signal?: AbortSignal): Promise<SyncCollectionReturn>
|
|
@@ -506,6 +549,13 @@ export interface GetCollectionArgs {
|
|
|
506
549
|
export interface GetCollectionReturn {
|
|
507
550
|
collection: Collection
|
|
508
551
|
}
|
|
552
|
+
export interface UpdateCollectionArgs {
|
|
553
|
+
collection: Collection
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
export interface UpdateCollectionReturn {
|
|
557
|
+
collection: Collection
|
|
558
|
+
}
|
|
509
559
|
export interface ListCollectionsArgs {
|
|
510
560
|
projectId: number
|
|
511
561
|
page?: Page
|
|
@@ -568,6 +618,7 @@ export interface DeleteCurrencyReturn {
|
|
|
568
618
|
|
|
569
619
|
export interface Marketplace {
|
|
570
620
|
listCurrencies(headers?: object, signal?: AbortSignal): Promise<ListCurrenciesReturn>
|
|
621
|
+
getCollectionDetail(args: GetCollectionDetailArgs, headers?: object, signal?: AbortSignal): Promise<GetCollectionDetailReturn>
|
|
571
622
|
getCollectible(args: GetCollectibleArgs, headers?: object, signal?: AbortSignal): Promise<GetCollectibleReturn>
|
|
572
623
|
getLowestPriceOfferForCollectible(
|
|
573
624
|
args: GetLowestPriceOfferForCollectibleArgs,
|
|
@@ -599,6 +650,16 @@ export interface Marketplace {
|
|
|
599
650
|
headers?: object,
|
|
600
651
|
signal?: AbortSignal
|
|
601
652
|
): Promise<ListOffersForCollectibleReturn>
|
|
653
|
+
getCountOfListingsForCollectible(
|
|
654
|
+
args: GetCountOfListingsForCollectibleArgs,
|
|
655
|
+
headers?: object,
|
|
656
|
+
signal?: AbortSignal
|
|
657
|
+
): Promise<GetCountOfListingsForCollectibleReturn>
|
|
658
|
+
getCountOfOffersForCollectible(
|
|
659
|
+
args: GetCountOfOffersForCollectibleArgs,
|
|
660
|
+
headers?: object,
|
|
661
|
+
signal?: AbortSignal
|
|
662
|
+
): Promise<GetCountOfOffersForCollectibleReturn>
|
|
602
663
|
getCollectibleLowestOffer(
|
|
603
664
|
args: GetCollectibleLowestOfferArgs,
|
|
604
665
|
headers?: object,
|
|
@@ -649,6 +710,11 @@ export interface Marketplace {
|
|
|
649
710
|
headers?: object,
|
|
650
711
|
signal?: AbortSignal
|
|
651
712
|
): Promise<GenerateOfferTransactionReturn>
|
|
713
|
+
generateCancelTransaction(
|
|
714
|
+
args: GenerateCancelTransactionArgs,
|
|
715
|
+
headers?: object,
|
|
716
|
+
signal?: AbortSignal
|
|
717
|
+
): Promise<GenerateCancelTransactionReturn>
|
|
652
718
|
execute(args: ExecuteArgs, headers?: object, signal?: AbortSignal): Promise<ExecuteReturn>
|
|
653
719
|
listCollectibles(args: ListCollectiblesArgs, headers?: object, signal?: AbortSignal): Promise<ListCollectiblesReturn>
|
|
654
720
|
getCountOfAllCollectibles(
|
|
@@ -662,6 +728,16 @@ export interface Marketplace {
|
|
|
662
728
|
signal?: AbortSignal
|
|
663
729
|
): Promise<GetCountOfFilteredCollectiblesReturn>
|
|
664
730
|
getFloorOrder(args: GetFloorOrderArgs, headers?: object, signal?: AbortSignal): Promise<GetFloorOrderReturn>
|
|
731
|
+
listCollectionActivities(
|
|
732
|
+
args: ListCollectionActivitiesArgs,
|
|
733
|
+
headers?: object,
|
|
734
|
+
signal?: AbortSignal
|
|
735
|
+
): Promise<ListCollectionActivitiesReturn>
|
|
736
|
+
listCollectibleActivities(
|
|
737
|
+
args: ListCollectibleActivitiesArgs,
|
|
738
|
+
headers?: object,
|
|
739
|
+
signal?: AbortSignal
|
|
740
|
+
): Promise<ListCollectibleActivitiesReturn>
|
|
665
741
|
listCollectiblesWithLowestListing(
|
|
666
742
|
args: ListCollectiblesWithLowestListingArgs,
|
|
667
743
|
headers?: object,
|
|
@@ -692,6 +768,13 @@ export interface ListCurrenciesArgs {}
|
|
|
692
768
|
export interface ListCurrenciesReturn {
|
|
693
769
|
currencies: Array<Currency>
|
|
694
770
|
}
|
|
771
|
+
export interface GetCollectionDetailArgs {
|
|
772
|
+
contractAddress: string
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
export interface GetCollectionDetailReturn {
|
|
776
|
+
collection: Collection
|
|
777
|
+
}
|
|
695
778
|
export interface GetCollectibleArgs {
|
|
696
779
|
contractAddress: string
|
|
697
780
|
tokenId: string
|
|
@@ -758,6 +841,24 @@ export interface ListOffersForCollectibleReturn {
|
|
|
758
841
|
offers: Array<Order>
|
|
759
842
|
page?: Page
|
|
760
843
|
}
|
|
844
|
+
export interface GetCountOfListingsForCollectibleArgs {
|
|
845
|
+
contractAddress: string
|
|
846
|
+
tokenId: string
|
|
847
|
+
filter?: OrderFilter
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
export interface GetCountOfListingsForCollectibleReturn {
|
|
851
|
+
count: number
|
|
852
|
+
}
|
|
853
|
+
export interface GetCountOfOffersForCollectibleArgs {
|
|
854
|
+
contractAddress: string
|
|
855
|
+
tokenId: string
|
|
856
|
+
filter?: OrderFilter
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
export interface GetCountOfOffersForCollectibleReturn {
|
|
860
|
+
count: number
|
|
861
|
+
}
|
|
761
862
|
export interface GetCollectibleLowestOfferArgs {
|
|
762
863
|
contractAddress: string
|
|
763
864
|
tokenId: string
|
|
@@ -864,6 +965,16 @@ export interface GenerateOfferTransactionArgs {
|
|
|
864
965
|
export interface GenerateOfferTransactionReturn {
|
|
865
966
|
steps: Array<Step>
|
|
866
967
|
}
|
|
968
|
+
export interface GenerateCancelTransactionArgs {
|
|
969
|
+
collectionAddress: string
|
|
970
|
+
maker: string
|
|
971
|
+
marketplace: MarketplaceKind
|
|
972
|
+
orderId: string
|
|
973
|
+
}
|
|
974
|
+
|
|
975
|
+
export interface GenerateCancelTransactionReturn {
|
|
976
|
+
steps: Array<Step>
|
|
977
|
+
}
|
|
867
978
|
export interface ExecuteArgs {
|
|
868
979
|
signature: string
|
|
869
980
|
executeType: ExecuteType
|
|
@@ -908,6 +1019,25 @@ export interface GetFloorOrderArgs {
|
|
|
908
1019
|
export interface GetFloorOrderReturn {
|
|
909
1020
|
collectible: CollectibleOrder
|
|
910
1021
|
}
|
|
1022
|
+
export interface ListCollectionActivitiesArgs {
|
|
1023
|
+
contractAddress: string
|
|
1024
|
+
page?: Page
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
export interface ListCollectionActivitiesReturn {
|
|
1028
|
+
activities: Array<Activity>
|
|
1029
|
+
page?: Page
|
|
1030
|
+
}
|
|
1031
|
+
export interface ListCollectibleActivitiesArgs {
|
|
1032
|
+
contractAddress: string
|
|
1033
|
+
tokenId: string
|
|
1034
|
+
page?: Page
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
export interface ListCollectibleActivitiesReturn {
|
|
1038
|
+
activities: Array<Activity>
|
|
1039
|
+
page?: Page
|
|
1040
|
+
}
|
|
911
1041
|
export interface ListCollectiblesWithLowestListingArgs {
|
|
912
1042
|
contractAddress: string
|
|
913
1043
|
filter?: CollectiblesFilter
|
|
@@ -1014,6 +1144,21 @@ export class Admin implements Admin {
|
|
|
1014
1144
|
)
|
|
1015
1145
|
}
|
|
1016
1146
|
|
|
1147
|
+
updateCollection = (args: UpdateCollectionArgs, headers?: object, signal?: AbortSignal): Promise<UpdateCollectionReturn> => {
|
|
1148
|
+
return this.fetch(this.url('UpdateCollection'), createHTTPRequest(args, headers, signal)).then(
|
|
1149
|
+
res => {
|
|
1150
|
+
return buildResponse(res).then(_data => {
|
|
1151
|
+
return {
|
|
1152
|
+
collection: <Collection>_data.collection
|
|
1153
|
+
}
|
|
1154
|
+
})
|
|
1155
|
+
},
|
|
1156
|
+
error => {
|
|
1157
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
|
1158
|
+
}
|
|
1159
|
+
)
|
|
1160
|
+
}
|
|
1161
|
+
|
|
1017
1162
|
listCollections = (args: ListCollectionsArgs, headers?: object, signal?: AbortSignal): Promise<ListCollectionsReturn> => {
|
|
1018
1163
|
return this.fetch(this.url('ListCollections'), createHTTPRequest(args, headers, signal)).then(
|
|
1019
1164
|
res => {
|
|
@@ -1164,6 +1309,25 @@ export class Marketplace implements Marketplace {
|
|
|
1164
1309
|
)
|
|
1165
1310
|
}
|
|
1166
1311
|
|
|
1312
|
+
getCollectionDetail = (
|
|
1313
|
+
args: GetCollectionDetailArgs,
|
|
1314
|
+
headers?: object,
|
|
1315
|
+
signal?: AbortSignal
|
|
1316
|
+
): Promise<GetCollectionDetailReturn> => {
|
|
1317
|
+
return this.fetch(this.url('GetCollectionDetail'), createHTTPRequest(args, headers, signal)).then(
|
|
1318
|
+
res => {
|
|
1319
|
+
return buildResponse(res).then(_data => {
|
|
1320
|
+
return {
|
|
1321
|
+
collection: <Collection>_data.collection
|
|
1322
|
+
}
|
|
1323
|
+
})
|
|
1324
|
+
},
|
|
1325
|
+
error => {
|
|
1326
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
|
1327
|
+
}
|
|
1328
|
+
)
|
|
1329
|
+
}
|
|
1330
|
+
|
|
1167
1331
|
getCollectible = (args: GetCollectibleArgs, headers?: object, signal?: AbortSignal): Promise<GetCollectibleReturn> => {
|
|
1168
1332
|
return this.fetch(this.url('GetCollectible'), createHTTPRequest(args, headers, signal)).then(
|
|
1169
1333
|
res => {
|
|
@@ -1295,6 +1459,44 @@ export class Marketplace implements Marketplace {
|
|
|
1295
1459
|
)
|
|
1296
1460
|
}
|
|
1297
1461
|
|
|
1462
|
+
getCountOfListingsForCollectible = (
|
|
1463
|
+
args: GetCountOfListingsForCollectibleArgs,
|
|
1464
|
+
headers?: object,
|
|
1465
|
+
signal?: AbortSignal
|
|
1466
|
+
): Promise<GetCountOfListingsForCollectibleReturn> => {
|
|
1467
|
+
return this.fetch(this.url('GetCountOfListingsForCollectible'), createHTTPRequest(args, headers, signal)).then(
|
|
1468
|
+
res => {
|
|
1469
|
+
return buildResponse(res).then(_data => {
|
|
1470
|
+
return {
|
|
1471
|
+
count: <number>_data.count
|
|
1472
|
+
}
|
|
1473
|
+
})
|
|
1474
|
+
},
|
|
1475
|
+
error => {
|
|
1476
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
|
1477
|
+
}
|
|
1478
|
+
)
|
|
1479
|
+
}
|
|
1480
|
+
|
|
1481
|
+
getCountOfOffersForCollectible = (
|
|
1482
|
+
args: GetCountOfOffersForCollectibleArgs,
|
|
1483
|
+
headers?: object,
|
|
1484
|
+
signal?: AbortSignal
|
|
1485
|
+
): Promise<GetCountOfOffersForCollectibleReturn> => {
|
|
1486
|
+
return this.fetch(this.url('GetCountOfOffersForCollectible'), createHTTPRequest(args, headers, signal)).then(
|
|
1487
|
+
res => {
|
|
1488
|
+
return buildResponse(res).then(_data => {
|
|
1489
|
+
return {
|
|
1490
|
+
count: <number>_data.count
|
|
1491
|
+
}
|
|
1492
|
+
})
|
|
1493
|
+
},
|
|
1494
|
+
error => {
|
|
1495
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
|
1496
|
+
}
|
|
1497
|
+
)
|
|
1498
|
+
}
|
|
1499
|
+
|
|
1298
1500
|
getCollectibleLowestOffer = (
|
|
1299
1501
|
args: GetCollectibleLowestOfferArgs,
|
|
1300
1502
|
headers?: object,
|
|
@@ -1487,6 +1689,25 @@ export class Marketplace implements Marketplace {
|
|
|
1487
1689
|
)
|
|
1488
1690
|
}
|
|
1489
1691
|
|
|
1692
|
+
generateCancelTransaction = (
|
|
1693
|
+
args: GenerateCancelTransactionArgs,
|
|
1694
|
+
headers?: object,
|
|
1695
|
+
signal?: AbortSignal
|
|
1696
|
+
): Promise<GenerateCancelTransactionReturn> => {
|
|
1697
|
+
return this.fetch(this.url('GenerateCancelTransaction'), createHTTPRequest(args, headers, signal)).then(
|
|
1698
|
+
res => {
|
|
1699
|
+
return buildResponse(res).then(_data => {
|
|
1700
|
+
return {
|
|
1701
|
+
steps: <Array<Step>>_data.steps
|
|
1702
|
+
}
|
|
1703
|
+
})
|
|
1704
|
+
},
|
|
1705
|
+
error => {
|
|
1706
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
|
1707
|
+
}
|
|
1708
|
+
)
|
|
1709
|
+
}
|
|
1710
|
+
|
|
1490
1711
|
execute = (args: ExecuteArgs, headers?: object, signal?: AbortSignal): Promise<ExecuteReturn> => {
|
|
1491
1712
|
return this.fetch(this.url('Execute'), createHTTPRequest(args, headers, signal)).then(
|
|
1492
1713
|
res => {
|
|
@@ -1571,6 +1792,46 @@ export class Marketplace implements Marketplace {
|
|
|
1571
1792
|
)
|
|
1572
1793
|
}
|
|
1573
1794
|
|
|
1795
|
+
listCollectionActivities = (
|
|
1796
|
+
args: ListCollectionActivitiesArgs,
|
|
1797
|
+
headers?: object,
|
|
1798
|
+
signal?: AbortSignal
|
|
1799
|
+
): Promise<ListCollectionActivitiesReturn> => {
|
|
1800
|
+
return this.fetch(this.url('ListCollectionActivities'), createHTTPRequest(args, headers, signal)).then(
|
|
1801
|
+
res => {
|
|
1802
|
+
return buildResponse(res).then(_data => {
|
|
1803
|
+
return {
|
|
1804
|
+
activities: <Array<Activity>>_data.activities,
|
|
1805
|
+
page: <Page>_data.page
|
|
1806
|
+
}
|
|
1807
|
+
})
|
|
1808
|
+
},
|
|
1809
|
+
error => {
|
|
1810
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
|
1811
|
+
}
|
|
1812
|
+
)
|
|
1813
|
+
}
|
|
1814
|
+
|
|
1815
|
+
listCollectibleActivities = (
|
|
1816
|
+
args: ListCollectibleActivitiesArgs,
|
|
1817
|
+
headers?: object,
|
|
1818
|
+
signal?: AbortSignal
|
|
1819
|
+
): Promise<ListCollectibleActivitiesReturn> => {
|
|
1820
|
+
return this.fetch(this.url('ListCollectibleActivities'), createHTTPRequest(args, headers, signal)).then(
|
|
1821
|
+
res => {
|
|
1822
|
+
return buildResponse(res).then(_data => {
|
|
1823
|
+
return {
|
|
1824
|
+
activities: <Array<Activity>>_data.activities,
|
|
1825
|
+
page: <Page>_data.page
|
|
1826
|
+
}
|
|
1827
|
+
})
|
|
1828
|
+
},
|
|
1829
|
+
error => {
|
|
1830
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
|
|
1831
|
+
}
|
|
1832
|
+
)
|
|
1833
|
+
}
|
|
1834
|
+
|
|
1574
1835
|
listCollectiblesWithLowestListing = (
|
|
1575
1836
|
args: ListCollectiblesWithLowestListingArgs,
|
|
1576
1837
|
headers?: object,
|
|
@@ -1763,7 +2024,7 @@ export class WebrpcEndpointError extends WebrpcError {
|
|
|
1763
2024
|
constructor(
|
|
1764
2025
|
name: string = 'WebrpcEndpoint',
|
|
1765
2026
|
code: number = 0,
|
|
1766
|
-
message: string =
|
|
2027
|
+
message: string = `endpoint error`,
|
|
1767
2028
|
status: number = 0,
|
|
1768
2029
|
cause?: string
|
|
1769
2030
|
) {
|
|
@@ -1776,7 +2037,7 @@ export class WebrpcRequestFailedError extends WebrpcError {
|
|
|
1776
2037
|
constructor(
|
|
1777
2038
|
name: string = 'WebrpcRequestFailed',
|
|
1778
2039
|
code: number = -1,
|
|
1779
|
-
message: string =
|
|
2040
|
+
message: string = `request failed`,
|
|
1780
2041
|
status: number = 0,
|
|
1781
2042
|
cause?: string
|
|
1782
2043
|
) {
|
|
@@ -1789,7 +2050,7 @@ export class WebrpcBadRouteError extends WebrpcError {
|
|
|
1789
2050
|
constructor(
|
|
1790
2051
|
name: string = 'WebrpcBadRoute',
|
|
1791
2052
|
code: number = -2,
|
|
1792
|
-
message: string =
|
|
2053
|
+
message: string = `bad route`,
|
|
1793
2054
|
status: number = 0,
|
|
1794
2055
|
cause?: string
|
|
1795
2056
|
) {
|
|
@@ -1802,7 +2063,7 @@ export class WebrpcBadMethodError extends WebrpcError {
|
|
|
1802
2063
|
constructor(
|
|
1803
2064
|
name: string = 'WebrpcBadMethod',
|
|
1804
2065
|
code: number = -3,
|
|
1805
|
-
message: string =
|
|
2066
|
+
message: string = `bad method`,
|
|
1806
2067
|
status: number = 0,
|
|
1807
2068
|
cause?: string
|
|
1808
2069
|
) {
|
|
@@ -1815,7 +2076,7 @@ export class WebrpcBadRequestError extends WebrpcError {
|
|
|
1815
2076
|
constructor(
|
|
1816
2077
|
name: string = 'WebrpcBadRequest',
|
|
1817
2078
|
code: number = -4,
|
|
1818
|
-
message: string =
|
|
2079
|
+
message: string = `bad request`,
|
|
1819
2080
|
status: number = 0,
|
|
1820
2081
|
cause?: string
|
|
1821
2082
|
) {
|
|
@@ -1828,7 +2089,7 @@ export class WebrpcBadResponseError extends WebrpcError {
|
|
|
1828
2089
|
constructor(
|
|
1829
2090
|
name: string = 'WebrpcBadResponse',
|
|
1830
2091
|
code: number = -5,
|
|
1831
|
-
message: string =
|
|
2092
|
+
message: string = `bad response`,
|
|
1832
2093
|
status: number = 0,
|
|
1833
2094
|
cause?: string
|
|
1834
2095
|
) {
|
|
@@ -1841,7 +2102,7 @@ export class WebrpcServerPanicError extends WebrpcError {
|
|
|
1841
2102
|
constructor(
|
|
1842
2103
|
name: string = 'WebrpcServerPanic',
|
|
1843
2104
|
code: number = -6,
|
|
1844
|
-
message: string =
|
|
2105
|
+
message: string = `server panic`,
|
|
1845
2106
|
status: number = 0,
|
|
1846
2107
|
cause?: string
|
|
1847
2108
|
) {
|
|
@@ -1854,7 +2115,7 @@ export class WebrpcInternalErrorError extends WebrpcError {
|
|
|
1854
2115
|
constructor(
|
|
1855
2116
|
name: string = 'WebrpcInternalError',
|
|
1856
2117
|
code: number = -7,
|
|
1857
|
-
message: string =
|
|
2118
|
+
message: string = `internal error`,
|
|
1858
2119
|
status: number = 0,
|
|
1859
2120
|
cause?: string
|
|
1860
2121
|
) {
|
|
@@ -1867,7 +2128,7 @@ export class WebrpcClientDisconnectedError extends WebrpcError {
|
|
|
1867
2128
|
constructor(
|
|
1868
2129
|
name: string = 'WebrpcClientDisconnected',
|
|
1869
2130
|
code: number = -8,
|
|
1870
|
-
message: string =
|
|
2131
|
+
message: string = `client disconnected`,
|
|
1871
2132
|
status: number = 0,
|
|
1872
2133
|
cause?: string
|
|
1873
2134
|
) {
|
|
@@ -1880,7 +2141,7 @@ export class WebrpcStreamLostError extends WebrpcError {
|
|
|
1880
2141
|
constructor(
|
|
1881
2142
|
name: string = 'WebrpcStreamLost',
|
|
1882
2143
|
code: number = -9,
|
|
1883
|
-
message: string =
|
|
2144
|
+
message: string = `stream lost`,
|
|
1884
2145
|
status: number = 0,
|
|
1885
2146
|
cause?: string
|
|
1886
2147
|
) {
|
|
@@ -1893,7 +2154,7 @@ export class WebrpcStreamFinishedError extends WebrpcError {
|
|
|
1893
2154
|
constructor(
|
|
1894
2155
|
name: string = 'WebrpcStreamFinished',
|
|
1895
2156
|
code: number = -10,
|
|
1896
|
-
message: string =
|
|
2157
|
+
message: string = `stream finished`,
|
|
1897
2158
|
status: number = 0,
|
|
1898
2159
|
cause?: string
|
|
1899
2160
|
) {
|
|
@@ -1908,7 +2169,7 @@ export class UnauthorizedError extends WebrpcError {
|
|
|
1908
2169
|
constructor(
|
|
1909
2170
|
name: string = 'Unauthorized',
|
|
1910
2171
|
code: number = 1000,
|
|
1911
|
-
message: string =
|
|
2172
|
+
message: string = `Unauthorized access`,
|
|
1912
2173
|
status: number = 0,
|
|
1913
2174
|
cause?: string
|
|
1914
2175
|
) {
|
|
@@ -1921,7 +2182,7 @@ export class PermissionDeniedError extends WebrpcError {
|
|
|
1921
2182
|
constructor(
|
|
1922
2183
|
name: string = 'PermissionDenied',
|
|
1923
2184
|
code: number = 1001,
|
|
1924
|
-
message: string =
|
|
2185
|
+
message: string = `Permission denied`,
|
|
1925
2186
|
status: number = 0,
|
|
1926
2187
|
cause?: string
|
|
1927
2188
|
) {
|
|
@@ -1934,7 +2195,7 @@ export class SessionExpiredError extends WebrpcError {
|
|
|
1934
2195
|
constructor(
|
|
1935
2196
|
name: string = 'SessionExpired',
|
|
1936
2197
|
code: number = 1002,
|
|
1937
|
-
message: string =
|
|
2198
|
+
message: string = `Session expired`,
|
|
1938
2199
|
status: number = 0,
|
|
1939
2200
|
cause?: string
|
|
1940
2201
|
) {
|
|
@@ -1947,7 +2208,7 @@ export class MethodNotFoundError extends WebrpcError {
|
|
|
1947
2208
|
constructor(
|
|
1948
2209
|
name: string = 'MethodNotFound',
|
|
1949
2210
|
code: number = 1003,
|
|
1950
|
-
message: string =
|
|
2211
|
+
message: string = `Method not found`,
|
|
1951
2212
|
status: number = 0,
|
|
1952
2213
|
cause?: string
|
|
1953
2214
|
) {
|
|
@@ -1960,7 +2221,7 @@ export class TimeoutError extends WebrpcError {
|
|
|
1960
2221
|
constructor(
|
|
1961
2222
|
name: string = 'Timeout',
|
|
1962
2223
|
code: number = 2000,
|
|
1963
|
-
message: string =
|
|
2224
|
+
message: string = `Request timed out`,
|
|
1964
2225
|
status: number = 0,
|
|
1965
2226
|
cause?: string
|
|
1966
2227
|
) {
|
|
@@ -1973,7 +2234,7 @@ export class InvalidArgumentError extends WebrpcError {
|
|
|
1973
2234
|
constructor(
|
|
1974
2235
|
name: string = 'InvalidArgument',
|
|
1975
2236
|
code: number = 2001,
|
|
1976
|
-
message: string =
|
|
2237
|
+
message: string = `Invalid argument`,
|
|
1977
2238
|
status: number = 0,
|
|
1978
2239
|
cause?: string
|
|
1979
2240
|
) {
|
|
@@ -1986,7 +2247,7 @@ export class NotFoundError extends WebrpcError {
|
|
|
1986
2247
|
constructor(
|
|
1987
2248
|
name: string = 'NotFound',
|
|
1988
2249
|
code: number = 3000,
|
|
1989
|
-
message: string =
|
|
2250
|
+
message: string = `Resource not found`,
|
|
1990
2251
|
status: number = 0,
|
|
1991
2252
|
cause?: string
|
|
1992
2253
|
) {
|
|
@@ -1999,7 +2260,7 @@ export class UserNotFoundError extends WebrpcError {
|
|
|
1999
2260
|
constructor(
|
|
2000
2261
|
name: string = 'UserNotFound',
|
|
2001
2262
|
code: number = 3001,
|
|
2002
|
-
message: string =
|
|
2263
|
+
message: string = `User not found`,
|
|
2003
2264
|
status: number = 0,
|
|
2004
2265
|
cause?: string
|
|
2005
2266
|
) {
|
|
@@ -2012,7 +2273,7 @@ export class ProjectNotFoundError extends WebrpcError {
|
|
|
2012
2273
|
constructor(
|
|
2013
2274
|
name: string = 'ProjectNotFound',
|
|
2014
2275
|
code: number = 3002,
|
|
2015
|
-
message: string =
|
|
2276
|
+
message: string = `Project not found`,
|
|
2016
2277
|
status: number = 0,
|
|
2017
2278
|
cause?: string
|
|
2018
2279
|
) {
|
|
@@ -2025,7 +2286,7 @@ export class InvalidTierError extends WebrpcError {
|
|
|
2025
2286
|
constructor(
|
|
2026
2287
|
name: string = 'InvalidTier',
|
|
2027
2288
|
code: number = 3003,
|
|
2028
|
-
message: string =
|
|
2289
|
+
message: string = `Invalid subscription tier`,
|
|
2029
2290
|
status: number = 0,
|
|
2030
2291
|
cause?: string
|
|
2031
2292
|
) {
|
|
@@ -2038,7 +2299,7 @@ export class ProjectLimitReachedError extends WebrpcError {
|
|
|
2038
2299
|
constructor(
|
|
2039
2300
|
name: string = 'ProjectLimitReached',
|
|
2040
2301
|
code: number = 3005,
|
|
2041
|
-
message: string =
|
|
2302
|
+
message: string = `Project limit reached`,
|
|
2042
2303
|
status: number = 0,
|
|
2043
2304
|
cause?: string
|
|
2044
2305
|
) {
|
|
@@ -2051,7 +2312,7 @@ export class NotImplementedError extends WebrpcError {
|
|
|
2051
2312
|
constructor(
|
|
2052
2313
|
name: string = 'NotImplemented',
|
|
2053
2314
|
code: number = 9999,
|
|
2054
|
-
message: string =
|
|
2315
|
+
message: string = `Not Implemented`,
|
|
2055
2316
|
status: number = 0,
|
|
2056
2317
|
cause?: string
|
|
2057
2318
|
) {
|
|
@@ -2086,7 +2347,33 @@ export enum errors {
|
|
|
2086
2347
|
NotImplemented = 'NotImplemented'
|
|
2087
2348
|
}
|
|
2088
2349
|
|
|
2089
|
-
|
|
2350
|
+
export enum WebrpcErrorCodes {
|
|
2351
|
+
WebrpcEndpoint = 0,
|
|
2352
|
+
WebrpcRequestFailed = -1,
|
|
2353
|
+
WebrpcBadRoute = -2,
|
|
2354
|
+
WebrpcBadMethod = -3,
|
|
2355
|
+
WebrpcBadRequest = -4,
|
|
2356
|
+
WebrpcBadResponse = -5,
|
|
2357
|
+
WebrpcServerPanic = -6,
|
|
2358
|
+
WebrpcInternalError = -7,
|
|
2359
|
+
WebrpcClientDisconnected = -8,
|
|
2360
|
+
WebrpcStreamLost = -9,
|
|
2361
|
+
WebrpcStreamFinished = -10,
|
|
2362
|
+
Unauthorized = 1000,
|
|
2363
|
+
PermissionDenied = 1001,
|
|
2364
|
+
SessionExpired = 1002,
|
|
2365
|
+
MethodNotFound = 1003,
|
|
2366
|
+
Timeout = 2000,
|
|
2367
|
+
InvalidArgument = 2001,
|
|
2368
|
+
NotFound = 3000,
|
|
2369
|
+
UserNotFound = 3001,
|
|
2370
|
+
ProjectNotFound = 3002,
|
|
2371
|
+
InvalidTier = 3003,
|
|
2372
|
+
ProjectLimitReached = 3005,
|
|
2373
|
+
NotImplemented = 9999
|
|
2374
|
+
}
|
|
2375
|
+
|
|
2376
|
+
export const webrpcErrorByCode: { [code: number]: any } = {
|
|
2090
2377
|
[0]: WebrpcEndpointError,
|
|
2091
2378
|
[-1]: WebrpcRequestFailedError,
|
|
2092
2379
|
[-2]: WebrpcBadRouteError,
|