@basedone/core 0.2.6 → 0.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-CAU4QLVH.mjs → chunk-NKSQEISP.mjs} +176 -117
- package/dist/{client-CgmiTuEX.d.mts → client-DMVXX1Gw.d.mts} +5 -2
- package/dist/{client-CgmiTuEX.d.ts → client-DMVXX1Gw.d.ts} +5 -2
- package/dist/ecommerce.d.mts +128 -1
- package/dist/ecommerce.d.ts +128 -1
- package/dist/ecommerce.js +177 -116
- package/dist/ecommerce.mjs +1 -2
- package/dist/index.d.mts +4 -160
- package/dist/index.d.ts +4 -160
- package/dist/index.js +290 -41538
- package/dist/index.mjs +115 -640
- package/dist/react.d.mts +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.mjs +0 -1
- package/lib/ecommerce/client/customer.ts +261 -186
- package/lib/ecommerce/types/entities.ts +56 -0
- package/lib/ecommerce/types/enums.ts +32 -0
- package/lib/ecommerce/types/requests.ts +7 -0
- package/lib/ecommerce/types/responses.ts +90 -48
- package/lib/hip3/market-info.ts +5 -1
- package/lib/hip3/utils.ts +2 -0
- package/lib/meta/metadata.ts +0 -666
- package/package.json +10 -8
- package/dist/chunk-4UEJOM6W.mjs +0 -7
- package/dist/meta-JB5ITE27.mjs +0 -1390
- package/dist/meta-UOGUG3OW.mjs +0 -1504
- package/dist/perpDexs-3LRJ5ZHM.mjs +0 -288
- package/dist/perpDexs-4ISLD7NX.mjs +0 -2975
- package/dist/spotMeta-GHXX7C5M.mjs +0 -6968
- package/dist/spotMeta-IBBUP2SG.mjs +0 -27592
- package/dist/staticMeta-GM7T3OYL.mjs +0 -20
- package/dist/staticMeta-QV2KMX57.mjs +0 -22
|
@@ -9,6 +9,8 @@ import {
|
|
|
9
9
|
PaymentMethod,
|
|
10
10
|
PaymentStatus,
|
|
11
11
|
MerchantStatus,
|
|
12
|
+
MerchantBusinessType,
|
|
13
|
+
MerchantReturnPolicyType,
|
|
12
14
|
ShipmentStatus,
|
|
13
15
|
ReturnStatus,
|
|
14
16
|
ReviewStatus,
|
|
@@ -127,6 +129,22 @@ export interface ProductVariant extends BaseEntity {
|
|
|
127
129
|
sortOrder: number;
|
|
128
130
|
}
|
|
129
131
|
|
|
132
|
+
/**
|
|
133
|
+
* Social links for merchant profile
|
|
134
|
+
*/
|
|
135
|
+
export interface MerchantSocialLinks {
|
|
136
|
+
/** Twitter/X profile URL */
|
|
137
|
+
twitter?: string | null;
|
|
138
|
+
/** Instagram profile URL */
|
|
139
|
+
instagram?: string | null;
|
|
140
|
+
/** Facebook page URL */
|
|
141
|
+
facebook?: string | null;
|
|
142
|
+
/** Discord server invite URL */
|
|
143
|
+
discord?: string | null;
|
|
144
|
+
/** Telegram channel/group URL */
|
|
145
|
+
telegram?: string | null;
|
|
146
|
+
}
|
|
147
|
+
|
|
130
148
|
/**
|
|
131
149
|
* Merchant entity
|
|
132
150
|
*/
|
|
@@ -141,6 +159,44 @@ export interface Merchant extends BaseEntity {
|
|
|
141
159
|
payoutAddress: string;
|
|
142
160
|
/** Merchant status */
|
|
143
161
|
status: MerchantStatus;
|
|
162
|
+
|
|
163
|
+
// Contact information
|
|
164
|
+
/** Contact email for notifications and customer inquiries */
|
|
165
|
+
email?: string | null;
|
|
166
|
+
/** Contact phone number */
|
|
167
|
+
phone?: string | null;
|
|
168
|
+
/** Store website URL */
|
|
169
|
+
website?: string | null;
|
|
170
|
+
|
|
171
|
+
// Business information
|
|
172
|
+
/** Business type (individual, company, etc.) */
|
|
173
|
+
businessType?: MerchantBusinessType;
|
|
174
|
+
|
|
175
|
+
// Branding
|
|
176
|
+
/** Store logo/avatar URL */
|
|
177
|
+
logoUrl?: string | null;
|
|
178
|
+
/** Store banner image URL */
|
|
179
|
+
bannerUrl?: string | null;
|
|
180
|
+
|
|
181
|
+
// Social links
|
|
182
|
+
/** Social media links */
|
|
183
|
+
socialLinks?: MerchantSocialLinks | null;
|
|
184
|
+
|
|
185
|
+
// Return policy
|
|
186
|
+
/** Return policy type */
|
|
187
|
+
returnPolicyType?: MerchantReturnPolicyType;
|
|
188
|
+
/** Custom return policy details/text */
|
|
189
|
+
returnPolicyDetails?: string | null;
|
|
190
|
+
/** Return window in days (e.g., 30) */
|
|
191
|
+
returnWindowDays?: number | null;
|
|
192
|
+
|
|
193
|
+
// Location
|
|
194
|
+
/** ISO 2-letter country code (for tax/shipping) */
|
|
195
|
+
country?: string | null;
|
|
196
|
+
/** City name */
|
|
197
|
+
city?: string | null;
|
|
198
|
+
/** Street address */
|
|
199
|
+
addressLine1?: string | null;
|
|
144
200
|
}
|
|
145
201
|
|
|
146
202
|
/**
|
|
@@ -70,6 +70,38 @@ export enum MerchantStatus {
|
|
|
70
70
|
PENDING = "PENDING",
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
+
/**
|
|
74
|
+
* Merchant business type enum
|
|
75
|
+
*/
|
|
76
|
+
export enum MerchantBusinessType {
|
|
77
|
+
/** Individual seller */
|
|
78
|
+
INDIVIDUAL = "INDIVIDUAL",
|
|
79
|
+
/** Registered company */
|
|
80
|
+
COMPANY = "COMPANY",
|
|
81
|
+
/** Partnership */
|
|
82
|
+
PARTNERSHIP = "PARTNERSHIP",
|
|
83
|
+
/** Non-profit organization */
|
|
84
|
+
NON_PROFIT = "NON_PROFIT",
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Merchant return policy type enum
|
|
89
|
+
*/
|
|
90
|
+
export enum MerchantReturnPolicyType {
|
|
91
|
+
/** No returns accepted */
|
|
92
|
+
NO_RETURNS = "NO_RETURNS",
|
|
93
|
+
/** Exchange for same/similar item only */
|
|
94
|
+
EXCHANGE_ONLY = "EXCHANGE_ONLY",
|
|
95
|
+
/** Refund as store credit only */
|
|
96
|
+
STORE_CREDIT = "STORE_CREDIT",
|
|
97
|
+
/** Full refund available */
|
|
98
|
+
FULL_REFUND = "FULL_REFUND",
|
|
99
|
+
/** Partial refund (restocking fee may apply) */
|
|
100
|
+
PARTIAL_REFUND = "PARTIAL_REFUND",
|
|
101
|
+
/** Handled on a case-by-case basis */
|
|
102
|
+
CASE_BY_CASE = "CASE_BY_CASE",
|
|
103
|
+
}
|
|
104
|
+
|
|
73
105
|
/**
|
|
74
106
|
* Shipment status enum
|
|
75
107
|
*/
|
|
@@ -156,6 +156,11 @@ export interface CreateOrderRequest {
|
|
|
156
156
|
* SECURITY: The cost is never trusted from the frontend.
|
|
157
157
|
*/
|
|
158
158
|
shippingRateId?: string;
|
|
159
|
+
/**
|
|
160
|
+
* Shipping method name (e.g., "On-site Collection")
|
|
161
|
+
* Sent as fallback when validation is disabled, so the method name can still be stored.
|
|
162
|
+
*/
|
|
163
|
+
shippingMethodName?: string;
|
|
159
164
|
|
|
160
165
|
// =====================================================
|
|
161
166
|
// DEPRECATED FIELDS - Do not use
|
|
@@ -179,6 +184,8 @@ export interface CreateOrderRequest {
|
|
|
179
184
|
export interface ListOrdersParams extends PaginationParams {
|
|
180
185
|
/** Filter by status */
|
|
181
186
|
status?: OrderStatus;
|
|
187
|
+
/** Filter by merchant ID (for godview access) */
|
|
188
|
+
merchantId?: string;
|
|
182
189
|
}
|
|
183
190
|
|
|
184
191
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Ecommerce API Response Types
|
|
3
|
-
*
|
|
3
|
+
*
|
|
4
4
|
* This module contains all response types for the ecommerce API.
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -61,7 +61,7 @@ export interface ListProductsResponse extends PaginatedResponse<Product> {}
|
|
|
61
61
|
|
|
62
62
|
/**
|
|
63
63
|
* Get product response
|
|
64
|
-
*
|
|
64
|
+
*
|
|
65
65
|
* Note: The API returns the product object directly, not wrapped in a `product` field.
|
|
66
66
|
* This type extends Product to be compatible with the actual API response.
|
|
67
67
|
*/
|
|
@@ -465,11 +465,13 @@ export interface CouponResponse {
|
|
|
465
465
|
export interface GetCouponResponse {
|
|
466
466
|
/** Coupon with usages */
|
|
467
467
|
coupon: Coupon & {
|
|
468
|
-
usages: Array<
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
468
|
+
usages: Array<
|
|
469
|
+
CouponUsage & {
|
|
470
|
+
user: {
|
|
471
|
+
username?: string;
|
|
472
|
+
};
|
|
473
|
+
}
|
|
474
|
+
>;
|
|
473
475
|
};
|
|
474
476
|
}
|
|
475
477
|
|
|
@@ -494,17 +496,19 @@ export interface ShippingMethodResponse {
|
|
|
494
496
|
*/
|
|
495
497
|
export interface ListShipmentsResponse {
|
|
496
498
|
/** Shipments */
|
|
497
|
-
shipments: Array<
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
totalUSDC: string;
|
|
501
|
-
shippingAddress: any;
|
|
502
|
-
user: {
|
|
499
|
+
shipments: Array<
|
|
500
|
+
Shipment & {
|
|
501
|
+
order: {
|
|
503
502
|
id: string;
|
|
504
|
-
|
|
503
|
+
totalUSDC: string;
|
|
504
|
+
shippingAddress: any;
|
|
505
|
+
user: {
|
|
506
|
+
id: string;
|
|
507
|
+
username?: string;
|
|
508
|
+
};
|
|
505
509
|
};
|
|
506
|
-
}
|
|
507
|
-
|
|
510
|
+
}
|
|
511
|
+
>;
|
|
508
512
|
}
|
|
509
513
|
|
|
510
514
|
/**
|
|
@@ -520,16 +524,18 @@ export interface ShipmentResponse {
|
|
|
520
524
|
*/
|
|
521
525
|
export interface ListReturnsResponse {
|
|
522
526
|
/** Returns */
|
|
523
|
-
returns: Array<
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
527
|
+
returns: Array<
|
|
528
|
+
Return & {
|
|
529
|
+
user: {
|
|
530
|
+
id: string;
|
|
531
|
+
username?: string;
|
|
532
|
+
};
|
|
533
|
+
order: {
|
|
534
|
+
id: string;
|
|
535
|
+
totalUSDC: string;
|
|
536
|
+
};
|
|
537
|
+
}
|
|
538
|
+
>;
|
|
533
539
|
}
|
|
534
540
|
|
|
535
541
|
/**
|
|
@@ -603,7 +609,7 @@ export interface MessageResponse {
|
|
|
603
609
|
|
|
604
610
|
/**
|
|
605
611
|
* Customer messages response (for retail users)
|
|
606
|
-
*
|
|
612
|
+
*
|
|
607
613
|
* Groups messages by order, where each order represents a conversation with a merchant.
|
|
608
614
|
*/
|
|
609
615
|
export interface CustomerMessagesResponse {
|
|
@@ -790,17 +796,19 @@ export interface GetProductMetricsResponse {
|
|
|
790
796
|
*/
|
|
791
797
|
export interface ListInventoryAuditResponse {
|
|
792
798
|
/** Entries */
|
|
793
|
-
entries: Array<
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
799
|
+
entries: Array<
|
|
800
|
+
InventoryAuditEntry & {
|
|
801
|
+
product: {
|
|
802
|
+
id: string;
|
|
803
|
+
title: string;
|
|
804
|
+
images: string[];
|
|
805
|
+
};
|
|
806
|
+
variant?: {
|
|
807
|
+
id: string;
|
|
808
|
+
name: string;
|
|
809
|
+
};
|
|
810
|
+
}
|
|
811
|
+
>;
|
|
804
812
|
}
|
|
805
813
|
|
|
806
814
|
/**
|
|
@@ -997,14 +1005,16 @@ import type {
|
|
|
997
1005
|
*/
|
|
998
1006
|
export interface ShippingSettingsResponse {
|
|
999
1007
|
/** Shipping settings */
|
|
1000
|
-
settings:
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
+
settings:
|
|
1009
|
+
| MerchantShippingSettings
|
|
1010
|
+
| {
|
|
1011
|
+
defaultHandlingFee: number;
|
|
1012
|
+
defaultProcessingDays: number;
|
|
1013
|
+
freeShippingEnabled: boolean;
|
|
1014
|
+
freeShippingThreshold: number | null;
|
|
1015
|
+
defaultWeightKg: number;
|
|
1016
|
+
showEstimatedDelivery: boolean;
|
|
1017
|
+
};
|
|
1008
1018
|
}
|
|
1009
1019
|
|
|
1010
1020
|
/**
|
|
@@ -1118,7 +1128,13 @@ export interface ProcessPaymentResponse {
|
|
|
1118
1128
|
/** Blockchain transaction hash (for crypto payments) */
|
|
1119
1129
|
transactionHash?: string;
|
|
1120
1130
|
/** Payment status */
|
|
1121
|
-
status:
|
|
1131
|
+
status:
|
|
1132
|
+
| "PENDING"
|
|
1133
|
+
| "PROCESSING"
|
|
1134
|
+
| "COMPLETED"
|
|
1135
|
+
| "FAILED"
|
|
1136
|
+
| "CANCELLED"
|
|
1137
|
+
| "REFUNDED";
|
|
1122
1138
|
/** Amount charged */
|
|
1123
1139
|
amount: number;
|
|
1124
1140
|
/** Currency */
|
|
@@ -1136,7 +1152,7 @@ export interface ProcessPaymentResponse {
|
|
|
1136
1152
|
/**
|
|
1137
1153
|
* Gem source type - how gems were earned
|
|
1138
1154
|
*/
|
|
1139
|
-
export type GemSource =
|
|
1155
|
+
export type GemSource =
|
|
1140
1156
|
| "BUILDER_CODE"
|
|
1141
1157
|
| "PREDICTION"
|
|
1142
1158
|
| "CARD_SPEND"
|
|
@@ -1295,3 +1311,29 @@ export interface DeleteBrowsingLocationResponse {
|
|
|
1295
1311
|
message: string;
|
|
1296
1312
|
}
|
|
1297
1313
|
|
|
1314
|
+
// ============================================================================
|
|
1315
|
+
// BasedPay Cash Account Responses
|
|
1316
|
+
// ============================================================================
|
|
1317
|
+
|
|
1318
|
+
/**
|
|
1319
|
+
* Cash account balance response
|
|
1320
|
+
*/
|
|
1321
|
+
export interface CashAccountBalanceResponse {
|
|
1322
|
+
/** Balance amount */
|
|
1323
|
+
balance: string;
|
|
1324
|
+
/** Currency code (e.g., "USD") */
|
|
1325
|
+
currency: string;
|
|
1326
|
+
}
|
|
1327
|
+
|
|
1328
|
+
export interface DeliveryAddressResponse {
|
|
1329
|
+
name: string;
|
|
1330
|
+
phoneNumber: string;
|
|
1331
|
+
deliveryAddress: {
|
|
1332
|
+
addressLine1: string;
|
|
1333
|
+
addressLine2?: string | null;
|
|
1334
|
+
postalCode: string;
|
|
1335
|
+
city: string | null;
|
|
1336
|
+
region: string | null;
|
|
1337
|
+
country: string;
|
|
1338
|
+
};
|
|
1339
|
+
}
|
package/lib/hip3/market-info.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InfoClient, PerpsAssetCtx, MarginTables } from "@nktkas/hyperliquid";
|
|
1
|
+
import { InfoClient, PerpsAssetCtx, MarginTables, PerpDex as LegacyPerpDex } from "@nktkas/hyperliquid";
|
|
2
2
|
|
|
3
3
|
export interface PerpsMeta {
|
|
4
4
|
collateralToken: number;
|
|
@@ -34,6 +34,10 @@ export interface PerpsUniverse {
|
|
|
34
34
|
marginMode?: "strictIsolated" | "noCross";
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
export interface PerpDex extends LegacyPerpDex {
|
|
38
|
+
deployerFeeScale: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
37
41
|
export type AllPerpsMeta = PerpsMeta[];
|
|
38
42
|
|
|
39
43
|
export async function getAllPerpsMeta(
|