@myx-trade/sdk 1.0.3-beta.0 → 1.0.4-beta.0

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.mts CHANGED
@@ -896,16 +896,16 @@ interface PreviewWithdrawDataParams {
896
896
  }
897
897
 
898
898
  declare const claimBasePoolRebate: (params: ClaimParams) => Promise<any>;
899
- declare const claimBasePoolRebates: (params: ClaimRebatesParams) => Promise<any>;
899
+ declare const claimBasePoolRebates: (params: ClaimRebatesParams) => Promise<viem.TransactionReceipt | undefined>;
900
900
 
901
- declare const deposit$1: (params: Deposit) => Promise<any>;
901
+ declare const deposit$1: (params: Deposit) => Promise<viem.TransactionReceipt | undefined>;
902
902
 
903
903
  declare const withdrawableLpAmount$1: (params: {
904
904
  chainId: ChainId;
905
905
  poolId: string;
906
906
  price?: bigint;
907
907
  }) => Promise<any>;
908
- declare const withdraw$1: (params: WithdrawParams) => Promise<any>;
908
+ declare const withdraw$1: (params: WithdrawParams) => Promise<viem.TransactionReceipt>;
909
909
 
910
910
  declare const getRewards$1: (params: RewardsParams) => Promise<{
911
911
  rebates: any;
@@ -926,21 +926,21 @@ declare namespace index$2 {
926
926
  export { index$2_claimBasePoolRebate as claimBasePoolRebate, index$2_claimBasePoolRebates as claimBasePoolRebates, deposit$1 as deposit, getLpPrice$1 as getLpPrice, getRewards$1 as getRewards, index$2_previewUserWithdrawData as previewUserWithdrawData, withdraw$1 as withdraw, withdrawableLpAmount$1 as withdrawableLpAmount };
927
927
  }
928
928
 
929
- declare const deposit: (params: Deposit) => Promise<any>;
929
+ declare const deposit: (params: Deposit) => Promise<viem.TransactionReceipt | undefined>;
930
930
 
931
931
  declare const withdrawableLpAmount: (params: {
932
932
  chainId: ChainId;
933
933
  poolId: string;
934
934
  price?: bigint;
935
935
  }) => Promise<any>;
936
- declare const withdraw: (params: WithdrawParams) => Promise<any>;
936
+ declare const withdraw: (params: WithdrawParams) => Promise<viem.TransactionReceipt>;
937
937
 
938
- declare const transfer: (chainId: ChainId, fromPoolId: string, toPoolId: string, amount: number) => Promise<any>;
938
+ declare const transfer: (chainId: ChainId, fromPoolId: string, toPoolId: string, amount: number) => Promise<viem.TransactionReceipt | null>;
939
939
 
940
940
  declare const getRewards: (params: RewardsParams) => Promise<any>;
941
941
 
942
942
  declare const claimQuotePoolRebate: (params: ClaimParams) => Promise<any>;
943
- declare const claimQuotePoolRebates: (params: ClaimRebatesParams) => Promise<any>;
943
+ declare const claimQuotePoolRebates: (params: ClaimRebatesParams) => Promise<viem.TransactionReceipt | undefined>;
944
944
 
945
945
  declare const getLpPrice: (chainId: ChainId, poolId: string) => Promise<any>;
946
946
 
@@ -1030,9 +1030,9 @@ declare const pool: {
1030
1030
  };
1031
1031
  }>;
1032
1032
  getUserGenesisShare: (chainId: ChainId, tokenAddress: string, account: string) => Promise<any>;
1033
- addTpSl: (params: AddTpSLParams) => Promise<any>;
1034
- cancelTpSl: (params: CancelTpSLParams) => Promise<any>;
1035
- reprime: (chainId: ChainId, poolId: string, marketId: string) => Promise<any>;
1033
+ addTpSl: (params: AddTpSLParams) => Promise<viem.TransactionReceipt>;
1034
+ cancelTpSl: (params: CancelTpSLParams) => Promise<viem.TransactionReceipt>;
1035
+ reprime: (chainId: ChainId, poolId: string, marketId: string) => Promise<viem.TransactionReceipt>;
1036
1036
  getPoolDetail: (chainId: ChainId, poolId: string) => Promise<MarketPool | undefined>;
1037
1037
  getOpenOrders: (chainId: ChainId, address: string) => Promise<PoolOpenOrder[]>;
1038
1038
  };
@@ -1061,37 +1061,28 @@ declare const getTokenInfo: (chainId: number, tokenAddress: string, account?: st
1061
1061
 
1062
1062
  /**
1063
1063
  * MyxLogger
1064
- * @description MyxLogger is a logger for Myx SDK
1065
- * @author Myx
1066
- * @version 1.0.0
1067
- * @since 2025-09-19
1068
- * @license MIT
1069
- * @copyright Myx
1070
- * @description MyxLogger is a logger for Myx SDK
1064
+ * Uses optional sink (no global console by default) so LavaMoat allowlist can omit "console".
1065
+ * Host can setSdkLogSink(console) to get logs.
1071
1066
  */
1072
1067
  type LogLevel = "debug" | "info" | "error" | "warn" | "none";
1073
1068
  interface LoggerOptions {
1074
1069
  logLevel?: LogLevel;
1070
+ /** Optional sink; if not set, uses getSdkLogSink() (no-op by default). */
1071
+ sink?: {
1072
+ log?: (...a: unknown[]) => void;
1073
+ info?: (...a: unknown[]) => void;
1074
+ warn?: (...a: unknown[]) => void;
1075
+ error?: (...a: unknown[]) => void;
1076
+ };
1075
1077
  }
1076
1078
  declare class Logger {
1077
1079
  private options;
1078
1080
  constructor(options?: LoggerOptions);
1079
- /**
1080
- * debug
1081
- */
1082
- debug(message: string, ...args: any[]): void;
1083
- /**
1084
- * info
1085
- */
1086
- info(message: string, ...args: any[]): void;
1087
- /**
1088
- * error
1089
- */
1090
- error(message: string, ...args: any[]): void;
1091
- /**
1092
- * warn
1093
- */
1094
- warn(message: string, ...args: any[]): void;
1081
+ private get out();
1082
+ debug(message: string, ...args: unknown[]): void;
1083
+ info(message: string, ...args: unknown[]): void;
1084
+ error(message: string, ...args: unknown[]): void;
1085
+ warn(message: string, ...args: unknown[]): void;
1095
1086
  }
1096
1087
 
1097
1088
  interface WebSocketConfig extends Omit<Options, "maxReconnectionDelay" | "minReconnectionDelay"> {
@@ -2018,6 +2009,10 @@ declare class Account {
2018
2009
  constructor(configManager: ConfigManager, logger: Logger, utils: Utils, client: MyxClient);
2019
2010
  /** Retry an async call a few times to tolerate intermittent RPC/decoding failures (e.g. BAD_DATA / 0x). */
2020
2011
  private withRetry;
2012
+ getTradeFlow(params: GetHistoryOrdersParams, address: string): Promise<{
2013
+ code: number;
2014
+ data: TradeFlowItem[];
2015
+ }>;
2021
2016
  getWalletQuoteTokenBalance(chainId: number, address?: string): Promise<{
2022
2017
  code: number;
2023
2018
  data: any;
package/dist/index.d.ts CHANGED
@@ -896,16 +896,16 @@ interface PreviewWithdrawDataParams {
896
896
  }
897
897
 
898
898
  declare const claimBasePoolRebate: (params: ClaimParams) => Promise<any>;
899
- declare const claimBasePoolRebates: (params: ClaimRebatesParams) => Promise<any>;
899
+ declare const claimBasePoolRebates: (params: ClaimRebatesParams) => Promise<viem.TransactionReceipt | undefined>;
900
900
 
901
- declare const deposit$1: (params: Deposit) => Promise<any>;
901
+ declare const deposit$1: (params: Deposit) => Promise<viem.TransactionReceipt | undefined>;
902
902
 
903
903
  declare const withdrawableLpAmount$1: (params: {
904
904
  chainId: ChainId;
905
905
  poolId: string;
906
906
  price?: bigint;
907
907
  }) => Promise<any>;
908
- declare const withdraw$1: (params: WithdrawParams) => Promise<any>;
908
+ declare const withdraw$1: (params: WithdrawParams) => Promise<viem.TransactionReceipt>;
909
909
 
910
910
  declare const getRewards$1: (params: RewardsParams) => Promise<{
911
911
  rebates: any;
@@ -926,21 +926,21 @@ declare namespace index$2 {
926
926
  export { index$2_claimBasePoolRebate as claimBasePoolRebate, index$2_claimBasePoolRebates as claimBasePoolRebates, deposit$1 as deposit, getLpPrice$1 as getLpPrice, getRewards$1 as getRewards, index$2_previewUserWithdrawData as previewUserWithdrawData, withdraw$1 as withdraw, withdrawableLpAmount$1 as withdrawableLpAmount };
927
927
  }
928
928
 
929
- declare const deposit: (params: Deposit) => Promise<any>;
929
+ declare const deposit: (params: Deposit) => Promise<viem.TransactionReceipt | undefined>;
930
930
 
931
931
  declare const withdrawableLpAmount: (params: {
932
932
  chainId: ChainId;
933
933
  poolId: string;
934
934
  price?: bigint;
935
935
  }) => Promise<any>;
936
- declare const withdraw: (params: WithdrawParams) => Promise<any>;
936
+ declare const withdraw: (params: WithdrawParams) => Promise<viem.TransactionReceipt>;
937
937
 
938
- declare const transfer: (chainId: ChainId, fromPoolId: string, toPoolId: string, amount: number) => Promise<any>;
938
+ declare const transfer: (chainId: ChainId, fromPoolId: string, toPoolId: string, amount: number) => Promise<viem.TransactionReceipt | null>;
939
939
 
940
940
  declare const getRewards: (params: RewardsParams) => Promise<any>;
941
941
 
942
942
  declare const claimQuotePoolRebate: (params: ClaimParams) => Promise<any>;
943
- declare const claimQuotePoolRebates: (params: ClaimRebatesParams) => Promise<any>;
943
+ declare const claimQuotePoolRebates: (params: ClaimRebatesParams) => Promise<viem.TransactionReceipt | undefined>;
944
944
 
945
945
  declare const getLpPrice: (chainId: ChainId, poolId: string) => Promise<any>;
946
946
 
@@ -1030,9 +1030,9 @@ declare const pool: {
1030
1030
  };
1031
1031
  }>;
1032
1032
  getUserGenesisShare: (chainId: ChainId, tokenAddress: string, account: string) => Promise<any>;
1033
- addTpSl: (params: AddTpSLParams) => Promise<any>;
1034
- cancelTpSl: (params: CancelTpSLParams) => Promise<any>;
1035
- reprime: (chainId: ChainId, poolId: string, marketId: string) => Promise<any>;
1033
+ addTpSl: (params: AddTpSLParams) => Promise<viem.TransactionReceipt>;
1034
+ cancelTpSl: (params: CancelTpSLParams) => Promise<viem.TransactionReceipt>;
1035
+ reprime: (chainId: ChainId, poolId: string, marketId: string) => Promise<viem.TransactionReceipt>;
1036
1036
  getPoolDetail: (chainId: ChainId, poolId: string) => Promise<MarketPool | undefined>;
1037
1037
  getOpenOrders: (chainId: ChainId, address: string) => Promise<PoolOpenOrder[]>;
1038
1038
  };
@@ -1061,37 +1061,28 @@ declare const getTokenInfo: (chainId: number, tokenAddress: string, account?: st
1061
1061
 
1062
1062
  /**
1063
1063
  * MyxLogger
1064
- * @description MyxLogger is a logger for Myx SDK
1065
- * @author Myx
1066
- * @version 1.0.0
1067
- * @since 2025-09-19
1068
- * @license MIT
1069
- * @copyright Myx
1070
- * @description MyxLogger is a logger for Myx SDK
1064
+ * Uses optional sink (no global console by default) so LavaMoat allowlist can omit "console".
1065
+ * Host can setSdkLogSink(console) to get logs.
1071
1066
  */
1072
1067
  type LogLevel = "debug" | "info" | "error" | "warn" | "none";
1073
1068
  interface LoggerOptions {
1074
1069
  logLevel?: LogLevel;
1070
+ /** Optional sink; if not set, uses getSdkLogSink() (no-op by default). */
1071
+ sink?: {
1072
+ log?: (...a: unknown[]) => void;
1073
+ info?: (...a: unknown[]) => void;
1074
+ warn?: (...a: unknown[]) => void;
1075
+ error?: (...a: unknown[]) => void;
1076
+ };
1075
1077
  }
1076
1078
  declare class Logger {
1077
1079
  private options;
1078
1080
  constructor(options?: LoggerOptions);
1079
- /**
1080
- * debug
1081
- */
1082
- debug(message: string, ...args: any[]): void;
1083
- /**
1084
- * info
1085
- */
1086
- info(message: string, ...args: any[]): void;
1087
- /**
1088
- * error
1089
- */
1090
- error(message: string, ...args: any[]): void;
1091
- /**
1092
- * warn
1093
- */
1094
- warn(message: string, ...args: any[]): void;
1081
+ private get out();
1082
+ debug(message: string, ...args: unknown[]): void;
1083
+ info(message: string, ...args: unknown[]): void;
1084
+ error(message: string, ...args: unknown[]): void;
1085
+ warn(message: string, ...args: unknown[]): void;
1095
1086
  }
1096
1087
 
1097
1088
  interface WebSocketConfig extends Omit<Options, "maxReconnectionDelay" | "minReconnectionDelay"> {
@@ -2018,6 +2009,10 @@ declare class Account {
2018
2009
  constructor(configManager: ConfigManager, logger: Logger, utils: Utils, client: MyxClient);
2019
2010
  /** Retry an async call a few times to tolerate intermittent RPC/decoding failures (e.g. BAD_DATA / 0x). */
2020
2011
  private withRetry;
2012
+ getTradeFlow(params: GetHistoryOrdersParams, address: string): Promise<{
2013
+ code: number;
2014
+ data: TradeFlowItem[];
2015
+ }>;
2021
2016
  getWalletQuoteTokenBalance(chainId: number, address?: string): Promise<{
2022
2017
  code: number;
2023
2018
  data: any;