@ar.io/sdk 3.23.0-alpha.4 → 3.23.0-alpha.5
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.
|
@@ -19,6 +19,10 @@ exports.calculateSaleTax = calculateSaleTax;
|
|
|
19
19
|
* limitations under the License.
|
|
20
20
|
*/
|
|
21
21
|
const index_js_1 = require("../node/index.js");
|
|
22
|
+
/**
|
|
23
|
+
* Read-only client for the ArNS marketplace
|
|
24
|
+
* @experimental
|
|
25
|
+
*/
|
|
22
26
|
class ArNSMarketplaceRead {
|
|
23
27
|
process;
|
|
24
28
|
logger;
|
|
@@ -194,6 +198,10 @@ class ArNSMarketplaceRead {
|
|
|
194
198
|
}
|
|
195
199
|
}
|
|
196
200
|
exports.ArNSMarketplaceRead = ArNSMarketplaceRead;
|
|
201
|
+
/**
|
|
202
|
+
* Write client for the ArNS marketplace
|
|
203
|
+
* @experimental
|
|
204
|
+
*/
|
|
197
205
|
class ArNSMarketplaceWrite extends ArNSMarketplaceRead {
|
|
198
206
|
process;
|
|
199
207
|
signer;
|
|
@@ -614,6 +622,7 @@ exports.ArNSMarketplaceWrite = ArNSMarketplaceWrite;
|
|
|
614
622
|
* Calculates the listing fee for an order based on the end timestamp.
|
|
615
623
|
* The fee is calculated by rounding up the hours until the end timestamp to the nearest hour.
|
|
616
624
|
*
|
|
625
|
+
* @experimental
|
|
617
626
|
* @param params - Parameters for calculating the listing fee
|
|
618
627
|
* @param params.listingFeePerHour - The listing fee per hour in mARIO (as a string)
|
|
619
628
|
* @param params.endTimestamp - Unix timestamp when the order expires
|
|
@@ -643,6 +652,7 @@ function calculateListingFee({ listingFeePerHour, endTimestamp, }) {
|
|
|
643
652
|
/**
|
|
644
653
|
* Calculates the sale tax for an order based on the sale amount.
|
|
645
654
|
*
|
|
655
|
+
* @experimental
|
|
646
656
|
* @param params - Parameters for calculating the sale tax
|
|
647
657
|
* @param params.saleAmount - The sale amount in mARIO (as a string or number)
|
|
648
658
|
* @param params.saleTaxNumerator - The numerator for sale tax calculation
|
package/lib/cjs/version.js
CHANGED
|
@@ -14,6 +14,10 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { ANT, AOProcess, Logger, MARKETPLACE_CONTRACT_ID, paginationParamsToTags, } from '../node/index.js';
|
|
17
|
+
/**
|
|
18
|
+
* Read-only client for the ArNS marketplace
|
|
19
|
+
* @experimental
|
|
20
|
+
*/
|
|
17
21
|
export class ArNSMarketplaceRead {
|
|
18
22
|
process;
|
|
19
23
|
logger;
|
|
@@ -188,6 +192,10 @@ export class ArNSMarketplaceRead {
|
|
|
188
192
|
return { intents, orders, balances, antIds: antIdsArray };
|
|
189
193
|
}
|
|
190
194
|
}
|
|
195
|
+
/**
|
|
196
|
+
* Write client for the ArNS marketplace
|
|
197
|
+
* @experimental
|
|
198
|
+
*/
|
|
191
199
|
export class ArNSMarketplaceWrite extends ArNSMarketplaceRead {
|
|
192
200
|
process;
|
|
193
201
|
signer;
|
|
@@ -607,6 +615,7 @@ export class ArNSMarketplaceWrite extends ArNSMarketplaceRead {
|
|
|
607
615
|
* Calculates the listing fee for an order based on the end timestamp.
|
|
608
616
|
* The fee is calculated by rounding up the hours until the end timestamp to the nearest hour.
|
|
609
617
|
*
|
|
618
|
+
* @experimental
|
|
610
619
|
* @param params - Parameters for calculating the listing fee
|
|
611
620
|
* @param params.listingFeePerHour - The listing fee per hour in mARIO (as a string)
|
|
612
621
|
* @param params.endTimestamp - Unix timestamp when the order expires
|
|
@@ -636,6 +645,7 @@ export function calculateListingFee({ listingFeePerHour, endTimestamp, }) {
|
|
|
636
645
|
/**
|
|
637
646
|
* Calculates the sale tax for an order based on the sale amount.
|
|
638
647
|
*
|
|
648
|
+
* @experimental
|
|
639
649
|
* @param params - Parameters for calculating the sale tax
|
|
640
650
|
* @param params.saleAmount - The sale amount in mARIO (as a string or number)
|
|
641
651
|
* @param params.saleTaxNumerator - The numerator for sale tax calculation
|
package/lib/esm/version.js
CHANGED
|
@@ -19,6 +19,7 @@ import { AoARIOWrite, PaginationParams, PaginationResult } from '../types/io.js'
|
|
|
19
19
|
/**
|
|
20
20
|
* User-provided order parameters for intent-based order creation
|
|
21
21
|
* These are the user-configurable fields when creating an order via the intent workflow
|
|
22
|
+
* @experimental
|
|
22
23
|
*/
|
|
23
24
|
export interface MarketplaceOrderIntentParams {
|
|
24
25
|
orderType?: 'fixed' | 'dutch' | 'english';
|
|
@@ -30,6 +31,7 @@ export interface MarketplaceOrderIntentParams {
|
|
|
30
31
|
}
|
|
31
32
|
/**
|
|
32
33
|
* Intent structure - matches Lua Intent type
|
|
34
|
+
* @experimental
|
|
33
35
|
*/
|
|
34
36
|
export interface MarketplaceIntent {
|
|
35
37
|
intentId: string;
|
|
@@ -46,6 +48,7 @@ export interface MarketplaceIntent {
|
|
|
46
48
|
}
|
|
47
49
|
/**
|
|
48
50
|
* Fee information structure for calculating order costs
|
|
51
|
+
* @experimental
|
|
49
52
|
*/
|
|
50
53
|
export interface MarketplaceFeeInfo {
|
|
51
54
|
listingFeePerHour: string;
|
|
@@ -54,6 +57,7 @@ export interface MarketplaceFeeInfo {
|
|
|
54
57
|
}
|
|
55
58
|
/**
|
|
56
59
|
* Intent statistics structure
|
|
60
|
+
* @experimental
|
|
57
61
|
*/
|
|
58
62
|
export interface MarketplaceIntentStats {
|
|
59
63
|
total: number;
|
|
@@ -63,6 +67,7 @@ export interface MarketplaceIntentStats {
|
|
|
63
67
|
}
|
|
64
68
|
/**
|
|
65
69
|
* Activity information structure
|
|
70
|
+
* @experimental
|
|
66
71
|
*/
|
|
67
72
|
export interface MarketplaceActivityInfo {
|
|
68
73
|
totalOrders: number;
|
|
@@ -74,7 +79,8 @@ export interface MarketplaceActivityInfo {
|
|
|
74
79
|
listedOrders: number;
|
|
75
80
|
}
|
|
76
81
|
/**
|
|
77
|
-
*
|
|
82
|
+
* Marketplace information structure
|
|
83
|
+
* @experimental
|
|
78
84
|
*/
|
|
79
85
|
export interface MarketplaceInfo {
|
|
80
86
|
totalPairs: number;
|
|
@@ -83,6 +89,7 @@ export interface MarketplaceInfo {
|
|
|
83
89
|
}
|
|
84
90
|
/**
|
|
85
91
|
* Info response structure from the marketplace
|
|
92
|
+
* @experimental
|
|
86
93
|
*/
|
|
87
94
|
export interface InfoResponse {
|
|
88
95
|
name: string;
|
|
@@ -95,6 +102,7 @@ export interface InfoResponse {
|
|
|
95
102
|
}
|
|
96
103
|
/**
|
|
97
104
|
* Parameters for creating an intent (Create-Order action is assumed)
|
|
105
|
+
* @experimental
|
|
98
106
|
*/
|
|
99
107
|
export interface CreateIntentParams {
|
|
100
108
|
antId: string;
|
|
@@ -107,6 +115,7 @@ export interface CreateIntentParams {
|
|
|
107
115
|
}
|
|
108
116
|
/**
|
|
109
117
|
* Parameters for paginated intent queries
|
|
118
|
+
* @experimental
|
|
110
119
|
*/
|
|
111
120
|
export interface GetPaginatedIntentsParams {
|
|
112
121
|
cursor?: string;
|
|
@@ -117,6 +126,7 @@ export interface GetPaginatedIntentsParams {
|
|
|
117
126
|
}
|
|
118
127
|
/**
|
|
119
128
|
* Parameters for creating an order using internal ARIO balance
|
|
129
|
+
* @experimental
|
|
120
130
|
*/
|
|
121
131
|
export interface CreateOrderParams {
|
|
122
132
|
swapToken: string;
|
|
@@ -130,6 +140,7 @@ export interface CreateOrderParams {
|
|
|
130
140
|
}
|
|
131
141
|
/**
|
|
132
142
|
* Parameters for getting orders with flexible selectors
|
|
143
|
+
* @experimental
|
|
133
144
|
*/
|
|
134
145
|
export interface GetOrdersParams extends GetPaginatedIntentsParams {
|
|
135
146
|
status?: 'all' | 'listed' | 'completed' | 'active' | 'ready-for-settlement' | 'executed' | 'cancelled' | 'expired';
|
|
@@ -139,6 +150,7 @@ export interface GetOrdersParams extends GetPaginatedIntentsParams {
|
|
|
139
150
|
}
|
|
140
151
|
/**
|
|
141
152
|
* Individual order structure returned from Get-Orders and Get-Order handlers
|
|
153
|
+
* @experimental
|
|
142
154
|
*/
|
|
143
155
|
export interface Order {
|
|
144
156
|
id: string;
|
|
@@ -161,6 +173,10 @@ export interface Order {
|
|
|
161
173
|
endedAt?: number;
|
|
162
174
|
bids?: Record<string, boolean>;
|
|
163
175
|
}
|
|
176
|
+
/**
|
|
177
|
+
* Marketplace balance information for a wallet address
|
|
178
|
+
* @experimental
|
|
179
|
+
*/
|
|
164
180
|
export interface MarketplaceBalance {
|
|
165
181
|
address: WalletAddress;
|
|
166
182
|
balance: string;
|
|
@@ -168,6 +184,10 @@ export interface MarketplaceBalance {
|
|
|
168
184
|
totalBalance: string;
|
|
169
185
|
orders: Record<string, string>;
|
|
170
186
|
}
|
|
187
|
+
/**
|
|
188
|
+
* Read-only interface for the ArNS marketplace
|
|
189
|
+
* @experimental
|
|
190
|
+
*/
|
|
171
191
|
export interface AoArNSMarketplaceRead {
|
|
172
192
|
getInfo(): Promise<InfoResponse>;
|
|
173
193
|
getPaginatedIntents(params: GetPaginatedIntentsParams): Promise<PaginationResult<MarketplaceIntent>>;
|
|
@@ -197,6 +217,7 @@ export interface AoArNSMarketplaceRead {
|
|
|
197
217
|
}
|
|
198
218
|
/**
|
|
199
219
|
* Common fields for create-intent progress events
|
|
220
|
+
* @experimental
|
|
200
221
|
*/
|
|
201
222
|
export interface CreateIntentEventData {
|
|
202
223
|
name: string;
|
|
@@ -207,12 +228,14 @@ export interface CreateIntentEventData {
|
|
|
207
228
|
}
|
|
208
229
|
/**
|
|
209
230
|
* Progress event emitted while creating the marketplace intent
|
|
231
|
+
* @experimental
|
|
210
232
|
*/
|
|
211
233
|
export interface CreatingIntentProgressEvent extends CreateIntentEventData {
|
|
212
234
|
step: 'creating-intent';
|
|
213
235
|
}
|
|
214
236
|
/**
|
|
215
237
|
* Progress event emitted after successfully creating the marketplace intent
|
|
238
|
+
* @experimental
|
|
216
239
|
*/
|
|
217
240
|
export interface IntentCreatedProgressEvent extends CreateIntentEventData {
|
|
218
241
|
step: 'intent-created';
|
|
@@ -220,6 +243,7 @@ export interface IntentCreatedProgressEvent extends CreateIntentEventData {
|
|
|
220
243
|
}
|
|
221
244
|
/**
|
|
222
245
|
* Common fields for transfer-ant progress events
|
|
246
|
+
* @experimental
|
|
223
247
|
*/
|
|
224
248
|
export interface TransferAntEventData {
|
|
225
249
|
name: string;
|
|
@@ -229,12 +253,14 @@ export interface TransferAntEventData {
|
|
|
229
253
|
}
|
|
230
254
|
/**
|
|
231
255
|
* Progress event emitted while transferring the ANT to the marketplace
|
|
256
|
+
* @experimental
|
|
232
257
|
*/
|
|
233
258
|
export interface TransferringAntProgressEvent extends TransferAntEventData {
|
|
234
259
|
step: 'transferring-ant';
|
|
235
260
|
}
|
|
236
261
|
/**
|
|
237
262
|
* Progress event emitted after successfully transferring the ANT to the marketplace
|
|
263
|
+
* @experimental
|
|
238
264
|
*/
|
|
239
265
|
export interface AntTransferredProgressEvent extends TransferAntEventData {
|
|
240
266
|
step: 'ant-transferred';
|
|
@@ -242,6 +268,7 @@ export interface AntTransferredProgressEvent extends TransferAntEventData {
|
|
|
242
268
|
}
|
|
243
269
|
/**
|
|
244
270
|
* Progress event emitted when an error occurs during the workflow
|
|
271
|
+
* @experimental
|
|
245
272
|
*/
|
|
246
273
|
export interface ListNameForSaleErrorEvent {
|
|
247
274
|
step: 'error';
|
|
@@ -259,6 +286,7 @@ export interface ListNameForSaleErrorEvent {
|
|
|
259
286
|
}
|
|
260
287
|
/**
|
|
261
288
|
* Progress event emitted when the workflow completes successfully
|
|
289
|
+
* @experimental
|
|
262
290
|
*/
|
|
263
291
|
export interface ListNameForSaleCompleteEvent {
|
|
264
292
|
step: 'complete';
|
|
@@ -270,8 +298,13 @@ export interface ListNameForSaleCompleteEvent {
|
|
|
270
298
|
}
|
|
271
299
|
/**
|
|
272
300
|
* Progress events emitted during listNameForSale workflow
|
|
301
|
+
* @experimental
|
|
273
302
|
*/
|
|
274
303
|
export type ListNameForSaleProgressEvent = CreatingIntentProgressEvent | IntentCreatedProgressEvent | TransferringAntProgressEvent | AntTransferredProgressEvent | ListNameForSaleErrorEvent | ListNameForSaleCompleteEvent;
|
|
304
|
+
/**
|
|
305
|
+
* Write interface for the ArNS marketplace
|
|
306
|
+
* @experimental
|
|
307
|
+
*/
|
|
275
308
|
export interface AoArNSMarketplaceWrite {
|
|
276
309
|
createIntent(params: CreateIntentParams): Promise<AoMessageResult<MarketplaceIntent>>;
|
|
277
310
|
cancelOrder(orderId: string): Promise<AoMessageResult>;
|
|
@@ -352,6 +385,10 @@ export interface AoArNSMarketplaceWrite {
|
|
|
352
385
|
antId: string;
|
|
353
386
|
}): Promise<AoMessageResult>;
|
|
354
387
|
}
|
|
388
|
+
/**
|
|
389
|
+
* Read-only client for the ArNS marketplace
|
|
390
|
+
* @experimental
|
|
391
|
+
*/
|
|
355
392
|
export declare class ArNSMarketplaceRead implements AoArNSMarketplaceRead {
|
|
356
393
|
protected process: AOProcess;
|
|
357
394
|
protected logger: Logger;
|
|
@@ -393,6 +430,10 @@ export declare class ArNSMarketplaceRead implements AoArNSMarketplaceRead {
|
|
|
393
430
|
antIds: string[];
|
|
394
431
|
}>;
|
|
395
432
|
}
|
|
433
|
+
/**
|
|
434
|
+
* Write client for the ArNS marketplace
|
|
435
|
+
* @experimental
|
|
436
|
+
*/
|
|
396
437
|
export declare class ArNSMarketplaceWrite extends ArNSMarketplaceRead implements AoArNSMarketplaceWrite {
|
|
397
438
|
protected process: AOProcess;
|
|
398
439
|
protected signer: AoSigner;
|
|
@@ -467,6 +508,7 @@ export declare class ArNSMarketplaceWrite extends ArNSMarketplaceRead implements
|
|
|
467
508
|
* Calculates the listing fee for an order based on the end timestamp.
|
|
468
509
|
* The fee is calculated by rounding up the hours until the end timestamp to the nearest hour.
|
|
469
510
|
*
|
|
511
|
+
* @experimental
|
|
470
512
|
* @param params - Parameters for calculating the listing fee
|
|
471
513
|
* @param params.listingFeePerHour - The listing fee per hour in mARIO (as a string)
|
|
472
514
|
* @param params.endTimestamp - Unix timestamp when the order expires
|
|
@@ -489,6 +531,7 @@ export declare function calculateListingFee({ listingFeePerHour, endTimestamp, }
|
|
|
489
531
|
/**
|
|
490
532
|
* Calculates the sale tax for an order based on the sale amount.
|
|
491
533
|
*
|
|
534
|
+
* @experimental
|
|
492
535
|
* @param params - Parameters for calculating the sale tax
|
|
493
536
|
* @param params.saleAmount - The sale amount in mARIO (as a string or number)
|
|
494
537
|
* @param params.saleTaxNumerator - The numerator for sale tax calculation
|
package/lib/types/version.d.ts
CHANGED