@basedone/core 0.1.10 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-4UEJOM6W.mjs +1 -3
- package/dist/chunk-MVFO4WRF.mjs +2091 -0
- package/dist/chunk-VBC6EQ7Q.mjs +235 -0
- package/dist/client-CgmiTuEX.d.mts +179 -0
- package/dist/client-CgmiTuEX.d.ts +179 -0
- package/dist/ecommerce.d.mts +3986 -0
- package/dist/ecommerce.d.ts +3986 -0
- package/dist/ecommerce.js +2135 -0
- package/dist/ecommerce.mjs +2 -0
- package/dist/index.d.mts +51 -43
- package/dist/index.d.ts +51 -43
- package/dist/index.js +2795 -205
- package/dist/index.mjs +68 -90
- package/dist/{meta-FVJIMALT.mjs → meta-JB5ITE27.mjs} +4 -10
- package/dist/meta-UOGUG3OW.mjs +3 -7
- package/dist/{perpDexs-GGL32HT4.mjs → perpDexs-3LRJ5ZHM.mjs} +37 -8
- package/dist/{perpDexs-G7V2QIM6.mjs → perpDexs-4ISLD7NX.mjs} +177 -32
- package/dist/react.d.mts +39 -0
- package/dist/react.d.ts +39 -0
- package/dist/react.js +268 -0
- package/dist/react.mjs +31 -0
- package/dist/{spotMeta-OD7S6HGW.mjs → spotMeta-GHXX7C5M.mjs} +24 -9
- package/dist/{spotMeta-PCN4Z4R3.mjs → spotMeta-IBBUP2SG.mjs} +54 -6
- package/dist/staticMeta-GM7T3OYL.mjs +3 -6
- package/dist/staticMeta-QV2KMX57.mjs +3 -6
- package/ecommerce.ts +15 -0
- package/index.ts +6 -0
- package/lib/ecommerce/FLASH_SALES.md +340 -0
- package/lib/ecommerce/QUICK_REFERENCE.md +211 -0
- package/lib/ecommerce/README.md +391 -0
- package/lib/ecommerce/USAGE_EXAMPLES.md +704 -0
- package/lib/ecommerce/client/base.ts +272 -0
- package/lib/ecommerce/client/customer.ts +639 -0
- package/lib/ecommerce/client/merchant.ts +1341 -0
- package/lib/ecommerce/index.ts +51 -0
- package/lib/ecommerce/types/entities.ts +791 -0
- package/lib/ecommerce/types/enums.ts +270 -0
- package/lib/ecommerce/types/index.ts +18 -0
- package/lib/ecommerce/types/requests.ts +580 -0
- package/lib/ecommerce/types/responses.ts +857 -0
- package/lib/ecommerce/utils/errors.ts +113 -0
- package/lib/ecommerce/utils/helpers.ts +131 -0
- package/lib/hip3/market-info.ts +1 -1
- package/lib/instrument/client.ts +351 -0
- package/lib/meta/data/mainnet/perpDexs.json +34 -4
- package/lib/meta/data/mainnet/spotMeta.json +21 -3
- package/lib/meta/data/testnet/meta.json +1 -3
- package/lib/meta/data/testnet/perpDexs.json +174 -28
- package/lib/meta/data/testnet/spotMeta.json +51 -0
- package/lib/react/InstrumentProvider.tsx +69 -0
- package/lib/utils/flooredDateTime.ts +55 -0
- package/lib/utils/time.ts +51 -0
- package/package.json +37 -11
- package/react.ts +1 -0
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ecommerce Type Enums
|
|
3
|
+
*
|
|
4
|
+
* This module contains all enum types used in the ecommerce API.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Order status enum representing the lifecycle of an order
|
|
9
|
+
*/
|
|
10
|
+
export enum OrderStatus {
|
|
11
|
+
/** Order created but payment not initiated */
|
|
12
|
+
CREATED = "CREATED",
|
|
13
|
+
/** Awaiting escrow deposit from customer */
|
|
14
|
+
AWAITING_DEPOSIT = "AWAITING_DEPOSIT",
|
|
15
|
+
/** Payment reserved in escrow */
|
|
16
|
+
PAYMENT_RESERVED = "PAYMENT_RESERVED",
|
|
17
|
+
/** Merchant has accepted the order */
|
|
18
|
+
MERCHANT_ACCEPTED = "MERCHANT_ACCEPTED",
|
|
19
|
+
/** Order has been shipped */
|
|
20
|
+
SHIPPED = "SHIPPED",
|
|
21
|
+
/** Order has been delivered */
|
|
22
|
+
DELIVERED = "DELIVERED",
|
|
23
|
+
/** Order has been cancelled */
|
|
24
|
+
CANCELLED = "CANCELLED",
|
|
25
|
+
/** Order is confirmed (legacy status) */
|
|
26
|
+
CONFIRMED = "CONFIRMED",
|
|
27
|
+
/** Order is completed (legacy status) */
|
|
28
|
+
COMPLETED = "COMPLETED",
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Payment method enum
|
|
33
|
+
*/
|
|
34
|
+
export enum PaymentMethod {
|
|
35
|
+
/** USDC payment via Hyperliquid escrow */
|
|
36
|
+
USDC_ESCROW = "USDC_ESCROW",
|
|
37
|
+
/** Points-based payment */
|
|
38
|
+
POINTS = "POINTS",
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Payment status enum
|
|
43
|
+
*/
|
|
44
|
+
export enum PaymentStatus {
|
|
45
|
+
/** Payment is pending */
|
|
46
|
+
PENDING = "PENDING",
|
|
47
|
+
/** Payment is reserved in escrow */
|
|
48
|
+
RESERVED = "RESERVED",
|
|
49
|
+
/** Payment is completed */
|
|
50
|
+
COMPLETED = "COMPLETED",
|
|
51
|
+
/** Payment failed */
|
|
52
|
+
FAILED = "FAILED",
|
|
53
|
+
/** Payment was refunded */
|
|
54
|
+
REFUNDED = "REFUNDED",
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Merchant status enum
|
|
59
|
+
*/
|
|
60
|
+
export enum MerchantStatus {
|
|
61
|
+
/** Merchant is active */
|
|
62
|
+
ACTIVE = "ACTIVE",
|
|
63
|
+
/** Merchant is suspended */
|
|
64
|
+
SUSPENDED = "SUSPENDED",
|
|
65
|
+
/** Merchant is pending approval */
|
|
66
|
+
PENDING = "PENDING",
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Shipment status enum
|
|
71
|
+
*/
|
|
72
|
+
export enum ShipmentStatus {
|
|
73
|
+
/** Shipment is pending */
|
|
74
|
+
PENDING = "PENDING",
|
|
75
|
+
/** Shipment is in transit */
|
|
76
|
+
SHIPPED = "SHIPPED",
|
|
77
|
+
/** Shipment is delivered */
|
|
78
|
+
DELIVERED = "DELIVERED",
|
|
79
|
+
/** Shipment failed */
|
|
80
|
+
FAILED = "FAILED",
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Return status enum
|
|
85
|
+
*/
|
|
86
|
+
export enum ReturnStatus {
|
|
87
|
+
/** Return requested by customer */
|
|
88
|
+
REQUESTED = "REQUESTED",
|
|
89
|
+
/** Return approved by merchant */
|
|
90
|
+
APPROVED = "APPROVED",
|
|
91
|
+
/** Return rejected by merchant */
|
|
92
|
+
REJECTED = "REJECTED",
|
|
93
|
+
/** Return item shipped back */
|
|
94
|
+
SHIPPED_BACK = "SHIPPED_BACK",
|
|
95
|
+
/** Return item received by merchant */
|
|
96
|
+
RECEIVED = "RECEIVED",
|
|
97
|
+
/** Refund processed */
|
|
98
|
+
REFUNDED = "REFUNDED",
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Review status enum
|
|
103
|
+
*/
|
|
104
|
+
export enum ReviewStatus {
|
|
105
|
+
/** Review is pending */
|
|
106
|
+
PENDING = "PENDING",
|
|
107
|
+
/** Review has been responded to */
|
|
108
|
+
RESPONDED = "RESPONDED",
|
|
109
|
+
/** Review has been flagged */
|
|
110
|
+
FLAGGED = "FLAGGED",
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Discount type enum
|
|
115
|
+
*/
|
|
116
|
+
export enum DiscountType {
|
|
117
|
+
/** Percentage discount */
|
|
118
|
+
PERCENTAGE = "PERCENTAGE",
|
|
119
|
+
/** Fixed amount discount */
|
|
120
|
+
FIXED_AMOUNT = "FIXED_AMOUNT",
|
|
121
|
+
/** Buy X get Y discount */
|
|
122
|
+
BUY_X_GET_Y = "BUY_X_GET_Y",
|
|
123
|
+
/** Free shipping */
|
|
124
|
+
FREE_SHIPPING = "FREE_SHIPPING",
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Discount method enum
|
|
129
|
+
*/
|
|
130
|
+
export enum DiscountMethod {
|
|
131
|
+
/** Code-based discount (coupon) */
|
|
132
|
+
CODE = "CODE",
|
|
133
|
+
/** Automatic discount */
|
|
134
|
+
AUTOMATIC = "AUTOMATIC",
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Discount scope enum
|
|
139
|
+
*/
|
|
140
|
+
export enum DiscountScope {
|
|
141
|
+
/** Applies to entire order */
|
|
142
|
+
ORDER = "ORDER",
|
|
143
|
+
/** Applies to specific products */
|
|
144
|
+
PRODUCT = "PRODUCT",
|
|
145
|
+
/** Applies to specific categories */
|
|
146
|
+
CATEGORY = "CATEGORY",
|
|
147
|
+
/** Applies to shipping */
|
|
148
|
+
SHIPPING = "SHIPPING",
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Banner type enum
|
|
153
|
+
*/
|
|
154
|
+
export enum BannerType {
|
|
155
|
+
/** Hero banner */
|
|
156
|
+
HERO = "HERO",
|
|
157
|
+
/** Promotional banner */
|
|
158
|
+
PROMO = "PROMO",
|
|
159
|
+
/** Featured banner */
|
|
160
|
+
FEATURED = "FEATURED",
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Tax type enum
|
|
165
|
+
*/
|
|
166
|
+
export enum TaxType {
|
|
167
|
+
/** Sales tax */
|
|
168
|
+
SALES_TAX = "SALES_TAX",
|
|
169
|
+
/** Value-added tax */
|
|
170
|
+
VAT = "VAT",
|
|
171
|
+
/** Goods and services tax */
|
|
172
|
+
GST = "GST",
|
|
173
|
+
/** Provincial sales tax */
|
|
174
|
+
PST = "PST",
|
|
175
|
+
/** Harmonized sales tax */
|
|
176
|
+
HST = "HST",
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Tax behavior enum
|
|
181
|
+
*/
|
|
182
|
+
export enum TaxBehavior {
|
|
183
|
+
/** Charge tax on top of price */
|
|
184
|
+
CHARGE = "CHARGE",
|
|
185
|
+
/** Tax is included in price */
|
|
186
|
+
INCLUSIVE = "INCLUSIVE",
|
|
187
|
+
/** No tax */
|
|
188
|
+
EXEMPT = "EXEMPT",
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Tax report period type enum
|
|
193
|
+
*/
|
|
194
|
+
export enum TaxReportPeriodType {
|
|
195
|
+
/** Monthly report */
|
|
196
|
+
MONTHLY = "MONTHLY",
|
|
197
|
+
/** Quarterly report */
|
|
198
|
+
QUARTERLY = "QUARTERLY",
|
|
199
|
+
/** Yearly report */
|
|
200
|
+
YEARLY = "YEARLY",
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Tax report status enum
|
|
205
|
+
*/
|
|
206
|
+
export enum TaxReportStatus {
|
|
207
|
+
/** Report is in draft */
|
|
208
|
+
DRAFT = "DRAFT",
|
|
209
|
+
/** Report is finalized */
|
|
210
|
+
FINALIZED = "FINALIZED",
|
|
211
|
+
/** Report has been filed */
|
|
212
|
+
FILED = "FILED",
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Inventory audit action enum
|
|
217
|
+
*/
|
|
218
|
+
export enum InventoryAuditAction {
|
|
219
|
+
/** Inventory created */
|
|
220
|
+
CREATED = "CREATED",
|
|
221
|
+
/** Inventory updated */
|
|
222
|
+
UPDATED = "UPDATED",
|
|
223
|
+
/** Inventory reserved */
|
|
224
|
+
RESERVED = "RESERVED",
|
|
225
|
+
/** Inventory deducted */
|
|
226
|
+
DEDUCTED = "DEDUCTED",
|
|
227
|
+
/** Inventory restored */
|
|
228
|
+
RESTORED = "RESTORED",
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Sort order enum
|
|
233
|
+
*/
|
|
234
|
+
export enum SortOrder {
|
|
235
|
+
/** Ascending order */
|
|
236
|
+
ASC = "asc",
|
|
237
|
+
/** Descending order */
|
|
238
|
+
DESC = "desc",
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* Product sort by enum
|
|
243
|
+
*/
|
|
244
|
+
export enum ProductSortBy {
|
|
245
|
+
/** Sort by date (newest first) */
|
|
246
|
+
DATE_DESC = "date_desc",
|
|
247
|
+
/** Sort by date (oldest first) */
|
|
248
|
+
DATE_ASC = "date_asc",
|
|
249
|
+
/** Sort by price (low to high) */
|
|
250
|
+
PRICE_ASC = "price_asc",
|
|
251
|
+
/** Sort by price (high to low) */
|
|
252
|
+
PRICE_DESC = "price_desc",
|
|
253
|
+
/** Sort by popularity */
|
|
254
|
+
POPULAR = "popular",
|
|
255
|
+
/** Sort by featured status */
|
|
256
|
+
FEATURED = "featured",
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Review sort by enum
|
|
261
|
+
*/
|
|
262
|
+
export enum ReviewSortBy {
|
|
263
|
+
/** Sort by newest */
|
|
264
|
+
NEWEST = "newest",
|
|
265
|
+
/** Sort by highest rating */
|
|
266
|
+
HIGHEST = "highest",
|
|
267
|
+
/** Sort by lowest rating */
|
|
268
|
+
LOWEST = "lowest",
|
|
269
|
+
}
|
|
270
|
+
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ecommerce Types Module
|
|
3
|
+
*
|
|
4
|
+
* This module exports all TypeScript types and interfaces for the ecommerce API.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
// Export all enums
|
|
8
|
+
export * from "./enums";
|
|
9
|
+
|
|
10
|
+
// Export all entities
|
|
11
|
+
export * from "./entities";
|
|
12
|
+
|
|
13
|
+
// Export all request types
|
|
14
|
+
export * from "./requests";
|
|
15
|
+
|
|
16
|
+
// Export all response types
|
|
17
|
+
export * from "./responses";
|
|
18
|
+
|