@myx-trade/sdk 0.1.96 → 0.1.98

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
@@ -927,8 +927,7 @@ declare namespace index$1 {
927
927
  export { index$1_claimQuotePoolRebate as claimQuotePoolRebate, index$1_claimQuotePoolRebates as claimQuotePoolRebates, index$1_deposit as deposit, index$1_getLpPrice as getLpPrice, index$1_getRewards as getRewards, index$1_transfer as transfer, index$1_withdraw as withdraw };
928
928
  }
929
929
 
930
- declare const getMarket: (chainId: ChainId, marketId: string) => Promise<([string, string, bigint, bigint, bigint, bigint, bigint] & {
931
- marketId: string;
930
+ declare const getMarket: (chainId: ChainId, marketId: string) => Promise<([string, bigint, bigint, bigint, bigint, bigint] & {
932
931
  quoteToken: string;
933
932
  baseReserveRatio: bigint;
934
933
  quoteReserveRatio: bigint;
@@ -1318,8 +1317,9 @@ declare class Utils {
1318
1317
  constructor(configManager: ConfigManager, logger: Logger);
1319
1318
  getOrderIdFromTransaction(receipt: any): string | null;
1320
1319
  private getApproveQuoteAmount;
1321
- needsApproval(quoteAddress: string, requiredAmount: string, spenderAddress?: string): Promise<boolean>;
1322
- approveAuthorization({ quoteAddress, amount, spenderAddress, }: {
1320
+ needsApproval(chainId: number, quoteAddress: string, requiredAmount: string, spenderAddress?: string): Promise<boolean>;
1321
+ approveAuthorization({ chainId, quoteAddress, amount, spenderAddress, }: {
1322
+ chainId: number;
1323
1323
  quoteAddress: string;
1324
1324
  amount?: string;
1325
1325
  spenderAddress?: string;
@@ -1438,12 +1438,13 @@ declare class Position {
1438
1438
  * @desc temp skip eip7702
1439
1439
  * @todo adjustCollateral 调整保证金
1440
1440
  */
1441
- adjustCollateral({ poolId, positionId, adjustAmount, quoteToken, poolOracleType, }: {
1441
+ adjustCollateral({ poolId, positionId, adjustAmount, quoteToken, poolOracleType, chainId }: {
1442
1442
  poolId: string;
1443
1443
  positionId: string;
1444
1444
  adjustAmount: string;
1445
1445
  quoteToken: string;
1446
1446
  poolOracleType: OracleType;
1447
+ chainId: number;
1447
1448
  }): Promise<{
1448
1449
  code: number;
1449
1450
  data: {
@@ -1514,10 +1515,11 @@ declare class Account {
1514
1515
  message: string;
1515
1516
  data?: undefined;
1516
1517
  }>;
1517
- deposit({ poolId, amount, tokenAddress }: {
1518
+ deposit({ poolId, amount, tokenAddress, chainId }: {
1518
1519
  poolId: string;
1519
1520
  amount: string;
1520
1521
  tokenAddress: string;
1522
+ chainId: number;
1521
1523
  }): Promise<{
1522
1524
  code: number;
1523
1525
  data: any;
@@ -1606,8 +1608,9 @@ declare class Seamless {
1606
1608
  open: boolean;
1607
1609
  };
1608
1610
  }>;
1609
- createSeamless({ password }: {
1611
+ createSeamless({ password, chainId }: {
1610
1612
  password: string;
1613
+ chainId: number;
1611
1614
  }): Promise<{
1612
1615
  code: number;
1613
1616
  data: {
@@ -1629,7 +1632,8 @@ declare class Order {
1629
1632
  private logger;
1630
1633
  private utils;
1631
1634
  private seamless;
1632
- constructor(configManager: ConfigManager, logger: Logger, utils: Utils, seamless: Seamless);
1635
+ private account;
1636
+ constructor(configManager: ConfigManager, logger: Logger, utils: Utils, seamless: Seamless, account: Account);
1633
1637
  createIncreaseOrder(params: PlaceOrderParams): Promise<{
1634
1638
  code: number;
1635
1639
  message: string;
@@ -1714,19 +1718,19 @@ declare class Order {
1714
1718
  message: any;
1715
1719
  data?: undefined;
1716
1720
  }>;
1717
- cancelAllOrders(orderIds: string[]): Promise<{
1721
+ cancelAllOrders(orderIds: string[], chainId: ChainId): Promise<{
1718
1722
  code: number;
1719
1723
  message: any;
1720
1724
  }>;
1721
- cancelOrder(orderId: string): Promise<{
1725
+ cancelOrder(orderId: string, chainId: ChainId): Promise<{
1722
1726
  code: number;
1723
1727
  message: any;
1724
1728
  }>;
1725
- cancelOrders(orderIds: string[]): Promise<{
1729
+ cancelOrders(orderIds: string[], chainId: ChainId): Promise<{
1726
1730
  code: number;
1727
1731
  message: any;
1728
1732
  }>;
1729
- updateOrderTpSl(params: UpdateOrderParams, chainId: number): Promise<{
1733
+ updateOrderTpSl(params: UpdateOrderParams, quoteAddress: string, chainId: number): Promise<{
1730
1734
  code: number;
1731
1735
  data: ethers$1.ContractTransactionReceipt | null;
1732
1736
  message: string;
package/dist/index.d.ts CHANGED
@@ -927,8 +927,7 @@ declare namespace index$1 {
927
927
  export { index$1_claimQuotePoolRebate as claimQuotePoolRebate, index$1_claimQuotePoolRebates as claimQuotePoolRebates, index$1_deposit as deposit, index$1_getLpPrice as getLpPrice, index$1_getRewards as getRewards, index$1_transfer as transfer, index$1_withdraw as withdraw };
928
928
  }
929
929
 
930
- declare const getMarket: (chainId: ChainId, marketId: string) => Promise<([string, string, bigint, bigint, bigint, bigint, bigint] & {
931
- marketId: string;
930
+ declare const getMarket: (chainId: ChainId, marketId: string) => Promise<([string, bigint, bigint, bigint, bigint, bigint] & {
932
931
  quoteToken: string;
933
932
  baseReserveRatio: bigint;
934
933
  quoteReserveRatio: bigint;
@@ -1318,8 +1317,9 @@ declare class Utils {
1318
1317
  constructor(configManager: ConfigManager, logger: Logger);
1319
1318
  getOrderIdFromTransaction(receipt: any): string | null;
1320
1319
  private getApproveQuoteAmount;
1321
- needsApproval(quoteAddress: string, requiredAmount: string, spenderAddress?: string): Promise<boolean>;
1322
- approveAuthorization({ quoteAddress, amount, spenderAddress, }: {
1320
+ needsApproval(chainId: number, quoteAddress: string, requiredAmount: string, spenderAddress?: string): Promise<boolean>;
1321
+ approveAuthorization({ chainId, quoteAddress, amount, spenderAddress, }: {
1322
+ chainId: number;
1323
1323
  quoteAddress: string;
1324
1324
  amount?: string;
1325
1325
  spenderAddress?: string;
@@ -1438,12 +1438,13 @@ declare class Position {
1438
1438
  * @desc temp skip eip7702
1439
1439
  * @todo adjustCollateral 调整保证金
1440
1440
  */
1441
- adjustCollateral({ poolId, positionId, adjustAmount, quoteToken, poolOracleType, }: {
1441
+ adjustCollateral({ poolId, positionId, adjustAmount, quoteToken, poolOracleType, chainId }: {
1442
1442
  poolId: string;
1443
1443
  positionId: string;
1444
1444
  adjustAmount: string;
1445
1445
  quoteToken: string;
1446
1446
  poolOracleType: OracleType;
1447
+ chainId: number;
1447
1448
  }): Promise<{
1448
1449
  code: number;
1449
1450
  data: {
@@ -1514,10 +1515,11 @@ declare class Account {
1514
1515
  message: string;
1515
1516
  data?: undefined;
1516
1517
  }>;
1517
- deposit({ poolId, amount, tokenAddress }: {
1518
+ deposit({ poolId, amount, tokenAddress, chainId }: {
1518
1519
  poolId: string;
1519
1520
  amount: string;
1520
1521
  tokenAddress: string;
1522
+ chainId: number;
1521
1523
  }): Promise<{
1522
1524
  code: number;
1523
1525
  data: any;
@@ -1606,8 +1608,9 @@ declare class Seamless {
1606
1608
  open: boolean;
1607
1609
  };
1608
1610
  }>;
1609
- createSeamless({ password }: {
1611
+ createSeamless({ password, chainId }: {
1610
1612
  password: string;
1613
+ chainId: number;
1611
1614
  }): Promise<{
1612
1615
  code: number;
1613
1616
  data: {
@@ -1629,7 +1632,8 @@ declare class Order {
1629
1632
  private logger;
1630
1633
  private utils;
1631
1634
  private seamless;
1632
- constructor(configManager: ConfigManager, logger: Logger, utils: Utils, seamless: Seamless);
1635
+ private account;
1636
+ constructor(configManager: ConfigManager, logger: Logger, utils: Utils, seamless: Seamless, account: Account);
1633
1637
  createIncreaseOrder(params: PlaceOrderParams): Promise<{
1634
1638
  code: number;
1635
1639
  message: string;
@@ -1714,19 +1718,19 @@ declare class Order {
1714
1718
  message: any;
1715
1719
  data?: undefined;
1716
1720
  }>;
1717
- cancelAllOrders(orderIds: string[]): Promise<{
1721
+ cancelAllOrders(orderIds: string[], chainId: ChainId): Promise<{
1718
1722
  code: number;
1719
1723
  message: any;
1720
1724
  }>;
1721
- cancelOrder(orderId: string): Promise<{
1725
+ cancelOrder(orderId: string, chainId: ChainId): Promise<{
1722
1726
  code: number;
1723
1727
  message: any;
1724
1728
  }>;
1725
- cancelOrders(orderIds: string[]): Promise<{
1729
+ cancelOrders(orderIds: string[], chainId: ChainId): Promise<{
1726
1730
  code: number;
1727
1731
  message: any;
1728
1732
  }>;
1729
- updateOrderTpSl(params: UpdateOrderParams, chainId: number): Promise<{
1733
+ updateOrderTpSl(params: UpdateOrderParams, quoteAddress: string, chainId: number): Promise<{
1730
1734
  code: number;
1731
1735
  data: ethers$1.ContractTransactionReceipt | null;
1732
1736
  message: string;