@basedone/core 0.2.7 → 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-L63E7FZC.mjs → chunk-NKSQEISP.mjs} +17 -1
- 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 +74 -1
- package/dist/ecommerce.d.ts +74 -1
- package/dist/ecommerce.js +18 -0
- package/dist/ecommerce.mjs +1 -2
- package/dist/index.d.mts +4 -160
- package/dist/index.d.ts +4 -160
- package/dist/index.js +154 -41445
- 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/types/entities.ts +56 -0
- package/lib/ecommerce/types/enums.ts +32 -0
- package/lib/ecommerce/types/requests.ts +2 -0
- 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 +1 -1
- 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
|
@@ -2790,6 +2790,22 @@ var MerchantStatus = /* @__PURE__ */ ((MerchantStatus2) => {
|
|
|
2790
2790
|
MerchantStatus2["PENDING"] = "PENDING";
|
|
2791
2791
|
return MerchantStatus2;
|
|
2792
2792
|
})(MerchantStatus || {});
|
|
2793
|
+
var MerchantBusinessType = /* @__PURE__ */ ((MerchantBusinessType2) => {
|
|
2794
|
+
MerchantBusinessType2["INDIVIDUAL"] = "INDIVIDUAL";
|
|
2795
|
+
MerchantBusinessType2["COMPANY"] = "COMPANY";
|
|
2796
|
+
MerchantBusinessType2["PARTNERSHIP"] = "PARTNERSHIP";
|
|
2797
|
+
MerchantBusinessType2["NON_PROFIT"] = "NON_PROFIT";
|
|
2798
|
+
return MerchantBusinessType2;
|
|
2799
|
+
})(MerchantBusinessType || {});
|
|
2800
|
+
var MerchantReturnPolicyType = /* @__PURE__ */ ((MerchantReturnPolicyType2) => {
|
|
2801
|
+
MerchantReturnPolicyType2["NO_RETURNS"] = "NO_RETURNS";
|
|
2802
|
+
MerchantReturnPolicyType2["EXCHANGE_ONLY"] = "EXCHANGE_ONLY";
|
|
2803
|
+
MerchantReturnPolicyType2["STORE_CREDIT"] = "STORE_CREDIT";
|
|
2804
|
+
MerchantReturnPolicyType2["FULL_REFUND"] = "FULL_REFUND";
|
|
2805
|
+
MerchantReturnPolicyType2["PARTIAL_REFUND"] = "PARTIAL_REFUND";
|
|
2806
|
+
MerchantReturnPolicyType2["CASE_BY_CASE"] = "CASE_BY_CASE";
|
|
2807
|
+
return MerchantReturnPolicyType2;
|
|
2808
|
+
})(MerchantReturnPolicyType || {});
|
|
2793
2809
|
var ShipmentStatus = /* @__PURE__ */ ((ShipmentStatus2) => {
|
|
2794
2810
|
ShipmentStatus2["PENDING"] = "PENDING";
|
|
2795
2811
|
ShipmentStatus2["SHIPPED"] = "SHIPPED";
|
|
@@ -2893,4 +2909,4 @@ var ReviewSortBy = /* @__PURE__ */ ((ReviewSortBy2) => {
|
|
|
2893
2909
|
return ReviewSortBy2;
|
|
2894
2910
|
})(ReviewSortBy || {});
|
|
2895
2911
|
|
|
2896
|
-
export { BannerType, BaseEcommerceClient, CustomerEcommerceClient, DiscountMethod, DiscountScope, DiscountType, EcommerceApiError, InventoryAuditAction, MerchantEcommerceClient, MerchantStatus, OrderStatus, PaymentMethod, PaymentStatus, ProductSortBy, ReturnStatus, ReviewSortBy, ReviewStatus, ShipmentStatus, SortOrder, TaxBehavior, TaxReportPeriodType, TaxReportStatus, TaxType, buildQueryString, calculateDiscountAmount, calculateFinalPrice, formatPrice, getBackoffDelay, isRetryableError, isValidAddress, isValidEmail, parseError, retryWithBackoff, sleep, truncateAddress };
|
|
2912
|
+
export { BannerType, BaseEcommerceClient, CustomerEcommerceClient, DiscountMethod, DiscountScope, DiscountType, EcommerceApiError, InventoryAuditAction, MerchantBusinessType, MerchantEcommerceClient, MerchantReturnPolicyType, MerchantStatus, OrderStatus, PaymentMethod, PaymentStatus, ProductSortBy, ReturnStatus, ReviewSortBy, ReviewStatus, ShipmentStatus, SortOrder, TaxBehavior, TaxReportPeriodType, TaxReportStatus, TaxType, buildQueryString, calculateDiscountAmount, calculateFinalPrice, formatPrice, getBackoffDelay, isRetryableError, isValidAddress, isValidEmail, parseError, retryWithBackoff, sleep, truncateAddress };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MarginTables, PerpsAssetCtx, InfoClient, SpotToken, SpotMeta } from '@nktkas/hyperliquid';
|
|
1
|
+
import { MarginTables, PerpsAssetCtx, PerpDex as PerpDex$1, InfoClient, SpotToken, SpotMeta } from '@nktkas/hyperliquid';
|
|
2
2
|
|
|
3
3
|
interface PerpsMeta {
|
|
4
4
|
collateralToken: number;
|
|
@@ -33,6 +33,9 @@ interface PerpsUniverse {
|
|
|
33
33
|
/** Margin mode for the universe. */
|
|
34
34
|
marginMode?: "strictIsolated" | "noCross";
|
|
35
35
|
}
|
|
36
|
+
interface PerpDex extends PerpDex$1 {
|
|
37
|
+
deployerFeeScale: string;
|
|
38
|
+
}
|
|
36
39
|
type AllPerpsMeta = PerpsMeta[];
|
|
37
40
|
declare function getAllPerpsMeta(infoClient: InfoClient): Promise<AllPerpsMeta>;
|
|
38
41
|
|
|
@@ -176,4 +179,4 @@ declare class InstrumentClient {
|
|
|
176
179
|
private extractDexNameFromMeta;
|
|
177
180
|
}
|
|
178
181
|
|
|
179
|
-
export { type AllPerpsMeta as A, type BaseInstrument as B, InstrumentClient as I, type MarketInstrument as M, type PerpsMeta as P, type SpotInstrument as S, type PerpsMetaAndAssetCtxs as a, type PerpsUniverse as b, type
|
|
182
|
+
export { type AllPerpsMeta as A, type BaseInstrument as B, InstrumentClient as I, type MarketInstrument as M, type PerpsMeta as P, type SpotInstrument as S, type PerpsMetaAndAssetCtxs as a, type PerpsUniverse as b, type PerpDex as c, type PerpsInstrument as d, AssetIdUtils as e, getAllPerpsMeta as g };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MarginTables, PerpsAssetCtx, InfoClient, SpotToken, SpotMeta } from '@nktkas/hyperliquid';
|
|
1
|
+
import { MarginTables, PerpsAssetCtx, PerpDex as PerpDex$1, InfoClient, SpotToken, SpotMeta } from '@nktkas/hyperliquid';
|
|
2
2
|
|
|
3
3
|
interface PerpsMeta {
|
|
4
4
|
collateralToken: number;
|
|
@@ -33,6 +33,9 @@ interface PerpsUniverse {
|
|
|
33
33
|
/** Margin mode for the universe. */
|
|
34
34
|
marginMode?: "strictIsolated" | "noCross";
|
|
35
35
|
}
|
|
36
|
+
interface PerpDex extends PerpDex$1 {
|
|
37
|
+
deployerFeeScale: string;
|
|
38
|
+
}
|
|
36
39
|
type AllPerpsMeta = PerpsMeta[];
|
|
37
40
|
declare function getAllPerpsMeta(infoClient: InfoClient): Promise<AllPerpsMeta>;
|
|
38
41
|
|
|
@@ -176,4 +179,4 @@ declare class InstrumentClient {
|
|
|
176
179
|
private extractDexNameFromMeta;
|
|
177
180
|
}
|
|
178
181
|
|
|
179
|
-
export { type AllPerpsMeta as A, type BaseInstrument as B, InstrumentClient as I, type MarketInstrument as M, type PerpsMeta as P, type SpotInstrument as S, type PerpsMetaAndAssetCtxs as a, type PerpsUniverse as b, type
|
|
182
|
+
export { type AllPerpsMeta as A, type BaseInstrument as B, InstrumentClient as I, type MarketInstrument as M, type PerpsMeta as P, type SpotInstrument as S, type PerpsMetaAndAssetCtxs as a, type PerpsUniverse as b, type PerpDex as c, type PerpsInstrument as d, AssetIdUtils as e, getAllPerpsMeta as g };
|
package/dist/ecommerce.d.mts
CHANGED
|
@@ -236,6 +236,36 @@ declare enum MerchantStatus {
|
|
|
236
236
|
/** Merchant is pending approval */
|
|
237
237
|
PENDING = "PENDING"
|
|
238
238
|
}
|
|
239
|
+
/**
|
|
240
|
+
* Merchant business type enum
|
|
241
|
+
*/
|
|
242
|
+
declare enum MerchantBusinessType {
|
|
243
|
+
/** Individual seller */
|
|
244
|
+
INDIVIDUAL = "INDIVIDUAL",
|
|
245
|
+
/** Registered company */
|
|
246
|
+
COMPANY = "COMPANY",
|
|
247
|
+
/** Partnership */
|
|
248
|
+
PARTNERSHIP = "PARTNERSHIP",
|
|
249
|
+
/** Non-profit organization */
|
|
250
|
+
NON_PROFIT = "NON_PROFIT"
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Merchant return policy type enum
|
|
254
|
+
*/
|
|
255
|
+
declare enum MerchantReturnPolicyType {
|
|
256
|
+
/** No returns accepted */
|
|
257
|
+
NO_RETURNS = "NO_RETURNS",
|
|
258
|
+
/** Exchange for same/similar item only */
|
|
259
|
+
EXCHANGE_ONLY = "EXCHANGE_ONLY",
|
|
260
|
+
/** Refund as store credit only */
|
|
261
|
+
STORE_CREDIT = "STORE_CREDIT",
|
|
262
|
+
/** Full refund available */
|
|
263
|
+
FULL_REFUND = "FULL_REFUND",
|
|
264
|
+
/** Partial refund (restocking fee may apply) */
|
|
265
|
+
PARTIAL_REFUND = "PARTIAL_REFUND",
|
|
266
|
+
/** Handled on a case-by-case basis */
|
|
267
|
+
CASE_BY_CASE = "CASE_BY_CASE"
|
|
268
|
+
}
|
|
239
269
|
/**
|
|
240
270
|
* Shipment status enum
|
|
241
271
|
*/
|
|
@@ -532,6 +562,21 @@ interface ProductVariant extends BaseEntity {
|
|
|
532
562
|
/** Sort order */
|
|
533
563
|
sortOrder: number;
|
|
534
564
|
}
|
|
565
|
+
/**
|
|
566
|
+
* Social links for merchant profile
|
|
567
|
+
*/
|
|
568
|
+
interface MerchantSocialLinks {
|
|
569
|
+
/** Twitter/X profile URL */
|
|
570
|
+
twitter?: string | null;
|
|
571
|
+
/** Instagram profile URL */
|
|
572
|
+
instagram?: string | null;
|
|
573
|
+
/** Facebook page URL */
|
|
574
|
+
facebook?: string | null;
|
|
575
|
+
/** Discord server invite URL */
|
|
576
|
+
discord?: string | null;
|
|
577
|
+
/** Telegram channel/group URL */
|
|
578
|
+
telegram?: string | null;
|
|
579
|
+
}
|
|
535
580
|
/**
|
|
536
581
|
* Merchant entity
|
|
537
582
|
*/
|
|
@@ -546,6 +591,32 @@ interface Merchant extends BaseEntity {
|
|
|
546
591
|
payoutAddress: string;
|
|
547
592
|
/** Merchant status */
|
|
548
593
|
status: MerchantStatus;
|
|
594
|
+
/** Contact email for notifications and customer inquiries */
|
|
595
|
+
email?: string | null;
|
|
596
|
+
/** Contact phone number */
|
|
597
|
+
phone?: string | null;
|
|
598
|
+
/** Store website URL */
|
|
599
|
+
website?: string | null;
|
|
600
|
+
/** Business type (individual, company, etc.) */
|
|
601
|
+
businessType?: MerchantBusinessType;
|
|
602
|
+
/** Store logo/avatar URL */
|
|
603
|
+
logoUrl?: string | null;
|
|
604
|
+
/** Store banner image URL */
|
|
605
|
+
bannerUrl?: string | null;
|
|
606
|
+
/** Social media links */
|
|
607
|
+
socialLinks?: MerchantSocialLinks | null;
|
|
608
|
+
/** Return policy type */
|
|
609
|
+
returnPolicyType?: MerchantReturnPolicyType;
|
|
610
|
+
/** Custom return policy details/text */
|
|
611
|
+
returnPolicyDetails?: string | null;
|
|
612
|
+
/** Return window in days (e.g., 30) */
|
|
613
|
+
returnWindowDays?: number | null;
|
|
614
|
+
/** ISO 2-letter country code (for tax/shipping) */
|
|
615
|
+
country?: string | null;
|
|
616
|
+
/** City name */
|
|
617
|
+
city?: string | null;
|
|
618
|
+
/** Street address */
|
|
619
|
+
addressLine1?: string | null;
|
|
549
620
|
}
|
|
550
621
|
/**
|
|
551
622
|
* Shipping address
|
|
@@ -1424,6 +1495,8 @@ interface CreateOrderRequest {
|
|
|
1424
1495
|
interface ListOrdersParams extends PaginationParams {
|
|
1425
1496
|
/** Filter by status */
|
|
1426
1497
|
status?: OrderStatus;
|
|
1498
|
+
/** Filter by merchant ID (for godview access) */
|
|
1499
|
+
merchantId?: string;
|
|
1427
1500
|
}
|
|
1428
1501
|
/**
|
|
1429
1502
|
* Update order status request
|
|
@@ -5654,4 +5727,4 @@ declare function calculateDiscountAmount(price: number, discountType: "PERCENTAG
|
|
|
5654
5727
|
*/
|
|
5655
5728
|
declare function calculateFinalPrice(price: number, discountType: "PERCENTAGE" | "FIXED_AMOUNT", discountValue: number): number;
|
|
5656
5729
|
|
|
5657
|
-
export { type ActiveFlashSalesResponse, type AnalyticsOverview, type ApiResponse, type AppliedDiscount, type Banner, type BannerResponse, BannerType, BaseEcommerceClient, type BaseEntity, type BrowsingLocation, type CalculateCartDiscountsRequest, type CalculateCartDiscountsResponse, type CalculateShippingRequest, type CalculateShippingResponse, type CalculateTaxRequest, type CalculateTaxResponse, type CartItem, type CashAccountBalanceResponse, type ConfirmEscrowDepositResponse, type Coupon, type CouponResponse, type CouponUsage, type CreateBannerRequest, type CreateCouponRequest, type CreateFlashSaleRequest, type CreateOrderEventRequest, type CreateOrderEventResponse, type CreateOrderRequest, type CreateOrderResponse, type CreateProductRequest, type CreateProductVariantRequest, type CreateReviewRequest, type CreateShippingMethodRequest, type CreateShippingRateRequest, type CreateShippingZoneRequest, type CreateTaxNexusRequest, type CreateTaxRuleRequest, CustomerEcommerceClient, type CustomerMessagesResponse, type CustomerSummary, type DeleteBrowsingLocationResponse, type DeliveryAddressResponse, DiscountMethod, DiscountScope, DiscountType, EcommerceApiError, type EcommerceClientConfig, type ExpiringGemBatch, type FlashSale, type FlashSaleAllowanceInfo, type FlashSaleItem, type FlashSaleItemInput, type FollowActionResponse, type FollowStatusResponse, type FollowedMerchantSummary, type GemHistoryItem, type GemHistoryType, type GemHistoryTypeFilter, type GemSource, type GenerateTaxReportRequest, type GetAnalyticsParams, type GetAnalyticsResponse, type GetBrowsingLocationResponse, type GetCouponResponse, type GetExpiringGemsParams, type GetExpiringGemsResponse, type GetFlashSaleAllowanceParams, type GetFlashSaleAllowanceResponse, type GetGemBalanceResponse, type GetGemHistoryParams, type GetGemHistoryResponse, type GetOrderResponse, type GetPaymentMethodsResponse, type GetProductMetricsResponse, type GetProductResponse, type GetTaxReportResponse, InventoryAuditAction, type InventoryAuditEntry, type ListActiveBannersParams, type ListActiveFlashSalesParams, type ListBannersResponse, type ListCouponsResponse, type ListCustomersParams, type ListCustomersResponse, type ListFollowingParams, type ListFollowingResponse, type ListInventoryAuditResponse, type ListMediaAssetsResponse, type ListMerchantProductsParams, type ListMessagesResponse, type ListOrdersParams, type ListOrdersResponse, type ListProductVariantsResponse, type ListProductsParams, type ListProductsResponse, type ListReturnsResponse, type ListReviewsParams, type ListReviewsResponse, type ListShipmentsResponse, type ListShippingAddressesResponse, type ListShippingMethodsResponse, type ListShippingRatesResponse, type ListShippingZonesResponse, type ListTaxNexusResponse, type ListTaxReportsParams, type ListTaxReportsResponse, type ListTaxRulesResponse, type MediaAsset, type MediaAssetResponse, type Merchant, MerchantEcommerceClient, type MerchantProductsResponse, type MerchantProfileRequest, type MerchantProfileResponse, type MerchantShippingSettings, MerchantStatus, type Message, type MessageResponse, type MessageStatsResponse, type Order, type OrderEvent, type OrderItem, type OrderReceiptResponse, OrderStatus, type OrdersByStatus, type PaginatedResponse, type PaginationParams, type Payment, PaymentMethod, type PaymentMethodInfo, PaymentStatus, type ProcessPaymentRequest, type ProcessPaymentResponse, type Product, type ProductDimensions, type ProductDiscountsResponse, type ProductMetrics, type ProductResponse, type ProductReview, ProductSortBy, type ProductVariant, type ProductVariantResponse, type PublicMerchantProfile, type PublicMerchantProfileResponse, type RecentOrderSummary, type RespondToReviewRequest, type Return, type ReturnItem, type ReturnResponse, ReturnStatus, type RevenueByDay, type ReviewResponse, ReviewSortBy, ReviewStatus, type SaveBrowsingLocationRequest, type SaveBrowsingLocationResponse, type SendMessageRequest, type Settlement, type Shipment, type ShipmentResponse, ShipmentStatus, type ShippingAddress$1 as ShippingAddress, type ShippingAddressRequest, type ShippingAddressResponse, type ShippingMethod, type ShippingMethodResponse, type ShippingOption, type ShippingRate, type ShippingRateResponse, type ShippingSettingsResponse, type ShippingZone, type ShippingZoneResponse, SortOrder, type SuccessResponse, TaxBehavior, type TaxBreakdownItem, type TaxNexus, type TaxNexusResponse, type TaxReport, type TaxReportDetails, TaxReportPeriodType, type TaxReportResponse, TaxReportStatus, type TaxRule, type TaxRuleResponse, type TaxSettings, type TaxSettingsResponse, TaxType, type TopProduct, type TrackBannerRequest, type UpdateBannerRequest, type UpdateCouponRequest, type UpdateFlashSaleRequest, type UpdateOrderResponse, type UpdateOrderStatusRequest, type UpdateProductRequest, type UpdateProductVariantRequest, type UpdateShipmentRequest, type UpdateShippingMethodRequest, type UpdateShippingRateRequest, type UpdateShippingSettingsRequest, type UpdateShippingZoneRequest, type UpdateTaxNexusRequest, type UpdateTaxReportStatusRequest, type UpdateTaxRuleRequest, type UpdateTaxSettingsRequest, type UserShippingAddress, type ValidateDiscountRequest, type ValidateDiscountResponse, buildQueryString, calculateDiscountAmount, calculateFinalPrice, formatPrice, getBackoffDelay, isRetryableError, isValidAddress, isValidEmail, parseError, retryWithBackoff, sleep, truncateAddress };
|
|
5730
|
+
export { type ActiveFlashSalesResponse, type AnalyticsOverview, type ApiResponse, type AppliedDiscount, type Banner, type BannerResponse, BannerType, BaseEcommerceClient, type BaseEntity, type BrowsingLocation, type CalculateCartDiscountsRequest, type CalculateCartDiscountsResponse, type CalculateShippingRequest, type CalculateShippingResponse, type CalculateTaxRequest, type CalculateTaxResponse, type CartItem, type CashAccountBalanceResponse, type ConfirmEscrowDepositResponse, type Coupon, type CouponResponse, type CouponUsage, type CreateBannerRequest, type CreateCouponRequest, type CreateFlashSaleRequest, type CreateOrderEventRequest, type CreateOrderEventResponse, type CreateOrderRequest, type CreateOrderResponse, type CreateProductRequest, type CreateProductVariantRequest, type CreateReviewRequest, type CreateShippingMethodRequest, type CreateShippingRateRequest, type CreateShippingZoneRequest, type CreateTaxNexusRequest, type CreateTaxRuleRequest, CustomerEcommerceClient, type CustomerMessagesResponse, type CustomerSummary, type DeleteBrowsingLocationResponse, type DeliveryAddressResponse, DiscountMethod, DiscountScope, DiscountType, EcommerceApiError, type EcommerceClientConfig, type ExpiringGemBatch, type FlashSale, type FlashSaleAllowanceInfo, type FlashSaleItem, type FlashSaleItemInput, type FollowActionResponse, type FollowStatusResponse, type FollowedMerchantSummary, type GemHistoryItem, type GemHistoryType, type GemHistoryTypeFilter, type GemSource, type GenerateTaxReportRequest, type GetAnalyticsParams, type GetAnalyticsResponse, type GetBrowsingLocationResponse, type GetCouponResponse, type GetExpiringGemsParams, type GetExpiringGemsResponse, type GetFlashSaleAllowanceParams, type GetFlashSaleAllowanceResponse, type GetGemBalanceResponse, type GetGemHistoryParams, type GetGemHistoryResponse, type GetOrderResponse, type GetPaymentMethodsResponse, type GetProductMetricsResponse, type GetProductResponse, type GetTaxReportResponse, InventoryAuditAction, type InventoryAuditEntry, type ListActiveBannersParams, type ListActiveFlashSalesParams, type ListBannersResponse, type ListCouponsResponse, type ListCustomersParams, type ListCustomersResponse, type ListFollowingParams, type ListFollowingResponse, type ListInventoryAuditResponse, type ListMediaAssetsResponse, type ListMerchantProductsParams, type ListMessagesResponse, type ListOrdersParams, type ListOrdersResponse, type ListProductVariantsResponse, type ListProductsParams, type ListProductsResponse, type ListReturnsResponse, type ListReviewsParams, type ListReviewsResponse, type ListShipmentsResponse, type ListShippingAddressesResponse, type ListShippingMethodsResponse, type ListShippingRatesResponse, type ListShippingZonesResponse, type ListTaxNexusResponse, type ListTaxReportsParams, type ListTaxReportsResponse, type ListTaxRulesResponse, type MediaAsset, type MediaAssetResponse, type Merchant, MerchantBusinessType, MerchantEcommerceClient, type MerchantProductsResponse, type MerchantProfileRequest, type MerchantProfileResponse, MerchantReturnPolicyType, type MerchantShippingSettings, type MerchantSocialLinks, MerchantStatus, type Message, type MessageResponse, type MessageStatsResponse, type Order, type OrderEvent, type OrderItem, type OrderReceiptResponse, OrderStatus, type OrdersByStatus, type PaginatedResponse, type PaginationParams, type Payment, PaymentMethod, type PaymentMethodInfo, PaymentStatus, type ProcessPaymentRequest, type ProcessPaymentResponse, type Product, type ProductDimensions, type ProductDiscountsResponse, type ProductMetrics, type ProductResponse, type ProductReview, ProductSortBy, type ProductVariant, type ProductVariantResponse, type PublicMerchantProfile, type PublicMerchantProfileResponse, type RecentOrderSummary, type RespondToReviewRequest, type Return, type ReturnItem, type ReturnResponse, ReturnStatus, type RevenueByDay, type ReviewResponse, ReviewSortBy, ReviewStatus, type SaveBrowsingLocationRequest, type SaveBrowsingLocationResponse, type SendMessageRequest, type Settlement, type Shipment, type ShipmentResponse, ShipmentStatus, type ShippingAddress$1 as ShippingAddress, type ShippingAddressRequest, type ShippingAddressResponse, type ShippingMethod, type ShippingMethodResponse, type ShippingOption, type ShippingRate, type ShippingRateResponse, type ShippingSettingsResponse, type ShippingZone, type ShippingZoneResponse, SortOrder, type SuccessResponse, TaxBehavior, type TaxBreakdownItem, type TaxNexus, type TaxNexusResponse, type TaxReport, type TaxReportDetails, TaxReportPeriodType, type TaxReportResponse, TaxReportStatus, type TaxRule, type TaxRuleResponse, type TaxSettings, type TaxSettingsResponse, TaxType, type TopProduct, type TrackBannerRequest, type UpdateBannerRequest, type UpdateCouponRequest, type UpdateFlashSaleRequest, type UpdateOrderResponse, type UpdateOrderStatusRequest, type UpdateProductRequest, type UpdateProductVariantRequest, type UpdateShipmentRequest, type UpdateShippingMethodRequest, type UpdateShippingRateRequest, type UpdateShippingSettingsRequest, type UpdateShippingZoneRequest, type UpdateTaxNexusRequest, type UpdateTaxReportStatusRequest, type UpdateTaxRuleRequest, type UpdateTaxSettingsRequest, type UserShippingAddress, type ValidateDiscountRequest, type ValidateDiscountResponse, buildQueryString, calculateDiscountAmount, calculateFinalPrice, formatPrice, getBackoffDelay, isRetryableError, isValidAddress, isValidEmail, parseError, retryWithBackoff, sleep, truncateAddress };
|
package/dist/ecommerce.d.ts
CHANGED
|
@@ -236,6 +236,36 @@ declare enum MerchantStatus {
|
|
|
236
236
|
/** Merchant is pending approval */
|
|
237
237
|
PENDING = "PENDING"
|
|
238
238
|
}
|
|
239
|
+
/**
|
|
240
|
+
* Merchant business type enum
|
|
241
|
+
*/
|
|
242
|
+
declare enum MerchantBusinessType {
|
|
243
|
+
/** Individual seller */
|
|
244
|
+
INDIVIDUAL = "INDIVIDUAL",
|
|
245
|
+
/** Registered company */
|
|
246
|
+
COMPANY = "COMPANY",
|
|
247
|
+
/** Partnership */
|
|
248
|
+
PARTNERSHIP = "PARTNERSHIP",
|
|
249
|
+
/** Non-profit organization */
|
|
250
|
+
NON_PROFIT = "NON_PROFIT"
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Merchant return policy type enum
|
|
254
|
+
*/
|
|
255
|
+
declare enum MerchantReturnPolicyType {
|
|
256
|
+
/** No returns accepted */
|
|
257
|
+
NO_RETURNS = "NO_RETURNS",
|
|
258
|
+
/** Exchange for same/similar item only */
|
|
259
|
+
EXCHANGE_ONLY = "EXCHANGE_ONLY",
|
|
260
|
+
/** Refund as store credit only */
|
|
261
|
+
STORE_CREDIT = "STORE_CREDIT",
|
|
262
|
+
/** Full refund available */
|
|
263
|
+
FULL_REFUND = "FULL_REFUND",
|
|
264
|
+
/** Partial refund (restocking fee may apply) */
|
|
265
|
+
PARTIAL_REFUND = "PARTIAL_REFUND",
|
|
266
|
+
/** Handled on a case-by-case basis */
|
|
267
|
+
CASE_BY_CASE = "CASE_BY_CASE"
|
|
268
|
+
}
|
|
239
269
|
/**
|
|
240
270
|
* Shipment status enum
|
|
241
271
|
*/
|
|
@@ -532,6 +562,21 @@ interface ProductVariant extends BaseEntity {
|
|
|
532
562
|
/** Sort order */
|
|
533
563
|
sortOrder: number;
|
|
534
564
|
}
|
|
565
|
+
/**
|
|
566
|
+
* Social links for merchant profile
|
|
567
|
+
*/
|
|
568
|
+
interface MerchantSocialLinks {
|
|
569
|
+
/** Twitter/X profile URL */
|
|
570
|
+
twitter?: string | null;
|
|
571
|
+
/** Instagram profile URL */
|
|
572
|
+
instagram?: string | null;
|
|
573
|
+
/** Facebook page URL */
|
|
574
|
+
facebook?: string | null;
|
|
575
|
+
/** Discord server invite URL */
|
|
576
|
+
discord?: string | null;
|
|
577
|
+
/** Telegram channel/group URL */
|
|
578
|
+
telegram?: string | null;
|
|
579
|
+
}
|
|
535
580
|
/**
|
|
536
581
|
* Merchant entity
|
|
537
582
|
*/
|
|
@@ -546,6 +591,32 @@ interface Merchant extends BaseEntity {
|
|
|
546
591
|
payoutAddress: string;
|
|
547
592
|
/** Merchant status */
|
|
548
593
|
status: MerchantStatus;
|
|
594
|
+
/** Contact email for notifications and customer inquiries */
|
|
595
|
+
email?: string | null;
|
|
596
|
+
/** Contact phone number */
|
|
597
|
+
phone?: string | null;
|
|
598
|
+
/** Store website URL */
|
|
599
|
+
website?: string | null;
|
|
600
|
+
/** Business type (individual, company, etc.) */
|
|
601
|
+
businessType?: MerchantBusinessType;
|
|
602
|
+
/** Store logo/avatar URL */
|
|
603
|
+
logoUrl?: string | null;
|
|
604
|
+
/** Store banner image URL */
|
|
605
|
+
bannerUrl?: string | null;
|
|
606
|
+
/** Social media links */
|
|
607
|
+
socialLinks?: MerchantSocialLinks | null;
|
|
608
|
+
/** Return policy type */
|
|
609
|
+
returnPolicyType?: MerchantReturnPolicyType;
|
|
610
|
+
/** Custom return policy details/text */
|
|
611
|
+
returnPolicyDetails?: string | null;
|
|
612
|
+
/** Return window in days (e.g., 30) */
|
|
613
|
+
returnWindowDays?: number | null;
|
|
614
|
+
/** ISO 2-letter country code (for tax/shipping) */
|
|
615
|
+
country?: string | null;
|
|
616
|
+
/** City name */
|
|
617
|
+
city?: string | null;
|
|
618
|
+
/** Street address */
|
|
619
|
+
addressLine1?: string | null;
|
|
549
620
|
}
|
|
550
621
|
/**
|
|
551
622
|
* Shipping address
|
|
@@ -1424,6 +1495,8 @@ interface CreateOrderRequest {
|
|
|
1424
1495
|
interface ListOrdersParams extends PaginationParams {
|
|
1425
1496
|
/** Filter by status */
|
|
1426
1497
|
status?: OrderStatus;
|
|
1498
|
+
/** Filter by merchant ID (for godview access) */
|
|
1499
|
+
merchantId?: string;
|
|
1427
1500
|
}
|
|
1428
1501
|
/**
|
|
1429
1502
|
* Update order status request
|
|
@@ -5654,4 +5727,4 @@ declare function calculateDiscountAmount(price: number, discountType: "PERCENTAG
|
|
|
5654
5727
|
*/
|
|
5655
5728
|
declare function calculateFinalPrice(price: number, discountType: "PERCENTAGE" | "FIXED_AMOUNT", discountValue: number): number;
|
|
5656
5729
|
|
|
5657
|
-
export { type ActiveFlashSalesResponse, type AnalyticsOverview, type ApiResponse, type AppliedDiscount, type Banner, type BannerResponse, BannerType, BaseEcommerceClient, type BaseEntity, type BrowsingLocation, type CalculateCartDiscountsRequest, type CalculateCartDiscountsResponse, type CalculateShippingRequest, type CalculateShippingResponse, type CalculateTaxRequest, type CalculateTaxResponse, type CartItem, type CashAccountBalanceResponse, type ConfirmEscrowDepositResponse, type Coupon, type CouponResponse, type CouponUsage, type CreateBannerRequest, type CreateCouponRequest, type CreateFlashSaleRequest, type CreateOrderEventRequest, type CreateOrderEventResponse, type CreateOrderRequest, type CreateOrderResponse, type CreateProductRequest, type CreateProductVariantRequest, type CreateReviewRequest, type CreateShippingMethodRequest, type CreateShippingRateRequest, type CreateShippingZoneRequest, type CreateTaxNexusRequest, type CreateTaxRuleRequest, CustomerEcommerceClient, type CustomerMessagesResponse, type CustomerSummary, type DeleteBrowsingLocationResponse, type DeliveryAddressResponse, DiscountMethod, DiscountScope, DiscountType, EcommerceApiError, type EcommerceClientConfig, type ExpiringGemBatch, type FlashSale, type FlashSaleAllowanceInfo, type FlashSaleItem, type FlashSaleItemInput, type FollowActionResponse, type FollowStatusResponse, type FollowedMerchantSummary, type GemHistoryItem, type GemHistoryType, type GemHistoryTypeFilter, type GemSource, type GenerateTaxReportRequest, type GetAnalyticsParams, type GetAnalyticsResponse, type GetBrowsingLocationResponse, type GetCouponResponse, type GetExpiringGemsParams, type GetExpiringGemsResponse, type GetFlashSaleAllowanceParams, type GetFlashSaleAllowanceResponse, type GetGemBalanceResponse, type GetGemHistoryParams, type GetGemHistoryResponse, type GetOrderResponse, type GetPaymentMethodsResponse, type GetProductMetricsResponse, type GetProductResponse, type GetTaxReportResponse, InventoryAuditAction, type InventoryAuditEntry, type ListActiveBannersParams, type ListActiveFlashSalesParams, type ListBannersResponse, type ListCouponsResponse, type ListCustomersParams, type ListCustomersResponse, type ListFollowingParams, type ListFollowingResponse, type ListInventoryAuditResponse, type ListMediaAssetsResponse, type ListMerchantProductsParams, type ListMessagesResponse, type ListOrdersParams, type ListOrdersResponse, type ListProductVariantsResponse, type ListProductsParams, type ListProductsResponse, type ListReturnsResponse, type ListReviewsParams, type ListReviewsResponse, type ListShipmentsResponse, type ListShippingAddressesResponse, type ListShippingMethodsResponse, type ListShippingRatesResponse, type ListShippingZonesResponse, type ListTaxNexusResponse, type ListTaxReportsParams, type ListTaxReportsResponse, type ListTaxRulesResponse, type MediaAsset, type MediaAssetResponse, type Merchant, MerchantEcommerceClient, type MerchantProductsResponse, type MerchantProfileRequest, type MerchantProfileResponse, type MerchantShippingSettings, MerchantStatus, type Message, type MessageResponse, type MessageStatsResponse, type Order, type OrderEvent, type OrderItem, type OrderReceiptResponse, OrderStatus, type OrdersByStatus, type PaginatedResponse, type PaginationParams, type Payment, PaymentMethod, type PaymentMethodInfo, PaymentStatus, type ProcessPaymentRequest, type ProcessPaymentResponse, type Product, type ProductDimensions, type ProductDiscountsResponse, type ProductMetrics, type ProductResponse, type ProductReview, ProductSortBy, type ProductVariant, type ProductVariantResponse, type PublicMerchantProfile, type PublicMerchantProfileResponse, type RecentOrderSummary, type RespondToReviewRequest, type Return, type ReturnItem, type ReturnResponse, ReturnStatus, type RevenueByDay, type ReviewResponse, ReviewSortBy, ReviewStatus, type SaveBrowsingLocationRequest, type SaveBrowsingLocationResponse, type SendMessageRequest, type Settlement, type Shipment, type ShipmentResponse, ShipmentStatus, type ShippingAddress$1 as ShippingAddress, type ShippingAddressRequest, type ShippingAddressResponse, type ShippingMethod, type ShippingMethodResponse, type ShippingOption, type ShippingRate, type ShippingRateResponse, type ShippingSettingsResponse, type ShippingZone, type ShippingZoneResponse, SortOrder, type SuccessResponse, TaxBehavior, type TaxBreakdownItem, type TaxNexus, type TaxNexusResponse, type TaxReport, type TaxReportDetails, TaxReportPeriodType, type TaxReportResponse, TaxReportStatus, type TaxRule, type TaxRuleResponse, type TaxSettings, type TaxSettingsResponse, TaxType, type TopProduct, type TrackBannerRequest, type UpdateBannerRequest, type UpdateCouponRequest, type UpdateFlashSaleRequest, type UpdateOrderResponse, type UpdateOrderStatusRequest, type UpdateProductRequest, type UpdateProductVariantRequest, type UpdateShipmentRequest, type UpdateShippingMethodRequest, type UpdateShippingRateRequest, type UpdateShippingSettingsRequest, type UpdateShippingZoneRequest, type UpdateTaxNexusRequest, type UpdateTaxReportStatusRequest, type UpdateTaxRuleRequest, type UpdateTaxSettingsRequest, type UserShippingAddress, type ValidateDiscountRequest, type ValidateDiscountResponse, buildQueryString, calculateDiscountAmount, calculateFinalPrice, formatPrice, getBackoffDelay, isRetryableError, isValidAddress, isValidEmail, parseError, retryWithBackoff, sleep, truncateAddress };
|
|
5730
|
+
export { type ActiveFlashSalesResponse, type AnalyticsOverview, type ApiResponse, type AppliedDiscount, type Banner, type BannerResponse, BannerType, BaseEcommerceClient, type BaseEntity, type BrowsingLocation, type CalculateCartDiscountsRequest, type CalculateCartDiscountsResponse, type CalculateShippingRequest, type CalculateShippingResponse, type CalculateTaxRequest, type CalculateTaxResponse, type CartItem, type CashAccountBalanceResponse, type ConfirmEscrowDepositResponse, type Coupon, type CouponResponse, type CouponUsage, type CreateBannerRequest, type CreateCouponRequest, type CreateFlashSaleRequest, type CreateOrderEventRequest, type CreateOrderEventResponse, type CreateOrderRequest, type CreateOrderResponse, type CreateProductRequest, type CreateProductVariantRequest, type CreateReviewRequest, type CreateShippingMethodRequest, type CreateShippingRateRequest, type CreateShippingZoneRequest, type CreateTaxNexusRequest, type CreateTaxRuleRequest, CustomerEcommerceClient, type CustomerMessagesResponse, type CustomerSummary, type DeleteBrowsingLocationResponse, type DeliveryAddressResponse, DiscountMethod, DiscountScope, DiscountType, EcommerceApiError, type EcommerceClientConfig, type ExpiringGemBatch, type FlashSale, type FlashSaleAllowanceInfo, type FlashSaleItem, type FlashSaleItemInput, type FollowActionResponse, type FollowStatusResponse, type FollowedMerchantSummary, type GemHistoryItem, type GemHistoryType, type GemHistoryTypeFilter, type GemSource, type GenerateTaxReportRequest, type GetAnalyticsParams, type GetAnalyticsResponse, type GetBrowsingLocationResponse, type GetCouponResponse, type GetExpiringGemsParams, type GetExpiringGemsResponse, type GetFlashSaleAllowanceParams, type GetFlashSaleAllowanceResponse, type GetGemBalanceResponse, type GetGemHistoryParams, type GetGemHistoryResponse, type GetOrderResponse, type GetPaymentMethodsResponse, type GetProductMetricsResponse, type GetProductResponse, type GetTaxReportResponse, InventoryAuditAction, type InventoryAuditEntry, type ListActiveBannersParams, type ListActiveFlashSalesParams, type ListBannersResponse, type ListCouponsResponse, type ListCustomersParams, type ListCustomersResponse, type ListFollowingParams, type ListFollowingResponse, type ListInventoryAuditResponse, type ListMediaAssetsResponse, type ListMerchantProductsParams, type ListMessagesResponse, type ListOrdersParams, type ListOrdersResponse, type ListProductVariantsResponse, type ListProductsParams, type ListProductsResponse, type ListReturnsResponse, type ListReviewsParams, type ListReviewsResponse, type ListShipmentsResponse, type ListShippingAddressesResponse, type ListShippingMethodsResponse, type ListShippingRatesResponse, type ListShippingZonesResponse, type ListTaxNexusResponse, type ListTaxReportsParams, type ListTaxReportsResponse, type ListTaxRulesResponse, type MediaAsset, type MediaAssetResponse, type Merchant, MerchantBusinessType, MerchantEcommerceClient, type MerchantProductsResponse, type MerchantProfileRequest, type MerchantProfileResponse, MerchantReturnPolicyType, type MerchantShippingSettings, type MerchantSocialLinks, MerchantStatus, type Message, type MessageResponse, type MessageStatsResponse, type Order, type OrderEvent, type OrderItem, type OrderReceiptResponse, OrderStatus, type OrdersByStatus, type PaginatedResponse, type PaginationParams, type Payment, PaymentMethod, type PaymentMethodInfo, PaymentStatus, type ProcessPaymentRequest, type ProcessPaymentResponse, type Product, type ProductDimensions, type ProductDiscountsResponse, type ProductMetrics, type ProductResponse, type ProductReview, ProductSortBy, type ProductVariant, type ProductVariantResponse, type PublicMerchantProfile, type PublicMerchantProfileResponse, type RecentOrderSummary, type RespondToReviewRequest, type Return, type ReturnItem, type ReturnResponse, ReturnStatus, type RevenueByDay, type ReviewResponse, ReviewSortBy, ReviewStatus, type SaveBrowsingLocationRequest, type SaveBrowsingLocationResponse, type SendMessageRequest, type Settlement, type Shipment, type ShipmentResponse, ShipmentStatus, type ShippingAddress$1 as ShippingAddress, type ShippingAddressRequest, type ShippingAddressResponse, type ShippingMethod, type ShippingMethodResponse, type ShippingOption, type ShippingRate, type ShippingRateResponse, type ShippingSettingsResponse, type ShippingZone, type ShippingZoneResponse, SortOrder, type SuccessResponse, TaxBehavior, type TaxBreakdownItem, type TaxNexus, type TaxNexusResponse, type TaxReport, type TaxReportDetails, TaxReportPeriodType, type TaxReportResponse, TaxReportStatus, type TaxRule, type TaxRuleResponse, type TaxSettings, type TaxSettingsResponse, TaxType, type TopProduct, type TrackBannerRequest, type UpdateBannerRequest, type UpdateCouponRequest, type UpdateFlashSaleRequest, type UpdateOrderResponse, type UpdateOrderStatusRequest, type UpdateProductRequest, type UpdateProductVariantRequest, type UpdateShipmentRequest, type UpdateShippingMethodRequest, type UpdateShippingRateRequest, type UpdateShippingSettingsRequest, type UpdateShippingZoneRequest, type UpdateTaxNexusRequest, type UpdateTaxReportStatusRequest, type UpdateTaxRuleRequest, type UpdateTaxSettingsRequest, type UserShippingAddress, type ValidateDiscountRequest, type ValidateDiscountResponse, buildQueryString, calculateDiscountAmount, calculateFinalPrice, formatPrice, getBackoffDelay, isRetryableError, isValidAddress, isValidEmail, parseError, retryWithBackoff, sleep, truncateAddress };
|
package/dist/ecommerce.js
CHANGED
|
@@ -2800,6 +2800,22 @@ var MerchantStatus = /* @__PURE__ */ ((MerchantStatus2) => {
|
|
|
2800
2800
|
MerchantStatus2["PENDING"] = "PENDING";
|
|
2801
2801
|
return MerchantStatus2;
|
|
2802
2802
|
})(MerchantStatus || {});
|
|
2803
|
+
var MerchantBusinessType = /* @__PURE__ */ ((MerchantBusinessType2) => {
|
|
2804
|
+
MerchantBusinessType2["INDIVIDUAL"] = "INDIVIDUAL";
|
|
2805
|
+
MerchantBusinessType2["COMPANY"] = "COMPANY";
|
|
2806
|
+
MerchantBusinessType2["PARTNERSHIP"] = "PARTNERSHIP";
|
|
2807
|
+
MerchantBusinessType2["NON_PROFIT"] = "NON_PROFIT";
|
|
2808
|
+
return MerchantBusinessType2;
|
|
2809
|
+
})(MerchantBusinessType || {});
|
|
2810
|
+
var MerchantReturnPolicyType = /* @__PURE__ */ ((MerchantReturnPolicyType2) => {
|
|
2811
|
+
MerchantReturnPolicyType2["NO_RETURNS"] = "NO_RETURNS";
|
|
2812
|
+
MerchantReturnPolicyType2["EXCHANGE_ONLY"] = "EXCHANGE_ONLY";
|
|
2813
|
+
MerchantReturnPolicyType2["STORE_CREDIT"] = "STORE_CREDIT";
|
|
2814
|
+
MerchantReturnPolicyType2["FULL_REFUND"] = "FULL_REFUND";
|
|
2815
|
+
MerchantReturnPolicyType2["PARTIAL_REFUND"] = "PARTIAL_REFUND";
|
|
2816
|
+
MerchantReturnPolicyType2["CASE_BY_CASE"] = "CASE_BY_CASE";
|
|
2817
|
+
return MerchantReturnPolicyType2;
|
|
2818
|
+
})(MerchantReturnPolicyType || {});
|
|
2803
2819
|
var ShipmentStatus = /* @__PURE__ */ ((ShipmentStatus2) => {
|
|
2804
2820
|
ShipmentStatus2["PENDING"] = "PENDING";
|
|
2805
2821
|
ShipmentStatus2["SHIPPED"] = "SHIPPED";
|
|
@@ -2911,7 +2927,9 @@ exports.DiscountScope = DiscountScope;
|
|
|
2911
2927
|
exports.DiscountType = DiscountType;
|
|
2912
2928
|
exports.EcommerceApiError = EcommerceApiError;
|
|
2913
2929
|
exports.InventoryAuditAction = InventoryAuditAction;
|
|
2930
|
+
exports.MerchantBusinessType = MerchantBusinessType;
|
|
2914
2931
|
exports.MerchantEcommerceClient = MerchantEcommerceClient;
|
|
2932
|
+
exports.MerchantReturnPolicyType = MerchantReturnPolicyType;
|
|
2915
2933
|
exports.MerchantStatus = MerchantStatus;
|
|
2916
2934
|
exports.OrderStatus = OrderStatus;
|
|
2917
2935
|
exports.PaymentMethod = PaymentMethod;
|
package/dist/ecommerce.mjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export { BannerType, BaseEcommerceClient, CustomerEcommerceClient, DiscountMethod, DiscountScope, DiscountType, EcommerceApiError, InventoryAuditAction, MerchantEcommerceClient, MerchantStatus, OrderStatus, PaymentMethod, PaymentStatus, ProductSortBy, ReturnStatus, ReviewSortBy, ReviewStatus, ShipmentStatus, SortOrder, TaxBehavior, TaxReportPeriodType, TaxReportStatus, TaxType, buildQueryString, calculateDiscountAmount, calculateFinalPrice, formatPrice, getBackoffDelay, isRetryableError, isValidAddress, isValidEmail, parseError, retryWithBackoff, sleep, truncateAddress } from './chunk-
|
|
2
|
-
import './chunk-4UEJOM6W.mjs';
|
|
1
|
+
export { BannerType, BaseEcommerceClient, CustomerEcommerceClient, DiscountMethod, DiscountScope, DiscountType, EcommerceApiError, InventoryAuditAction, MerchantBusinessType, MerchantEcommerceClient, MerchantReturnPolicyType, MerchantStatus, OrderStatus, PaymentMethod, PaymentStatus, ProductSortBy, ReturnStatus, ReviewSortBy, ReviewStatus, ShipmentStatus, SortOrder, TaxBehavior, TaxReportPeriodType, TaxReportStatus, TaxType, buildQueryString, calculateDiscountAmount, calculateFinalPrice, formatPrice, getBackoffDelay, isRetryableError, isValidAddress, isValidEmail, parseError, retryWithBackoff, sleep, truncateAddress } from './chunk-NKSQEISP.mjs';
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { SpotToken, MarginTables, PerpsAssetCtx,
|
|
2
|
-
|
|
3
|
-
export {
|
|
4
|
-
export { ActiveFlashSalesResponse, AnalyticsOverview, ApiResponse, AppliedDiscount, Banner, BannerResponse, BannerType, BaseEcommerceClient, BaseEntity, BrowsingLocation, CalculateCartDiscountsRequest, CalculateCartDiscountsResponse, CalculateShippingRequest, CalculateShippingResponse, CalculateTaxRequest, CalculateTaxResponse, CartItem, CashAccountBalanceResponse, ConfirmEscrowDepositResponse, Coupon, CouponResponse, CouponUsage, CreateBannerRequest, CreateCouponRequest, CreateFlashSaleRequest, CreateOrderEventRequest, CreateOrderEventResponse, CreateOrderRequest, CreateOrderResponse, CreateProductRequest, CreateProductVariantRequest, CreateReviewRequest, CreateShippingMethodRequest, CreateShippingRateRequest, CreateShippingZoneRequest, CreateTaxNexusRequest, CreateTaxRuleRequest, CustomerEcommerceClient, CustomerMessagesResponse, CustomerSummary, DeleteBrowsingLocationResponse, DeliveryAddressResponse, DiscountMethod, DiscountScope, DiscountType, EcommerceApiError, EcommerceClientConfig, ExpiringGemBatch, FlashSale, FlashSaleAllowanceInfo, FlashSaleItem, FlashSaleItemInput, FollowActionResponse, FollowStatusResponse, FollowedMerchantSummary, GemHistoryItem, GemHistoryType, GemHistoryTypeFilter, GemSource, GenerateTaxReportRequest, GetAnalyticsParams, GetAnalyticsResponse, GetBrowsingLocationResponse, GetCouponResponse, GetExpiringGemsParams, GetExpiringGemsResponse, GetFlashSaleAllowanceParams, GetFlashSaleAllowanceResponse, GetGemBalanceResponse, GetGemHistoryParams, GetGemHistoryResponse, GetOrderResponse, GetPaymentMethodsResponse, GetProductMetricsResponse, GetProductResponse, GetTaxReportResponse, InventoryAuditAction, InventoryAuditEntry, ListActiveBannersParams, ListActiveFlashSalesParams, ListBannersResponse, ListCouponsResponse, ListCustomersParams, ListCustomersResponse, ListFollowingParams, ListFollowingResponse, ListInventoryAuditResponse, ListMediaAssetsResponse, ListMerchantProductsParams, ListMessagesResponse, ListOrdersParams, ListOrdersResponse, ListProductVariantsResponse, ListProductsParams, ListProductsResponse, ListReturnsResponse, ListReviewsParams, ListReviewsResponse, ListShipmentsResponse, ListShippingAddressesResponse, ListShippingMethodsResponse, ListShippingRatesResponse, ListShippingZonesResponse, ListTaxNexusResponse, ListTaxReportsParams, ListTaxReportsResponse, ListTaxRulesResponse, MediaAsset, MediaAssetResponse, Merchant, MerchantEcommerceClient, MerchantProductsResponse, MerchantProfileRequest, MerchantProfileResponse, MerchantShippingSettings, MerchantStatus, Message, MessageResponse, MessageStatsResponse, Order, OrderEvent, OrderItem, OrderReceiptResponse, OrderStatus, OrdersByStatus, PaginatedResponse, PaginationParams, Payment, PaymentMethod, PaymentMethodInfo, PaymentStatus, ProcessPaymentRequest, ProcessPaymentResponse, Product, ProductDimensions, ProductDiscountsResponse, ProductMetrics, ProductResponse, ProductReview, ProductSortBy, ProductVariant, ProductVariantResponse, PublicMerchantProfile, PublicMerchantProfileResponse, RecentOrderSummary, RespondToReviewRequest, Return, ReturnItem, ReturnResponse, ReturnStatus, RevenueByDay, ReviewResponse, ReviewSortBy, ReviewStatus, SaveBrowsingLocationRequest, SaveBrowsingLocationResponse, SendMessageRequest, Settlement, Shipment, ShipmentResponse, ShipmentStatus, ShippingAddress, ShippingAddressRequest, ShippingAddressResponse, ShippingMethod, ShippingMethodResponse, ShippingOption, ShippingRate, ShippingRateResponse, ShippingSettingsResponse, ShippingZone, ShippingZoneResponse, SortOrder, SuccessResponse, TaxBehavior, TaxBreakdownItem, TaxNexus, TaxNexusResponse, TaxReport, TaxReportDetails, TaxReportPeriodType, TaxReportResponse, TaxReportStatus, TaxRule, TaxRuleResponse, TaxSettings, TaxSettingsResponse, TaxType, TopProduct, TrackBannerRequest, UpdateBannerRequest, UpdateCouponRequest, UpdateFlashSaleRequest, UpdateOrderResponse, UpdateOrderStatusRequest, UpdateProductRequest, UpdateProductVariantRequest, UpdateShipmentRequest, UpdateShippingMethodRequest, UpdateShippingRateRequest, UpdateShippingSettingsRequest, UpdateShippingZoneRequest, UpdateTaxNexusRequest, UpdateTaxReportStatusRequest, UpdateTaxRuleRequest, UpdateTaxSettingsRequest, UserShippingAddress, ValidateDiscountRequest, ValidateDiscountResponse, buildQueryString, calculateDiscountAmount, calculateFinalPrice, formatPrice, getBackoffDelay, isRetryableError, isValidAddress, isValidEmail, parseError, retryWithBackoff, sleep, truncateAddress } from './ecommerce.mjs';
|
|
1
|
+
import { SpotToken, MarginTables, PerpsAssetCtx, ExchangeClient, SuccessResponse, InfoClient } from '@nktkas/hyperliquid';
|
|
2
|
+
export { A as AllPerpsMeta, e as AssetIdUtils, B as BaseInstrument, I as InstrumentClient, M as MarketInstrument, c as PerpDex, d as PerpsInstrument, P as PerpsMeta, a as PerpsMetaAndAssetCtxs, b as PerpsUniverse, S as SpotInstrument, g as getAllPerpsMeta } from './client-DMVXX1Gw.mjs';
|
|
3
|
+
export { ActiveFlashSalesResponse, AnalyticsOverview, ApiResponse, AppliedDiscount, Banner, BannerResponse, BannerType, BaseEcommerceClient, BaseEntity, BrowsingLocation, CalculateCartDiscountsRequest, CalculateCartDiscountsResponse, CalculateShippingRequest, CalculateShippingResponse, CalculateTaxRequest, CalculateTaxResponse, CartItem, CashAccountBalanceResponse, ConfirmEscrowDepositResponse, Coupon, CouponResponse, CouponUsage, CreateBannerRequest, CreateCouponRequest, CreateFlashSaleRequest, CreateOrderEventRequest, CreateOrderEventResponse, CreateOrderRequest, CreateOrderResponse, CreateProductRequest, CreateProductVariantRequest, CreateReviewRequest, CreateShippingMethodRequest, CreateShippingRateRequest, CreateShippingZoneRequest, CreateTaxNexusRequest, CreateTaxRuleRequest, CustomerEcommerceClient, CustomerMessagesResponse, CustomerSummary, DeleteBrowsingLocationResponse, DeliveryAddressResponse, DiscountMethod, DiscountScope, DiscountType, EcommerceApiError, EcommerceClientConfig, ExpiringGemBatch, FlashSale, FlashSaleAllowanceInfo, FlashSaleItem, FlashSaleItemInput, FollowActionResponse, FollowStatusResponse, FollowedMerchantSummary, GemHistoryItem, GemHistoryType, GemHistoryTypeFilter, GemSource, GenerateTaxReportRequest, GetAnalyticsParams, GetAnalyticsResponse, GetBrowsingLocationResponse, GetCouponResponse, GetExpiringGemsParams, GetExpiringGemsResponse, GetFlashSaleAllowanceParams, GetFlashSaleAllowanceResponse, GetGemBalanceResponse, GetGemHistoryParams, GetGemHistoryResponse, GetOrderResponse, GetPaymentMethodsResponse, GetProductMetricsResponse, GetProductResponse, GetTaxReportResponse, InventoryAuditAction, InventoryAuditEntry, ListActiveBannersParams, ListActiveFlashSalesParams, ListBannersResponse, ListCouponsResponse, ListCustomersParams, ListCustomersResponse, ListFollowingParams, ListFollowingResponse, ListInventoryAuditResponse, ListMediaAssetsResponse, ListMerchantProductsParams, ListMessagesResponse, ListOrdersParams, ListOrdersResponse, ListProductVariantsResponse, ListProductsParams, ListProductsResponse, ListReturnsResponse, ListReviewsParams, ListReviewsResponse, ListShipmentsResponse, ListShippingAddressesResponse, ListShippingMethodsResponse, ListShippingRatesResponse, ListShippingZonesResponse, ListTaxNexusResponse, ListTaxReportsParams, ListTaxReportsResponse, ListTaxRulesResponse, MediaAsset, MediaAssetResponse, Merchant, MerchantBusinessType, MerchantEcommerceClient, MerchantProductsResponse, MerchantProfileRequest, MerchantProfileResponse, MerchantReturnPolicyType, MerchantShippingSettings, MerchantSocialLinks, MerchantStatus, Message, MessageResponse, MessageStatsResponse, Order, OrderEvent, OrderItem, OrderReceiptResponse, OrderStatus, OrdersByStatus, PaginatedResponse, PaginationParams, Payment, PaymentMethod, PaymentMethodInfo, PaymentStatus, ProcessPaymentRequest, ProcessPaymentResponse, Product, ProductDimensions, ProductDiscountsResponse, ProductMetrics, ProductResponse, ProductReview, ProductSortBy, ProductVariant, ProductVariantResponse, PublicMerchantProfile, PublicMerchantProfileResponse, RecentOrderSummary, RespondToReviewRequest, Return, ReturnItem, ReturnResponse, ReturnStatus, RevenueByDay, ReviewResponse, ReviewSortBy, ReviewStatus, SaveBrowsingLocationRequest, SaveBrowsingLocationResponse, SendMessageRequest, Settlement, Shipment, ShipmentResponse, ShipmentStatus, ShippingAddress, ShippingAddressRequest, ShippingAddressResponse, ShippingMethod, ShippingMethodResponse, ShippingOption, ShippingRate, ShippingRateResponse, ShippingSettingsResponse, ShippingZone, ShippingZoneResponse, SortOrder, SuccessResponse, TaxBehavior, TaxBreakdownItem, TaxNexus, TaxNexusResponse, TaxReport, TaxReportDetails, TaxReportPeriodType, TaxReportResponse, TaxReportStatus, TaxRule, TaxRuleResponse, TaxSettings, TaxSettingsResponse, TaxType, TopProduct, TrackBannerRequest, UpdateBannerRequest, UpdateCouponRequest, UpdateFlashSaleRequest, UpdateOrderResponse, UpdateOrderStatusRequest, UpdateProductRequest, UpdateProductVariantRequest, UpdateShipmentRequest, UpdateShippingMethodRequest, UpdateShippingRateRequest, UpdateShippingSettingsRequest, UpdateShippingZoneRequest, UpdateTaxNexusRequest, UpdateTaxReportStatusRequest, UpdateTaxRuleRequest, UpdateTaxSettingsRequest, UserShippingAddress, ValidateDiscountRequest, ValidateDiscountResponse, buildQueryString, calculateDiscountAmount, calculateFinalPrice, formatPrice, getBackoffDelay, isRetryableError, isValidAddress, isValidEmail, parseError, retryWithBackoff, sleep, truncateAddress } from './ecommerce.mjs';
|
|
5
4
|
import 'axios';
|
|
6
5
|
|
|
7
6
|
declare function encodeSlug(slug: string): bigint;
|
|
@@ -270,18 +269,6 @@ interface PerpsUniverse {
|
|
|
270
269
|
marginMode?: "strictIsolated" | "noCross";
|
|
271
270
|
}
|
|
272
271
|
|
|
273
|
-
interface PerpDex {
|
|
274
|
-
/** Short name of the perpetual dex. */
|
|
275
|
-
name: string;
|
|
276
|
-
/** Complete name of the perpetual dex. */
|
|
277
|
-
fullName: string;
|
|
278
|
-
/** Hex address of the dex deployer. */
|
|
279
|
-
deployer: Hex;
|
|
280
|
-
/** Hex address of the oracle updater, or null if not available. */
|
|
281
|
-
oracleUpdater: Hex | null;
|
|
282
|
-
feeRecipient: Hex | null;
|
|
283
|
-
assetToStreamingOiCap: [string, string][];
|
|
284
|
-
}
|
|
285
272
|
/**
|
|
286
273
|
* Market information for trading operations
|
|
287
274
|
*/
|
|
@@ -327,23 +314,6 @@ interface TokenInfo {
|
|
|
327
314
|
weiDecimals: number;
|
|
328
315
|
tokenId: string;
|
|
329
316
|
}
|
|
330
|
-
/**
|
|
331
|
-
* Configuration for MetadataClient
|
|
332
|
-
*/
|
|
333
|
-
interface MetadataClientConfig {
|
|
334
|
-
/** List of HIP-3 DEX names to load metadata for */
|
|
335
|
-
hip3Dexs?: string[];
|
|
336
|
-
/** Whether to lazily initialize (fetch metadata on first use) */
|
|
337
|
-
lazyInit?: boolean;
|
|
338
|
-
/** Whether to use testnet (default: false for mainnet) */
|
|
339
|
-
isTestnet?: boolean;
|
|
340
|
-
/** Use static fallback data only, no API fetch */
|
|
341
|
-
onlyUseStaticFallback?: boolean;
|
|
342
|
-
/** Whether to use static fallback data if API fetch fails (default: true) */
|
|
343
|
-
useStaticFallback?: boolean;
|
|
344
|
-
/** Whether to enable debug logs (default: false) */
|
|
345
|
-
debug?: boolean;
|
|
346
|
-
}
|
|
347
317
|
/**
|
|
348
318
|
* MetadataClient - Handles Hyperliquid metadata for trading operations
|
|
349
319
|
*
|
|
@@ -359,132 +329,6 @@ interface MetadataClientConfig {
|
|
|
359
329
|
* - HIP-3: 100000 + perp_dex_index * 10000 + index_in_meta
|
|
360
330
|
*/
|
|
361
331
|
declare const ROOT_DEX = "hyperliquid";
|
|
362
|
-
/**@deprecated use react sdk instead */
|
|
363
|
-
declare class MetadataClient {
|
|
364
|
-
private infoClient;
|
|
365
|
-
private config;
|
|
366
|
-
private isTestnet;
|
|
367
|
-
private spotMeta;
|
|
368
|
-
private perpsMeta;
|
|
369
|
-
private perpDexs;
|
|
370
|
-
private staticMeta;
|
|
371
|
-
private hip3DexsMeta;
|
|
372
|
-
private perpsSymbolToIndex;
|
|
373
|
-
private spotTokenNameToIndex;
|
|
374
|
-
private spotPairToMarket;
|
|
375
|
-
private baseTokenToMarkets;
|
|
376
|
-
private quoteAssets;
|
|
377
|
-
private coinToMarket;
|
|
378
|
-
private hip3SymbolToMarket;
|
|
379
|
-
private dexNameToIndex;
|
|
380
|
-
private initialized;
|
|
381
|
-
private initializing;
|
|
382
|
-
constructor(config?: MetadataClientConfig);
|
|
383
|
-
/**
|
|
384
|
-
* Initialize metadata by fetching from Hyperliquid
|
|
385
|
-
*/
|
|
386
|
-
initialize(): Promise<void>;
|
|
387
|
-
/**
|
|
388
|
-
* Load staticMeta.json for display overrides
|
|
389
|
-
* This is always loaded regardless of config.useStaticFallback
|
|
390
|
-
*/
|
|
391
|
-
private loadStaticMetaOverrides;
|
|
392
|
-
/**
|
|
393
|
-
* Load static metadata from bundled JSON files
|
|
394
|
-
*/
|
|
395
|
-
private loadStaticMetadata;
|
|
396
|
-
/**
|
|
397
|
-
* Build optimized lookup maps from raw metadata
|
|
398
|
-
* Called after metadata is loaded (from API or static files)
|
|
399
|
-
*/
|
|
400
|
-
private buildLookupMaps;
|
|
401
|
-
/**
|
|
402
|
-
* Load metadata for a specific HIP-3 DEX
|
|
403
|
-
* Also builds optimized lookups for this DEX's markets
|
|
404
|
-
*/
|
|
405
|
-
loadHip3Metadata(dexName: string): Promise<DexInfo>;
|
|
406
|
-
/**
|
|
407
|
-
* Build optimized lookups for HIP-3 markets of a specific DEX
|
|
408
|
-
*/
|
|
409
|
-
private buildHip3MarketsForDex;
|
|
410
|
-
/**
|
|
411
|
-
* Ensure metadata is loaded (for lazy init)
|
|
412
|
-
*/
|
|
413
|
-
private ensureInitialized;
|
|
414
|
-
/**
|
|
415
|
-
* Get market information by symbol
|
|
416
|
-
* Optimized: O(1) direct map lookup for most cases
|
|
417
|
-
* Lazily initialize hip-3 metadata if not already initialized
|
|
418
|
-
*
|
|
419
|
-
* @param symbol - Market symbol (e.g., "BTC", "PURR/USDC", "vntls:ABC")
|
|
420
|
-
* @param quoteAsset - Quote asset for spot markets (default: "USDC")
|
|
421
|
-
* @returns Market information or null if not found
|
|
422
|
-
*/
|
|
423
|
-
getMarketBySymbolAsync(symbol: string, quoteAsset?: string): Promise<MarketInfo | null>;
|
|
424
|
-
getMarketByCoin(coin: string): MarketInfo | null;
|
|
425
|
-
/**
|
|
426
|
-
* Get perpetuals market information
|
|
427
|
-
* Optimized: O(1) map lookup instead of O(n) array search
|
|
428
|
-
*/
|
|
429
|
-
getPerpsMarket(symbol: string): MarketInfo | null;
|
|
430
|
-
/**
|
|
431
|
-
* Get spot market information
|
|
432
|
-
* Optimized: O(1) map lookup instead of O(n) array searches
|
|
433
|
-
*
|
|
434
|
-
* @param baseSymbol - Base token symbol (e.g., "PURR", "UHYPE")
|
|
435
|
-
* @param quoteSymbol - Quote token symbol (default: "USDC")
|
|
436
|
-
*/
|
|
437
|
-
getSpotMarket(baseSymbol: string, quoteSymbol?: string): MarketInfo | null;
|
|
438
|
-
/**
|
|
439
|
-
* Get HIP-3 market information
|
|
440
|
-
* Optimized: O(1) map lookup after DEX metadata is loaded
|
|
441
|
-
*
|
|
442
|
-
* @param symbol - HIP-3 market symbol (format: "dex:coin")
|
|
443
|
-
*/
|
|
444
|
-
getHip3Market(symbol: string): Promise<MarketInfo | null>;
|
|
445
|
-
getHip3Dex(dexName: string): Promise<DexInfo | null>;
|
|
446
|
-
/**
|
|
447
|
-
* Get all available markets for a base token
|
|
448
|
-
* Optimized: O(1) map lookup instead of O(n) filter + map
|
|
449
|
-
* Useful for showing all quote asset options
|
|
450
|
-
*/
|
|
451
|
-
getAllMarketsForBase(baseSymbol: string): MarketInfo[];
|
|
452
|
-
/**
|
|
453
|
-
* Get spot token information
|
|
454
|
-
* Optimized: O(1) map lookup instead of O(n) array search
|
|
455
|
-
*/
|
|
456
|
-
getSpotTokenInfo(tokenSymbol: string): TokenInfo | null;
|
|
457
|
-
/**
|
|
458
|
-
* Get all available quote assets
|
|
459
|
-
* Optimized: O(1) pre-computed array instead of O(n) computation
|
|
460
|
-
*/
|
|
461
|
-
getAvailableQuoteAssets(): string[];
|
|
462
|
-
/**
|
|
463
|
-
* Get raw metadata (for advanced use cases)
|
|
464
|
-
*/
|
|
465
|
-
getRawMetadata(): {
|
|
466
|
-
spotMeta: SpotMeta | null;
|
|
467
|
-
perpsMeta: PerpsMeta | null;
|
|
468
|
-
perpDexs: (PerpDex | null)[];
|
|
469
|
-
hip3DexsMeta: {
|
|
470
|
-
[k: string]: DexInfo;
|
|
471
|
-
};
|
|
472
|
-
coinToMarket: {
|
|
473
|
-
[k: string]: MarketInfo;
|
|
474
|
-
};
|
|
475
|
-
hip3SymbolToMarket: {
|
|
476
|
-
[k: string]: MarketInfo;
|
|
477
|
-
};
|
|
478
|
-
};
|
|
479
|
-
/**
|
|
480
|
-
* Get network configuration
|
|
481
|
-
*/
|
|
482
|
-
getNetworkInfo(): {
|
|
483
|
-
isTestnet: boolean;
|
|
484
|
-
useStaticFallback: boolean | undefined;
|
|
485
|
-
initialized: boolean;
|
|
486
|
-
};
|
|
487
|
-
}
|
|
488
332
|
|
|
489
333
|
declare const formatPriceAndSize: ({ px, sz, szDecimals, isSpot, }: {
|
|
490
334
|
px: number;
|
|
@@ -652,4 +496,4 @@ declare function isStableQuoteToken(coin: string): boolean;
|
|
|
652
496
|
declare function getDisplayMarketSymbol(coin: string | undefined, showCollateralTokenSymbol?: boolean, collateralTokenSymbol?: string): string | undefined;
|
|
653
497
|
declare function getDexFromCollateralTokenSymbol(collateralTokenSymbol: string): string | undefined;
|
|
654
498
|
|
|
655
|
-
export { type AirdropAllocationData, CloidClientCode, type CloidClientCodeId, CloidClientCodeNameById, type CloidData, DayOfWeek, type DexInfo, type ExtendedPerpsMeta, type MarketInfo,
|
|
499
|
+
export { type AirdropAllocationData, CloidClientCode, type CloidClientCodeId, CloidClientCodeNameById, type CloidData, DayOfWeek, type DexInfo, type ExtendedPerpsMeta, type MarketInfo, PUP_TOKEN_ADDRESS, PUP_TOKEN_THRESHOLDS, type PupEligibilityResult, ROOT_DEX, TARGET_APPROVED_MAX_BUILDER_FEE, TARGET_APPROVED_MAX_BUILDER_FEE_PERCENT, TESTNET_USDC_SPOT_TOKEN, type TokenInfo, USDC_SPOT_TOKEN, type UpheavalApiResponse, type UpheavalPosition, type UpheavalSnapshot, UserDexAbstractionTypes, type V3LPTokenInfo, type WeekInfo, WidgetType, WidgetTypeById, type WidgetTypeId, XP_BOOST_PERCENTAGES, buildCloid, calculateBoostPercentage, calculateTotalPupAmount, decodeSlug, enableHip3DexAbstractionWithAgent, encodeSlug, floorUtcDay, floorUtcHour, floorUtcMinutes, floorUtcWeek, formatPriceAndSize, formatPriceForDisplay, formatPriceForOrder, formatSizeForDisplay, formatSizeForOrder, getApprovalAmount, getClientCodeNameById, getCloid, getDexFromCollateralTokenSymbol, getDisplayMarketSymbol, getHip3Dex, getHip3DexAbstraction, getLatestCompletedWeek, getNextTierInfo, getPriceDecimals, getStaticCollateralTokenByDex, getStaticCollateralTokenSymbol, getWeekInfoFromNumber, getWidgetTypeById, isBasedCloid, isClientCode, isHip3Symbol, isMiniAppCloid, isMiniAppTriggeredCloid, isSpotSymbol, isStableQuoteToken, isTenantCloid, isTrackingIdCloid, isWidgetType, makeUtcRounder, normaliseSlug, normaliseTrackingId, normalizeAirdropAmount, parseCloid, setHip3DexAbstraction, stableQuoteTokens };
|