@emberai/onchain-actions-registry 3.0.0-alpha.1 → 3.0.0-alpha.2

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/index.d.cts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { z } from 'zod';
2
- import { DecreasePositionSwapType, OrderType } from '@gmx-io/sdk/types/orders';
3
2
 
4
3
  /**
5
4
  * Configuration for a blockchain network.
@@ -155,6 +154,8 @@ declare const WithdrawTokensResponseSchema: z.ZodObject<{
155
154
  type WithdrawTokensResponse = z.infer<typeof WithdrawTokensResponseSchema>;
156
155
  declare const GetWalletLendingPositionsRequestSchema: z.ZodObject<{
157
156
  walletAddress: z.ZodString;
157
+ chainId: z.ZodOptional<z.ZodString>;
158
+ tokenAddress: z.ZodOptional<z.ZodString>;
158
159
  }, z.core.$strip>;
159
160
  type GetWalletLendingPositionsRequest = z.infer<typeof GetWalletLendingPositionsRequestSchema>;
160
161
  declare const LendTokenDetailSchema: z.ZodObject<{
@@ -444,8 +445,16 @@ type LiquidityWithdrawCallback = (request: WithdrawLiquidityRequest) => Promise<
444
445
  */
445
446
  type LiquidityActions = 'liquidity-supply' | 'liquidity-withdraw';
446
447
 
447
- declare const DecreasePositionSwapTypeSchema: z.ZodEnum<typeof DecreasePositionSwapType>;
448
- declare const PositionSideSchema: z.ZodUnion<readonly [z.ZodLiteral<"long">, z.ZodLiteral<"short">]>;
448
+ declare const DecreasePositionSwapTypeSchema: z.ZodEnum<{
449
+ NoSwap: "NoSwap";
450
+ SwapPnlTokenToCollateralToken: "SwapPnlTokenToCollateralToken";
451
+ SwapCollateralTokenToPnlToken: "SwapCollateralTokenToPnlToken";
452
+ }>;
453
+ type DecreasePositionSwapType = z.infer<typeof DecreasePositionSwapTypeSchema>;
454
+ declare const PositionSideSchema: z.ZodEnum<{
455
+ long: "long";
456
+ short: "short";
457
+ }>;
449
458
  type PositionSide = z.infer<typeof PositionSideSchema>;
450
459
  declare const PositionSchema: z.ZodObject<{
451
460
  chainId: z.ZodString;
@@ -460,7 +469,10 @@ declare const PositionSchema: z.ZodObject<{
460
469
  pendingBorrowingFeesUsd: z.ZodString;
461
470
  increasedAtTime: z.ZodString;
462
471
  decreasedAtTime: z.ZodString;
463
- positionSide: z.ZodUnion<readonly [z.ZodLiteral<"long">, z.ZodLiteral<"short">]>;
472
+ positionSide: z.ZodEnum<{
473
+ long: "long";
474
+ short: "short";
475
+ }>;
464
476
  isLong: z.ZodBoolean;
465
477
  fundingFeeAmount: z.ZodString;
466
478
  claimableLongTokenAmount: z.ZodString;
@@ -486,7 +498,10 @@ declare const PositionsDataSchema: z.ZodArray<z.ZodObject<{
486
498
  pendingBorrowingFeesUsd: z.ZodString;
487
499
  increasedAtTime: z.ZodString;
488
500
  decreasedAtTime: z.ZodString;
489
- positionSide: z.ZodUnion<readonly [z.ZodLiteral<"long">, z.ZodLiteral<"short">]>;
501
+ positionSide: z.ZodEnum<{
502
+ long: "long";
503
+ short: "short";
504
+ }>;
490
505
  isLong: z.ZodBoolean;
491
506
  fundingFeeAmount: z.ZodString;
492
507
  claimableLongTokenAmount: z.ZodString;
@@ -498,6 +513,18 @@ declare const PositionsDataSchema: z.ZodArray<z.ZodObject<{
498
513
  uiFeeAmount: z.ZodString;
499
514
  data: z.ZodOptional<z.ZodString>;
500
515
  }, z.core.$strip>>;
516
+ declare const OrderTypeSchema: z.ZodEnum<{
517
+ MarketSwap: "MarketSwap";
518
+ LimitSwap: "LimitSwap";
519
+ MarketIncrease: "MarketIncrease";
520
+ LimitIncrease: "LimitIncrease";
521
+ MarketDecrease: "MarketDecrease";
522
+ LimitDecrease: "LimitDecrease";
523
+ StopLossDecrease: "StopLossDecrease";
524
+ Liquidation: "Liquidation";
525
+ StopIncrease: "StopIncrease";
526
+ }>;
527
+ type OrderType = z.infer<typeof OrderTypeSchema>;
501
528
  declare const OrderSchema: z.ZodObject<{
502
529
  chainId: z.ZodString;
503
530
  key: z.ZodString;
@@ -505,7 +532,11 @@ declare const OrderSchema: z.ZodObject<{
505
532
  callbackContract: z.ZodString;
506
533
  initialCollateralTokenAddress: z.ZodString;
507
534
  marketAddress: z.ZodString;
508
- decreasePositionSwapType: z.ZodEnum<typeof DecreasePositionSwapType>;
535
+ decreasePositionSwapType: z.ZodEnum<{
536
+ NoSwap: "NoSwap";
537
+ SwapPnlTokenToCollateralToken: "SwapPnlTokenToCollateralToken";
538
+ SwapCollateralTokenToPnlToken: "SwapCollateralTokenToPnlToken";
539
+ }>;
509
540
  receiver: z.ZodString;
510
541
  swapPath: z.ZodArray<z.ZodString>;
511
542
  contractAcceptablePrice: z.ZodString;
@@ -517,8 +548,21 @@ declare const OrderSchema: z.ZodObject<{
517
548
  sizeDeltaUsd: z.ZodString;
518
549
  updatedAtTime: z.ZodString;
519
550
  isFrozen: z.ZodBoolean;
520
- positionSide: z.ZodUnion<readonly [z.ZodLiteral<"long">, z.ZodLiteral<"short">]>;
521
- orderType: z.ZodEnum<typeof OrderType>;
551
+ positionSide: z.ZodEnum<{
552
+ long: "long";
553
+ short: "short";
554
+ }>;
555
+ orderType: z.ZodEnum<{
556
+ MarketSwap: "MarketSwap";
557
+ LimitSwap: "LimitSwap";
558
+ MarketIncrease: "MarketIncrease";
559
+ LimitIncrease: "LimitIncrease";
560
+ MarketDecrease: "MarketDecrease";
561
+ LimitDecrease: "LimitDecrease";
562
+ StopLossDecrease: "StopLossDecrease";
563
+ Liquidation: "Liquidation";
564
+ StopIncrease: "StopIncrease";
565
+ }>;
522
566
  shouldUnwrapNativeToken: z.ZodBoolean;
523
567
  autoCancel: z.ZodBoolean;
524
568
  data: z.ZodOptional<z.ZodString>;
@@ -534,7 +578,11 @@ declare const OrdersDataSchema: z.ZodArray<z.ZodObject<{
534
578
  callbackContract: z.ZodString;
535
579
  initialCollateralTokenAddress: z.ZodString;
536
580
  marketAddress: z.ZodString;
537
- decreasePositionSwapType: z.ZodEnum<typeof DecreasePositionSwapType>;
581
+ decreasePositionSwapType: z.ZodEnum<{
582
+ NoSwap: "NoSwap";
583
+ SwapPnlTokenToCollateralToken: "SwapPnlTokenToCollateralToken";
584
+ SwapCollateralTokenToPnlToken: "SwapCollateralTokenToPnlToken";
585
+ }>;
538
586
  receiver: z.ZodString;
539
587
  swapPath: z.ZodArray<z.ZodString>;
540
588
  contractAcceptablePrice: z.ZodString;
@@ -546,8 +594,21 @@ declare const OrdersDataSchema: z.ZodArray<z.ZodObject<{
546
594
  sizeDeltaUsd: z.ZodString;
547
595
  updatedAtTime: z.ZodString;
548
596
  isFrozen: z.ZodBoolean;
549
- positionSide: z.ZodUnion<readonly [z.ZodLiteral<"long">, z.ZodLiteral<"short">]>;
550
- orderType: z.ZodEnum<typeof OrderType>;
597
+ positionSide: z.ZodEnum<{
598
+ long: "long";
599
+ short: "short";
600
+ }>;
601
+ orderType: z.ZodEnum<{
602
+ MarketSwap: "MarketSwap";
603
+ LimitSwap: "LimitSwap";
604
+ MarketIncrease: "MarketIncrease";
605
+ LimitIncrease: "LimitIncrease";
606
+ MarketDecrease: "MarketDecrease";
607
+ LimitDecrease: "LimitDecrease";
608
+ StopLossDecrease: "StopLossDecrease";
609
+ Liquidation: "Liquidation";
610
+ StopIncrease: "StopIncrease";
611
+ }>;
551
612
  shouldUnwrapNativeToken: z.ZodBoolean;
552
613
  autoCancel: z.ZodBoolean;
553
614
  data: z.ZodOptional<z.ZodString>;
@@ -597,7 +658,10 @@ declare const GetPerpetualsMarketsPositionsResponseSchema: z.ZodObject<{
597
658
  pendingBorrowingFeesUsd: z.ZodString;
598
659
  increasedAtTime: z.ZodString;
599
660
  decreasedAtTime: z.ZodString;
600
- positionSide: z.ZodUnion<readonly [z.ZodLiteral<"long">, z.ZodLiteral<"short">]>;
661
+ positionSide: z.ZodEnum<{
662
+ long: "long";
663
+ short: "short";
664
+ }>;
601
665
  isLong: z.ZodBoolean;
602
666
  fundingFeeAmount: z.ZodString;
603
667
  claimableLongTokenAmount: z.ZodString;
@@ -623,7 +687,11 @@ declare const GetPerpetualsMarketsOrdersResponseSchema: z.ZodObject<{
623
687
  callbackContract: z.ZodString;
624
688
  initialCollateralTokenAddress: z.ZodString;
625
689
  marketAddress: z.ZodString;
626
- decreasePositionSwapType: z.ZodEnum<typeof DecreasePositionSwapType>;
690
+ decreasePositionSwapType: z.ZodEnum<{
691
+ NoSwap: "NoSwap";
692
+ SwapPnlTokenToCollateralToken: "SwapPnlTokenToCollateralToken";
693
+ SwapCollateralTokenToPnlToken: "SwapCollateralTokenToPnlToken";
694
+ }>;
627
695
  receiver: z.ZodString;
628
696
  swapPath: z.ZodArray<z.ZodString>;
629
697
  contractAcceptablePrice: z.ZodString;
@@ -635,8 +703,21 @@ declare const GetPerpetualsMarketsOrdersResponseSchema: z.ZodObject<{
635
703
  sizeDeltaUsd: z.ZodString;
636
704
  updatedAtTime: z.ZodString;
637
705
  isFrozen: z.ZodBoolean;
638
- positionSide: z.ZodUnion<readonly [z.ZodLiteral<"long">, z.ZodLiteral<"short">]>;
639
- orderType: z.ZodEnum<typeof OrderType>;
706
+ positionSide: z.ZodEnum<{
707
+ long: "long";
708
+ short: "short";
709
+ }>;
710
+ orderType: z.ZodEnum<{
711
+ MarketSwap: "MarketSwap";
712
+ LimitSwap: "LimitSwap";
713
+ MarketIncrease: "MarketIncrease";
714
+ LimitIncrease: "LimitIncrease";
715
+ MarketDecrease: "MarketDecrease";
716
+ LimitDecrease: "LimitDecrease";
717
+ StopLossDecrease: "StopLossDecrease";
718
+ Liquidation: "Liquidation";
719
+ StopIncrease: "StopIncrease";
720
+ }>;
640
721
  shouldUnwrapNativeToken: z.ZodBoolean;
641
722
  autoCancel: z.ZodBoolean;
642
723
  data: z.ZodOptional<z.ZodString>;
@@ -1116,4 +1197,4 @@ declare class PublicEmberPluginRegistry {
1116
1197
  */
1117
1198
  declare function initializePublicRegistry(chainConfigs: ChainConfig[]): PublicEmberPluginRegistry;
1118
1199
 
1119
- export { type Action, type ActionDefinition, type AvailableActions, type AvailableQueries, type BorrowTokensRequest, BorrowTokensRequestSchema, type BorrowTokensResponse, BorrowTokensResponseSchema, type Chain, type ChainConfig, ChainSchema, type ChainType, ChainTypeSchema, type ClosePerpetualsOrdersRequest, ClosePerpetualsOrdersRequestSchema, type ClosePerpetualsOrdersResponse, ClosePerpetualsOrdersResponseSchema, type CreatePerpetualsPositionRequest, CreatePerpetualsPositionRequestSchema, type CreatePerpetualsPositionResponse, CreatePerpetualsPositionResponseSchema, DecreasePositionSwapTypeSchema, type EmberPlugin, type FeeBreakdown, FeeBreakdownSchema, type GetLiquidityPoolsResponse, GetLiquidityPoolsResponseSchema, type GetPerpetualsMarketsOrdersRequest, GetPerpetualsMarketsOrdersRequestSchema, type GetPerpetualsMarketsOrdersResponse, GetPerpetualsMarketsOrdersResponseSchema, type GetPerpetualsMarketsPositionsRequest, GetPerpetualsMarketsPositionsRequestSchema, type GetPerpetualsMarketsPositionsResponse, GetPerpetualsMarketsPositionsResponseSchema, type GetPerpetualsMarketsRequest, GetPerpetualsMarketsRequestSchema, type GetPerpetualsMarketsResponse, GetPerpetualsMarketsResponseSchema, type GetWalletLendingPositionsRequest, GetWalletLendingPositionsRequestSchema, type GetWalletLendingPositionsResponse, GetWalletLendingPositionsResponseSchema, type GetWalletLiquidityPositionsRequest, GetWalletLiquidityPositionsRequestSchema, type GetWalletLiquidityPositionsResponse, GetWalletLiquidityPositionsResponseSchema, type LendTokenDetail, LendTokenDetailSchema, type LendingActions, type LendingGetPositions, type LendingQueries, type LimitedLiquidityProvisionRange, LimitedLiquidityProvisionRangeSchema, type LiquidityActions, type LiquidityGetPools, type LiquidityGetWalletPositions, type LiquidityPayTokens, LiquidityPayTokensSchema, type LiquidityPool, LiquidityPoolSchema, LiquidityPoolTokens, type LiquidityPosition, type LiquidityPositionRange, LiquidityPositionRangeSchema, LiquidityPositionSchema, type LiquidityProvisionRange, LiquidityProvisionRangeSchema, type LiquidityQueries, type LiquiditySuppliedToken, LiquiditySuppliedTokenSchema, OrderSchema, OrdersDataSchema, type PerpetualMarket, PerpetualMarketSchema, type PerpetualsActions, type PerpetualsGetMarkets, type PerpetualsGetOrders, type PerpetualsGetPositions, type PerpetualsOrder, type PerpetualsPosition, type PerpetualsQueries, type PluginType, PositionSchema, type PositionSide, PositionSideSchema, PositionsDataSchema, type ProviderTrackingInfo, ProviderTrackingInfoSchema, type ProviderTrackingStatus, ProviderTrackingStatusSchema, PublicEmberPluginRegistry, type RepayTokensRequest, RepayTokensRequestSchema, type RepayTokensResponse, RepayTokensResponseSchema, type SupplyLiquidityRequest, SupplyLiquidityRequestSchema, type SupplyLiquidityResponse, SupplyLiquidityResponseSchema, type SupplyTokensRequest, SupplyTokensRequestSchema, type SupplyTokensResponse, SupplyTokensResponseSchema, type SwapActions, type SwapEstimation, SwapEstimationSchema, type SwapTokensRequest, SwapTokensRequestSchema, type SwapTokensResponse, SwapTokensResponseSchema, type Token, type TokenIdentifier, TokenIdentifierSchema, TokenSchema, type TokenSet, type TransactionPlan, type TransactionPlanError, TransactionPlanErrorSchema, TransactionPlanSchema, type TransactionType, TransactionTypeSchema, TransactionTypes, type WithdrawLiquidityRequest, WithdrawLiquidityRequestSchema, type WithdrawLiquidityResponse, WithdrawLiquidityResponseSchema, type WithdrawTokensRequest, WithdrawTokensRequestSchema, type WithdrawTokensResponse, WithdrawTokensResponseSchema, initializePublicRegistry };
1200
+ export { type Action, type ActionDefinition, type AvailableActions, type AvailableQueries, type BorrowTokensRequest, BorrowTokensRequestSchema, type BorrowTokensResponse, BorrowTokensResponseSchema, type Chain, type ChainConfig, ChainSchema, type ChainType, ChainTypeSchema, type ClosePerpetualsOrdersRequest, ClosePerpetualsOrdersRequestSchema, type ClosePerpetualsOrdersResponse, ClosePerpetualsOrdersResponseSchema, type CreatePerpetualsPositionRequest, CreatePerpetualsPositionRequestSchema, type CreatePerpetualsPositionResponse, CreatePerpetualsPositionResponseSchema, type DecreasePositionSwapType, DecreasePositionSwapTypeSchema, type EmberPlugin, type FeeBreakdown, FeeBreakdownSchema, type GetLiquidityPoolsResponse, GetLiquidityPoolsResponseSchema, type GetPerpetualsMarketsOrdersRequest, GetPerpetualsMarketsOrdersRequestSchema, type GetPerpetualsMarketsOrdersResponse, GetPerpetualsMarketsOrdersResponseSchema, type GetPerpetualsMarketsPositionsRequest, GetPerpetualsMarketsPositionsRequestSchema, type GetPerpetualsMarketsPositionsResponse, GetPerpetualsMarketsPositionsResponseSchema, type GetPerpetualsMarketsRequest, GetPerpetualsMarketsRequestSchema, type GetPerpetualsMarketsResponse, GetPerpetualsMarketsResponseSchema, type GetWalletLendingPositionsRequest, GetWalletLendingPositionsRequestSchema, type GetWalletLendingPositionsResponse, GetWalletLendingPositionsResponseSchema, type GetWalletLiquidityPositionsRequest, GetWalletLiquidityPositionsRequestSchema, type GetWalletLiquidityPositionsResponse, GetWalletLiquidityPositionsResponseSchema, type LendTokenDetail, LendTokenDetailSchema, type LendingActions, type LendingGetPositions, type LendingQueries, type LimitedLiquidityProvisionRange, LimitedLiquidityProvisionRangeSchema, type LiquidityActions, type LiquidityGetPools, type LiquidityGetWalletPositions, type LiquidityPayTokens, LiquidityPayTokensSchema, type LiquidityPool, LiquidityPoolSchema, LiquidityPoolTokens, type LiquidityPosition, type LiquidityPositionRange, LiquidityPositionRangeSchema, LiquidityPositionSchema, type LiquidityProvisionRange, LiquidityProvisionRangeSchema, type LiquidityQueries, type LiquiditySuppliedToken, LiquiditySuppliedTokenSchema, OrderSchema, type OrderType, OrderTypeSchema, OrdersDataSchema, type PerpetualMarket, PerpetualMarketSchema, type PerpetualsActions, type PerpetualsGetMarkets, type PerpetualsGetOrders, type PerpetualsGetPositions, type PerpetualsOrder, type PerpetualsPosition, type PerpetualsQueries, type PluginType, PositionSchema, type PositionSide, PositionSideSchema, PositionsDataSchema, type ProviderTrackingInfo, ProviderTrackingInfoSchema, type ProviderTrackingStatus, ProviderTrackingStatusSchema, PublicEmberPluginRegistry, type RepayTokensRequest, RepayTokensRequestSchema, type RepayTokensResponse, RepayTokensResponseSchema, type SupplyLiquidityRequest, SupplyLiquidityRequestSchema, type SupplyLiquidityResponse, SupplyLiquidityResponseSchema, type SupplyTokensRequest, SupplyTokensRequestSchema, type SupplyTokensResponse, SupplyTokensResponseSchema, type SwapActions, type SwapEstimation, SwapEstimationSchema, type SwapTokensRequest, SwapTokensRequestSchema, type SwapTokensResponse, SwapTokensResponseSchema, type Token, type TokenIdentifier, TokenIdentifierSchema, TokenSchema, type TokenSet, type TransactionPlan, type TransactionPlanError, TransactionPlanErrorSchema, TransactionPlanSchema, type TransactionType, TransactionTypeSchema, TransactionTypes, type WithdrawLiquidityRequest, WithdrawLiquidityRequestSchema, type WithdrawLiquidityResponse, WithdrawLiquidityResponseSchema, type WithdrawTokensRequest, WithdrawTokensRequestSchema, type WithdrawTokensResponse, WithdrawTokensResponseSchema, initializePublicRegistry };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { z } from 'zod';
2
- import { DecreasePositionSwapType, OrderType } from '@gmx-io/sdk/types/orders';
3
2
 
4
3
  /**
5
4
  * Configuration for a blockchain network.
@@ -155,6 +154,8 @@ declare const WithdrawTokensResponseSchema: z.ZodObject<{
155
154
  type WithdrawTokensResponse = z.infer<typeof WithdrawTokensResponseSchema>;
156
155
  declare const GetWalletLendingPositionsRequestSchema: z.ZodObject<{
157
156
  walletAddress: z.ZodString;
157
+ chainId: z.ZodOptional<z.ZodString>;
158
+ tokenAddress: z.ZodOptional<z.ZodString>;
158
159
  }, z.core.$strip>;
159
160
  type GetWalletLendingPositionsRequest = z.infer<typeof GetWalletLendingPositionsRequestSchema>;
160
161
  declare const LendTokenDetailSchema: z.ZodObject<{
@@ -444,8 +445,16 @@ type LiquidityWithdrawCallback = (request: WithdrawLiquidityRequest) => Promise<
444
445
  */
445
446
  type LiquidityActions = 'liquidity-supply' | 'liquidity-withdraw';
446
447
 
447
- declare const DecreasePositionSwapTypeSchema: z.ZodEnum<typeof DecreasePositionSwapType>;
448
- declare const PositionSideSchema: z.ZodUnion<readonly [z.ZodLiteral<"long">, z.ZodLiteral<"short">]>;
448
+ declare const DecreasePositionSwapTypeSchema: z.ZodEnum<{
449
+ NoSwap: "NoSwap";
450
+ SwapPnlTokenToCollateralToken: "SwapPnlTokenToCollateralToken";
451
+ SwapCollateralTokenToPnlToken: "SwapCollateralTokenToPnlToken";
452
+ }>;
453
+ type DecreasePositionSwapType = z.infer<typeof DecreasePositionSwapTypeSchema>;
454
+ declare const PositionSideSchema: z.ZodEnum<{
455
+ long: "long";
456
+ short: "short";
457
+ }>;
449
458
  type PositionSide = z.infer<typeof PositionSideSchema>;
450
459
  declare const PositionSchema: z.ZodObject<{
451
460
  chainId: z.ZodString;
@@ -460,7 +469,10 @@ declare const PositionSchema: z.ZodObject<{
460
469
  pendingBorrowingFeesUsd: z.ZodString;
461
470
  increasedAtTime: z.ZodString;
462
471
  decreasedAtTime: z.ZodString;
463
- positionSide: z.ZodUnion<readonly [z.ZodLiteral<"long">, z.ZodLiteral<"short">]>;
472
+ positionSide: z.ZodEnum<{
473
+ long: "long";
474
+ short: "short";
475
+ }>;
464
476
  isLong: z.ZodBoolean;
465
477
  fundingFeeAmount: z.ZodString;
466
478
  claimableLongTokenAmount: z.ZodString;
@@ -486,7 +498,10 @@ declare const PositionsDataSchema: z.ZodArray<z.ZodObject<{
486
498
  pendingBorrowingFeesUsd: z.ZodString;
487
499
  increasedAtTime: z.ZodString;
488
500
  decreasedAtTime: z.ZodString;
489
- positionSide: z.ZodUnion<readonly [z.ZodLiteral<"long">, z.ZodLiteral<"short">]>;
501
+ positionSide: z.ZodEnum<{
502
+ long: "long";
503
+ short: "short";
504
+ }>;
490
505
  isLong: z.ZodBoolean;
491
506
  fundingFeeAmount: z.ZodString;
492
507
  claimableLongTokenAmount: z.ZodString;
@@ -498,6 +513,18 @@ declare const PositionsDataSchema: z.ZodArray<z.ZodObject<{
498
513
  uiFeeAmount: z.ZodString;
499
514
  data: z.ZodOptional<z.ZodString>;
500
515
  }, z.core.$strip>>;
516
+ declare const OrderTypeSchema: z.ZodEnum<{
517
+ MarketSwap: "MarketSwap";
518
+ LimitSwap: "LimitSwap";
519
+ MarketIncrease: "MarketIncrease";
520
+ LimitIncrease: "LimitIncrease";
521
+ MarketDecrease: "MarketDecrease";
522
+ LimitDecrease: "LimitDecrease";
523
+ StopLossDecrease: "StopLossDecrease";
524
+ Liquidation: "Liquidation";
525
+ StopIncrease: "StopIncrease";
526
+ }>;
527
+ type OrderType = z.infer<typeof OrderTypeSchema>;
501
528
  declare const OrderSchema: z.ZodObject<{
502
529
  chainId: z.ZodString;
503
530
  key: z.ZodString;
@@ -505,7 +532,11 @@ declare const OrderSchema: z.ZodObject<{
505
532
  callbackContract: z.ZodString;
506
533
  initialCollateralTokenAddress: z.ZodString;
507
534
  marketAddress: z.ZodString;
508
- decreasePositionSwapType: z.ZodEnum<typeof DecreasePositionSwapType>;
535
+ decreasePositionSwapType: z.ZodEnum<{
536
+ NoSwap: "NoSwap";
537
+ SwapPnlTokenToCollateralToken: "SwapPnlTokenToCollateralToken";
538
+ SwapCollateralTokenToPnlToken: "SwapCollateralTokenToPnlToken";
539
+ }>;
509
540
  receiver: z.ZodString;
510
541
  swapPath: z.ZodArray<z.ZodString>;
511
542
  contractAcceptablePrice: z.ZodString;
@@ -517,8 +548,21 @@ declare const OrderSchema: z.ZodObject<{
517
548
  sizeDeltaUsd: z.ZodString;
518
549
  updatedAtTime: z.ZodString;
519
550
  isFrozen: z.ZodBoolean;
520
- positionSide: z.ZodUnion<readonly [z.ZodLiteral<"long">, z.ZodLiteral<"short">]>;
521
- orderType: z.ZodEnum<typeof OrderType>;
551
+ positionSide: z.ZodEnum<{
552
+ long: "long";
553
+ short: "short";
554
+ }>;
555
+ orderType: z.ZodEnum<{
556
+ MarketSwap: "MarketSwap";
557
+ LimitSwap: "LimitSwap";
558
+ MarketIncrease: "MarketIncrease";
559
+ LimitIncrease: "LimitIncrease";
560
+ MarketDecrease: "MarketDecrease";
561
+ LimitDecrease: "LimitDecrease";
562
+ StopLossDecrease: "StopLossDecrease";
563
+ Liquidation: "Liquidation";
564
+ StopIncrease: "StopIncrease";
565
+ }>;
522
566
  shouldUnwrapNativeToken: z.ZodBoolean;
523
567
  autoCancel: z.ZodBoolean;
524
568
  data: z.ZodOptional<z.ZodString>;
@@ -534,7 +578,11 @@ declare const OrdersDataSchema: z.ZodArray<z.ZodObject<{
534
578
  callbackContract: z.ZodString;
535
579
  initialCollateralTokenAddress: z.ZodString;
536
580
  marketAddress: z.ZodString;
537
- decreasePositionSwapType: z.ZodEnum<typeof DecreasePositionSwapType>;
581
+ decreasePositionSwapType: z.ZodEnum<{
582
+ NoSwap: "NoSwap";
583
+ SwapPnlTokenToCollateralToken: "SwapPnlTokenToCollateralToken";
584
+ SwapCollateralTokenToPnlToken: "SwapCollateralTokenToPnlToken";
585
+ }>;
538
586
  receiver: z.ZodString;
539
587
  swapPath: z.ZodArray<z.ZodString>;
540
588
  contractAcceptablePrice: z.ZodString;
@@ -546,8 +594,21 @@ declare const OrdersDataSchema: z.ZodArray<z.ZodObject<{
546
594
  sizeDeltaUsd: z.ZodString;
547
595
  updatedAtTime: z.ZodString;
548
596
  isFrozen: z.ZodBoolean;
549
- positionSide: z.ZodUnion<readonly [z.ZodLiteral<"long">, z.ZodLiteral<"short">]>;
550
- orderType: z.ZodEnum<typeof OrderType>;
597
+ positionSide: z.ZodEnum<{
598
+ long: "long";
599
+ short: "short";
600
+ }>;
601
+ orderType: z.ZodEnum<{
602
+ MarketSwap: "MarketSwap";
603
+ LimitSwap: "LimitSwap";
604
+ MarketIncrease: "MarketIncrease";
605
+ LimitIncrease: "LimitIncrease";
606
+ MarketDecrease: "MarketDecrease";
607
+ LimitDecrease: "LimitDecrease";
608
+ StopLossDecrease: "StopLossDecrease";
609
+ Liquidation: "Liquidation";
610
+ StopIncrease: "StopIncrease";
611
+ }>;
551
612
  shouldUnwrapNativeToken: z.ZodBoolean;
552
613
  autoCancel: z.ZodBoolean;
553
614
  data: z.ZodOptional<z.ZodString>;
@@ -597,7 +658,10 @@ declare const GetPerpetualsMarketsPositionsResponseSchema: z.ZodObject<{
597
658
  pendingBorrowingFeesUsd: z.ZodString;
598
659
  increasedAtTime: z.ZodString;
599
660
  decreasedAtTime: z.ZodString;
600
- positionSide: z.ZodUnion<readonly [z.ZodLiteral<"long">, z.ZodLiteral<"short">]>;
661
+ positionSide: z.ZodEnum<{
662
+ long: "long";
663
+ short: "short";
664
+ }>;
601
665
  isLong: z.ZodBoolean;
602
666
  fundingFeeAmount: z.ZodString;
603
667
  claimableLongTokenAmount: z.ZodString;
@@ -623,7 +687,11 @@ declare const GetPerpetualsMarketsOrdersResponseSchema: z.ZodObject<{
623
687
  callbackContract: z.ZodString;
624
688
  initialCollateralTokenAddress: z.ZodString;
625
689
  marketAddress: z.ZodString;
626
- decreasePositionSwapType: z.ZodEnum<typeof DecreasePositionSwapType>;
690
+ decreasePositionSwapType: z.ZodEnum<{
691
+ NoSwap: "NoSwap";
692
+ SwapPnlTokenToCollateralToken: "SwapPnlTokenToCollateralToken";
693
+ SwapCollateralTokenToPnlToken: "SwapCollateralTokenToPnlToken";
694
+ }>;
627
695
  receiver: z.ZodString;
628
696
  swapPath: z.ZodArray<z.ZodString>;
629
697
  contractAcceptablePrice: z.ZodString;
@@ -635,8 +703,21 @@ declare const GetPerpetualsMarketsOrdersResponseSchema: z.ZodObject<{
635
703
  sizeDeltaUsd: z.ZodString;
636
704
  updatedAtTime: z.ZodString;
637
705
  isFrozen: z.ZodBoolean;
638
- positionSide: z.ZodUnion<readonly [z.ZodLiteral<"long">, z.ZodLiteral<"short">]>;
639
- orderType: z.ZodEnum<typeof OrderType>;
706
+ positionSide: z.ZodEnum<{
707
+ long: "long";
708
+ short: "short";
709
+ }>;
710
+ orderType: z.ZodEnum<{
711
+ MarketSwap: "MarketSwap";
712
+ LimitSwap: "LimitSwap";
713
+ MarketIncrease: "MarketIncrease";
714
+ LimitIncrease: "LimitIncrease";
715
+ MarketDecrease: "MarketDecrease";
716
+ LimitDecrease: "LimitDecrease";
717
+ StopLossDecrease: "StopLossDecrease";
718
+ Liquidation: "Liquidation";
719
+ StopIncrease: "StopIncrease";
720
+ }>;
640
721
  shouldUnwrapNativeToken: z.ZodBoolean;
641
722
  autoCancel: z.ZodBoolean;
642
723
  data: z.ZodOptional<z.ZodString>;
@@ -1116,4 +1197,4 @@ declare class PublicEmberPluginRegistry {
1116
1197
  */
1117
1198
  declare function initializePublicRegistry(chainConfigs: ChainConfig[]): PublicEmberPluginRegistry;
1118
1199
 
1119
- export { type Action, type ActionDefinition, type AvailableActions, type AvailableQueries, type BorrowTokensRequest, BorrowTokensRequestSchema, type BorrowTokensResponse, BorrowTokensResponseSchema, type Chain, type ChainConfig, ChainSchema, type ChainType, ChainTypeSchema, type ClosePerpetualsOrdersRequest, ClosePerpetualsOrdersRequestSchema, type ClosePerpetualsOrdersResponse, ClosePerpetualsOrdersResponseSchema, type CreatePerpetualsPositionRequest, CreatePerpetualsPositionRequestSchema, type CreatePerpetualsPositionResponse, CreatePerpetualsPositionResponseSchema, DecreasePositionSwapTypeSchema, type EmberPlugin, type FeeBreakdown, FeeBreakdownSchema, type GetLiquidityPoolsResponse, GetLiquidityPoolsResponseSchema, type GetPerpetualsMarketsOrdersRequest, GetPerpetualsMarketsOrdersRequestSchema, type GetPerpetualsMarketsOrdersResponse, GetPerpetualsMarketsOrdersResponseSchema, type GetPerpetualsMarketsPositionsRequest, GetPerpetualsMarketsPositionsRequestSchema, type GetPerpetualsMarketsPositionsResponse, GetPerpetualsMarketsPositionsResponseSchema, type GetPerpetualsMarketsRequest, GetPerpetualsMarketsRequestSchema, type GetPerpetualsMarketsResponse, GetPerpetualsMarketsResponseSchema, type GetWalletLendingPositionsRequest, GetWalletLendingPositionsRequestSchema, type GetWalletLendingPositionsResponse, GetWalletLendingPositionsResponseSchema, type GetWalletLiquidityPositionsRequest, GetWalletLiquidityPositionsRequestSchema, type GetWalletLiquidityPositionsResponse, GetWalletLiquidityPositionsResponseSchema, type LendTokenDetail, LendTokenDetailSchema, type LendingActions, type LendingGetPositions, type LendingQueries, type LimitedLiquidityProvisionRange, LimitedLiquidityProvisionRangeSchema, type LiquidityActions, type LiquidityGetPools, type LiquidityGetWalletPositions, type LiquidityPayTokens, LiquidityPayTokensSchema, type LiquidityPool, LiquidityPoolSchema, LiquidityPoolTokens, type LiquidityPosition, type LiquidityPositionRange, LiquidityPositionRangeSchema, LiquidityPositionSchema, type LiquidityProvisionRange, LiquidityProvisionRangeSchema, type LiquidityQueries, type LiquiditySuppliedToken, LiquiditySuppliedTokenSchema, OrderSchema, OrdersDataSchema, type PerpetualMarket, PerpetualMarketSchema, type PerpetualsActions, type PerpetualsGetMarkets, type PerpetualsGetOrders, type PerpetualsGetPositions, type PerpetualsOrder, type PerpetualsPosition, type PerpetualsQueries, type PluginType, PositionSchema, type PositionSide, PositionSideSchema, PositionsDataSchema, type ProviderTrackingInfo, ProviderTrackingInfoSchema, type ProviderTrackingStatus, ProviderTrackingStatusSchema, PublicEmberPluginRegistry, type RepayTokensRequest, RepayTokensRequestSchema, type RepayTokensResponse, RepayTokensResponseSchema, type SupplyLiquidityRequest, SupplyLiquidityRequestSchema, type SupplyLiquidityResponse, SupplyLiquidityResponseSchema, type SupplyTokensRequest, SupplyTokensRequestSchema, type SupplyTokensResponse, SupplyTokensResponseSchema, type SwapActions, type SwapEstimation, SwapEstimationSchema, type SwapTokensRequest, SwapTokensRequestSchema, type SwapTokensResponse, SwapTokensResponseSchema, type Token, type TokenIdentifier, TokenIdentifierSchema, TokenSchema, type TokenSet, type TransactionPlan, type TransactionPlanError, TransactionPlanErrorSchema, TransactionPlanSchema, type TransactionType, TransactionTypeSchema, TransactionTypes, type WithdrawLiquidityRequest, WithdrawLiquidityRequestSchema, type WithdrawLiquidityResponse, WithdrawLiquidityResponseSchema, type WithdrawTokensRequest, WithdrawTokensRequestSchema, type WithdrawTokensResponse, WithdrawTokensResponseSchema, initializePublicRegistry };
1200
+ export { type Action, type ActionDefinition, type AvailableActions, type AvailableQueries, type BorrowTokensRequest, BorrowTokensRequestSchema, type BorrowTokensResponse, BorrowTokensResponseSchema, type Chain, type ChainConfig, ChainSchema, type ChainType, ChainTypeSchema, type ClosePerpetualsOrdersRequest, ClosePerpetualsOrdersRequestSchema, type ClosePerpetualsOrdersResponse, ClosePerpetualsOrdersResponseSchema, type CreatePerpetualsPositionRequest, CreatePerpetualsPositionRequestSchema, type CreatePerpetualsPositionResponse, CreatePerpetualsPositionResponseSchema, type DecreasePositionSwapType, DecreasePositionSwapTypeSchema, type EmberPlugin, type FeeBreakdown, FeeBreakdownSchema, type GetLiquidityPoolsResponse, GetLiquidityPoolsResponseSchema, type GetPerpetualsMarketsOrdersRequest, GetPerpetualsMarketsOrdersRequestSchema, type GetPerpetualsMarketsOrdersResponse, GetPerpetualsMarketsOrdersResponseSchema, type GetPerpetualsMarketsPositionsRequest, GetPerpetualsMarketsPositionsRequestSchema, type GetPerpetualsMarketsPositionsResponse, GetPerpetualsMarketsPositionsResponseSchema, type GetPerpetualsMarketsRequest, GetPerpetualsMarketsRequestSchema, type GetPerpetualsMarketsResponse, GetPerpetualsMarketsResponseSchema, type GetWalletLendingPositionsRequest, GetWalletLendingPositionsRequestSchema, type GetWalletLendingPositionsResponse, GetWalletLendingPositionsResponseSchema, type GetWalletLiquidityPositionsRequest, GetWalletLiquidityPositionsRequestSchema, type GetWalletLiquidityPositionsResponse, GetWalletLiquidityPositionsResponseSchema, type LendTokenDetail, LendTokenDetailSchema, type LendingActions, type LendingGetPositions, type LendingQueries, type LimitedLiquidityProvisionRange, LimitedLiquidityProvisionRangeSchema, type LiquidityActions, type LiquidityGetPools, type LiquidityGetWalletPositions, type LiquidityPayTokens, LiquidityPayTokensSchema, type LiquidityPool, LiquidityPoolSchema, LiquidityPoolTokens, type LiquidityPosition, type LiquidityPositionRange, LiquidityPositionRangeSchema, LiquidityPositionSchema, type LiquidityProvisionRange, LiquidityProvisionRangeSchema, type LiquidityQueries, type LiquiditySuppliedToken, LiquiditySuppliedTokenSchema, OrderSchema, type OrderType, OrderTypeSchema, OrdersDataSchema, type PerpetualMarket, PerpetualMarketSchema, type PerpetualsActions, type PerpetualsGetMarkets, type PerpetualsGetOrders, type PerpetualsGetPositions, type PerpetualsOrder, type PerpetualsPosition, type PerpetualsQueries, type PluginType, PositionSchema, type PositionSide, PositionSideSchema, PositionsDataSchema, type ProviderTrackingInfo, ProviderTrackingInfoSchema, type ProviderTrackingStatus, ProviderTrackingStatusSchema, PublicEmberPluginRegistry, type RepayTokensRequest, RepayTokensRequestSchema, type RepayTokensResponse, RepayTokensResponseSchema, type SupplyLiquidityRequest, SupplyLiquidityRequestSchema, type SupplyLiquidityResponse, SupplyLiquidityResponseSchema, type SupplyTokensRequest, SupplyTokensRequestSchema, type SupplyTokensResponse, SupplyTokensResponseSchema, type SwapActions, type SwapEstimation, SwapEstimationSchema, type SwapTokensRequest, SwapTokensRequestSchema, type SwapTokensResponse, SwapTokensResponseSchema, type Token, type TokenIdentifier, TokenIdentifierSchema, TokenSchema, type TokenSet, type TransactionPlan, type TransactionPlanError, TransactionPlanErrorSchema, TransactionPlanSchema, type TransactionType, TransactionTypeSchema, TransactionTypes, type WithdrawLiquidityRequest, WithdrawLiquidityRequestSchema, type WithdrawLiquidityResponse, WithdrawLiquidityResponseSchema, type WithdrawTokensRequest, WithdrawTokensRequestSchema, type WithdrawTokensResponse, WithdrawTokensResponseSchema, initializePublicRegistry };
package/dist/index.js CHANGED
@@ -121,7 +121,9 @@ var WithdrawTokensResponseSchema = z3.object({
121
121
  transactions: z3.array(TransactionPlanSchema)
122
122
  });
123
123
  var GetWalletLendingPositionsRequestSchema = z3.object({
124
- walletAddress: z3.string()
124
+ walletAddress: z3.string(),
125
+ chainId: z3.string().optional(),
126
+ tokenAddress: z3.string().optional()
125
127
  });
126
128
  var LendTokenDetailSchema = z3.object({
127
129
  tokenUid: TokenIdentifierSchema,
@@ -219,10 +221,13 @@ var GetLiquidityPoolsResponseSchema = z4.object({
219
221
  });
220
222
 
221
223
  // src/core/schemas/perpetuals.ts
222
- import { DecreasePositionSwapType, OrderType } from "@gmx-io/sdk/types/orders";
223
224
  import { z as z5 } from "zod";
224
- var DecreasePositionSwapTypeSchema = z5.nativeEnum(DecreasePositionSwapType);
225
- var PositionSideSchema = z5.union([z5.literal("long"), z5.literal("short")]);
225
+ var DecreasePositionSwapTypeSchema = z5.enum([
226
+ "NoSwap",
227
+ "SwapPnlTokenToCollateralToken",
228
+ "SwapCollateralTokenToPnlToken"
229
+ ]);
230
+ var PositionSideSchema = z5.enum(["long", "short"]);
226
231
  var PositionSchema = z5.object({
227
232
  chainId: z5.string(),
228
233
  key: z5.string(),
@@ -249,6 +254,17 @@ var PositionSchema = z5.object({
249
254
  data: z5.string().optional()
250
255
  });
251
256
  var PositionsDataSchema = z5.array(PositionSchema);
257
+ var OrderTypeSchema = z5.enum([
258
+ "MarketSwap",
259
+ "LimitSwap",
260
+ "MarketIncrease",
261
+ "LimitIncrease",
262
+ "MarketDecrease",
263
+ "LimitDecrease",
264
+ "StopLossDecrease",
265
+ "Liquidation",
266
+ "StopIncrease"
267
+ ]);
252
268
  var OrderSchema = z5.object({
253
269
  chainId: z5.string(),
254
270
  key: z5.string(),
@@ -269,7 +285,7 @@ var OrderSchema = z5.object({
269
285
  updatedAtTime: z5.string(),
270
286
  isFrozen: z5.boolean(),
271
287
  positionSide: PositionSideSchema,
272
- orderType: z5.nativeEnum(OrderType),
288
+ orderType: OrderTypeSchema,
273
289
  shouldUnwrapNativeToken: z5.boolean(),
274
290
  autoCancel: z5.boolean(),
275
291
  data: z5.string().optional(),
@@ -1401,6 +1417,7 @@ export {
1401
1417
  LiquidityProvisionRangeSchema,
1402
1418
  LiquiditySuppliedTokenSchema,
1403
1419
  OrderSchema,
1420
+ OrderTypeSchema,
1404
1421
  OrdersDataSchema,
1405
1422
  PerpetualMarketSchema,
1406
1423
  PositionSchema,