@0xsequence/marketplace-sdk 0.8.10 → 0.8.11

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.
Files changed (166) hide show
  1. package/.changeset/fluffy-jokes-lay.md +5 -0
  2. package/.changeset/wise-bugs-boil.md +8 -0
  3. package/CHANGELOG.md +16 -3
  4. package/dist/{chunk-DWTLVJAW.js → chunk-6OPMUCGX.js} +1 -1
  5. package/dist/chunk-6OPMUCGX.js.map +1 -0
  6. package/dist/{chunk-O34GCB47.js → chunk-L6KWLCER.js} +4 -4
  7. package/dist/chunk-L6KWLCER.js.map +1 -0
  8. package/dist/{chunk-Y2HJO2VY.js → chunk-LAP2CKLN.js} +56 -3
  9. package/dist/chunk-LAP2CKLN.js.map +1 -0
  10. package/dist/{chunk-Y63BOO6M.js → chunk-LECCEZAO.js} +1 -1
  11. package/dist/{chunk-WH5BZC7W.js → chunk-N7SQWS2R.js} +3 -3
  12. package/dist/{chunk-7F27CJZW.js → chunk-OAOONM4S.js} +682 -439
  13. package/dist/chunk-OAOONM4S.js.map +1 -0
  14. package/dist/chunk-QY52UADF.js +107 -0
  15. package/dist/chunk-QY52UADF.js.map +1 -0
  16. package/dist/{chunk-UJSF7PSC.js → chunk-TNAR3XEF.js} +3766 -765
  17. package/dist/chunk-TNAR3XEF.js.map +1 -0
  18. package/dist/chunk-XABYNWXO.js +549 -0
  19. package/dist/chunk-XABYNWXO.js.map +1 -0
  20. package/dist/chunk-YB5UUF2G.js +11 -0
  21. package/dist/chunk-YB5UUF2G.js.map +1 -0
  22. package/dist/{chunk-M6NJ73Y5.js → chunk-YWGFI4PN.js} +87 -24
  23. package/dist/chunk-YWGFI4PN.js.map +1 -0
  24. package/dist/{create-config-CAQcvjl6.d.ts → create-config-DLMvMTkZ.d.ts} +2 -2
  25. package/dist/index.css +1 -1
  26. package/dist/index.css.map +1 -1
  27. package/dist/index.d.ts +7 -6
  28. package/dist/index.js +14 -15
  29. package/dist/{listTokenMetadata-DO4ChDjn.d.ts → marketCurrencies-enNVYwBk.d.ts} +77 -3
  30. package/dist/{marketplace.gen-DQzWciwC.d.ts → marketplace.gen-D24veUQs.d.ts} +3 -2
  31. package/dist/marketplaceConfig-BwNAbLPw.d.ts +21 -0
  32. package/dist/new-marketplace-types-BCw19X9S.d.ts +102 -0
  33. package/dist/react/_internal/api/index.d.ts +3 -3
  34. package/dist/react/_internal/api/index.js +1 -1
  35. package/dist/react/_internal/databeat/index.css +2764 -0
  36. package/dist/react/_internal/databeat/index.css.map +1 -0
  37. package/dist/react/_internal/databeat/index.d.ts +1 -1
  38. package/dist/react/_internal/databeat/index.js +12 -12
  39. package/dist/react/_internal/index.d.ts +61 -9
  40. package/dist/react/_internal/index.js +3 -3
  41. package/dist/react/_internal/wagmi/index.d.ts +5 -6
  42. package/dist/react/_internal/wagmi/index.js +1 -1
  43. package/dist/react/hooks/index.css +2764 -0
  44. package/dist/react/hooks/index.css.map +1 -0
  45. package/dist/react/hooks/index.d.ts +71 -222
  46. package/dist/react/hooks/index.js +16 -20
  47. package/dist/react/hooks/options/index.d.ts +5 -4
  48. package/dist/react/hooks/options/index.js +9 -7
  49. package/dist/react/index.css +1 -1
  50. package/dist/react/index.css.map +1 -1
  51. package/dist/react/index.d.ts +9 -9
  52. package/dist/react/index.js +28 -34
  53. package/dist/react/queries/index.d.ts +3 -3
  54. package/dist/react/queries/index.js +15 -4
  55. package/dist/react/ssr/index.d.ts +3 -3
  56. package/dist/react/ssr/index.js +6 -5
  57. package/dist/react/ssr/index.js.map +1 -1
  58. package/dist/react/ui/components/collectible-card/index.css +1 -1
  59. package/dist/react/ui/components/collectible-card/index.css.map +1 -1
  60. package/dist/react/ui/components/collectible-card/index.d.ts +3 -2
  61. package/dist/react/ui/components/collectible-card/index.js +12 -17
  62. package/dist/react/ui/icons/index.js +6 -6
  63. package/dist/react/ui/index.css +1 -1
  64. package/dist/react/ui/index.css.map +1 -1
  65. package/dist/react/ui/index.d.ts +1 -1
  66. package/dist/react/ui/index.js +12 -17
  67. package/dist/react/ui/modals/_internal/components/actionModal/index.css +2764 -0
  68. package/dist/react/ui/modals/_internal/components/actionModal/index.css.map +1 -0
  69. package/dist/react/ui/modals/_internal/components/actionModal/index.js +12 -12
  70. package/dist/sdk-config-qorA0TgF.d.ts +165 -0
  71. package/dist/{services-CMSb9ipU.d.ts → services-WrshxCqc.d.ts} +2 -2
  72. package/dist/types/index.d.ts +5 -4
  73. package/dist/types/index.js +7 -7
  74. package/dist/{index-MlUK9AQE.d.ts → useCollection-YAdXfVO7.d.ts} +1 -2
  75. package/dist/utils/abi/index.js +4 -4
  76. package/dist/utils/index.d.ts +1 -1
  77. package/dist/utils/index.js +8 -7
  78. package/package.json +15 -15
  79. package/src/react/_internal/api/__mocks__/builder.msw.ts +157 -80
  80. package/src/react/_internal/api/builder-api.ts +2 -2
  81. package/src/react/_internal/api/builder.gen.ts +667 -112
  82. package/src/react/_internal/api/marketplace.gen.ts +1981 -1316
  83. package/src/react/_internal/types.ts +1 -13
  84. package/src/react/_internal/wagmi/__tests__/create-config.test.ts +99 -84
  85. package/src/react/_internal/wagmi/create-config.ts +8 -4
  86. package/src/react/_internal/wagmi/get-connectors.ts +24 -19
  87. package/src/react/hooks/__tests__/__snapshots__/useListCollections.test.tsx.snap +114 -0
  88. package/src/react/hooks/__tests__/__snapshots__/useMarketplaceConfig.test.tsx.snap +85 -83
  89. package/src/react/hooks/__tests__/useFilters.test.tsx +0 -16
  90. package/src/react/hooks/__tests__/useInventory.test.tsx +16 -16
  91. package/src/react/hooks/__tests__/useListCollections.test.tsx +23 -56
  92. package/src/react/hooks/__tests__/{useCurrencies.test.tsx → useMarketCurrencies.test.tsx} +21 -15
  93. package/src/react/hooks/__tests__/useMarketplaceConfig.test.tsx +2 -59
  94. package/src/react/hooks/index.ts +2 -1
  95. package/src/react/hooks/useBalanceOfCollectible.tsx +5 -3
  96. package/src/react/hooks/useConvertPriceToUSD.tsx +1 -1
  97. package/src/react/hooks/useFilters.tsx +14 -22
  98. package/src/react/hooks/useGetTokenSuppliesMap.ts +28 -0
  99. package/src/react/hooks/useInventory.tsx +4 -3
  100. package/src/react/hooks/useListBalances.tsx +5 -3
  101. package/src/react/hooks/useListCollectibles.tsx +5 -3
  102. package/src/react/hooks/useListCollections.tsx +14 -76
  103. package/src/react/hooks/useMarketCurrencies.tsx +8 -0
  104. package/src/react/hooks/useMarketplaceConfig.tsx +0 -2
  105. package/src/react/queries/index.ts +1 -0
  106. package/src/react/queries/inventory.ts +1 -1
  107. package/src/react/queries/listCollections.ts +118 -0
  108. package/src/react/queries/marketCurrencies.ts +77 -0
  109. package/src/react/queries/marketplaceConfig.ts +83 -55
  110. package/src/react/ssr/__tests__/__snapshots__/create-ssr-client.test.ts.snap +85 -83
  111. package/src/react/ui/components/collectible-card/__tests__/Media.test.tsx +41 -1
  112. package/src/react/ui/components/collectible-card/media/Media.tsx +11 -6
  113. package/src/react/ui/components/collectible-card/media/MediaSkeleton.tsx +1 -1
  114. package/src/react/ui/components/collectible-card/media/types.ts +1 -0
  115. package/src/react/ui/modals/BuyModal/ERC1155QuantityModal.tsx +9 -3
  116. package/src/react/ui/modals/BuyModal/hooks/__tests__/useFees.test.tsx +31 -21
  117. package/src/react/ui/modals/BuyModal/hooks/useFees.ts +3 -2
  118. package/src/react/ui/modals/CreateListingModal/Modal.tsx +3 -5
  119. package/src/react/ui/modals/CreateListingModal/hooks/useCreateListing.tsx +5 -3
  120. package/src/react/ui/modals/CreateListingModal/hooks/useTransactionSteps.tsx +2 -2
  121. package/src/react/ui/modals/MakeOfferModal/Modal.tsx +2 -3
  122. package/src/react/ui/modals/MakeOfferModal/hooks/useMakeOffer.tsx +4 -3
  123. package/src/react/ui/modals/SellModal/Modal.tsx +0 -1
  124. package/src/react/ui/modals/SellModal/hooks/useTransactionSteps.tsx +2 -2
  125. package/src/react/ui/modals/TransferModal/_views/enterWalletAddress/index.tsx +0 -1
  126. package/src/react/ui/modals/TransferModal/index.tsx +0 -1
  127. package/src/react/ui/modals/_internal/components/currencyOptionsSelect/__tests__/index.test.tsx +2 -2
  128. package/src/react/ui/modals/_internal/components/currencyOptionsSelect/index.tsx +7 -6
  129. package/src/react/ui/modals/_internal/components/selectWaasFeeOptions/__tests__/SelectWaasFeeOptions.test.tsx +13 -7
  130. package/src/react/ui/modals/_internal/components/selectWaasFeeOptions/index.tsx +3 -5
  131. package/src/react/ui/modals/_internal/components/selectWaasFeeOptions/useWaasFeeOptionManager.tsx +5 -3
  132. package/src/react/ui/modals/_internal/components/transactionDetails/index.tsx +2 -2
  133. package/src/react/ui/modals/_internal/hooks/useSelectWaasFeeOptions.ts +2 -12
  134. package/src/types/index.ts +1 -6
  135. package/src/types/new-marketplace-types.ts +119 -0
  136. package/src/types/sdk-config.ts +18 -2
  137. package/src/types/types.ts +1 -0
  138. package/tsconfig.tsbuildinfo +1 -1
  139. package/dist/chunk-7F27CJZW.js.map +0 -1
  140. package/dist/chunk-A7BVFBWB.js +0 -81
  141. package/dist/chunk-A7BVFBWB.js.map +0 -1
  142. package/dist/chunk-D7RVSZAQ.js +0 -332
  143. package/dist/chunk-D7RVSZAQ.js.map +0 -1
  144. package/dist/chunk-DWTLVJAW.js.map +0 -1
  145. package/dist/chunk-FGM57QUU.js +0 -128
  146. package/dist/chunk-FGM57QUU.js.map +0 -1
  147. package/dist/chunk-JKCF7HEA.js +0 -1
  148. package/dist/chunk-JKCF7HEA.js.map +0 -1
  149. package/dist/chunk-KTST7ORH.js +0 -53
  150. package/dist/chunk-KTST7ORH.js.map +0 -1
  151. package/dist/chunk-M6NJ73Y5.js.map +0 -1
  152. package/dist/chunk-N7BPFK46.js +0 -1
  153. package/dist/chunk-N7BPFK46.js.map +0 -1
  154. package/dist/chunk-O34GCB47.js.map +0 -1
  155. package/dist/chunk-RVIUUJTP.js +0 -76
  156. package/dist/chunk-RVIUUJTP.js.map +0 -1
  157. package/dist/chunk-SXVUTSMT.js +0 -2895
  158. package/dist/chunk-SXVUTSMT.js.map +0 -1
  159. package/dist/chunk-UJSF7PSC.js.map +0 -1
  160. package/dist/chunk-Y2HJO2VY.js.map +0 -1
  161. package/dist/marketplaceConfig-D0MXemEl.d.ts +0 -17
  162. package/dist/sdk-config-onSPBxJj.d.ts +0 -134
  163. package/dist/types-B8xzPEKX.d.ts +0 -68
  164. package/src/react/hooks/useCurrencies.tsx +0 -77
  165. /package/dist/{chunk-Y63BOO6M.js.map → chunk-LECCEZAO.js.map} +0 -0
  166. /package/dist/{chunk-WH5BZC7W.js.map → chunk-N7SQWS2R.js.map} +0 -0
@@ -5,18 +5,19 @@
5
5
  //
6
6
  // webrpc-gen -schema=marketplace.ridl -target=typescript -client -out=./clients/marketplace.gen.ts
7
7
 
8
- export const WebrpcHeader = "Webrpc"
8
+ export const WebrpcHeader = "Webrpc";
9
9
 
10
- export const WebrpcHeaderValue = "webrpc@v0.25.1;gen-typescript@v0.17.0;marketplace-api@v0.0.0-27c5a642f4eb523c04af2f1a45e4a2ab1f370fcd"
10
+ export const WebrpcHeaderValue =
11
+ "webrpc@v0.25.1;gen-typescript@v0.17.0;marketplace-api@v0.0.0-27c5a642f4eb523c04af2f1a45e4a2ab1f370fcd";
11
12
 
12
13
  // WebRPC description and code-gen version
13
- export const WebRPCVersion = "v1"
14
+ export const WebRPCVersion = "v1";
14
15
 
15
16
  // Schema version of your RIDL schema
16
- export const WebRPCSchemaVersion = ""
17
+ export const WebRPCSchemaVersion = "";
17
18
 
18
19
  // Schema hash generated from your RIDL schema
19
- export const WebRPCSchemaHash = "27c5a642f4eb523c04af2f1a45e4a2ab1f370fcd"
20
+ export const WebRPCSchemaHash = "27c5a642f4eb523c04af2f1a45e4a2ab1f370fcd";
20
21
 
21
22
  type WebrpcGenVersions = {
22
23
  webrpcGenVersion: string;
@@ -70,1728 +71,2391 @@ function parseWebrpcGenVersions(header: string): WebrpcGenVersions {
70
71
  // Types
71
72
  //
72
73
 
73
-
74
74
  export interface TokenMetadata {
75
- tokenId: string
76
- name: string
77
- description?: string
78
- image?: string
79
- video?: string
80
- audio?: string
81
- properties?: {[key: string]: any}
82
- attributes: Array<{[key: string]: any}>
83
- image_data?: string
84
- external_url?: string
85
- background_color?: string
86
- animation_url?: string
87
- decimals?: number
88
- updatedAt?: string
89
- assets?: Array<Asset>
75
+ tokenId: string;
76
+ name: string;
77
+ description?: string;
78
+ image?: string;
79
+ video?: string;
80
+ audio?: string;
81
+ properties?: { [key: string]: any };
82
+ attributes: Array<{ [key: string]: any }>;
83
+ image_data?: string;
84
+ external_url?: string;
85
+ background_color?: string;
86
+ animation_url?: string;
87
+ decimals?: number;
88
+ updatedAt?: string;
89
+ assets?: Array<Asset>;
90
90
  }
91
91
 
92
92
  export interface Asset {
93
- id: number
94
- collectionId: number
95
- tokenId: string
96
- url?: string
97
- metadataField: string
98
- name?: string
99
- filesize?: number
100
- mimeType?: string
101
- width?: number
102
- height?: number
103
- updatedAt?: string
93
+ id: number;
94
+ collectionId: number;
95
+ tokenId: string;
96
+ url?: string;
97
+ metadataField: string;
98
+ name?: string;
99
+ filesize?: number;
100
+ mimeType?: string;
101
+ width?: number;
102
+ height?: number;
103
+ updatedAt?: string;
104
104
  }
105
105
 
106
106
  export enum SortOrder {
107
- DESC = 'DESC',
108
- ASC = 'ASC'
107
+ DESC = "DESC",
108
+ ASC = "ASC",
109
109
  }
110
110
 
111
111
  export enum PropertyType {
112
- INT = 'INT',
113
- STRING = 'STRING',
114
- ARRAY = 'ARRAY',
115
- GENERIC = 'GENERIC'
112
+ INT = "INT",
113
+ STRING = "STRING",
114
+ ARRAY = "ARRAY",
115
+ GENERIC = "GENERIC",
116
116
  }
117
117
 
118
118
  export enum MarketplaceKind {
119
- unknown = 'unknown',
120
- sequence_marketplace_v1 = 'sequence_marketplace_v1',
121
- sequence_marketplace_v2 = 'sequence_marketplace_v2',
122
- blur = 'blur',
123
- zerox = 'zerox',
124
- opensea = 'opensea',
125
- looks_rare = 'looks_rare',
126
- x2y2 = 'x2y2',
127
- alienswap = 'alienswap',
128
- payment_processor = 'payment_processor',
129
- mintify = 'mintify',
130
- magic_eden = 'magic_eden'
119
+ unknown = "unknown",
120
+ sequence_marketplace_v1 = "sequence_marketplace_v1",
121
+ sequence_marketplace_v2 = "sequence_marketplace_v2",
122
+ blur = "blur",
123
+ zerox = "zerox",
124
+ opensea = "opensea",
125
+ looks_rare = "looks_rare",
126
+ x2y2 = "x2y2",
127
+ alienswap = "alienswap",
128
+ payment_processor = "payment_processor",
129
+ mintify = "mintify",
130
+ magic_eden = "magic_eden",
131
131
  }
132
132
 
133
133
  export enum OrderbookKind {
134
- unknown = 'unknown',
135
- sequence_marketplace_v1 = 'sequence_marketplace_v1',
136
- sequence_marketplace_v2 = 'sequence_marketplace_v2',
137
- blur = 'blur',
138
- opensea = 'opensea',
139
- looks_rare = 'looks_rare',
140
- reservoir = 'reservoir',
141
- x2y2 = 'x2y2'
134
+ unknown = "unknown",
135
+ sequence_marketplace_v1 = "sequence_marketplace_v1",
136
+ sequence_marketplace_v2 = "sequence_marketplace_v2",
137
+ blur = "blur",
138
+ opensea = "opensea",
139
+ looks_rare = "looks_rare",
140
+ reservoir = "reservoir",
141
+ x2y2 = "x2y2",
142
142
  }
143
143
 
144
144
  export enum SourceKind {
145
- unknown = 'unknown',
146
- external = 'external',
147
- sequence_marketplace_v1 = 'sequence_marketplace_v1',
148
- sequence_marketplace_v2 = 'sequence_marketplace_v2'
145
+ unknown = "unknown",
146
+ external = "external",
147
+ sequence_marketplace_v1 = "sequence_marketplace_v1",
148
+ sequence_marketplace_v2 = "sequence_marketplace_v2",
149
149
  }
150
150
 
151
151
  export enum OrderSide {
152
- unknown = 'unknown',
153
- listing = 'listing',
154
- offer = 'offer'
152
+ unknown = "unknown",
153
+ listing = "listing",
154
+ offer = "offer",
155
155
  }
156
156
 
157
157
  export enum OrderStatus {
158
- unknown = 'unknown',
159
- active = 'active',
160
- inactive = 'inactive',
161
- expired = 'expired',
162
- cancelled = 'cancelled',
163
- filled = 'filled',
164
- decimals_missing = 'decimals_missing'
158
+ unknown = "unknown",
159
+ active = "active",
160
+ inactive = "inactive",
161
+ expired = "expired",
162
+ cancelled = "cancelled",
163
+ filled = "filled",
164
+ decimals_missing = "decimals_missing",
165
165
  }
166
166
 
167
167
  export enum ContractType {
168
- UNKNOWN = 'UNKNOWN',
169
- ERC20 = 'ERC20',
170
- ERC721 = 'ERC721',
171
- ERC1155 = 'ERC1155'
168
+ UNKNOWN = "UNKNOWN",
169
+ ERC20 = "ERC20",
170
+ ERC721 = "ERC721",
171
+ ERC1155 = "ERC1155",
172
+ LAOSERC721 = "LAOSERC721", //TODO: This needs to be validated with the new builder return
172
173
  }
173
174
 
174
175
  export enum CollectionPriority {
175
- unknown = 'unknown',
176
- low = 'low',
177
- normal = 'normal',
178
- high = 'high'
176
+ unknown = "unknown",
177
+ low = "low",
178
+ normal = "normal",
179
+ high = "high",
179
180
  }
180
181
 
181
182
  export enum CollectionStatus {
182
- unknown = 'unknown',
183
- created = 'created',
184
- syncing_contract_metadata = 'syncing_contract_metadata',
185
- synced_contract_metadata = 'synced_contract_metadata',
186
- syncing_metadata = 'syncing_metadata',
187
- synced_metadata = 'synced_metadata',
188
- syncing_tokens = 'syncing_tokens',
189
- synced_tokens = 'synced_tokens',
190
- syncing_orders = 'syncing_orders',
191
- active = 'active',
192
- failed = 'failed',
193
- inactive = 'inactive',
194
- incompatible_type = 'incompatible_type'
183
+ unknown = "unknown",
184
+ created = "created",
185
+ syncing_contract_metadata = "syncing_contract_metadata",
186
+ synced_contract_metadata = "synced_contract_metadata",
187
+ syncing_metadata = "syncing_metadata",
188
+ synced_metadata = "synced_metadata",
189
+ syncing_tokens = "syncing_tokens",
190
+ synced_tokens = "synced_tokens",
191
+ syncing_orders = "syncing_orders",
192
+ active = "active",
193
+ failed = "failed",
194
+ inactive = "inactive",
195
+ incompatible_type = "incompatible_type",
195
196
  }
196
197
 
197
198
  export enum ProjectStatus {
198
- unknown = 'unknown',
199
- active = 'active',
200
- inactive = 'inactive'
199
+ unknown = "unknown",
200
+ active = "active",
201
+ inactive = "inactive",
201
202
  }
202
203
 
203
204
  export enum CollectibleStatus {
204
- unknown = 'unknown',
205
- active = 'active',
206
- inactive = 'inactive'
205
+ unknown = "unknown",
206
+ active = "active",
207
+ inactive = "inactive",
207
208
  }
208
209
 
209
210
  export enum CurrencyStatus {
210
- unknown = 'unknown',
211
- created = 'created',
212
- syncing_metadata = 'syncing_metadata',
213
- active = 'active',
214
- failed = 'failed'
211
+ unknown = "unknown",
212
+ created = "created",
213
+ syncing_metadata = "syncing_metadata",
214
+ active = "active",
215
+ failed = "failed",
215
216
  }
216
217
 
217
218
  export enum WalletKind {
218
- unknown = 'unknown',
219
- sequence = 'sequence'
219
+ unknown = "unknown",
220
+ sequence = "sequence",
220
221
  }
221
222
 
222
223
  export enum StepType {
223
- unknown = 'unknown',
224
- tokenApproval = 'tokenApproval',
225
- buy = 'buy',
226
- sell = 'sell',
227
- createListing = 'createListing',
228
- createOffer = 'createOffer',
229
- signEIP712 = 'signEIP712',
230
- signEIP191 = 'signEIP191',
231
- cancel = 'cancel'
224
+ unknown = "unknown",
225
+ tokenApproval = "tokenApproval",
226
+ buy = "buy",
227
+ sell = "sell",
228
+ createListing = "createListing",
229
+ createOffer = "createOffer",
230
+ signEIP712 = "signEIP712",
231
+ signEIP191 = "signEIP191",
232
+ cancel = "cancel",
232
233
  }
233
234
 
234
235
  export enum TransactionCrypto {
235
- none = 'none',
236
- partially = 'partially',
237
- all = 'all'
236
+ none = "none",
237
+ partially = "partially",
238
+ all = "all",
238
239
  }
239
240
 
240
241
  export enum TransactionNFTCheckoutProvider {
241
- unknown = 'unknown',
242
- sardine = 'sardine',
243
- transak = 'transak'
242
+ unknown = "unknown",
243
+ sardine = "sardine",
244
+ transak = "transak",
244
245
  }
245
246
 
246
247
  export enum TransactionOnRampProvider {
247
- unknown = 'unknown',
248
- sardine = 'sardine',
249
- transak = 'transak'
248
+ unknown = "unknown",
249
+ sardine = "sardine",
250
+ transak = "transak",
250
251
  }
251
252
 
252
253
  export enum TransactionSwapProvider {
253
- unknown = 'unknown',
254
- zerox = 'zerox'
254
+ unknown = "unknown",
255
+ zerox = "zerox",
255
256
  }
256
257
 
257
258
  export enum ExecuteType {
258
- unknown = 'unknown',
259
- order = 'order'
259
+ unknown = "unknown",
260
+ order = "order",
260
261
  }
261
262
 
262
263
  export enum ActivityAction {
263
- unknown = 'unknown',
264
- listing = 'listing',
265
- offer = 'offer',
266
- mint = 'mint',
267
- sale = 'sale',
268
- listingCancel = 'listingCancel',
269
- offerCancel = 'offerCancel',
270
- transfer = 'transfer'
264
+ unknown = "unknown",
265
+ listing = "listing",
266
+ offer = "offer",
267
+ mint = "mint",
268
+ sale = "sale",
269
+ listingCancel = "listingCancel",
270
+ offerCancel = "offerCancel",
271
+ transfer = "transfer",
271
272
  }
272
273
 
273
274
  export interface Page {
274
- page: number
275
- pageSize: number
276
- more?: boolean
277
- sort?: Array<SortBy>
275
+ page: number;
276
+ pageSize: number;
277
+ more?: boolean;
278
+ sort?: Array<SortBy>;
278
279
  }
279
280
 
280
281
  export interface SortBy {
281
- column: string
282
- order: SortOrder
282
+ column: string;
283
+ order: SortOrder;
283
284
  }
284
285
 
285
286
  export interface Filter {
286
- text?: string
287
- properties?: Array<PropertyFilter>
287
+ text?: string;
288
+ properties?: Array<PropertyFilter>;
288
289
  }
289
290
 
290
291
  export interface PropertyFilter {
291
- name: string
292
- type: PropertyType
293
- min?: number
294
- max?: number
295
- values?: Array<any>
292
+ name: string;
293
+ type: PropertyType;
294
+ min?: number;
295
+ max?: number;
296
+ values?: Array<any>;
296
297
  }
297
298
 
298
299
  export interface CollectiblesFilter {
299
- includeEmpty: boolean
300
- searchText?: string
301
- properties?: Array<PropertyFilter>
302
- marketplaces?: Array<MarketplaceKind>
303
- inAccounts?: Array<string>
304
- notInAccounts?: Array<string>
305
- ordersCreatedBy?: Array<string>
306
- ordersNotCreatedBy?: Array<string>
307
- inCurrencyAddresses?: Array<string>
308
- notInCurrencyAddresses?: Array<string>
300
+ includeEmpty: boolean;
301
+ searchText?: string;
302
+ properties?: Array<PropertyFilter>;
303
+ marketplaces?: Array<MarketplaceKind>;
304
+ inAccounts?: Array<string>;
305
+ notInAccounts?: Array<string>;
306
+ ordersCreatedBy?: Array<string>;
307
+ ordersNotCreatedBy?: Array<string>;
308
+ inCurrencyAddresses?: Array<string>;
309
+ notInCurrencyAddresses?: Array<string>;
309
310
  }
310
311
 
311
312
  export interface Order {
312
- orderId: string
313
- marketplace: MarketplaceKind
314
- side: OrderSide
315
- status: OrderStatus
316
- chainId: number
317
- originName: string
318
- collectionContractAddress: string
319
- tokenId?: string
320
- createdBy: string
321
- priceAmount: string
322
- priceAmountFormatted: string
323
- priceAmountNet: string
324
- priceAmountNetFormatted: string
325
- priceCurrencyAddress: string
326
- priceDecimals: number
327
- priceUSD: number
328
- priceUSDFormatted: string
329
- quantityInitial: string
330
- quantityInitialFormatted: string
331
- quantityRemaining: string
332
- quantityRemainingFormatted: string
333
- quantityAvailable: string
334
- quantityAvailableFormatted: string
335
- quantityDecimals: number
336
- feeBps: number
337
- feeBreakdown: Array<FeeBreakdown>
338
- validFrom: string
339
- validUntil: string
340
- blockNumber: number
341
- orderCreatedAt?: string
342
- orderUpdatedAt?: string
343
- createdAt: string
344
- updatedAt: string
345
- deletedAt?: string
313
+ orderId: string;
314
+ marketplace: MarketplaceKind;
315
+ side: OrderSide;
316
+ status: OrderStatus;
317
+ chainId: number;
318
+ originName: string;
319
+ collectionContractAddress: string;
320
+ tokenId?: string;
321
+ createdBy: string;
322
+ priceAmount: string;
323
+ priceAmountFormatted: string;
324
+ priceAmountNet: string;
325
+ priceAmountNetFormatted: string;
326
+ priceCurrencyAddress: string;
327
+ priceDecimals: number;
328
+ priceUSD: number;
329
+ priceUSDFormatted: string;
330
+ quantityInitial: string;
331
+ quantityInitialFormatted: string;
332
+ quantityRemaining: string;
333
+ quantityRemainingFormatted: string;
334
+ quantityAvailable: string;
335
+ quantityAvailableFormatted: string;
336
+ quantityDecimals: number;
337
+ feeBps: number;
338
+ feeBreakdown: Array<FeeBreakdown>;
339
+ validFrom: string;
340
+ validUntil: string;
341
+ blockNumber: number;
342
+ orderCreatedAt?: string;
343
+ orderUpdatedAt?: string;
344
+ createdAt: string;
345
+ updatedAt: string;
346
+ deletedAt?: string;
346
347
  }
347
348
 
348
349
  export interface FeeBreakdown {
349
- kind: string
350
- recipientAddress: string
351
- bps: number
350
+ kind: string;
351
+ recipientAddress: string;
352
+ bps: number;
352
353
  }
353
354
 
354
355
  export interface CollectibleOrder {
355
- metadata: TokenMetadata
356
- order?: Order
357
- listing?: Order
358
- offer?: Order
356
+ metadata: TokenMetadata;
357
+ order?: Order;
358
+ listing?: Order;
359
+ offer?: Order;
359
360
  }
360
361
 
361
362
  export interface OrderFilter {
362
- createdBy?: Array<string>
363
- marketplace?: Array<MarketplaceKind>
364
- currencies?: Array<string>
363
+ createdBy?: Array<string>;
364
+ marketplace?: Array<MarketplaceKind>;
365
+ currencies?: Array<string>;
365
366
  }
366
367
 
367
368
  export interface Collection {
368
- status: CollectionStatus
369
- chainId: number
370
- contractAddress: string
371
- contractType: ContractType
372
- priority: CollectionPriority
373
- tokenQuantityDecimals: number
374
- config: CollectionConfig
375
- createdAt: string
376
- updatedAt: string
377
- deletedAt?: string
369
+ status: CollectionStatus;
370
+ chainId: number;
371
+ contractAddress: string;
372
+ contractType: ContractType;
373
+ priority: CollectionPriority;
374
+ tokenQuantityDecimals: number;
375
+ config: CollectionConfig;
376
+ createdAt: string;
377
+ updatedAt: string;
378
+ deletedAt?: string;
378
379
  }
379
380
 
380
381
  export interface CollectionConfig {
381
- lastSynced: {[key: string]: CollectionLastSynced}
382
- collectiblesSynced: string
383
- activitiesSynced: string
384
- activitiesSyncedContinuity: string
382
+ lastSynced: { [key: string]: CollectionLastSynced };
383
+ collectiblesSynced: string;
384
+ activitiesSynced: string;
385
+ activitiesSyncedContinuity: string;
385
386
  }
386
387
 
387
388
  export interface CollectionLastSynced {
388
- allOrders: string
389
- newOrders: string
389
+ allOrders: string;
390
+ newOrders: string;
390
391
  }
391
392
 
392
393
  export interface Project {
393
- projectId: number
394
- chainId: number
395
- contractAddress: string
396
- status: ProjectStatus
397
- createdAt: string
398
- updatedAt: string
399
- deletedAt?: string
394
+ projectId: number;
395
+ chainId: number;
396
+ contractAddress: string;
397
+ status: ProjectStatus;
398
+ createdAt: string;
399
+ updatedAt: string;
400
+ deletedAt?: string;
400
401
  }
401
402
 
402
403
  export interface Collectible {
403
- chainId: number
404
- contractAddress: string
405
- status: CollectibleStatus
406
- tokenId: string
407
- decimals: number
408
- createdAt: string
409
- updatedAt: string
410
- deletedAt?: string
404
+ chainId: number;
405
+ contractAddress: string;
406
+ status: CollectibleStatus;
407
+ tokenId: string;
408
+ decimals: number;
409
+ createdAt: string;
410
+ updatedAt: string;
411
+ deletedAt?: string;
411
412
  }
412
413
 
413
414
  export interface Currency {
414
- chainId: number
415
- contractAddress: string
416
- status: CurrencyStatus
417
- name: string
418
- symbol: string
419
- decimals: number
420
- imageUrl: string
421
- exchangeRate: number
422
- defaultChainCurrency: boolean
423
- nativeCurrency: boolean
424
- createdAt: string
425
- updatedAt: string
426
- deletedAt?: string
415
+ chainId: number;
416
+ contractAddress: string;
417
+ status: CurrencyStatus;
418
+ name: string;
419
+ symbol: string;
420
+ decimals: number;
421
+ imageUrl: string;
422
+ exchangeRate: number;
423
+ defaultChainCurrency: boolean;
424
+ nativeCurrency: boolean;
425
+ createdAt: string;
426
+ updatedAt: string;
427
+ deletedAt?: string;
427
428
  }
428
429
 
429
430
  export interface OrderData {
430
- orderId: string
431
- quantity: string
432
- tokenId?: string
431
+ orderId: string;
432
+ quantity: string;
433
+ tokenId?: string;
433
434
  }
434
435
 
435
436
  export interface AdditionalFee {
436
- amount: string
437
- receiver: string
437
+ amount: string;
438
+ receiver: string;
438
439
  }
439
440
 
440
441
  export interface Step {
441
- id: StepType
442
- data: string
443
- to: string
444
- value: string
445
- price: string
446
- signature?: Signature
447
- post?: PostRequest
448
- executeType?: ExecuteType
442
+ id: StepType;
443
+ data: string;
444
+ to: string;
445
+ value: string;
446
+ price: string;
447
+ signature?: Signature;
448
+ post?: PostRequest;
449
+ executeType?: ExecuteType;
449
450
  }
450
451
 
451
452
  export interface PostRequest {
452
- endpoint: string
453
- method: string
454
- body: any
453
+ endpoint: string;
454
+ method: string;
455
+ body: any;
455
456
  }
456
457
 
457
458
  export interface CreateReq {
458
- tokenId: string
459
- quantity: string
460
- expiry: string
461
- currencyAddress: string
462
- pricePerToken: string
459
+ tokenId: string;
460
+ quantity: string;
461
+ expiry: string;
462
+ currencyAddress: string;
463
+ pricePerToken: string;
463
464
  }
464
465
 
465
466
  export interface GetOrdersInput {
466
- contractAddress: string
467
- orderId: string
468
- marketplace: MarketplaceKind
467
+ contractAddress: string;
468
+ orderId: string;
469
+ marketplace: MarketplaceKind;
469
470
  }
470
471
 
471
472
  export interface Signature {
472
- domain: Domain
473
- types: any
474
- primaryType: string
475
- value: any
473
+ domain: Domain;
474
+ types: any;
475
+ primaryType: string;
476
+ value: any;
476
477
  }
477
478
 
478
479
  export interface Domain {
479
- name: string
480
- version: string
481
- chainId: number
482
- verifyingContract: string
480
+ name: string;
481
+ version: string;
482
+ chainId: number;
483
+ verifyingContract: string;
483
484
  }
484
485
 
485
486
  export interface CheckoutOptionsMarketplaceOrder {
486
- contractAddress: string
487
- orderId: string
488
- marketplace: MarketplaceKind
487
+ contractAddress: string;
488
+ orderId: string;
489
+ marketplace: MarketplaceKind;
489
490
  }
490
491
 
491
492
  export interface CheckoutOptionsItem {
492
- tokenId: string
493
- quantity: string
493
+ tokenId: string;
494
+ quantity: string;
494
495
  }
495
496
 
496
497
  export interface CheckoutOptions {
497
- crypto: TransactionCrypto
498
- swap: Array<TransactionSwapProvider>
499
- nftCheckout: Array<TransactionNFTCheckoutProvider>
500
- onRamp: Array<TransactionOnRampProvider>
498
+ crypto: TransactionCrypto;
499
+ swap: Array<TransactionSwapProvider>;
500
+ nftCheckout: Array<TransactionNFTCheckoutProvider>;
501
+ onRamp: Array<TransactionOnRampProvider>;
501
502
  }
502
503
 
503
504
  export interface Activity {
504
- chainId: number
505
- contractAddress: string
506
- tokenId: string
507
- action: ActivityAction
508
- txHash: string
509
- from: string
510
- to?: string
511
- quantity: string
512
- quantityDecimals: number
513
- priceAmount?: string
514
- priceAmountFormatted?: string
515
- priceCurrencyAddress?: string
516
- priceDecimals?: number
517
- activityCreatedAt: string
518
- uniqueHash: string
519
- createdAt: string
520
- updatedAt: string
521
- deletedAt?: string
505
+ chainId: number;
506
+ contractAddress: string;
507
+ tokenId: string;
508
+ action: ActivityAction;
509
+ txHash: string;
510
+ from: string;
511
+ to?: string;
512
+ quantity: string;
513
+ quantityDecimals: number;
514
+ priceAmount?: string;
515
+ priceAmountFormatted?: string;
516
+ priceCurrencyAddress?: string;
517
+ priceDecimals?: number;
518
+ activityCreatedAt: string;
519
+ uniqueHash: string;
520
+ createdAt: string;
521
+ updatedAt: string;
522
+ deletedAt?: string;
522
523
  }
523
524
 
524
525
  export interface Admin {
525
- createCollection(args: CreateCollectionArgs, headers?: object, signal?: AbortSignal): Promise<CreateCollectionReturn>
526
- getCollection(args: GetCollectionArgs, headers?: object, signal?: AbortSignal): Promise<GetCollectionReturn>
527
- updateCollection(args: UpdateCollectionArgs, headers?: object, signal?: AbortSignal): Promise<UpdateCollectionReturn>
528
- listCollections(args: ListCollectionsArgs, headers?: object, signal?: AbortSignal): Promise<ListCollectionsReturn>
529
- deleteCollection(args: DeleteCollectionArgs, headers?: object, signal?: AbortSignal): Promise<DeleteCollectionReturn>
526
+ createCollection(
527
+ args: CreateCollectionArgs,
528
+ headers?: object,
529
+ signal?: AbortSignal
530
+ ): Promise<CreateCollectionReturn>;
531
+ getCollection(
532
+ args: GetCollectionArgs,
533
+ headers?: object,
534
+ signal?: AbortSignal
535
+ ): Promise<GetCollectionReturn>;
536
+ updateCollection(
537
+ args: UpdateCollectionArgs,
538
+ headers?: object,
539
+ signal?: AbortSignal
540
+ ): Promise<UpdateCollectionReturn>;
541
+ listCollections(
542
+ args: ListCollectionsArgs,
543
+ headers?: object,
544
+ signal?: AbortSignal
545
+ ): Promise<ListCollectionsReturn>;
546
+ deleteCollection(
547
+ args: DeleteCollectionArgs,
548
+ headers?: object,
549
+ signal?: AbortSignal
550
+ ): Promise<DeleteCollectionReturn>;
530
551
  /**
531
552
  * determine what should happen here
532
553
  */
533
- syncCollection(args: SyncCollectionArgs, headers?: object, signal?: AbortSignal): Promise<SyncCollectionReturn>
534
- createCurrency(args: CreateCurrencyArgs, headers?: object, signal?: AbortSignal): Promise<CreateCurrencyReturn>
535
- createCurrencies(args: CreateCurrenciesArgs, headers?: object, signal?: AbortSignal): Promise<CreateCurrenciesReturn>
536
- updateCurrency(args: UpdateCurrencyArgs, headers?: object, signal?: AbortSignal): Promise<UpdateCurrencyReturn>
537
- listCurrencies(headers?: object, signal?: AbortSignal): Promise<ListCurrenciesReturn>
538
- deleteCurrency(args: DeleteCurrencyArgs, headers?: object, signal?: AbortSignal): Promise<DeleteCurrencyReturn>
554
+ syncCollection(
555
+ args: SyncCollectionArgs,
556
+ headers?: object,
557
+ signal?: AbortSignal
558
+ ): Promise<SyncCollectionReturn>;
559
+ createCurrency(
560
+ args: CreateCurrencyArgs,
561
+ headers?: object,
562
+ signal?: AbortSignal
563
+ ): Promise<CreateCurrencyReturn>;
564
+ createCurrencies(
565
+ args: CreateCurrenciesArgs,
566
+ headers?: object,
567
+ signal?: AbortSignal
568
+ ): Promise<CreateCurrenciesReturn>;
569
+ updateCurrency(
570
+ args: UpdateCurrencyArgs,
571
+ headers?: object,
572
+ signal?: AbortSignal
573
+ ): Promise<UpdateCurrencyReturn>;
574
+ listCurrencies(
575
+ headers?: object,
576
+ signal?: AbortSignal
577
+ ): Promise<ListCurrenciesReturn>;
578
+ deleteCurrency(
579
+ args: DeleteCurrencyArgs,
580
+ headers?: object,
581
+ signal?: AbortSignal
582
+ ): Promise<DeleteCurrencyReturn>;
539
583
  }
540
584
 
541
585
  export interface CreateCollectionArgs {
542
- projectId: number
543
- contractAddress: string
586
+ projectId: number;
587
+ contractAddress: string;
544
588
  }
545
589
 
546
590
  export interface CreateCollectionReturn {
547
- collection: Collection
591
+ collection: Collection;
548
592
  }
549
593
  export interface GetCollectionArgs {
550
- projectId: number
551
- contractAddress: string
594
+ projectId: number;
595
+ contractAddress: string;
552
596
  }
553
597
 
554
598
  export interface GetCollectionReturn {
555
- collection: Collection
599
+ collection: Collection;
556
600
  }
557
601
  export interface UpdateCollectionArgs {
558
- collection: Collection
602
+ collection: Collection;
559
603
  }
560
604
 
561
605
  export interface UpdateCollectionReturn {
562
- collection: Collection
606
+ collection: Collection;
563
607
  }
564
608
  export interface ListCollectionsArgs {
565
- projectId: number
566
- page?: Page
609
+ projectId: number;
610
+ page?: Page;
567
611
  }
568
612
 
569
613
  export interface ListCollectionsReturn {
570
- collections: Array<Collection>
571
- page?: Page
614
+ collections: Array<Collection>;
615
+ page?: Page;
572
616
  }
573
617
  export interface DeleteCollectionArgs {
574
- projectId: number
575
- contractAddress: string
618
+ projectId: number;
619
+ contractAddress: string;
576
620
  }
577
621
 
578
622
  export interface DeleteCollectionReturn {
579
- collection: Collection
623
+ collection: Collection;
580
624
  }
581
625
  export interface SyncCollectionArgs {
582
- projectId: number
583
- contractAddress: string
626
+ projectId: number;
627
+ contractAddress: string;
584
628
  }
585
629
 
586
630
  export interface SyncCollectionReturn {
587
- collection: Collection
631
+ collection: Collection;
588
632
  }
589
633
  export interface CreateCurrencyArgs {
590
- currency: Currency
634
+ currency: Currency;
591
635
  }
592
636
 
593
637
  export interface CreateCurrencyReturn {
594
- currency: Currency
638
+ currency: Currency;
595
639
  }
596
640
  export interface CreateCurrenciesArgs {
597
- currencies: Array<Currency>
641
+ currencies: Array<Currency>;
598
642
  }
599
643
 
600
644
  export interface CreateCurrenciesReturn {
601
- currency: {[key: string]: Currency}
645
+ currency: { [key: string]: Currency };
602
646
  }
603
647
  export interface UpdateCurrencyArgs {
604
- currency: Currency
648
+ currency: Currency;
605
649
  }
606
650
 
607
651
  export interface UpdateCurrencyReturn {
608
- currency: Currency
609
- }
610
- export interface ListCurrenciesArgs {
652
+ currency: Currency;
611
653
  }
654
+ export interface ListCurrenciesArgs {}
612
655
 
613
656
  export interface ListCurrenciesReturn {
614
- currencies: Array<Currency>
657
+ currencies: Array<Currency>;
615
658
  }
616
659
  export interface DeleteCurrencyArgs {
617
- chainId: number
618
- contractAddress: string
660
+ chainId: number;
661
+ contractAddress: string;
619
662
  }
620
663
 
621
664
  export interface DeleteCurrencyReturn {
622
- currency: Currency
665
+ currency: Currency;
623
666
  }
624
667
 
625
668
  export interface Marketplace {
626
- listCurrencies(headers?: object, signal?: AbortSignal): Promise<ListCurrenciesReturn>
627
- getCollectionDetail(args: GetCollectionDetailArgs, headers?: object, signal?: AbortSignal): Promise<GetCollectionDetailReturn>
628
- getCollectible(args: GetCollectibleArgs, headers?: object, signal?: AbortSignal): Promise<GetCollectibleReturn>
629
- getLowestPriceOfferForCollectible(args: GetLowestPriceOfferForCollectibleArgs, headers?: object, signal?: AbortSignal): Promise<GetLowestPriceOfferForCollectibleReturn>
630
- getHighestPriceOfferForCollectible(args: GetHighestPriceOfferForCollectibleArgs, headers?: object, signal?: AbortSignal): Promise<GetHighestPriceOfferForCollectibleReturn>
631
- getLowestPriceListingForCollectible(args: GetLowestPriceListingForCollectibleArgs, headers?: object, signal?: AbortSignal): Promise<GetLowestPriceListingForCollectibleReturn>
632
- getHighestPriceListingForCollectible(args: GetHighestPriceListingForCollectibleArgs, headers?: object, signal?: AbortSignal): Promise<GetHighestPriceListingForCollectibleReturn>
633
- listListingsForCollectible(args: ListListingsForCollectibleArgs, headers?: object, signal?: AbortSignal): Promise<ListListingsForCollectibleReturn>
634
- listOffersForCollectible(args: ListOffersForCollectibleArgs, headers?: object, signal?: AbortSignal): Promise<ListOffersForCollectibleReturn>
635
- getCountOfListingsForCollectible(args: GetCountOfListingsForCollectibleArgs, headers?: object, signal?: AbortSignal): Promise<GetCountOfListingsForCollectibleReturn>
636
- getCountOfOffersForCollectible(args: GetCountOfOffersForCollectibleArgs, headers?: object, signal?: AbortSignal): Promise<GetCountOfOffersForCollectibleReturn>
669
+ listCurrencies(
670
+ headers?: object,
671
+ signal?: AbortSignal
672
+ ): Promise<ListCurrenciesReturn>;
673
+ getCollectionDetail(
674
+ args: GetCollectionDetailArgs,
675
+ headers?: object,
676
+ signal?: AbortSignal
677
+ ): Promise<GetCollectionDetailReturn>;
678
+ getCollectible(
679
+ args: GetCollectibleArgs,
680
+ headers?: object,
681
+ signal?: AbortSignal
682
+ ): Promise<GetCollectibleReturn>;
683
+ getLowestPriceOfferForCollectible(
684
+ args: GetLowestPriceOfferForCollectibleArgs,
685
+ headers?: object,
686
+ signal?: AbortSignal
687
+ ): Promise<GetLowestPriceOfferForCollectibleReturn>;
688
+ getHighestPriceOfferForCollectible(
689
+ args: GetHighestPriceOfferForCollectibleArgs,
690
+ headers?: object,
691
+ signal?: AbortSignal
692
+ ): Promise<GetHighestPriceOfferForCollectibleReturn>;
693
+ getLowestPriceListingForCollectible(
694
+ args: GetLowestPriceListingForCollectibleArgs,
695
+ headers?: object,
696
+ signal?: AbortSignal
697
+ ): Promise<GetLowestPriceListingForCollectibleReturn>;
698
+ getHighestPriceListingForCollectible(
699
+ args: GetHighestPriceListingForCollectibleArgs,
700
+ headers?: object,
701
+ signal?: AbortSignal
702
+ ): Promise<GetHighestPriceListingForCollectibleReturn>;
703
+ listListingsForCollectible(
704
+ args: ListListingsForCollectibleArgs,
705
+ headers?: object,
706
+ signal?: AbortSignal
707
+ ): Promise<ListListingsForCollectibleReturn>;
708
+ listOffersForCollectible(
709
+ args: ListOffersForCollectibleArgs,
710
+ headers?: object,
711
+ signal?: AbortSignal
712
+ ): Promise<ListOffersForCollectibleReturn>;
713
+ getCountOfListingsForCollectible(
714
+ args: GetCountOfListingsForCollectibleArgs,
715
+ headers?: object,
716
+ signal?: AbortSignal
717
+ ): Promise<GetCountOfListingsForCollectibleReturn>;
718
+ getCountOfOffersForCollectible(
719
+ args: GetCountOfOffersForCollectibleArgs,
720
+ headers?: object,
721
+ signal?: AbortSignal
722
+ ): Promise<GetCountOfOffersForCollectibleReturn>;
637
723
  /**
638
724
  * @deprecated Please use GetLowestPriceOfferForCollectible instead.
639
725
  */
640
- getCollectibleLowestOffer(args: GetCollectibleLowestOfferArgs, headers?: object, signal?: AbortSignal): Promise<GetCollectibleLowestOfferReturn>
726
+ getCollectibleLowestOffer(
727
+ args: GetCollectibleLowestOfferArgs,
728
+ headers?: object,
729
+ signal?: AbortSignal
730
+ ): Promise<GetCollectibleLowestOfferReturn>;
641
731
  /**
642
732
  * @deprecated Please use GetHighestPriceOfferForCollectible instead.
643
733
  */
644
- getCollectibleHighestOffer(args: GetCollectibleHighestOfferArgs, headers?: object, signal?: AbortSignal): Promise<GetCollectibleHighestOfferReturn>
734
+ getCollectibleHighestOffer(
735
+ args: GetCollectibleHighestOfferArgs,
736
+ headers?: object,
737
+ signal?: AbortSignal
738
+ ): Promise<GetCollectibleHighestOfferReturn>;
645
739
  /**
646
740
  * @deprecated Please use GetLowestPriceListingForCollectible instead.
647
741
  */
648
- getCollectibleLowestListing(args: GetCollectibleLowestListingArgs, headers?: object, signal?: AbortSignal): Promise<GetCollectibleLowestListingReturn>
742
+ getCollectibleLowestListing(
743
+ args: GetCollectibleLowestListingArgs,
744
+ headers?: object,
745
+ signal?: AbortSignal
746
+ ): Promise<GetCollectibleLowestListingReturn>;
649
747
  /**
650
748
  * @deprecated Please use GetHighestPriceListingForCollectible instead.
651
749
  */
652
- getCollectibleHighestListing(args: GetCollectibleHighestListingArgs, headers?: object, signal?: AbortSignal): Promise<GetCollectibleHighestListingReturn>
750
+ getCollectibleHighestListing(
751
+ args: GetCollectibleHighestListingArgs,
752
+ headers?: object,
753
+ signal?: AbortSignal
754
+ ): Promise<GetCollectibleHighestListingReturn>;
653
755
  /**
654
756
  * @deprecated Please use ListListingsForCollectible instead.
655
757
  */
656
- listCollectibleListings(args: ListCollectibleListingsArgs, headers?: object, signal?: AbortSignal): Promise<ListCollectibleListingsReturn>
758
+ listCollectibleListings(
759
+ args: ListCollectibleListingsArgs,
760
+ headers?: object,
761
+ signal?: AbortSignal
762
+ ): Promise<ListCollectibleListingsReturn>;
657
763
  /**
658
764
  * @deprecated Please use ListOffersForCollectible instead.
659
765
  */
660
- listCollectibleOffers(args: ListCollectibleOffersArgs, headers?: object, signal?: AbortSignal): Promise<ListCollectibleOffersReturn>
766
+ listCollectibleOffers(
767
+ args: ListCollectibleOffersArgs,
768
+ headers?: object,
769
+ signal?: AbortSignal
770
+ ): Promise<ListCollectibleOffersReturn>;
661
771
  /**
662
772
  * checkout process
663
773
  */
664
- generateBuyTransaction(args: GenerateBuyTransactionArgs, headers?: object, signal?: AbortSignal): Promise<GenerateBuyTransactionReturn>
665
- generateSellTransaction(args: GenerateSellTransactionArgs, headers?: object, signal?: AbortSignal): Promise<GenerateSellTransactionReturn>
666
- generateListingTransaction(args: GenerateListingTransactionArgs, headers?: object, signal?: AbortSignal): Promise<GenerateListingTransactionReturn>
667
- generateOfferTransaction(args: GenerateOfferTransactionArgs, headers?: object, signal?: AbortSignal): Promise<GenerateOfferTransactionReturn>
668
- generateCancelTransaction(args: GenerateCancelTransactionArgs, headers?: object, signal?: AbortSignal): Promise<GenerateCancelTransactionReturn>
774
+ generateBuyTransaction(
775
+ args: GenerateBuyTransactionArgs,
776
+ headers?: object,
777
+ signal?: AbortSignal
778
+ ): Promise<GenerateBuyTransactionReturn>;
779
+ generateSellTransaction(
780
+ args: GenerateSellTransactionArgs,
781
+ headers?: object,
782
+ signal?: AbortSignal
783
+ ): Promise<GenerateSellTransactionReturn>;
784
+ generateListingTransaction(
785
+ args: GenerateListingTransactionArgs,
786
+ headers?: object,
787
+ signal?: AbortSignal
788
+ ): Promise<GenerateListingTransactionReturn>;
789
+ generateOfferTransaction(
790
+ args: GenerateOfferTransactionArgs,
791
+ headers?: object,
792
+ signal?: AbortSignal
793
+ ): Promise<GenerateOfferTransactionReturn>;
794
+ generateCancelTransaction(
795
+ args: GenerateCancelTransactionArgs,
796
+ headers?: object,
797
+ signal?: AbortSignal
798
+ ): Promise<GenerateCancelTransactionReturn>;
669
799
  /**
670
800
  * only used in a case of external transactions ( when we create off-chain transactions ) for instance opensea market
671
801
  */
672
- execute(args: ExecuteArgs, headers?: object, signal?: AbortSignal): Promise<ExecuteReturn>
802
+ execute(
803
+ args: ExecuteArgs,
804
+ headers?: object,
805
+ signal?: AbortSignal
806
+ ): Promise<ExecuteReturn>;
673
807
  /**
674
808
  * list of collectibles with best order for each collectible, by default this only returns collectibles with an order
675
809
  */
676
- listCollectibles(args: ListCollectiblesArgs, headers?: object, signal?: AbortSignal): Promise<ListCollectiblesReturn>
677
- getCountOfAllCollectibles(args: GetCountOfAllCollectiblesArgs, headers?: object, signal?: AbortSignal): Promise<GetCountOfAllCollectiblesReturn>
678
- getCountOfFilteredCollectibles(args: GetCountOfFilteredCollectiblesArgs, headers?: object, signal?: AbortSignal): Promise<GetCountOfFilteredCollectiblesReturn>
679
- getFloorOrder(args: GetFloorOrderArgs, headers?: object, signal?: AbortSignal): Promise<GetFloorOrderReturn>
680
- listCollectionActivities(args: ListCollectionActivitiesArgs, headers?: object, signal?: AbortSignal): Promise<ListCollectionActivitiesReturn>
681
- listCollectibleActivities(args: ListCollectibleActivitiesArgs, headers?: object, signal?: AbortSignal): Promise<ListCollectibleActivitiesReturn>
682
- listCollectiblesWithLowestListing(args: ListCollectiblesWithLowestListingArgs, headers?: object, signal?: AbortSignal): Promise<ListCollectiblesWithLowestListingReturn>
683
- listCollectiblesWithHighestOffer(args: ListCollectiblesWithHighestOfferArgs, headers?: object, signal?: AbortSignal): Promise<ListCollectiblesWithHighestOfferReturn>
684
- syncOrder(args: SyncOrderArgs, headers?: object, signal?: AbortSignal): Promise<SyncOrderReturn>
685
- syncOrders(args: SyncOrdersArgs, headers?: object, signal?: AbortSignal): Promise<SyncOrdersReturn>
686
- getOrders(args: GetOrdersArgs, headers?: object, signal?: AbortSignal): Promise<GetOrdersReturn>
687
- checkoutOptionsMarketplace(args: CheckoutOptionsMarketplaceArgs, headers?: object, signal?: AbortSignal): Promise<CheckoutOptionsMarketplaceReturn>
688
- checkoutOptionsSalesContract(args: CheckoutOptionsSalesContractArgs, headers?: object, signal?: AbortSignal): Promise<CheckoutOptionsSalesContractReturn>
689
- }
690
-
691
- export interface ListCurrenciesArgs {
692
- }
810
+ listCollectibles(
811
+ args: ListCollectiblesArgs,
812
+ headers?: object,
813
+ signal?: AbortSignal
814
+ ): Promise<ListCollectiblesReturn>;
815
+ getCountOfAllCollectibles(
816
+ args: GetCountOfAllCollectiblesArgs,
817
+ headers?: object,
818
+ signal?: AbortSignal
819
+ ): Promise<GetCountOfAllCollectiblesReturn>;
820
+ getCountOfFilteredCollectibles(
821
+ args: GetCountOfFilteredCollectiblesArgs,
822
+ headers?: object,
823
+ signal?: AbortSignal
824
+ ): Promise<GetCountOfFilteredCollectiblesReturn>;
825
+ getFloorOrder(
826
+ args: GetFloorOrderArgs,
827
+ headers?: object,
828
+ signal?: AbortSignal
829
+ ): Promise<GetFloorOrderReturn>;
830
+ listCollectionActivities(
831
+ args: ListCollectionActivitiesArgs,
832
+ headers?: object,
833
+ signal?: AbortSignal
834
+ ): Promise<ListCollectionActivitiesReturn>;
835
+ listCollectibleActivities(
836
+ args: ListCollectibleActivitiesArgs,
837
+ headers?: object,
838
+ signal?: AbortSignal
839
+ ): Promise<ListCollectibleActivitiesReturn>;
840
+ listCollectiblesWithLowestListing(
841
+ args: ListCollectiblesWithLowestListingArgs,
842
+ headers?: object,
843
+ signal?: AbortSignal
844
+ ): Promise<ListCollectiblesWithLowestListingReturn>;
845
+ listCollectiblesWithHighestOffer(
846
+ args: ListCollectiblesWithHighestOfferArgs,
847
+ headers?: object,
848
+ signal?: AbortSignal
849
+ ): Promise<ListCollectiblesWithHighestOfferReturn>;
850
+ syncOrder(
851
+ args: SyncOrderArgs,
852
+ headers?: object,
853
+ signal?: AbortSignal
854
+ ): Promise<SyncOrderReturn>;
855
+ syncOrders(
856
+ args: SyncOrdersArgs,
857
+ headers?: object,
858
+ signal?: AbortSignal
859
+ ): Promise<SyncOrdersReturn>;
860
+ getOrders(
861
+ args: GetOrdersArgs,
862
+ headers?: object,
863
+ signal?: AbortSignal
864
+ ): Promise<GetOrdersReturn>;
865
+ checkoutOptionsMarketplace(
866
+ args: CheckoutOptionsMarketplaceArgs,
867
+ headers?: object,
868
+ signal?: AbortSignal
869
+ ): Promise<CheckoutOptionsMarketplaceReturn>;
870
+ checkoutOptionsSalesContract(
871
+ args: CheckoutOptionsSalesContractArgs,
872
+ headers?: object,
873
+ signal?: AbortSignal
874
+ ): Promise<CheckoutOptionsSalesContractReturn>;
875
+ }
876
+
877
+ export interface ListCurrenciesArgs {}
693
878
 
694
879
  export interface ListCurrenciesReturn {
695
- currencies: Array<Currency>
880
+ currencies: Array<Currency>;
696
881
  }
697
882
  export interface GetCollectionDetailArgs {
698
- contractAddress: string
883
+ contractAddress: string;
699
884
  }
700
885
 
701
886
  export interface GetCollectionDetailReturn {
702
- collection: Collection
887
+ collection: Collection;
703
888
  }
704
889
  export interface GetCollectibleArgs {
705
- contractAddress: string
706
- tokenId: string
890
+ contractAddress: string;
891
+ tokenId: string;
707
892
  }
708
893
 
709
894
  export interface GetCollectibleReturn {
710
- metadata: TokenMetadata
895
+ metadata: TokenMetadata;
711
896
  }
712
897
  export interface GetLowestPriceOfferForCollectibleArgs {
713
- contractAddress: string
714
- tokenId: string
715
- filter?: OrderFilter
898
+ contractAddress: string;
899
+ tokenId: string;
900
+ filter?: OrderFilter;
716
901
  }
717
902
 
718
903
  export interface GetLowestPriceOfferForCollectibleReturn {
719
- order: Order
904
+ order: Order;
720
905
  }
721
906
  export interface GetHighestPriceOfferForCollectibleArgs {
722
- contractAddress: string
723
- tokenId: string
724
- filter?: OrderFilter
907
+ contractAddress: string;
908
+ tokenId: string;
909
+ filter?: OrderFilter;
725
910
  }
726
911
 
727
912
  export interface GetHighestPriceOfferForCollectibleReturn {
728
- order: Order
913
+ order: Order;
729
914
  }
730
915
  export interface GetLowestPriceListingForCollectibleArgs {
731
- contractAddress: string
732
- tokenId: string
733
- filter?: OrderFilter
916
+ contractAddress: string;
917
+ tokenId: string;
918
+ filter?: OrderFilter;
734
919
  }
735
920
 
736
921
  export interface GetLowestPriceListingForCollectibleReturn {
737
- order: Order
922
+ order: Order;
738
923
  }
739
924
  export interface GetHighestPriceListingForCollectibleArgs {
740
- contractAddress: string
741
- tokenId: string
742
- filter?: OrderFilter
925
+ contractAddress: string;
926
+ tokenId: string;
927
+ filter?: OrderFilter;
743
928
  }
744
929
 
745
930
  export interface GetHighestPriceListingForCollectibleReturn {
746
- order: Order
931
+ order: Order;
747
932
  }
748
933
  export interface ListListingsForCollectibleArgs {
749
- contractAddress: string
750
- tokenId: string
751
- filter?: OrderFilter
752
- page?: Page
934
+ contractAddress: string;
935
+ tokenId: string;
936
+ filter?: OrderFilter;
937
+ page?: Page;
753
938
  }
754
939
 
755
940
  export interface ListListingsForCollectibleReturn {
756
- listings: Array<Order>
757
- page?: Page
941
+ listings: Array<Order>;
942
+ page?: Page;
758
943
  }
759
944
  export interface ListOffersForCollectibleArgs {
760
- contractAddress: string
761
- tokenId: string
762
- filter?: OrderFilter
763
- page?: Page
945
+ contractAddress: string;
946
+ tokenId: string;
947
+ filter?: OrderFilter;
948
+ page?: Page;
764
949
  }
765
950
 
766
951
  export interface ListOffersForCollectibleReturn {
767
- offers: Array<Order>
768
- page?: Page
952
+ offers: Array<Order>;
953
+ page?: Page;
769
954
  }
770
955
  export interface GetCountOfListingsForCollectibleArgs {
771
- contractAddress: string
772
- tokenId: string
773
- filter?: OrderFilter
956
+ contractAddress: string;
957
+ tokenId: string;
958
+ filter?: OrderFilter;
774
959
  }
775
960
 
776
961
  export interface GetCountOfListingsForCollectibleReturn {
777
- count: number
962
+ count: number;
778
963
  }
779
964
  export interface GetCountOfOffersForCollectibleArgs {
780
- contractAddress: string
781
- tokenId: string
782
- filter?: OrderFilter
965
+ contractAddress: string;
966
+ tokenId: string;
967
+ filter?: OrderFilter;
783
968
  }
784
969
 
785
970
  export interface GetCountOfOffersForCollectibleReturn {
786
- count: number
971
+ count: number;
787
972
  }
788
973
  export interface GetCollectibleLowestOfferArgs {
789
- contractAddress: string
790
- tokenId: string
791
- filter?: OrderFilter
974
+ contractAddress: string;
975
+ tokenId: string;
976
+ filter?: OrderFilter;
792
977
  }
793
978
 
794
979
  export interface GetCollectibleLowestOfferReturn {
795
- order?: Order
980
+ order?: Order;
796
981
  }
797
982
  export interface GetCollectibleHighestOfferArgs {
798
- contractAddress: string
799
- tokenId: string
800
- filter?: OrderFilter
983
+ contractAddress: string;
984
+ tokenId: string;
985
+ filter?: OrderFilter;
801
986
  }
802
987
 
803
988
  export interface GetCollectibleHighestOfferReturn {
804
- order?: Order
989
+ order?: Order;
805
990
  }
806
991
  export interface GetCollectibleLowestListingArgs {
807
- contractAddress: string
808
- tokenId: string
809
- filter?: OrderFilter
992
+ contractAddress: string;
993
+ tokenId: string;
994
+ filter?: OrderFilter;
810
995
  }
811
996
 
812
997
  export interface GetCollectibleLowestListingReturn {
813
- order?: Order
998
+ order?: Order;
814
999
  }
815
1000
  export interface GetCollectibleHighestListingArgs {
816
- contractAddress: string
817
- tokenId: string
818
- filter?: OrderFilter
1001
+ contractAddress: string;
1002
+ tokenId: string;
1003
+ filter?: OrderFilter;
819
1004
  }
820
1005
 
821
1006
  export interface GetCollectibleHighestListingReturn {
822
- order?: Order
1007
+ order?: Order;
823
1008
  }
824
1009
  export interface ListCollectibleListingsArgs {
825
- contractAddress: string
826
- tokenId: string
827
- filter?: OrderFilter
828
- page?: Page
1010
+ contractAddress: string;
1011
+ tokenId: string;
1012
+ filter?: OrderFilter;
1013
+ page?: Page;
829
1014
  }
830
1015
 
831
1016
  export interface ListCollectibleListingsReturn {
832
- listings: Array<Order>
833
- page?: Page
1017
+ listings: Array<Order>;
1018
+ page?: Page;
834
1019
  }
835
1020
  export interface ListCollectibleOffersArgs {
836
- contractAddress: string
837
- tokenId: string
838
- filter?: OrderFilter
839
- page?: Page
1021
+ contractAddress: string;
1022
+ tokenId: string;
1023
+ filter?: OrderFilter;
1024
+ page?: Page;
840
1025
  }
841
1026
 
842
1027
  export interface ListCollectibleOffersReturn {
843
- offers: Array<Order>
844
- page?: Page
1028
+ offers: Array<Order>;
1029
+ page?: Page;
845
1030
  }
846
1031
  export interface GenerateBuyTransactionArgs {
847
- collectionAddress: string
848
- buyer: string
849
- marketplace: MarketplaceKind
850
- ordersData: Array<OrderData>
851
- additionalFees: Array<AdditionalFee>
852
- walletType?: WalletKind
1032
+ collectionAddress: string;
1033
+ buyer: string;
1034
+ marketplace: MarketplaceKind;
1035
+ ordersData: Array<OrderData>;
1036
+ additionalFees: Array<AdditionalFee>;
1037
+ walletType?: WalletKind;
853
1038
  }
854
1039
 
855
1040
  export interface GenerateBuyTransactionReturn {
856
- steps: Array<Step>
1041
+ steps: Array<Step>;
857
1042
  }
858
1043
  export interface GenerateSellTransactionArgs {
859
- collectionAddress: string
860
- seller: string
861
- marketplace: MarketplaceKind
862
- ordersData: Array<OrderData>
863
- additionalFees: Array<AdditionalFee>
864
- walletType?: WalletKind
1044
+ collectionAddress: string;
1045
+ seller: string;
1046
+ marketplace: MarketplaceKind;
1047
+ ordersData: Array<OrderData>;
1048
+ additionalFees: Array<AdditionalFee>;
1049
+ walletType?: WalletKind;
865
1050
  }
866
1051
 
867
1052
  export interface GenerateSellTransactionReturn {
868
- steps: Array<Step>
1053
+ steps: Array<Step>;
869
1054
  }
870
1055
  export interface GenerateListingTransactionArgs {
871
- collectionAddress: string
872
- owner: string
873
- contractType: ContractType
874
- orderbook: OrderbookKind
875
- listing: CreateReq
876
- walletType?: WalletKind
1056
+ collectionAddress: string;
1057
+ owner: string;
1058
+ contractType: ContractType;
1059
+ orderbook: OrderbookKind;
1060
+ listing: CreateReq;
1061
+ walletType?: WalletKind;
877
1062
  }
878
1063
 
879
1064
  export interface GenerateListingTransactionReturn {
880
- steps: Array<Step>
1065
+ steps: Array<Step>;
881
1066
  }
882
1067
  export interface GenerateOfferTransactionArgs {
883
- collectionAddress: string
884
- maker: string
885
- contractType: ContractType
886
- orderbook: OrderbookKind
887
- offer: CreateReq
888
- walletType?: WalletKind
1068
+ collectionAddress: string;
1069
+ maker: string;
1070
+ contractType: ContractType;
1071
+ orderbook: OrderbookKind;
1072
+ offer: CreateReq;
1073
+ walletType?: WalletKind;
889
1074
  }
890
1075
 
891
1076
  export interface GenerateOfferTransactionReturn {
892
- steps: Array<Step>
1077
+ steps: Array<Step>;
893
1078
  }
894
1079
  export interface GenerateCancelTransactionArgs {
895
- collectionAddress: string
896
- maker: string
897
- marketplace: MarketplaceKind
898
- orderId: string
1080
+ collectionAddress: string;
1081
+ maker: string;
1082
+ marketplace: MarketplaceKind;
1083
+ orderId: string;
899
1084
  }
900
1085
 
901
1086
  export interface GenerateCancelTransactionReturn {
902
- steps: Array<Step>
1087
+ steps: Array<Step>;
903
1088
  }
904
1089
  export interface ExecuteArgs {
905
- signature: string
1090
+ signature: string;
906
1091
  //executeType: ExecuteType is deprecated, but we cant hide it in webrpc for now
907
- method: string
908
- endpoint: string
909
- body: any
1092
+ method: string;
1093
+ endpoint: string;
1094
+ body: any;
910
1095
  }
911
1096
 
912
1097
  export interface ExecuteReturn {
913
- orderId: string
1098
+ orderId: string;
914
1099
  }
915
1100
  export interface ListCollectiblesArgs {
916
- side: OrderSide
917
- contractAddress: string
918
- filter?: CollectiblesFilter
919
- page?: Page
1101
+ side: OrderSide;
1102
+ contractAddress: string;
1103
+ filter?: CollectiblesFilter;
1104
+ page?: Page;
920
1105
  }
921
1106
 
922
1107
  export interface ListCollectiblesReturn {
923
- collectibles: Array<CollectibleOrder>
924
- page?: Page
1108
+ collectibles: Array<CollectibleOrder>;
1109
+ page?: Page;
925
1110
  }
926
1111
  export interface GetCountOfAllCollectiblesArgs {
927
- contractAddress: string
1112
+ contractAddress: string;
928
1113
  }
929
1114
 
930
1115
  export interface GetCountOfAllCollectiblesReturn {
931
- count: number
1116
+ count: number;
932
1117
  }
933
1118
  export interface GetCountOfFilteredCollectiblesArgs {
934
- side: OrderSide
935
- contractAddress: string
936
- filter?: CollectiblesFilter
1119
+ side: OrderSide;
1120
+ contractAddress: string;
1121
+ filter?: CollectiblesFilter;
937
1122
  }
938
1123
 
939
1124
  export interface GetCountOfFilteredCollectiblesReturn {
940
- count: number
1125
+ count: number;
941
1126
  }
942
1127
  export interface GetFloorOrderArgs {
943
- contractAddress: string
944
- filter?: CollectiblesFilter
1128
+ contractAddress: string;
1129
+ filter?: CollectiblesFilter;
945
1130
  }
946
1131
 
947
1132
  export interface GetFloorOrderReturn {
948
- collectible: CollectibleOrder
1133
+ collectible: CollectibleOrder;
949
1134
  }
950
1135
  export interface ListCollectionActivitiesArgs {
951
- contractAddress: string
952
- page?: Page
1136
+ contractAddress: string;
1137
+ page?: Page;
953
1138
  }
954
1139
 
955
1140
  export interface ListCollectionActivitiesReturn {
956
- activities: Array<Activity>
957
- page?: Page
1141
+ activities: Array<Activity>;
1142
+ page?: Page;
958
1143
  }
959
1144
  export interface ListCollectibleActivitiesArgs {
960
- contractAddress: string
961
- tokenId: string
962
- page?: Page
1145
+ contractAddress: string;
1146
+ tokenId: string;
1147
+ page?: Page;
963
1148
  }
964
1149
 
965
1150
  export interface ListCollectibleActivitiesReturn {
966
- activities: Array<Activity>
967
- page?: Page
1151
+ activities: Array<Activity>;
1152
+ page?: Page;
968
1153
  }
969
1154
  export interface ListCollectiblesWithLowestListingArgs {
970
- contractAddress: string
971
- filter?: CollectiblesFilter
972
- page?: Page
1155
+ contractAddress: string;
1156
+ filter?: CollectiblesFilter;
1157
+ page?: Page;
973
1158
  }
974
1159
 
975
1160
  export interface ListCollectiblesWithLowestListingReturn {
976
- collectibles: Array<CollectibleOrder>
977
- page?: Page
1161
+ collectibles: Array<CollectibleOrder>;
1162
+ page?: Page;
978
1163
  }
979
1164
  export interface ListCollectiblesWithHighestOfferArgs {
980
- contractAddress: string
981
- filter?: CollectiblesFilter
982
- page?: Page
1165
+ contractAddress: string;
1166
+ filter?: CollectiblesFilter;
1167
+ page?: Page;
983
1168
  }
984
1169
 
985
1170
  export interface ListCollectiblesWithHighestOfferReturn {
986
- collectibles: Array<CollectibleOrder>
987
- page?: Page
1171
+ collectibles: Array<CollectibleOrder>;
1172
+ page?: Page;
988
1173
  }
989
1174
  export interface SyncOrderArgs {
990
- order: Order
1175
+ order: Order;
991
1176
  }
992
1177
 
993
- export interface SyncOrderReturn {
994
- }
1178
+ export interface SyncOrderReturn {}
995
1179
  export interface SyncOrdersArgs {
996
- orders: Array<Order>
1180
+ orders: Array<Order>;
997
1181
  }
998
1182
 
999
- export interface SyncOrdersReturn {
1000
- }
1183
+ export interface SyncOrdersReturn {}
1001
1184
  export interface GetOrdersArgs {
1002
- input: Array<GetOrdersInput>
1003
- page?: Page
1185
+ input: Array<GetOrdersInput>;
1186
+ page?: Page;
1004
1187
  }
1005
1188
 
1006
1189
  export interface GetOrdersReturn {
1007
- orders: Array<Order>
1008
- page?: Page
1190
+ orders: Array<Order>;
1191
+ page?: Page;
1009
1192
  }
1010
1193
  export interface CheckoutOptionsMarketplaceArgs {
1011
- wallet: string
1012
- orders: Array<CheckoutOptionsMarketplaceOrder>
1013
- additionalFee: number
1194
+ wallet: string;
1195
+ orders: Array<CheckoutOptionsMarketplaceOrder>;
1196
+ additionalFee: number;
1014
1197
  }
1015
1198
 
1016
1199
  export interface CheckoutOptionsMarketplaceReturn {
1017
- options: CheckoutOptions
1200
+ options: CheckoutOptions;
1018
1201
  }
1019
1202
  export interface CheckoutOptionsSalesContractArgs {
1020
- wallet: string
1021
- contractAddress: string
1022
- collectionAddress: string
1023
- items: Array<CheckoutOptionsItem>
1203
+ wallet: string;
1204
+ contractAddress: string;
1205
+ collectionAddress: string;
1206
+ items: Array<CheckoutOptionsItem>;
1024
1207
  }
1025
1208
 
1026
1209
  export interface CheckoutOptionsSalesContractReturn {
1027
- options: CheckoutOptions
1210
+ options: CheckoutOptions;
1028
1211
  }
1029
1212
 
1030
-
1031
-
1032
1213
  //
1033
1214
  // Client
1034
1215
  //
1035
1216
  export class Admin implements Admin {
1036
- protected hostname: string
1037
- protected fetch: Fetch
1038
- protected path = '/rpc/Admin/'
1217
+ protected hostname: string;
1218
+ protected fetch: Fetch;
1219
+ protected path = "/rpc/Admin/";
1039
1220
 
1040
1221
  constructor(hostname: string, fetch: Fetch) {
1041
- this.hostname = hostname.replace(/\/*$/, '')
1042
- this.fetch = (input: RequestInfo, init?: RequestInit) => fetch(input, init)
1222
+ this.hostname = hostname.replace(/\/*$/, "");
1223
+ this.fetch = (input: RequestInfo, init?: RequestInit) => fetch(input, init);
1043
1224
  }
1044
1225
 
1045
1226
  private url(name: string): string {
1046
- return this.hostname + this.path + name
1227
+ return this.hostname + this.path + name;
1047
1228
  }
1048
-
1049
- createCollection = (args: CreateCollectionArgs, headers?: object, signal?: AbortSignal): Promise<CreateCollectionReturn> => {
1229
+
1230
+ createCollection = (
1231
+ args: CreateCollectionArgs,
1232
+ headers?: object,
1233
+ signal?: AbortSignal
1234
+ ): Promise<CreateCollectionReturn> => {
1050
1235
  return this.fetch(
1051
- this.url('CreateCollection'),
1052
- createHTTPRequest(args, headers, signal)).then((res) => {
1053
- return buildResponse(res).then(_data => {
1054
- return {
1055
- collection: <Collection>(_data.collection),
1056
- }
1057
- })
1058
- }, (error) => {
1059
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1060
- })
1061
- }
1062
-
1063
- getCollection = (args: GetCollectionArgs, headers?: object, signal?: AbortSignal): Promise<GetCollectionReturn> => {
1236
+ this.url("CreateCollection"),
1237
+ createHTTPRequest(args, headers, signal)
1238
+ ).then(
1239
+ (res) => {
1240
+ return buildResponse(res).then((_data) => {
1241
+ return {
1242
+ collection: <Collection>_data.collection,
1243
+ };
1244
+ });
1245
+ },
1246
+ (error) => {
1247
+ throw WebrpcRequestFailedError.new({
1248
+ cause: `fetch(): ${error.message || ""}`,
1249
+ });
1250
+ }
1251
+ );
1252
+ };
1253
+
1254
+ getCollection = (
1255
+ args: GetCollectionArgs,
1256
+ headers?: object,
1257
+ signal?: AbortSignal
1258
+ ): Promise<GetCollectionReturn> => {
1064
1259
  return this.fetch(
1065
- this.url('GetCollection'),
1066
- createHTTPRequest(args, headers, signal)).then((res) => {
1067
- return buildResponse(res).then(_data => {
1068
- return {
1069
- collection: <Collection>(_data.collection),
1070
- }
1071
- })
1072
- }, (error) => {
1073
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1074
- })
1075
- }
1076
-
1077
- updateCollection = (args: UpdateCollectionArgs, headers?: object, signal?: AbortSignal): Promise<UpdateCollectionReturn> => {
1260
+ this.url("GetCollection"),
1261
+ createHTTPRequest(args, headers, signal)
1262
+ ).then(
1263
+ (res) => {
1264
+ return buildResponse(res).then((_data) => {
1265
+ return {
1266
+ collection: <Collection>_data.collection,
1267
+ };
1268
+ });
1269
+ },
1270
+ (error) => {
1271
+ throw WebrpcRequestFailedError.new({
1272
+ cause: `fetch(): ${error.message || ""}`,
1273
+ });
1274
+ }
1275
+ );
1276
+ };
1277
+
1278
+ updateCollection = (
1279
+ args: UpdateCollectionArgs,
1280
+ headers?: object,
1281
+ signal?: AbortSignal
1282
+ ): Promise<UpdateCollectionReturn> => {
1078
1283
  return this.fetch(
1079
- this.url('UpdateCollection'),
1080
- createHTTPRequest(args, headers, signal)).then((res) => {
1081
- return buildResponse(res).then(_data => {
1082
- return {
1083
- collection: <Collection>(_data.collection),
1084
- }
1085
- })
1086
- }, (error) => {
1087
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1088
- })
1089
- }
1090
-
1091
- listCollections = (args: ListCollectionsArgs, headers?: object, signal?: AbortSignal): Promise<ListCollectionsReturn> => {
1284
+ this.url("UpdateCollection"),
1285
+ createHTTPRequest(args, headers, signal)
1286
+ ).then(
1287
+ (res) => {
1288
+ return buildResponse(res).then((_data) => {
1289
+ return {
1290
+ collection: <Collection>_data.collection,
1291
+ };
1292
+ });
1293
+ },
1294
+ (error) => {
1295
+ throw WebrpcRequestFailedError.new({
1296
+ cause: `fetch(): ${error.message || ""}`,
1297
+ });
1298
+ }
1299
+ );
1300
+ };
1301
+
1302
+ listCollections = (
1303
+ args: ListCollectionsArgs,
1304
+ headers?: object,
1305
+ signal?: AbortSignal
1306
+ ): Promise<ListCollectionsReturn> => {
1092
1307
  return this.fetch(
1093
- this.url('ListCollections'),
1094
- createHTTPRequest(args, headers, signal)).then((res) => {
1095
- return buildResponse(res).then(_data => {
1096
- return {
1097
- collections: <Array<Collection>>(_data.collections),
1098
- page: <Page>(_data.page),
1099
- }
1100
- })
1101
- }, (error) => {
1102
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1103
- })
1104
- }
1105
-
1106
- deleteCollection = (args: DeleteCollectionArgs, headers?: object, signal?: AbortSignal): Promise<DeleteCollectionReturn> => {
1308
+ this.url("ListCollections"),
1309
+ createHTTPRequest(args, headers, signal)
1310
+ ).then(
1311
+ (res) => {
1312
+ return buildResponse(res).then((_data) => {
1313
+ return {
1314
+ collections: <Array<Collection>>_data.collections,
1315
+ page: <Page>_data.page,
1316
+ };
1317
+ });
1318
+ },
1319
+ (error) => {
1320
+ throw WebrpcRequestFailedError.new({
1321
+ cause: `fetch(): ${error.message || ""}`,
1322
+ });
1323
+ }
1324
+ );
1325
+ };
1326
+
1327
+ deleteCollection = (
1328
+ args: DeleteCollectionArgs,
1329
+ headers?: object,
1330
+ signal?: AbortSignal
1331
+ ): Promise<DeleteCollectionReturn> => {
1107
1332
  return this.fetch(
1108
- this.url('DeleteCollection'),
1109
- createHTTPRequest(args, headers, signal)).then((res) => {
1110
- return buildResponse(res).then(_data => {
1111
- return {
1112
- collection: <Collection>(_data.collection),
1113
- }
1114
- })
1115
- }, (error) => {
1116
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1117
- })
1118
- }
1119
-
1120
- syncCollection = (args: SyncCollectionArgs, headers?: object, signal?: AbortSignal): Promise<SyncCollectionReturn> => {
1333
+ this.url("DeleteCollection"),
1334
+ createHTTPRequest(args, headers, signal)
1335
+ ).then(
1336
+ (res) => {
1337
+ return buildResponse(res).then((_data) => {
1338
+ return {
1339
+ collection: <Collection>_data.collection,
1340
+ };
1341
+ });
1342
+ },
1343
+ (error) => {
1344
+ throw WebrpcRequestFailedError.new({
1345
+ cause: `fetch(): ${error.message || ""}`,
1346
+ });
1347
+ }
1348
+ );
1349
+ };
1350
+
1351
+ syncCollection = (
1352
+ args: SyncCollectionArgs,
1353
+ headers?: object,
1354
+ signal?: AbortSignal
1355
+ ): Promise<SyncCollectionReturn> => {
1121
1356
  return this.fetch(
1122
- this.url('SyncCollection'),
1123
- createHTTPRequest(args, headers, signal)).then((res) => {
1124
- return buildResponse(res).then(_data => {
1125
- return {
1126
- collection: <Collection>(_data.collection),
1127
- }
1128
- })
1129
- }, (error) => {
1130
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1131
- })
1132
- }
1133
-
1134
- createCurrency = (args: CreateCurrencyArgs, headers?: object, signal?: AbortSignal): Promise<CreateCurrencyReturn> => {
1357
+ this.url("SyncCollection"),
1358
+ createHTTPRequest(args, headers, signal)
1359
+ ).then(
1360
+ (res) => {
1361
+ return buildResponse(res).then((_data) => {
1362
+ return {
1363
+ collection: <Collection>_data.collection,
1364
+ };
1365
+ });
1366
+ },
1367
+ (error) => {
1368
+ throw WebrpcRequestFailedError.new({
1369
+ cause: `fetch(): ${error.message || ""}`,
1370
+ });
1371
+ }
1372
+ );
1373
+ };
1374
+
1375
+ createCurrency = (
1376
+ args: CreateCurrencyArgs,
1377
+ headers?: object,
1378
+ signal?: AbortSignal
1379
+ ): Promise<CreateCurrencyReturn> => {
1135
1380
  return this.fetch(
1136
- this.url('CreateCurrency'),
1137
- createHTTPRequest(args, headers, signal)).then((res) => {
1138
- return buildResponse(res).then(_data => {
1139
- return {
1140
- currency: <Currency>(_data.currency),
1141
- }
1142
- })
1143
- }, (error) => {
1144
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1145
- })
1146
- }
1147
-
1148
- createCurrencies = (args: CreateCurrenciesArgs, headers?: object, signal?: AbortSignal): Promise<CreateCurrenciesReturn> => {
1381
+ this.url("CreateCurrency"),
1382
+ createHTTPRequest(args, headers, signal)
1383
+ ).then(
1384
+ (res) => {
1385
+ return buildResponse(res).then((_data) => {
1386
+ return {
1387
+ currency: <Currency>_data.currency,
1388
+ };
1389
+ });
1390
+ },
1391
+ (error) => {
1392
+ throw WebrpcRequestFailedError.new({
1393
+ cause: `fetch(): ${error.message || ""}`,
1394
+ });
1395
+ }
1396
+ );
1397
+ };
1398
+
1399
+ createCurrencies = (
1400
+ args: CreateCurrenciesArgs,
1401
+ headers?: object,
1402
+ signal?: AbortSignal
1403
+ ): Promise<CreateCurrenciesReturn> => {
1149
1404
  return this.fetch(
1150
- this.url('CreateCurrencies'),
1151
- createHTTPRequest(args, headers, signal)).then((res) => {
1152
- return buildResponse(res).then(_data => {
1153
- return {
1154
- currency: <{[key: string]: Currency}>(_data.currency),
1155
- }
1156
- })
1157
- }, (error) => {
1158
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1159
- })
1160
- }
1161
-
1162
- updateCurrency = (args: UpdateCurrencyArgs, headers?: object, signal?: AbortSignal): Promise<UpdateCurrencyReturn> => {
1405
+ this.url("CreateCurrencies"),
1406
+ createHTTPRequest(args, headers, signal)
1407
+ ).then(
1408
+ (res) => {
1409
+ return buildResponse(res).then((_data) => {
1410
+ return {
1411
+ currency: <{ [key: string]: Currency }>_data.currency,
1412
+ };
1413
+ });
1414
+ },
1415
+ (error) => {
1416
+ throw WebrpcRequestFailedError.new({
1417
+ cause: `fetch(): ${error.message || ""}`,
1418
+ });
1419
+ }
1420
+ );
1421
+ };
1422
+
1423
+ updateCurrency = (
1424
+ args: UpdateCurrencyArgs,
1425
+ headers?: object,
1426
+ signal?: AbortSignal
1427
+ ): Promise<UpdateCurrencyReturn> => {
1163
1428
  return this.fetch(
1164
- this.url('UpdateCurrency'),
1165
- createHTTPRequest(args, headers, signal)).then((res) => {
1166
- return buildResponse(res).then(_data => {
1167
- return {
1168
- currency: <Currency>(_data.currency),
1169
- }
1170
- })
1171
- }, (error) => {
1172
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1173
- })
1174
- }
1175
-
1176
- listCurrencies = (headers?: object, signal?: AbortSignal): Promise<ListCurrenciesReturn> => {
1429
+ this.url("UpdateCurrency"),
1430
+ createHTTPRequest(args, headers, signal)
1431
+ ).then(
1432
+ (res) => {
1433
+ return buildResponse(res).then((_data) => {
1434
+ return {
1435
+ currency: <Currency>_data.currency,
1436
+ };
1437
+ });
1438
+ },
1439
+ (error) => {
1440
+ throw WebrpcRequestFailedError.new({
1441
+ cause: `fetch(): ${error.message || ""}`,
1442
+ });
1443
+ }
1444
+ );
1445
+ };
1446
+
1447
+ listCurrencies = (
1448
+ headers?: object,
1449
+ signal?: AbortSignal
1450
+ ): Promise<ListCurrenciesReturn> => {
1177
1451
  return this.fetch(
1178
- this.url('ListCurrencies'),
1452
+ this.url("ListCurrencies"),
1179
1453
  createHTTPRequest({}, headers, signal)
1180
- ).then((res) => {
1181
- return buildResponse(res).then(_data => {
1182
- return {
1183
- currencies: <Array<Currency>>(_data.currencies),
1184
- }
1185
- })
1186
- }, (error) => {
1187
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1188
- })
1189
- }
1190
-
1191
- deleteCurrency = (args: DeleteCurrencyArgs, headers?: object, signal?: AbortSignal): Promise<DeleteCurrencyReturn> => {
1454
+ ).then(
1455
+ (res) => {
1456
+ return buildResponse(res).then((_data) => {
1457
+ return {
1458
+ currencies: <Array<Currency>>_data.currencies,
1459
+ };
1460
+ });
1461
+ },
1462
+ (error) => {
1463
+ throw WebrpcRequestFailedError.new({
1464
+ cause: `fetch(): ${error.message || ""}`,
1465
+ });
1466
+ }
1467
+ );
1468
+ };
1469
+
1470
+ deleteCurrency = (
1471
+ args: DeleteCurrencyArgs,
1472
+ headers?: object,
1473
+ signal?: AbortSignal
1474
+ ): Promise<DeleteCurrencyReturn> => {
1192
1475
  return this.fetch(
1193
- this.url('DeleteCurrency'),
1194
- createHTTPRequest(args, headers, signal)).then((res) => {
1195
- return buildResponse(res).then(_data => {
1196
- return {
1197
- currency: <Currency>(_data.currency),
1198
- }
1199
- })
1200
- }, (error) => {
1201
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1202
- })
1203
- }
1204
-
1476
+ this.url("DeleteCurrency"),
1477
+ createHTTPRequest(args, headers, signal)
1478
+ ).then(
1479
+ (res) => {
1480
+ return buildResponse(res).then((_data) => {
1481
+ return {
1482
+ currency: <Currency>_data.currency,
1483
+ };
1484
+ });
1485
+ },
1486
+ (error) => {
1487
+ throw WebrpcRequestFailedError.new({
1488
+ cause: `fetch(): ${error.message || ""}`,
1489
+ });
1490
+ }
1491
+ );
1492
+ };
1205
1493
  }
1206
1494
  export class Marketplace implements Marketplace {
1207
- protected hostname: string
1208
- protected fetch: Fetch
1209
- protected path = '/rpc/Marketplace/'
1495
+ protected hostname: string;
1496
+ protected fetch: Fetch;
1497
+ protected path = "/rpc/Marketplace/";
1210
1498
 
1211
1499
  constructor(hostname: string, fetch: Fetch) {
1212
- this.hostname = hostname.replace(/\/*$/, '')
1213
- this.fetch = (input: RequestInfo, init?: RequestInit) => fetch(input, init)
1500
+ this.hostname = hostname.replace(/\/*$/, "");
1501
+ this.fetch = (input: RequestInfo, init?: RequestInit) => fetch(input, init);
1214
1502
  }
1215
1503
 
1216
1504
  private url(name: string): string {
1217
- return this.hostname + this.path + name
1505
+ return this.hostname + this.path + name;
1218
1506
  }
1219
-
1220
- listCurrencies = (headers?: object, signal?: AbortSignal): Promise<ListCurrenciesReturn> => {
1507
+
1508
+ listCurrencies = (
1509
+ headers?: object,
1510
+ signal?: AbortSignal
1511
+ ): Promise<ListCurrenciesReturn> => {
1221
1512
  return this.fetch(
1222
- this.url('ListCurrencies'),
1513
+ this.url("ListCurrencies"),
1223
1514
  createHTTPRequest({}, headers, signal)
1224
- ).then((res) => {
1225
- return buildResponse(res).then(_data => {
1226
- return {
1227
- currencies: <Array<Currency>>(_data.currencies),
1228
- }
1229
- })
1230
- }, (error) => {
1231
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1232
- })
1233
- }
1234
-
1235
- getCollectionDetail = (args: GetCollectionDetailArgs, headers?: object, signal?: AbortSignal): Promise<GetCollectionDetailReturn> => {
1515
+ ).then(
1516
+ (res) => {
1517
+ return buildResponse(res).then((_data) => {
1518
+ return {
1519
+ currencies: <Array<Currency>>_data.currencies,
1520
+ };
1521
+ });
1522
+ },
1523
+ (error) => {
1524
+ throw WebrpcRequestFailedError.new({
1525
+ cause: `fetch(): ${error.message || ""}`,
1526
+ });
1527
+ }
1528
+ );
1529
+ };
1530
+
1531
+ getCollectionDetail = (
1532
+ args: GetCollectionDetailArgs,
1533
+ headers?: object,
1534
+ signal?: AbortSignal
1535
+ ): Promise<GetCollectionDetailReturn> => {
1236
1536
  return this.fetch(
1237
- this.url('GetCollectionDetail'),
1238
- createHTTPRequest(args, headers, signal)).then((res) => {
1239
- return buildResponse(res).then(_data => {
1240
- return {
1241
- collection: <Collection>(_data.collection),
1242
- }
1243
- })
1244
- }, (error) => {
1245
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1246
- })
1247
- }
1248
-
1249
- getCollectible = (args: GetCollectibleArgs, headers?: object, signal?: AbortSignal): Promise<GetCollectibleReturn> => {
1537
+ this.url("GetCollectionDetail"),
1538
+ createHTTPRequest(args, headers, signal)
1539
+ ).then(
1540
+ (res) => {
1541
+ return buildResponse(res).then((_data) => {
1542
+ return {
1543
+ collection: <Collection>_data.collection,
1544
+ };
1545
+ });
1546
+ },
1547
+ (error) => {
1548
+ throw WebrpcRequestFailedError.new({
1549
+ cause: `fetch(): ${error.message || ""}`,
1550
+ });
1551
+ }
1552
+ );
1553
+ };
1554
+
1555
+ getCollectible = (
1556
+ args: GetCollectibleArgs,
1557
+ headers?: object,
1558
+ signal?: AbortSignal
1559
+ ): Promise<GetCollectibleReturn> => {
1250
1560
  return this.fetch(
1251
- this.url('GetCollectible'),
1252
- createHTTPRequest(args, headers, signal)).then((res) => {
1253
- return buildResponse(res).then(_data => {
1254
- return {
1255
- metadata: <TokenMetadata>(_data.metadata),
1256
- }
1257
- })
1258
- }, (error) => {
1259
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1260
- })
1261
- }
1262
-
1263
- getLowestPriceOfferForCollectible = (args: GetLowestPriceOfferForCollectibleArgs, headers?: object, signal?: AbortSignal): Promise<GetLowestPriceOfferForCollectibleReturn> => {
1561
+ this.url("GetCollectible"),
1562
+ createHTTPRequest(args, headers, signal)
1563
+ ).then(
1564
+ (res) => {
1565
+ return buildResponse(res).then((_data) => {
1566
+ return {
1567
+ metadata: <TokenMetadata>_data.metadata,
1568
+ };
1569
+ });
1570
+ },
1571
+ (error) => {
1572
+ throw WebrpcRequestFailedError.new({
1573
+ cause: `fetch(): ${error.message || ""}`,
1574
+ });
1575
+ }
1576
+ );
1577
+ };
1578
+
1579
+ getLowestPriceOfferForCollectible = (
1580
+ args: GetLowestPriceOfferForCollectibleArgs,
1581
+ headers?: object,
1582
+ signal?: AbortSignal
1583
+ ): Promise<GetLowestPriceOfferForCollectibleReturn> => {
1264
1584
  return this.fetch(
1265
- this.url('GetLowestPriceOfferForCollectible'),
1266
- createHTTPRequest(args, headers, signal)).then((res) => {
1267
- return buildResponse(res).then(_data => {
1268
- return {
1269
- order: <Order>(_data.order),
1270
- }
1271
- })
1272
- }, (error) => {
1273
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1274
- })
1275
- }
1276
-
1277
- getHighestPriceOfferForCollectible = (args: GetHighestPriceOfferForCollectibleArgs, headers?: object, signal?: AbortSignal): Promise<GetHighestPriceOfferForCollectibleReturn> => {
1585
+ this.url("GetLowestPriceOfferForCollectible"),
1586
+ createHTTPRequest(args, headers, signal)
1587
+ ).then(
1588
+ (res) => {
1589
+ return buildResponse(res).then((_data) => {
1590
+ return {
1591
+ order: <Order>_data.order,
1592
+ };
1593
+ });
1594
+ },
1595
+ (error) => {
1596
+ throw WebrpcRequestFailedError.new({
1597
+ cause: `fetch(): ${error.message || ""}`,
1598
+ });
1599
+ }
1600
+ );
1601
+ };
1602
+
1603
+ getHighestPriceOfferForCollectible = (
1604
+ args: GetHighestPriceOfferForCollectibleArgs,
1605
+ headers?: object,
1606
+ signal?: AbortSignal
1607
+ ): Promise<GetHighestPriceOfferForCollectibleReturn> => {
1278
1608
  return this.fetch(
1279
- this.url('GetHighestPriceOfferForCollectible'),
1280
- createHTTPRequest(args, headers, signal)).then((res) => {
1281
- return buildResponse(res).then(_data => {
1282
- return {
1283
- order: <Order>(_data.order),
1284
- }
1285
- })
1286
- }, (error) => {
1287
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1288
- })
1289
- }
1290
-
1291
- getLowestPriceListingForCollectible = (args: GetLowestPriceListingForCollectibleArgs, headers?: object, signal?: AbortSignal): Promise<GetLowestPriceListingForCollectibleReturn> => {
1609
+ this.url("GetHighestPriceOfferForCollectible"),
1610
+ createHTTPRequest(args, headers, signal)
1611
+ ).then(
1612
+ (res) => {
1613
+ return buildResponse(res).then((_data) => {
1614
+ return {
1615
+ order: <Order>_data.order,
1616
+ };
1617
+ });
1618
+ },
1619
+ (error) => {
1620
+ throw WebrpcRequestFailedError.new({
1621
+ cause: `fetch(): ${error.message || ""}`,
1622
+ });
1623
+ }
1624
+ );
1625
+ };
1626
+
1627
+ getLowestPriceListingForCollectible = (
1628
+ args: GetLowestPriceListingForCollectibleArgs,
1629
+ headers?: object,
1630
+ signal?: AbortSignal
1631
+ ): Promise<GetLowestPriceListingForCollectibleReturn> => {
1292
1632
  return this.fetch(
1293
- this.url('GetLowestPriceListingForCollectible'),
1294
- createHTTPRequest(args, headers, signal)).then((res) => {
1295
- return buildResponse(res).then(_data => {
1296
- return {
1297
- order: <Order>(_data.order),
1298
- }
1299
- })
1300
- }, (error) => {
1301
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1302
- })
1303
- }
1304
-
1305
- getHighestPriceListingForCollectible = (args: GetHighestPriceListingForCollectibleArgs, headers?: object, signal?: AbortSignal): Promise<GetHighestPriceListingForCollectibleReturn> => {
1633
+ this.url("GetLowestPriceListingForCollectible"),
1634
+ createHTTPRequest(args, headers, signal)
1635
+ ).then(
1636
+ (res) => {
1637
+ return buildResponse(res).then((_data) => {
1638
+ return {
1639
+ order: <Order>_data.order,
1640
+ };
1641
+ });
1642
+ },
1643
+ (error) => {
1644
+ throw WebrpcRequestFailedError.new({
1645
+ cause: `fetch(): ${error.message || ""}`,
1646
+ });
1647
+ }
1648
+ );
1649
+ };
1650
+
1651
+ getHighestPriceListingForCollectible = (
1652
+ args: GetHighestPriceListingForCollectibleArgs,
1653
+ headers?: object,
1654
+ signal?: AbortSignal
1655
+ ): Promise<GetHighestPriceListingForCollectibleReturn> => {
1306
1656
  return this.fetch(
1307
- this.url('GetHighestPriceListingForCollectible'),
1308
- createHTTPRequest(args, headers, signal)).then((res) => {
1309
- return buildResponse(res).then(_data => {
1310
- return {
1311
- order: <Order>(_data.order),
1312
- }
1313
- })
1314
- }, (error) => {
1315
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1316
- })
1317
- }
1318
-
1319
- listListingsForCollectible = (args: ListListingsForCollectibleArgs, headers?: object, signal?: AbortSignal): Promise<ListListingsForCollectibleReturn> => {
1657
+ this.url("GetHighestPriceListingForCollectible"),
1658
+ createHTTPRequest(args, headers, signal)
1659
+ ).then(
1660
+ (res) => {
1661
+ return buildResponse(res).then((_data) => {
1662
+ return {
1663
+ order: <Order>_data.order,
1664
+ };
1665
+ });
1666
+ },
1667
+ (error) => {
1668
+ throw WebrpcRequestFailedError.new({
1669
+ cause: `fetch(): ${error.message || ""}`,
1670
+ });
1671
+ }
1672
+ );
1673
+ };
1674
+
1675
+ listListingsForCollectible = (
1676
+ args: ListListingsForCollectibleArgs,
1677
+ headers?: object,
1678
+ signal?: AbortSignal
1679
+ ): Promise<ListListingsForCollectibleReturn> => {
1320
1680
  return this.fetch(
1321
- this.url('ListListingsForCollectible'),
1322
- createHTTPRequest(args, headers, signal)).then((res) => {
1323
- return buildResponse(res).then(_data => {
1324
- return {
1325
- listings: <Array<Order>>(_data.listings),
1326
- page: <Page>(_data.page),
1327
- }
1328
- })
1329
- }, (error) => {
1330
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1331
- })
1332
- }
1333
-
1334
- listOffersForCollectible = (args: ListOffersForCollectibleArgs, headers?: object, signal?: AbortSignal): Promise<ListOffersForCollectibleReturn> => {
1681
+ this.url("ListListingsForCollectible"),
1682
+ createHTTPRequest(args, headers, signal)
1683
+ ).then(
1684
+ (res) => {
1685
+ return buildResponse(res).then((_data) => {
1686
+ return {
1687
+ listings: <Array<Order>>_data.listings,
1688
+ page: <Page>_data.page,
1689
+ };
1690
+ });
1691
+ },
1692
+ (error) => {
1693
+ throw WebrpcRequestFailedError.new({
1694
+ cause: `fetch(): ${error.message || ""}`,
1695
+ });
1696
+ }
1697
+ );
1698
+ };
1699
+
1700
+ listOffersForCollectible = (
1701
+ args: ListOffersForCollectibleArgs,
1702
+ headers?: object,
1703
+ signal?: AbortSignal
1704
+ ): Promise<ListOffersForCollectibleReturn> => {
1335
1705
  return this.fetch(
1336
- this.url('ListOffersForCollectible'),
1337
- createHTTPRequest(args, headers, signal)).then((res) => {
1338
- return buildResponse(res).then(_data => {
1339
- return {
1340
- offers: <Array<Order>>(_data.offers),
1341
- page: <Page>(_data.page),
1342
- }
1343
- })
1344
- }, (error) => {
1345
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1346
- })
1347
- }
1348
-
1349
- getCountOfListingsForCollectible = (args: GetCountOfListingsForCollectibleArgs, headers?: object, signal?: AbortSignal): Promise<GetCountOfListingsForCollectibleReturn> => {
1706
+ this.url("ListOffersForCollectible"),
1707
+ createHTTPRequest(args, headers, signal)
1708
+ ).then(
1709
+ (res) => {
1710
+ return buildResponse(res).then((_data) => {
1711
+ return {
1712
+ offers: <Array<Order>>_data.offers,
1713
+ page: <Page>_data.page,
1714
+ };
1715
+ });
1716
+ },
1717
+ (error) => {
1718
+ throw WebrpcRequestFailedError.new({
1719
+ cause: `fetch(): ${error.message || ""}`,
1720
+ });
1721
+ }
1722
+ );
1723
+ };
1724
+
1725
+ getCountOfListingsForCollectible = (
1726
+ args: GetCountOfListingsForCollectibleArgs,
1727
+ headers?: object,
1728
+ signal?: AbortSignal
1729
+ ): Promise<GetCountOfListingsForCollectibleReturn> => {
1350
1730
  return this.fetch(
1351
- this.url('GetCountOfListingsForCollectible'),
1352
- createHTTPRequest(args, headers, signal)).then((res) => {
1353
- return buildResponse(res).then(_data => {
1354
- return {
1355
- count: <number>(_data.count),
1356
- }
1357
- })
1358
- }, (error) => {
1359
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1360
- })
1361
- }
1362
-
1363
- getCountOfOffersForCollectible = (args: GetCountOfOffersForCollectibleArgs, headers?: object, signal?: AbortSignal): Promise<GetCountOfOffersForCollectibleReturn> => {
1731
+ this.url("GetCountOfListingsForCollectible"),
1732
+ createHTTPRequest(args, headers, signal)
1733
+ ).then(
1734
+ (res) => {
1735
+ return buildResponse(res).then((_data) => {
1736
+ return {
1737
+ count: <number>_data.count,
1738
+ };
1739
+ });
1740
+ },
1741
+ (error) => {
1742
+ throw WebrpcRequestFailedError.new({
1743
+ cause: `fetch(): ${error.message || ""}`,
1744
+ });
1745
+ }
1746
+ );
1747
+ };
1748
+
1749
+ getCountOfOffersForCollectible = (
1750
+ args: GetCountOfOffersForCollectibleArgs,
1751
+ headers?: object,
1752
+ signal?: AbortSignal
1753
+ ): Promise<GetCountOfOffersForCollectibleReturn> => {
1364
1754
  return this.fetch(
1365
- this.url('GetCountOfOffersForCollectible'),
1366
- createHTTPRequest(args, headers, signal)).then((res) => {
1367
- return buildResponse(res).then(_data => {
1368
- return {
1369
- count: <number>(_data.count),
1370
- }
1371
- })
1372
- }, (error) => {
1373
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1374
- })
1375
- }
1376
-
1377
- getCollectibleLowestOffer = (args: GetCollectibleLowestOfferArgs, headers?: object, signal?: AbortSignal): Promise<GetCollectibleLowestOfferReturn> => {
1755
+ this.url("GetCountOfOffersForCollectible"),
1756
+ createHTTPRequest(args, headers, signal)
1757
+ ).then(
1758
+ (res) => {
1759
+ return buildResponse(res).then((_data) => {
1760
+ return {
1761
+ count: <number>_data.count,
1762
+ };
1763
+ });
1764
+ },
1765
+ (error) => {
1766
+ throw WebrpcRequestFailedError.new({
1767
+ cause: `fetch(): ${error.message || ""}`,
1768
+ });
1769
+ }
1770
+ );
1771
+ };
1772
+
1773
+ getCollectibleLowestOffer = (
1774
+ args: GetCollectibleLowestOfferArgs,
1775
+ headers?: object,
1776
+ signal?: AbortSignal
1777
+ ): Promise<GetCollectibleLowestOfferReturn> => {
1378
1778
  return this.fetch(
1379
- this.url('GetCollectibleLowestOffer'),
1380
- createHTTPRequest(args, headers, signal)).then((res) => {
1381
- return buildResponse(res).then(_data => {
1382
- return {
1383
- order: <Order>(_data.order),
1384
- }
1385
- })
1386
- }, (error) => {
1387
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1388
- })
1389
- }
1390
-
1391
- getCollectibleHighestOffer = (args: GetCollectibleHighestOfferArgs, headers?: object, signal?: AbortSignal): Promise<GetCollectibleHighestOfferReturn> => {
1779
+ this.url("GetCollectibleLowestOffer"),
1780
+ createHTTPRequest(args, headers, signal)
1781
+ ).then(
1782
+ (res) => {
1783
+ return buildResponse(res).then((_data) => {
1784
+ return {
1785
+ order: <Order>_data.order,
1786
+ };
1787
+ });
1788
+ },
1789
+ (error) => {
1790
+ throw WebrpcRequestFailedError.new({
1791
+ cause: `fetch(): ${error.message || ""}`,
1792
+ });
1793
+ }
1794
+ );
1795
+ };
1796
+
1797
+ getCollectibleHighestOffer = (
1798
+ args: GetCollectibleHighestOfferArgs,
1799
+ headers?: object,
1800
+ signal?: AbortSignal
1801
+ ): Promise<GetCollectibleHighestOfferReturn> => {
1392
1802
  return this.fetch(
1393
- this.url('GetCollectibleHighestOffer'),
1394
- createHTTPRequest(args, headers, signal)).then((res) => {
1395
- return buildResponse(res).then(_data => {
1396
- return {
1397
- order: <Order>(_data.order),
1398
- }
1399
- })
1400
- }, (error) => {
1401
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1402
- })
1403
- }
1404
-
1405
- getCollectibleLowestListing = (args: GetCollectibleLowestListingArgs, headers?: object, signal?: AbortSignal): Promise<GetCollectibleLowestListingReturn> => {
1803
+ this.url("GetCollectibleHighestOffer"),
1804
+ createHTTPRequest(args, headers, signal)
1805
+ ).then(
1806
+ (res) => {
1807
+ return buildResponse(res).then((_data) => {
1808
+ return {
1809
+ order: <Order>_data.order,
1810
+ };
1811
+ });
1812
+ },
1813
+ (error) => {
1814
+ throw WebrpcRequestFailedError.new({
1815
+ cause: `fetch(): ${error.message || ""}`,
1816
+ });
1817
+ }
1818
+ );
1819
+ };
1820
+
1821
+ getCollectibleLowestListing = (
1822
+ args: GetCollectibleLowestListingArgs,
1823
+ headers?: object,
1824
+ signal?: AbortSignal
1825
+ ): Promise<GetCollectibleLowestListingReturn> => {
1406
1826
  return this.fetch(
1407
- this.url('GetCollectibleLowestListing'),
1408
- createHTTPRequest(args, headers, signal)).then((res) => {
1409
- return buildResponse(res).then(_data => {
1410
- return {
1411
- order: <Order>(_data.order),
1412
- }
1413
- })
1414
- }, (error) => {
1415
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1416
- })
1417
- }
1418
-
1419
- getCollectibleHighestListing = (args: GetCollectibleHighestListingArgs, headers?: object, signal?: AbortSignal): Promise<GetCollectibleHighestListingReturn> => {
1827
+ this.url("GetCollectibleLowestListing"),
1828
+ createHTTPRequest(args, headers, signal)
1829
+ ).then(
1830
+ (res) => {
1831
+ return buildResponse(res).then((_data) => {
1832
+ return {
1833
+ order: <Order>_data.order,
1834
+ };
1835
+ });
1836
+ },
1837
+ (error) => {
1838
+ throw WebrpcRequestFailedError.new({
1839
+ cause: `fetch(): ${error.message || ""}`,
1840
+ });
1841
+ }
1842
+ );
1843
+ };
1844
+
1845
+ getCollectibleHighestListing = (
1846
+ args: GetCollectibleHighestListingArgs,
1847
+ headers?: object,
1848
+ signal?: AbortSignal
1849
+ ): Promise<GetCollectibleHighestListingReturn> => {
1420
1850
  return this.fetch(
1421
- this.url('GetCollectibleHighestListing'),
1422
- createHTTPRequest(args, headers, signal)).then((res) => {
1423
- return buildResponse(res).then(_data => {
1424
- return {
1425
- order: <Order>(_data.order),
1426
- }
1427
- })
1428
- }, (error) => {
1429
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1430
- })
1431
- }
1432
-
1433
- listCollectibleListings = (args: ListCollectibleListingsArgs, headers?: object, signal?: AbortSignal): Promise<ListCollectibleListingsReturn> => {
1851
+ this.url("GetCollectibleHighestListing"),
1852
+ createHTTPRequest(args, headers, signal)
1853
+ ).then(
1854
+ (res) => {
1855
+ return buildResponse(res).then((_data) => {
1856
+ return {
1857
+ order: <Order>_data.order,
1858
+ };
1859
+ });
1860
+ },
1861
+ (error) => {
1862
+ throw WebrpcRequestFailedError.new({
1863
+ cause: `fetch(): ${error.message || ""}`,
1864
+ });
1865
+ }
1866
+ );
1867
+ };
1868
+
1869
+ listCollectibleListings = (
1870
+ args: ListCollectibleListingsArgs,
1871
+ headers?: object,
1872
+ signal?: AbortSignal
1873
+ ): Promise<ListCollectibleListingsReturn> => {
1434
1874
  return this.fetch(
1435
- this.url('ListCollectibleListings'),
1436
- createHTTPRequest(args, headers, signal)).then((res) => {
1437
- return buildResponse(res).then(_data => {
1438
- return {
1439
- listings: <Array<Order>>(_data.listings),
1440
- page: <Page>(_data.page),
1441
- }
1442
- })
1443
- }, (error) => {
1444
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1445
- })
1446
- }
1447
-
1448
- listCollectibleOffers = (args: ListCollectibleOffersArgs, headers?: object, signal?: AbortSignal): Promise<ListCollectibleOffersReturn> => {
1875
+ this.url("ListCollectibleListings"),
1876
+ createHTTPRequest(args, headers, signal)
1877
+ ).then(
1878
+ (res) => {
1879
+ return buildResponse(res).then((_data) => {
1880
+ return {
1881
+ listings: <Array<Order>>_data.listings,
1882
+ page: <Page>_data.page,
1883
+ };
1884
+ });
1885
+ },
1886
+ (error) => {
1887
+ throw WebrpcRequestFailedError.new({
1888
+ cause: `fetch(): ${error.message || ""}`,
1889
+ });
1890
+ }
1891
+ );
1892
+ };
1893
+
1894
+ listCollectibleOffers = (
1895
+ args: ListCollectibleOffersArgs,
1896
+ headers?: object,
1897
+ signal?: AbortSignal
1898
+ ): Promise<ListCollectibleOffersReturn> => {
1449
1899
  return this.fetch(
1450
- this.url('ListCollectibleOffers'),
1451
- createHTTPRequest(args, headers, signal)).then((res) => {
1452
- return buildResponse(res).then(_data => {
1453
- return {
1454
- offers: <Array<Order>>(_data.offers),
1455
- page: <Page>(_data.page),
1456
- }
1457
- })
1458
- }, (error) => {
1459
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1460
- })
1461
- }
1462
-
1463
- generateBuyTransaction = (args: GenerateBuyTransactionArgs, headers?: object, signal?: AbortSignal): Promise<GenerateBuyTransactionReturn> => {
1900
+ this.url("ListCollectibleOffers"),
1901
+ createHTTPRequest(args, headers, signal)
1902
+ ).then(
1903
+ (res) => {
1904
+ return buildResponse(res).then((_data) => {
1905
+ return {
1906
+ offers: <Array<Order>>_data.offers,
1907
+ page: <Page>_data.page,
1908
+ };
1909
+ });
1910
+ },
1911
+ (error) => {
1912
+ throw WebrpcRequestFailedError.new({
1913
+ cause: `fetch(): ${error.message || ""}`,
1914
+ });
1915
+ }
1916
+ );
1917
+ };
1918
+
1919
+ generateBuyTransaction = (
1920
+ args: GenerateBuyTransactionArgs,
1921
+ headers?: object,
1922
+ signal?: AbortSignal
1923
+ ): Promise<GenerateBuyTransactionReturn> => {
1464
1924
  return this.fetch(
1465
- this.url('GenerateBuyTransaction'),
1466
- createHTTPRequest(args, headers, signal)).then((res) => {
1467
- return buildResponse(res).then(_data => {
1468
- return {
1469
- steps: <Array<Step>>(_data.steps),
1470
- }
1471
- })
1472
- }, (error) => {
1473
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1474
- })
1475
- }
1476
-
1477
- generateSellTransaction = (args: GenerateSellTransactionArgs, headers?: object, signal?: AbortSignal): Promise<GenerateSellTransactionReturn> => {
1925
+ this.url("GenerateBuyTransaction"),
1926
+ createHTTPRequest(args, headers, signal)
1927
+ ).then(
1928
+ (res) => {
1929
+ return buildResponse(res).then((_data) => {
1930
+ return {
1931
+ steps: <Array<Step>>_data.steps,
1932
+ };
1933
+ });
1934
+ },
1935
+ (error) => {
1936
+ throw WebrpcRequestFailedError.new({
1937
+ cause: `fetch(): ${error.message || ""}`,
1938
+ });
1939
+ }
1940
+ );
1941
+ };
1942
+
1943
+ generateSellTransaction = (
1944
+ args: GenerateSellTransactionArgs,
1945
+ headers?: object,
1946
+ signal?: AbortSignal
1947
+ ): Promise<GenerateSellTransactionReturn> => {
1478
1948
  return this.fetch(
1479
- this.url('GenerateSellTransaction'),
1480
- createHTTPRequest(args, headers, signal)).then((res) => {
1481
- return buildResponse(res).then(_data => {
1482
- return {
1483
- steps: <Array<Step>>(_data.steps),
1484
- }
1485
- })
1486
- }, (error) => {
1487
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1488
- })
1489
- }
1490
-
1491
- generateListingTransaction = (args: GenerateListingTransactionArgs, headers?: object, signal?: AbortSignal): Promise<GenerateListingTransactionReturn> => {
1949
+ this.url("GenerateSellTransaction"),
1950
+ createHTTPRequest(args, headers, signal)
1951
+ ).then(
1952
+ (res) => {
1953
+ return buildResponse(res).then((_data) => {
1954
+ return {
1955
+ steps: <Array<Step>>_data.steps,
1956
+ };
1957
+ });
1958
+ },
1959
+ (error) => {
1960
+ throw WebrpcRequestFailedError.new({
1961
+ cause: `fetch(): ${error.message || ""}`,
1962
+ });
1963
+ }
1964
+ );
1965
+ };
1966
+
1967
+ generateListingTransaction = (
1968
+ args: GenerateListingTransactionArgs,
1969
+ headers?: object,
1970
+ signal?: AbortSignal
1971
+ ): Promise<GenerateListingTransactionReturn> => {
1492
1972
  return this.fetch(
1493
- this.url('GenerateListingTransaction'),
1494
- createHTTPRequest(args, headers, signal)).then((res) => {
1495
- return buildResponse(res).then(_data => {
1496
- return {
1497
- steps: <Array<Step>>(_data.steps),
1498
- }
1499
- })
1500
- }, (error) => {
1501
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1502
- })
1503
- }
1504
-
1505
- generateOfferTransaction = (args: GenerateOfferTransactionArgs, headers?: object, signal?: AbortSignal): Promise<GenerateOfferTransactionReturn> => {
1973
+ this.url("GenerateListingTransaction"),
1974
+ createHTTPRequest(args, headers, signal)
1975
+ ).then(
1976
+ (res) => {
1977
+ return buildResponse(res).then((_data) => {
1978
+ return {
1979
+ steps: <Array<Step>>_data.steps,
1980
+ };
1981
+ });
1982
+ },
1983
+ (error) => {
1984
+ throw WebrpcRequestFailedError.new({
1985
+ cause: `fetch(): ${error.message || ""}`,
1986
+ });
1987
+ }
1988
+ );
1989
+ };
1990
+
1991
+ generateOfferTransaction = (
1992
+ args: GenerateOfferTransactionArgs,
1993
+ headers?: object,
1994
+ signal?: AbortSignal
1995
+ ): Promise<GenerateOfferTransactionReturn> => {
1506
1996
  return this.fetch(
1507
- this.url('GenerateOfferTransaction'),
1508
- createHTTPRequest(args, headers, signal)).then((res) => {
1509
- return buildResponse(res).then(_data => {
1510
- return {
1511
- steps: <Array<Step>>(_data.steps),
1512
- }
1513
- })
1514
- }, (error) => {
1515
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1516
- })
1517
- }
1518
-
1519
- generateCancelTransaction = (args: GenerateCancelTransactionArgs, headers?: object, signal?: AbortSignal): Promise<GenerateCancelTransactionReturn> => {
1997
+ this.url("GenerateOfferTransaction"),
1998
+ createHTTPRequest(args, headers, signal)
1999
+ ).then(
2000
+ (res) => {
2001
+ return buildResponse(res).then((_data) => {
2002
+ return {
2003
+ steps: <Array<Step>>_data.steps,
2004
+ };
2005
+ });
2006
+ },
2007
+ (error) => {
2008
+ throw WebrpcRequestFailedError.new({
2009
+ cause: `fetch(): ${error.message || ""}`,
2010
+ });
2011
+ }
2012
+ );
2013
+ };
2014
+
2015
+ generateCancelTransaction = (
2016
+ args: GenerateCancelTransactionArgs,
2017
+ headers?: object,
2018
+ signal?: AbortSignal
2019
+ ): Promise<GenerateCancelTransactionReturn> => {
1520
2020
  return this.fetch(
1521
- this.url('GenerateCancelTransaction'),
1522
- createHTTPRequest(args, headers, signal)).then((res) => {
1523
- return buildResponse(res).then(_data => {
1524
- return {
1525
- steps: <Array<Step>>(_data.steps),
1526
- }
1527
- })
1528
- }, (error) => {
1529
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1530
- })
1531
- }
1532
-
1533
- execute = (args: ExecuteArgs, headers?: object, signal?: AbortSignal): Promise<ExecuteReturn> => {
2021
+ this.url("GenerateCancelTransaction"),
2022
+ createHTTPRequest(args, headers, signal)
2023
+ ).then(
2024
+ (res) => {
2025
+ return buildResponse(res).then((_data) => {
2026
+ return {
2027
+ steps: <Array<Step>>_data.steps,
2028
+ };
2029
+ });
2030
+ },
2031
+ (error) => {
2032
+ throw WebrpcRequestFailedError.new({
2033
+ cause: `fetch(): ${error.message || ""}`,
2034
+ });
2035
+ }
2036
+ );
2037
+ };
2038
+
2039
+ execute = (
2040
+ args: ExecuteArgs,
2041
+ headers?: object,
2042
+ signal?: AbortSignal
2043
+ ): Promise<ExecuteReturn> => {
1534
2044
  return this.fetch(
1535
- this.url('Execute'),
1536
- createHTTPRequest(args, headers, signal)).then((res) => {
1537
- return buildResponse(res).then(_data => {
1538
- return {
1539
- orderId: <string>(_data.orderId),
1540
- }
1541
- })
1542
- }, (error) => {
1543
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1544
- })
1545
- }
1546
-
1547
- listCollectibles = (args: ListCollectiblesArgs, headers?: object, signal?: AbortSignal): Promise<ListCollectiblesReturn> => {
2045
+ this.url("Execute"),
2046
+ createHTTPRequest(args, headers, signal)
2047
+ ).then(
2048
+ (res) => {
2049
+ return buildResponse(res).then((_data) => {
2050
+ return {
2051
+ orderId: <string>_data.orderId,
2052
+ };
2053
+ });
2054
+ },
2055
+ (error) => {
2056
+ throw WebrpcRequestFailedError.new({
2057
+ cause: `fetch(): ${error.message || ""}`,
2058
+ });
2059
+ }
2060
+ );
2061
+ };
2062
+
2063
+ listCollectibles = (
2064
+ args: ListCollectiblesArgs,
2065
+ headers?: object,
2066
+ signal?: AbortSignal
2067
+ ): Promise<ListCollectiblesReturn> => {
1548
2068
  return this.fetch(
1549
- this.url('ListCollectibles'),
1550
- createHTTPRequest(args, headers, signal)).then((res) => {
1551
- return buildResponse(res).then(_data => {
1552
- return {
1553
- collectibles: <Array<CollectibleOrder>>(_data.collectibles),
1554
- page: <Page>(_data.page),
1555
- }
1556
- })
1557
- }, (error) => {
1558
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1559
- })
1560
- }
1561
-
1562
- getCountOfAllCollectibles = (args: GetCountOfAllCollectiblesArgs, headers?: object, signal?: AbortSignal): Promise<GetCountOfAllCollectiblesReturn> => {
2069
+ this.url("ListCollectibles"),
2070
+ createHTTPRequest(args, headers, signal)
2071
+ ).then(
2072
+ (res) => {
2073
+ return buildResponse(res).then((_data) => {
2074
+ return {
2075
+ collectibles: <Array<CollectibleOrder>>_data.collectibles,
2076
+ page: <Page>_data.page,
2077
+ };
2078
+ });
2079
+ },
2080
+ (error) => {
2081
+ throw WebrpcRequestFailedError.new({
2082
+ cause: `fetch(): ${error.message || ""}`,
2083
+ });
2084
+ }
2085
+ );
2086
+ };
2087
+
2088
+ getCountOfAllCollectibles = (
2089
+ args: GetCountOfAllCollectiblesArgs,
2090
+ headers?: object,
2091
+ signal?: AbortSignal
2092
+ ): Promise<GetCountOfAllCollectiblesReturn> => {
1563
2093
  return this.fetch(
1564
- this.url('GetCountOfAllCollectibles'),
1565
- createHTTPRequest(args, headers, signal)).then((res) => {
1566
- return buildResponse(res).then(_data => {
1567
- return {
1568
- count: <number>(_data.count),
1569
- }
1570
- })
1571
- }, (error) => {
1572
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1573
- })
1574
- }
1575
-
1576
- getCountOfFilteredCollectibles = (args: GetCountOfFilteredCollectiblesArgs, headers?: object, signal?: AbortSignal): Promise<GetCountOfFilteredCollectiblesReturn> => {
2094
+ this.url("GetCountOfAllCollectibles"),
2095
+ createHTTPRequest(args, headers, signal)
2096
+ ).then(
2097
+ (res) => {
2098
+ return buildResponse(res).then((_data) => {
2099
+ return {
2100
+ count: <number>_data.count,
2101
+ };
2102
+ });
2103
+ },
2104
+ (error) => {
2105
+ throw WebrpcRequestFailedError.new({
2106
+ cause: `fetch(): ${error.message || ""}`,
2107
+ });
2108
+ }
2109
+ );
2110
+ };
2111
+
2112
+ getCountOfFilteredCollectibles = (
2113
+ args: GetCountOfFilteredCollectiblesArgs,
2114
+ headers?: object,
2115
+ signal?: AbortSignal
2116
+ ): Promise<GetCountOfFilteredCollectiblesReturn> => {
1577
2117
  return this.fetch(
1578
- this.url('GetCountOfFilteredCollectibles'),
1579
- createHTTPRequest(args, headers, signal)).then((res) => {
1580
- return buildResponse(res).then(_data => {
1581
- return {
1582
- count: <number>(_data.count),
1583
- }
1584
- })
1585
- }, (error) => {
1586
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1587
- })
1588
- }
1589
-
1590
- getFloorOrder = (args: GetFloorOrderArgs, headers?: object, signal?: AbortSignal): Promise<GetFloorOrderReturn> => {
2118
+ this.url("GetCountOfFilteredCollectibles"),
2119
+ createHTTPRequest(args, headers, signal)
2120
+ ).then(
2121
+ (res) => {
2122
+ return buildResponse(res).then((_data) => {
2123
+ return {
2124
+ count: <number>_data.count,
2125
+ };
2126
+ });
2127
+ },
2128
+ (error) => {
2129
+ throw WebrpcRequestFailedError.new({
2130
+ cause: `fetch(): ${error.message || ""}`,
2131
+ });
2132
+ }
2133
+ );
2134
+ };
2135
+
2136
+ getFloorOrder = (
2137
+ args: GetFloorOrderArgs,
2138
+ headers?: object,
2139
+ signal?: AbortSignal
2140
+ ): Promise<GetFloorOrderReturn> => {
1591
2141
  return this.fetch(
1592
- this.url('GetFloorOrder'),
1593
- createHTTPRequest(args, headers, signal)).then((res) => {
1594
- return buildResponse(res).then(_data => {
1595
- return {
1596
- collectible: <CollectibleOrder>(_data.collectible),
1597
- }
1598
- })
1599
- }, (error) => {
1600
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1601
- })
1602
- }
1603
-
1604
- listCollectionActivities = (args: ListCollectionActivitiesArgs, headers?: object, signal?: AbortSignal): Promise<ListCollectionActivitiesReturn> => {
2142
+ this.url("GetFloorOrder"),
2143
+ createHTTPRequest(args, headers, signal)
2144
+ ).then(
2145
+ (res) => {
2146
+ return buildResponse(res).then((_data) => {
2147
+ return {
2148
+ collectible: <CollectibleOrder>_data.collectible,
2149
+ };
2150
+ });
2151
+ },
2152
+ (error) => {
2153
+ throw WebrpcRequestFailedError.new({
2154
+ cause: `fetch(): ${error.message || ""}`,
2155
+ });
2156
+ }
2157
+ );
2158
+ };
2159
+
2160
+ listCollectionActivities = (
2161
+ args: ListCollectionActivitiesArgs,
2162
+ headers?: object,
2163
+ signal?: AbortSignal
2164
+ ): Promise<ListCollectionActivitiesReturn> => {
1605
2165
  return this.fetch(
1606
- this.url('ListCollectionActivities'),
1607
- createHTTPRequest(args, headers, signal)).then((res) => {
1608
- return buildResponse(res).then(_data => {
1609
- return {
1610
- activities: <Array<Activity>>(_data.activities),
1611
- page: <Page>(_data.page),
1612
- }
1613
- })
1614
- }, (error) => {
1615
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1616
- })
1617
- }
1618
-
1619
- listCollectibleActivities = (args: ListCollectibleActivitiesArgs, headers?: object, signal?: AbortSignal): Promise<ListCollectibleActivitiesReturn> => {
2166
+ this.url("ListCollectionActivities"),
2167
+ createHTTPRequest(args, headers, signal)
2168
+ ).then(
2169
+ (res) => {
2170
+ return buildResponse(res).then((_data) => {
2171
+ return {
2172
+ activities: <Array<Activity>>_data.activities,
2173
+ page: <Page>_data.page,
2174
+ };
2175
+ });
2176
+ },
2177
+ (error) => {
2178
+ throw WebrpcRequestFailedError.new({
2179
+ cause: `fetch(): ${error.message || ""}`,
2180
+ });
2181
+ }
2182
+ );
2183
+ };
2184
+
2185
+ listCollectibleActivities = (
2186
+ args: ListCollectibleActivitiesArgs,
2187
+ headers?: object,
2188
+ signal?: AbortSignal
2189
+ ): Promise<ListCollectibleActivitiesReturn> => {
1620
2190
  return this.fetch(
1621
- this.url('ListCollectibleActivities'),
1622
- createHTTPRequest(args, headers, signal)).then((res) => {
1623
- return buildResponse(res).then(_data => {
1624
- return {
1625
- activities: <Array<Activity>>(_data.activities),
1626
- page: <Page>(_data.page),
1627
- }
1628
- })
1629
- }, (error) => {
1630
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1631
- })
1632
- }
1633
-
1634
- listCollectiblesWithLowestListing = (args: ListCollectiblesWithLowestListingArgs, headers?: object, signal?: AbortSignal): Promise<ListCollectiblesWithLowestListingReturn> => {
2191
+ this.url("ListCollectibleActivities"),
2192
+ createHTTPRequest(args, headers, signal)
2193
+ ).then(
2194
+ (res) => {
2195
+ return buildResponse(res).then((_data) => {
2196
+ return {
2197
+ activities: <Array<Activity>>_data.activities,
2198
+ page: <Page>_data.page,
2199
+ };
2200
+ });
2201
+ },
2202
+ (error) => {
2203
+ throw WebrpcRequestFailedError.new({
2204
+ cause: `fetch(): ${error.message || ""}`,
2205
+ });
2206
+ }
2207
+ );
2208
+ };
2209
+
2210
+ listCollectiblesWithLowestListing = (
2211
+ args: ListCollectiblesWithLowestListingArgs,
2212
+ headers?: object,
2213
+ signal?: AbortSignal
2214
+ ): Promise<ListCollectiblesWithLowestListingReturn> => {
1635
2215
  return this.fetch(
1636
- this.url('ListCollectiblesWithLowestListing'),
1637
- createHTTPRequest(args, headers, signal)).then((res) => {
1638
- return buildResponse(res).then(_data => {
1639
- return {
1640
- collectibles: <Array<CollectibleOrder>>(_data.collectibles),
1641
- page: <Page>(_data.page),
1642
- }
1643
- })
1644
- }, (error) => {
1645
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1646
- })
1647
- }
1648
-
1649
- listCollectiblesWithHighestOffer = (args: ListCollectiblesWithHighestOfferArgs, headers?: object, signal?: AbortSignal): Promise<ListCollectiblesWithHighestOfferReturn> => {
2216
+ this.url("ListCollectiblesWithLowestListing"),
2217
+ createHTTPRequest(args, headers, signal)
2218
+ ).then(
2219
+ (res) => {
2220
+ return buildResponse(res).then((_data) => {
2221
+ return {
2222
+ collectibles: <Array<CollectibleOrder>>_data.collectibles,
2223
+ page: <Page>_data.page,
2224
+ };
2225
+ });
2226
+ },
2227
+ (error) => {
2228
+ throw WebrpcRequestFailedError.new({
2229
+ cause: `fetch(): ${error.message || ""}`,
2230
+ });
2231
+ }
2232
+ );
2233
+ };
2234
+
2235
+ listCollectiblesWithHighestOffer = (
2236
+ args: ListCollectiblesWithHighestOfferArgs,
2237
+ headers?: object,
2238
+ signal?: AbortSignal
2239
+ ): Promise<ListCollectiblesWithHighestOfferReturn> => {
1650
2240
  return this.fetch(
1651
- this.url('ListCollectiblesWithHighestOffer'),
1652
- createHTTPRequest(args, headers, signal)).then((res) => {
1653
- return buildResponse(res).then(_data => {
1654
- return {
1655
- collectibles: <Array<CollectibleOrder>>(_data.collectibles),
1656
- page: <Page>(_data.page),
1657
- }
1658
- })
1659
- }, (error) => {
1660
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1661
- })
1662
- }
1663
-
1664
- syncOrder = (args: SyncOrderArgs, headers?: object, signal?: AbortSignal): Promise<SyncOrderReturn> => {
2241
+ this.url("ListCollectiblesWithHighestOffer"),
2242
+ createHTTPRequest(args, headers, signal)
2243
+ ).then(
2244
+ (res) => {
2245
+ return buildResponse(res).then((_data) => {
2246
+ return {
2247
+ collectibles: <Array<CollectibleOrder>>_data.collectibles,
2248
+ page: <Page>_data.page,
2249
+ };
2250
+ });
2251
+ },
2252
+ (error) => {
2253
+ throw WebrpcRequestFailedError.new({
2254
+ cause: `fetch(): ${error.message || ""}`,
2255
+ });
2256
+ }
2257
+ );
2258
+ };
2259
+
2260
+ syncOrder = (
2261
+ args: SyncOrderArgs,
2262
+ headers?: object,
2263
+ signal?: AbortSignal
2264
+ ): Promise<SyncOrderReturn> => {
1665
2265
  return this.fetch(
1666
- this.url('SyncOrder'),
1667
- createHTTPRequest(args, headers, signal)).then((res) => {
1668
- return buildResponse(res).then(_data => {
1669
- return {}
1670
- })
1671
- }, (error) => {
1672
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1673
- })
1674
- }
1675
-
1676
- syncOrders = (args: SyncOrdersArgs, headers?: object, signal?: AbortSignal): Promise<SyncOrdersReturn> => {
2266
+ this.url("SyncOrder"),
2267
+ createHTTPRequest(args, headers, signal)
2268
+ ).then(
2269
+ (res) => {
2270
+ return buildResponse(res).then((_data) => {
2271
+ return {};
2272
+ });
2273
+ },
2274
+ (error) => {
2275
+ throw WebrpcRequestFailedError.new({
2276
+ cause: `fetch(): ${error.message || ""}`,
2277
+ });
2278
+ }
2279
+ );
2280
+ };
2281
+
2282
+ syncOrders = (
2283
+ args: SyncOrdersArgs,
2284
+ headers?: object,
2285
+ signal?: AbortSignal
2286
+ ): Promise<SyncOrdersReturn> => {
1677
2287
  return this.fetch(
1678
- this.url('SyncOrders'),
1679
- createHTTPRequest(args, headers, signal)).then((res) => {
1680
- return buildResponse(res).then(_data => {
1681
- return {}
1682
- })
1683
- }, (error) => {
1684
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1685
- })
1686
- }
1687
-
1688
- getOrders = (args: GetOrdersArgs, headers?: object, signal?: AbortSignal): Promise<GetOrdersReturn> => {
2288
+ this.url("SyncOrders"),
2289
+ createHTTPRequest(args, headers, signal)
2290
+ ).then(
2291
+ (res) => {
2292
+ return buildResponse(res).then((_data) => {
2293
+ return {};
2294
+ });
2295
+ },
2296
+ (error) => {
2297
+ throw WebrpcRequestFailedError.new({
2298
+ cause: `fetch(): ${error.message || ""}`,
2299
+ });
2300
+ }
2301
+ );
2302
+ };
2303
+
2304
+ getOrders = (
2305
+ args: GetOrdersArgs,
2306
+ headers?: object,
2307
+ signal?: AbortSignal
2308
+ ): Promise<GetOrdersReturn> => {
1689
2309
  return this.fetch(
1690
- this.url('GetOrders'),
1691
- createHTTPRequest(args, headers, signal)).then((res) => {
1692
- return buildResponse(res).then(_data => {
1693
- return {
1694
- orders: <Array<Order>>(_data.orders),
1695
- page: <Page>(_data.page),
1696
- }
1697
- })
1698
- }, (error) => {
1699
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1700
- })
1701
- }
1702
-
1703
- checkoutOptionsMarketplace = (args: CheckoutOptionsMarketplaceArgs, headers?: object, signal?: AbortSignal): Promise<CheckoutOptionsMarketplaceReturn> => {
2310
+ this.url("GetOrders"),
2311
+ createHTTPRequest(args, headers, signal)
2312
+ ).then(
2313
+ (res) => {
2314
+ return buildResponse(res).then((_data) => {
2315
+ return {
2316
+ orders: <Array<Order>>_data.orders,
2317
+ page: <Page>_data.page,
2318
+ };
2319
+ });
2320
+ },
2321
+ (error) => {
2322
+ throw WebrpcRequestFailedError.new({
2323
+ cause: `fetch(): ${error.message || ""}`,
2324
+ });
2325
+ }
2326
+ );
2327
+ };
2328
+
2329
+ checkoutOptionsMarketplace = (
2330
+ args: CheckoutOptionsMarketplaceArgs,
2331
+ headers?: object,
2332
+ signal?: AbortSignal
2333
+ ): Promise<CheckoutOptionsMarketplaceReturn> => {
1704
2334
  return this.fetch(
1705
- this.url('CheckoutOptionsMarketplace'),
1706
- createHTTPRequest(args, headers, signal)).then((res) => {
1707
- return buildResponse(res).then(_data => {
1708
- return {
1709
- options: <CheckoutOptions>(_data.options),
1710
- }
1711
- })
1712
- }, (error) => {
1713
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1714
- })
1715
- }
1716
-
1717
- checkoutOptionsSalesContract = (args: CheckoutOptionsSalesContractArgs, headers?: object, signal?: AbortSignal): Promise<CheckoutOptionsSalesContractReturn> => {
2335
+ this.url("CheckoutOptionsMarketplace"),
2336
+ createHTTPRequest(args, headers, signal)
2337
+ ).then(
2338
+ (res) => {
2339
+ return buildResponse(res).then((_data) => {
2340
+ return {
2341
+ options: <CheckoutOptions>_data.options,
2342
+ };
2343
+ });
2344
+ },
2345
+ (error) => {
2346
+ throw WebrpcRequestFailedError.new({
2347
+ cause: `fetch(): ${error.message || ""}`,
2348
+ });
2349
+ }
2350
+ );
2351
+ };
2352
+
2353
+ checkoutOptionsSalesContract = (
2354
+ args: CheckoutOptionsSalesContractArgs,
2355
+ headers?: object,
2356
+ signal?: AbortSignal
2357
+ ): Promise<CheckoutOptionsSalesContractReturn> => {
1718
2358
  return this.fetch(
1719
- this.url('CheckoutOptionsSalesContract'),
1720
- createHTTPRequest(args, headers, signal)).then((res) => {
1721
- return buildResponse(res).then(_data => {
1722
- return {
1723
- options: <CheckoutOptions>(_data.options),
1724
- }
1725
- })
1726
- }, (error) => {
1727
- throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })
1728
- })
1729
- }
1730
-
2359
+ this.url("CheckoutOptionsSalesContract"),
2360
+ createHTTPRequest(args, headers, signal)
2361
+ ).then(
2362
+ (res) => {
2363
+ return buildResponse(res).then((_data) => {
2364
+ return {
2365
+ options: <CheckoutOptions>_data.options,
2366
+ };
2367
+ });
2368
+ },
2369
+ (error) => {
2370
+ throw WebrpcRequestFailedError.new({
2371
+ cause: `fetch(): ${error.message || ""}`,
2372
+ });
2373
+ }
2374
+ );
2375
+ };
1731
2376
  }
1732
2377
 
1733
- const createHTTPRequest = (body: object = {}, headers: object = {}, signal: AbortSignal | null = null): object => {
1734
- const reqHeaders: {[key: string]: string} = { ...headers, 'Content-Type': 'application/json' }
1735
- reqHeaders[WebrpcHeader] = WebrpcHeaderValue
2378
+ const createHTTPRequest = (
2379
+ body: object = {},
2380
+ headers: object = {},
2381
+ signal: AbortSignal | null = null
2382
+ ): object => {
2383
+ const reqHeaders: { [key: string]: string } = {
2384
+ ...headers,
2385
+ "Content-Type": "application/json",
2386
+ };
2387
+ reqHeaders[WebrpcHeader] = WebrpcHeaderValue;
1736
2388
 
1737
2389
  return {
1738
- method: 'POST',
2390
+ method: "POST",
1739
2391
  headers: reqHeaders,
1740
2392
  body: JSON.stringify(body || {}),
1741
- signal
1742
- }
1743
- }
2393
+ signal,
2394
+ };
2395
+ };
1744
2396
 
1745
2397
  const buildResponse = (res: Response): Promise<any> => {
1746
- return res.text().then(text => {
1747
- let data
2398
+ return res.text().then((text) => {
2399
+ let data;
1748
2400
  try {
1749
- data = JSON.parse(text)
1750
- } catch(error) {
1751
- let message = ''
1752
- if (error instanceof Error) {
1753
- message = error.message
2401
+ data = JSON.parse(text);
2402
+ } catch (error) {
2403
+ let message = "";
2404
+ if (error instanceof Error) {
2405
+ message = error.message;
1754
2406
  }
1755
2407
  throw WebrpcBadResponseError.new({
1756
2408
  status: res.status,
1757
- cause: `JSON.parse(): ${message}: response text: ${text}`},
1758
- )
2409
+ cause: `JSON.parse(): ${message}: response text: ${text}`,
2410
+ });
1759
2411
  }
1760
2412
  if (!res.ok) {
1761
- const code: number = (typeof data.code === 'number') ? data.code : 0
1762
- throw (webrpcErrorByCode[code] || WebrpcError).new(data)
2413
+ const code: number = typeof data.code === "number" ? data.code : 0;
2414
+ throw (webrpcErrorByCode[code] || WebrpcError).new(data);
1763
2415
  }
1764
- return data
1765
- })
1766
- }
2416
+ return data;
2417
+ });
2418
+ };
1767
2419
 
1768
2420
  //
1769
2421
  // Errors
1770
2422
  //
1771
2423
 
1772
2424
  export class WebrpcError extends Error {
1773
- name: string
1774
- code: number
1775
- message: string
1776
- status: number
1777
- cause?: string
2425
+ name: string;
2426
+ code: number;
2427
+ message: string;
2428
+ status: number;
2429
+ cause?: string;
1778
2430
 
1779
2431
  /** @deprecated Use message instead of msg. Deprecated in webrpc v0.11.0. */
1780
- msg: string
1781
-
1782
- constructor(name: string, code: number, message: string, status: number, cause?: string) {
1783
- super(message)
1784
- this.name = name || 'WebrpcError'
1785
- this.code = typeof code === 'number' ? code : 0
1786
- this.message = message || `endpoint error ${this.code}`
1787
- this.msg = this.message
1788
- this.status = typeof status === 'number' ? status : 0
1789
- this.cause = cause
1790
- Object.setPrototypeOf(this, WebrpcError.prototype)
2432
+ msg: string;
2433
+
2434
+ constructor(
2435
+ name: string,
2436
+ code: number,
2437
+ message: string,
2438
+ status: number,
2439
+ cause?: string
2440
+ ) {
2441
+ super(message);
2442
+ this.name = name || "WebrpcError";
2443
+ this.code = typeof code === "number" ? code : 0;
2444
+ this.message = message || `endpoint error ${this.code}`;
2445
+ this.msg = this.message;
2446
+ this.status = typeof status === "number" ? status : 0;
2447
+ this.cause = cause;
2448
+ Object.setPrototypeOf(this, WebrpcError.prototype);
1791
2449
  }
1792
2450
 
1793
2451
  static new(payload: any): WebrpcError {
1794
- return new this(payload.error, payload.code, payload.message || payload.msg, payload.status, payload.cause)
2452
+ return new this(
2453
+ payload.error,
2454
+ payload.code,
2455
+ payload.message || payload.msg,
2456
+ payload.status,
2457
+ payload.cause
2458
+ );
1795
2459
  }
1796
2460
  }
1797
2461
 
@@ -1799,331 +2463,329 @@ export class WebrpcError extends Error {
1799
2463
 
1800
2464
  export class WebrpcEndpointError extends WebrpcError {
1801
2465
  constructor(
1802
- name: string = 'WebrpcEndpoint',
2466
+ name: string = "WebrpcEndpoint",
1803
2467
  code: number = 0,
1804
2468
  message: string = `endpoint error`,
1805
2469
  status: number = 0,
1806
2470
  cause?: string
1807
2471
  ) {
1808
- super(name, code, message, status, cause)
1809
- Object.setPrototypeOf(this, WebrpcEndpointError.prototype)
2472
+ super(name, code, message, status, cause);
2473
+ Object.setPrototypeOf(this, WebrpcEndpointError.prototype);
1810
2474
  }
1811
2475
  }
1812
2476
 
1813
2477
  export class WebrpcRequestFailedError extends WebrpcError {
1814
2478
  constructor(
1815
- name: string = 'WebrpcRequestFailed',
2479
+ name: string = "WebrpcRequestFailed",
1816
2480
  code: number = -1,
1817
2481
  message: string = `request failed`,
1818
2482
  status: number = 0,
1819
2483
  cause?: string
1820
2484
  ) {
1821
- super(name, code, message, status, cause)
1822
- Object.setPrototypeOf(this, WebrpcRequestFailedError.prototype)
2485
+ super(name, code, message, status, cause);
2486
+ Object.setPrototypeOf(this, WebrpcRequestFailedError.prototype);
1823
2487
  }
1824
2488
  }
1825
2489
 
1826
2490
  export class WebrpcBadRouteError extends WebrpcError {
1827
2491
  constructor(
1828
- name: string = 'WebrpcBadRoute',
2492
+ name: string = "WebrpcBadRoute",
1829
2493
  code: number = -2,
1830
2494
  message: string = `bad route`,
1831
2495
  status: number = 0,
1832
2496
  cause?: string
1833
2497
  ) {
1834
- super(name, code, message, status, cause)
1835
- Object.setPrototypeOf(this, WebrpcBadRouteError.prototype)
2498
+ super(name, code, message, status, cause);
2499
+ Object.setPrototypeOf(this, WebrpcBadRouteError.prototype);
1836
2500
  }
1837
2501
  }
1838
2502
 
1839
2503
  export class WebrpcBadMethodError extends WebrpcError {
1840
2504
  constructor(
1841
- name: string = 'WebrpcBadMethod',
2505
+ name: string = "WebrpcBadMethod",
1842
2506
  code: number = -3,
1843
2507
  message: string = `bad method`,
1844
2508
  status: number = 0,
1845
2509
  cause?: string
1846
2510
  ) {
1847
- super(name, code, message, status, cause)
1848
- Object.setPrototypeOf(this, WebrpcBadMethodError.prototype)
2511
+ super(name, code, message, status, cause);
2512
+ Object.setPrototypeOf(this, WebrpcBadMethodError.prototype);
1849
2513
  }
1850
2514
  }
1851
2515
 
1852
2516
  export class WebrpcBadRequestError extends WebrpcError {
1853
2517
  constructor(
1854
- name: string = 'WebrpcBadRequest',
2518
+ name: string = "WebrpcBadRequest",
1855
2519
  code: number = -4,
1856
2520
  message: string = `bad request`,
1857
2521
  status: number = 0,
1858
2522
  cause?: string
1859
2523
  ) {
1860
- super(name, code, message, status, cause)
1861
- Object.setPrototypeOf(this, WebrpcBadRequestError.prototype)
2524
+ super(name, code, message, status, cause);
2525
+ Object.setPrototypeOf(this, WebrpcBadRequestError.prototype);
1862
2526
  }
1863
2527
  }
1864
2528
 
1865
2529
  export class WebrpcBadResponseError extends WebrpcError {
1866
2530
  constructor(
1867
- name: string = 'WebrpcBadResponse',
2531
+ name: string = "WebrpcBadResponse",
1868
2532
  code: number = -5,
1869
2533
  message: string = `bad response`,
1870
2534
  status: number = 0,
1871
2535
  cause?: string
1872
2536
  ) {
1873
- super(name, code, message, status, cause)
1874
- Object.setPrototypeOf(this, WebrpcBadResponseError.prototype)
2537
+ super(name, code, message, status, cause);
2538
+ Object.setPrototypeOf(this, WebrpcBadResponseError.prototype);
1875
2539
  }
1876
2540
  }
1877
2541
 
1878
2542
  export class WebrpcServerPanicError extends WebrpcError {
1879
2543
  constructor(
1880
- name: string = 'WebrpcServerPanic',
2544
+ name: string = "WebrpcServerPanic",
1881
2545
  code: number = -6,
1882
2546
  message: string = `server panic`,
1883
2547
  status: number = 0,
1884
2548
  cause?: string
1885
2549
  ) {
1886
- super(name, code, message, status, cause)
1887
- Object.setPrototypeOf(this, WebrpcServerPanicError.prototype)
2550
+ super(name, code, message, status, cause);
2551
+ Object.setPrototypeOf(this, WebrpcServerPanicError.prototype);
1888
2552
  }
1889
2553
  }
1890
2554
 
1891
2555
  export class WebrpcInternalErrorError extends WebrpcError {
1892
2556
  constructor(
1893
- name: string = 'WebrpcInternalError',
2557
+ name: string = "WebrpcInternalError",
1894
2558
  code: number = -7,
1895
2559
  message: string = `internal error`,
1896
2560
  status: number = 0,
1897
2561
  cause?: string
1898
2562
  ) {
1899
- super(name, code, message, status, cause)
1900
- Object.setPrototypeOf(this, WebrpcInternalErrorError.prototype)
2563
+ super(name, code, message, status, cause);
2564
+ Object.setPrototypeOf(this, WebrpcInternalErrorError.prototype);
1901
2565
  }
1902
2566
  }
1903
2567
 
1904
2568
  export class WebrpcClientDisconnectedError extends WebrpcError {
1905
2569
  constructor(
1906
- name: string = 'WebrpcClientDisconnected',
2570
+ name: string = "WebrpcClientDisconnected",
1907
2571
  code: number = -8,
1908
2572
  message: string = `client disconnected`,
1909
2573
  status: number = 0,
1910
2574
  cause?: string
1911
2575
  ) {
1912
- super(name, code, message, status, cause)
1913
- Object.setPrototypeOf(this, WebrpcClientDisconnectedError.prototype)
2576
+ super(name, code, message, status, cause);
2577
+ Object.setPrototypeOf(this, WebrpcClientDisconnectedError.prototype);
1914
2578
  }
1915
2579
  }
1916
2580
 
1917
2581
  export class WebrpcStreamLostError extends WebrpcError {
1918
2582
  constructor(
1919
- name: string = 'WebrpcStreamLost',
2583
+ name: string = "WebrpcStreamLost",
1920
2584
  code: number = -9,
1921
2585
  message: string = `stream lost`,
1922
2586
  status: number = 0,
1923
2587
  cause?: string
1924
2588
  ) {
1925
- super(name, code, message, status, cause)
1926
- Object.setPrototypeOf(this, WebrpcStreamLostError.prototype)
2589
+ super(name, code, message, status, cause);
2590
+ Object.setPrototypeOf(this, WebrpcStreamLostError.prototype);
1927
2591
  }
1928
2592
  }
1929
2593
 
1930
2594
  export class WebrpcStreamFinishedError extends WebrpcError {
1931
2595
  constructor(
1932
- name: string = 'WebrpcStreamFinished',
2596
+ name: string = "WebrpcStreamFinished",
1933
2597
  code: number = -10,
1934
2598
  message: string = `stream finished`,
1935
2599
  status: number = 0,
1936
2600
  cause?: string
1937
2601
  ) {
1938
- super(name, code, message, status, cause)
1939
- Object.setPrototypeOf(this, WebrpcStreamFinishedError.prototype)
2602
+ super(name, code, message, status, cause);
2603
+ Object.setPrototypeOf(this, WebrpcStreamFinishedError.prototype);
1940
2604
  }
1941
2605
  }
1942
2606
 
1943
-
1944
2607
  // Schema errors
1945
2608
 
1946
2609
  export class UnauthorizedError extends WebrpcError {
1947
2610
  constructor(
1948
- name: string = 'Unauthorized',
2611
+ name: string = "Unauthorized",
1949
2612
  code: number = 1000,
1950
2613
  message: string = `Unauthorized access`,
1951
2614
  status: number = 0,
1952
2615
  cause?: string
1953
2616
  ) {
1954
- super(name, code, message, status, cause)
1955
- Object.setPrototypeOf(this, UnauthorizedError.prototype)
2617
+ super(name, code, message, status, cause);
2618
+ Object.setPrototypeOf(this, UnauthorizedError.prototype);
1956
2619
  }
1957
2620
  }
1958
2621
 
1959
2622
  export class PermissionDeniedError extends WebrpcError {
1960
2623
  constructor(
1961
- name: string = 'PermissionDenied',
2624
+ name: string = "PermissionDenied",
1962
2625
  code: number = 1001,
1963
2626
  message: string = `Permission denied`,
1964
2627
  status: number = 0,
1965
2628
  cause?: string
1966
2629
  ) {
1967
- super(name, code, message, status, cause)
1968
- Object.setPrototypeOf(this, PermissionDeniedError.prototype)
2630
+ super(name, code, message, status, cause);
2631
+ Object.setPrototypeOf(this, PermissionDeniedError.prototype);
1969
2632
  }
1970
2633
  }
1971
2634
 
1972
2635
  export class SessionExpiredError extends WebrpcError {
1973
2636
  constructor(
1974
- name: string = 'SessionExpired',
2637
+ name: string = "SessionExpired",
1975
2638
  code: number = 1002,
1976
2639
  message: string = `Session expired`,
1977
2640
  status: number = 0,
1978
2641
  cause?: string
1979
2642
  ) {
1980
- super(name, code, message, status, cause)
1981
- Object.setPrototypeOf(this, SessionExpiredError.prototype)
2643
+ super(name, code, message, status, cause);
2644
+ Object.setPrototypeOf(this, SessionExpiredError.prototype);
1982
2645
  }
1983
2646
  }
1984
2647
 
1985
2648
  export class MethodNotFoundError extends WebrpcError {
1986
2649
  constructor(
1987
- name: string = 'MethodNotFound',
2650
+ name: string = "MethodNotFound",
1988
2651
  code: number = 1003,
1989
2652
  message: string = `Method not found`,
1990
2653
  status: number = 0,
1991
2654
  cause?: string
1992
2655
  ) {
1993
- super(name, code, message, status, cause)
1994
- Object.setPrototypeOf(this, MethodNotFoundError.prototype)
2656
+ super(name, code, message, status, cause);
2657
+ Object.setPrototypeOf(this, MethodNotFoundError.prototype);
1995
2658
  }
1996
2659
  }
1997
2660
 
1998
2661
  export class TimeoutError extends WebrpcError {
1999
2662
  constructor(
2000
- name: string = 'Timeout',
2663
+ name: string = "Timeout",
2001
2664
  code: number = 2000,
2002
2665
  message: string = `Request timed out`,
2003
2666
  status: number = 0,
2004
2667
  cause?: string
2005
2668
  ) {
2006
- super(name, code, message, status, cause)
2007
- Object.setPrototypeOf(this, TimeoutError.prototype)
2669
+ super(name, code, message, status, cause);
2670
+ Object.setPrototypeOf(this, TimeoutError.prototype);
2008
2671
  }
2009
2672
  }
2010
2673
 
2011
2674
  export class InvalidArgumentError extends WebrpcError {
2012
2675
  constructor(
2013
- name: string = 'InvalidArgument',
2676
+ name: string = "InvalidArgument",
2014
2677
  code: number = 2001,
2015
2678
  message: string = `Invalid argument`,
2016
2679
  status: number = 0,
2017
2680
  cause?: string
2018
2681
  ) {
2019
- super(name, code, message, status, cause)
2020
- Object.setPrototypeOf(this, InvalidArgumentError.prototype)
2682
+ super(name, code, message, status, cause);
2683
+ Object.setPrototypeOf(this, InvalidArgumentError.prototype);
2021
2684
  }
2022
2685
  }
2023
2686
 
2024
2687
  export class NotFoundError extends WebrpcError {
2025
2688
  constructor(
2026
- name: string = 'NotFound',
2689
+ name: string = "NotFound",
2027
2690
  code: number = 3000,
2028
2691
  message: string = `Resource not found`,
2029
2692
  status: number = 0,
2030
2693
  cause?: string
2031
2694
  ) {
2032
- super(name, code, message, status, cause)
2033
- Object.setPrototypeOf(this, NotFoundError.prototype)
2695
+ super(name, code, message, status, cause);
2696
+ Object.setPrototypeOf(this, NotFoundError.prototype);
2034
2697
  }
2035
2698
  }
2036
2699
 
2037
2700
  export class UserNotFoundError extends WebrpcError {
2038
2701
  constructor(
2039
- name: string = 'UserNotFound',
2702
+ name: string = "UserNotFound",
2040
2703
  code: number = 3001,
2041
2704
  message: string = `User not found`,
2042
2705
  status: number = 0,
2043
2706
  cause?: string
2044
2707
  ) {
2045
- super(name, code, message, status, cause)
2046
- Object.setPrototypeOf(this, UserNotFoundError.prototype)
2708
+ super(name, code, message, status, cause);
2709
+ Object.setPrototypeOf(this, UserNotFoundError.prototype);
2047
2710
  }
2048
2711
  }
2049
2712
 
2050
2713
  export class ProjectNotFoundError extends WebrpcError {
2051
2714
  constructor(
2052
- name: string = 'ProjectNotFound',
2715
+ name: string = "ProjectNotFound",
2053
2716
  code: number = 3002,
2054
2717
  message: string = `Project not found`,
2055
2718
  status: number = 0,
2056
2719
  cause?: string
2057
2720
  ) {
2058
- super(name, code, message, status, cause)
2059
- Object.setPrototypeOf(this, ProjectNotFoundError.prototype)
2721
+ super(name, code, message, status, cause);
2722
+ Object.setPrototypeOf(this, ProjectNotFoundError.prototype);
2060
2723
  }
2061
2724
  }
2062
2725
 
2063
2726
  export class InvalidTierError extends WebrpcError {
2064
2727
  constructor(
2065
- name: string = 'InvalidTier',
2728
+ name: string = "InvalidTier",
2066
2729
  code: number = 3003,
2067
2730
  message: string = `Invalid subscription tier`,
2068
2731
  status: number = 0,
2069
2732
  cause?: string
2070
2733
  ) {
2071
- super(name, code, message, status, cause)
2072
- Object.setPrototypeOf(this, InvalidTierError.prototype)
2734
+ super(name, code, message, status, cause);
2735
+ Object.setPrototypeOf(this, InvalidTierError.prototype);
2073
2736
  }
2074
2737
  }
2075
2738
 
2076
2739
  export class ProjectLimitReachedError extends WebrpcError {
2077
2740
  constructor(
2078
- name: string = 'ProjectLimitReached',
2741
+ name: string = "ProjectLimitReached",
2079
2742
  code: number = 3005,
2080
2743
  message: string = `Project limit reached`,
2081
2744
  status: number = 0,
2082
2745
  cause?: string
2083
2746
  ) {
2084
- super(name, code, message, status, cause)
2085
- Object.setPrototypeOf(this, ProjectLimitReachedError.prototype)
2747
+ super(name, code, message, status, cause);
2748
+ Object.setPrototypeOf(this, ProjectLimitReachedError.prototype);
2086
2749
  }
2087
2750
  }
2088
2751
 
2089
2752
  export class NotImplementedError extends WebrpcError {
2090
2753
  constructor(
2091
- name: string = 'NotImplemented',
2754
+ name: string = "NotImplemented",
2092
2755
  code: number = 9999,
2093
2756
  message: string = `Not Implemented`,
2094
2757
  status: number = 0,
2095
2758
  cause?: string
2096
2759
  ) {
2097
- super(name, code, message, status, cause)
2098
- Object.setPrototypeOf(this, NotImplementedError.prototype)
2760
+ super(name, code, message, status, cause);
2761
+ Object.setPrototypeOf(this, NotImplementedError.prototype);
2099
2762
  }
2100
2763
  }
2101
2764
 
2102
-
2103
2765
  export enum errors {
2104
- WebrpcEndpoint = 'WebrpcEndpoint',
2105
- WebrpcRequestFailed = 'WebrpcRequestFailed',
2106
- WebrpcBadRoute = 'WebrpcBadRoute',
2107
- WebrpcBadMethod = 'WebrpcBadMethod',
2108
- WebrpcBadRequest = 'WebrpcBadRequest',
2109
- WebrpcBadResponse = 'WebrpcBadResponse',
2110
- WebrpcServerPanic = 'WebrpcServerPanic',
2111
- WebrpcInternalError = 'WebrpcInternalError',
2112
- WebrpcClientDisconnected = 'WebrpcClientDisconnected',
2113
- WebrpcStreamLost = 'WebrpcStreamLost',
2114
- WebrpcStreamFinished = 'WebrpcStreamFinished',
2115
- Unauthorized = 'Unauthorized',
2116
- PermissionDenied = 'PermissionDenied',
2117
- SessionExpired = 'SessionExpired',
2118
- MethodNotFound = 'MethodNotFound',
2119
- Timeout = 'Timeout',
2120
- InvalidArgument = 'InvalidArgument',
2121
- NotFound = 'NotFound',
2122
- UserNotFound = 'UserNotFound',
2123
- ProjectNotFound = 'ProjectNotFound',
2124
- InvalidTier = 'InvalidTier',
2125
- ProjectLimitReached = 'ProjectLimitReached',
2126
- NotImplemented = 'NotImplemented',
2766
+ WebrpcEndpoint = "WebrpcEndpoint",
2767
+ WebrpcRequestFailed = "WebrpcRequestFailed",
2768
+ WebrpcBadRoute = "WebrpcBadRoute",
2769
+ WebrpcBadMethod = "WebrpcBadMethod",
2770
+ WebrpcBadRequest = "WebrpcBadRequest",
2771
+ WebrpcBadResponse = "WebrpcBadResponse",
2772
+ WebrpcServerPanic = "WebrpcServerPanic",
2773
+ WebrpcInternalError = "WebrpcInternalError",
2774
+ WebrpcClientDisconnected = "WebrpcClientDisconnected",
2775
+ WebrpcStreamLost = "WebrpcStreamLost",
2776
+ WebrpcStreamFinished = "WebrpcStreamFinished",
2777
+ Unauthorized = "Unauthorized",
2778
+ PermissionDenied = "PermissionDenied",
2779
+ SessionExpired = "SessionExpired",
2780
+ MethodNotFound = "MethodNotFound",
2781
+ Timeout = "Timeout",
2782
+ InvalidArgument = "InvalidArgument",
2783
+ NotFound = "NotFound",
2784
+ UserNotFound = "UserNotFound",
2785
+ ProjectNotFound = "ProjectNotFound",
2786
+ InvalidTier = "InvalidTier",
2787
+ ProjectLimitReached = "ProjectLimitReached",
2788
+ NotImplemented = "NotImplemented",
2127
2789
  }
2128
2790
 
2129
2791
  export enum WebrpcErrorCodes {
@@ -2176,6 +2838,9 @@ export const webrpcErrorByCode: { [code: number]: any } = {
2176
2838
  [3003]: InvalidTierError,
2177
2839
  [3005]: ProjectLimitReachedError,
2178
2840
  [9999]: NotImplementedError,
2179
- }
2841
+ };
2180
2842
 
2181
- export type Fetch = (input: RequestInfo, init?: RequestInit) => Promise<Response>
2843
+ export type Fetch = (
2844
+ input: RequestInfo,
2845
+ init?: RequestInit
2846
+ ) => Promise<Response>;