@myx-trade/sdk 0.1.89 → 0.1.91

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
@@ -1332,7 +1332,7 @@ declare class Utils {
1332
1332
  message: any;
1333
1333
  data?: undefined;
1334
1334
  }>;
1335
- getNetworkFee(quoteAddress: string): Promise<any>;
1335
+ getNetworkFee(quoteAddress: string, chainId: number): Promise<any>;
1336
1336
  getOraclePrice(poolId: string): Promise<{
1337
1337
  poolId: string;
1338
1338
  price: string;
package/dist/index.d.ts CHANGED
@@ -1332,7 +1332,7 @@ declare class Utils {
1332
1332
  message: any;
1333
1333
  data?: undefined;
1334
1334
  }>;
1335
- getNetworkFee(quoteAddress: string): Promise<any>;
1335
+ getNetworkFee(quoteAddress: string, chainId: number): Promise<any>;
1336
1336
  getOraclePrice(poolId: string): Promise<{
1337
1337
  poolId: string;
1338
1338
  price: string;
package/dist/index.js CHANGED
@@ -1838,7 +1838,7 @@ var RotationProvider = class extends import_providers.BaseProvider {
1838
1838
  // package.json
1839
1839
  var package_default = {
1840
1840
  name: "@myx-trade/sdk",
1841
- version: "0.1.89",
1841
+ version: "0.1.91",
1842
1842
  private: false,
1843
1843
  publishConfig: {
1844
1844
  access: "public"
@@ -14290,7 +14290,8 @@ var Order = class {
14290
14290
  throw new MyxSDKError("INVALID_SIGNER" /* InvalidSigner */, "Invalid signer");
14291
14291
  }
14292
14292
  const networkFee = await this.utils.getNetworkFee(
14293
- params.executionFeeToken
14293
+ params.executionFeeToken,
14294
+ params.chainId
14294
14295
  );
14295
14296
  const collateralWithNetworkFee = BigInt(params.collateralAmount) + BigInt(networkFee);
14296
14297
  const needsApproval = await this.utils.needsApproval(
@@ -14453,7 +14454,8 @@ var Order = class {
14453
14454
  this.configManager.getConfig().brokerAddress
14454
14455
  );
14455
14456
  const networkFee = await this.utils.getNetworkFee(
14456
- params[0].executionFeeToken
14457
+ params[0].executionFeeToken,
14458
+ chainId
14457
14459
  );
14458
14460
  const positionIds = params.map((param) => param.positionId.toString());
14459
14461
  const dataMap = params.map((param) => {
@@ -14522,7 +14524,8 @@ var Order = class {
14522
14524
  this.configManager.getConfig().brokerAddress
14523
14525
  );
14524
14526
  const networkFee = await this.utils.getNetworkFee(
14525
- params.executionFeeToken
14527
+ params.executionFeeToken,
14528
+ params.chainId
14526
14529
  );
14527
14530
  const collateralWithNetworkFee = BigInt(params.collateralAmount) + BigInt(networkFee);
14528
14531
  const data = {
@@ -14615,7 +14618,8 @@ var Order = class {
14615
14618
  );
14616
14619
  try {
14617
14620
  const networkFee = await this.utils.getNetworkFee(
14618
- params.executionFeeToken
14621
+ params.executionFeeToken,
14622
+ params.chainId
14619
14623
  );
14620
14624
  if (params.tpSize !== "0" && params.slSize !== "0") {
14621
14625
  const data2 = [
@@ -19481,10 +19485,10 @@ var Utils = class {
19481
19485
  };
19482
19486
  }
19483
19487
  }
19484
- async getNetworkFee(quoteAddress) {
19488
+ async getNetworkFee(quoteAddress, chainId) {
19485
19489
  const config = this.configManager.getConfig();
19486
19490
  const orderManagerAddress = getContractAddressByChainId(
19487
- config.chainId
19491
+ chainId
19488
19492
  ).ORDER_MANAGER;
19489
19493
  const provider = await getJSONProvider(config.chainId);
19490
19494
  const orderManagerContract = new import_ethers25.ethers.Contract(
package/dist/index.mjs CHANGED
@@ -1749,7 +1749,7 @@ var RotationProvider = class extends BaseProvider {
1749
1749
  // package.json
1750
1750
  var package_default = {
1751
1751
  name: "@myx-trade/sdk",
1752
- version: "0.1.89",
1752
+ version: "0.1.91",
1753
1753
  private: false,
1754
1754
  publishConfig: {
1755
1755
  access: "public"
@@ -14201,7 +14201,8 @@ var Order = class {
14201
14201
  throw new MyxSDKError("INVALID_SIGNER" /* InvalidSigner */, "Invalid signer");
14202
14202
  }
14203
14203
  const networkFee = await this.utils.getNetworkFee(
14204
- params.executionFeeToken
14204
+ params.executionFeeToken,
14205
+ params.chainId
14205
14206
  );
14206
14207
  const collateralWithNetworkFee = BigInt(params.collateralAmount) + BigInt(networkFee);
14207
14208
  const needsApproval = await this.utils.needsApproval(
@@ -14364,7 +14365,8 @@ var Order = class {
14364
14365
  this.configManager.getConfig().brokerAddress
14365
14366
  );
14366
14367
  const networkFee = await this.utils.getNetworkFee(
14367
- params[0].executionFeeToken
14368
+ params[0].executionFeeToken,
14369
+ chainId
14368
14370
  );
14369
14371
  const positionIds = params.map((param) => param.positionId.toString());
14370
14372
  const dataMap = params.map((param) => {
@@ -14433,7 +14435,8 @@ var Order = class {
14433
14435
  this.configManager.getConfig().brokerAddress
14434
14436
  );
14435
14437
  const networkFee = await this.utils.getNetworkFee(
14436
- params.executionFeeToken
14438
+ params.executionFeeToken,
14439
+ params.chainId
14437
14440
  );
14438
14441
  const collateralWithNetworkFee = BigInt(params.collateralAmount) + BigInt(networkFee);
14439
14442
  const data = {
@@ -14526,7 +14529,8 @@ var Order = class {
14526
14529
  );
14527
14530
  try {
14528
14531
  const networkFee = await this.utils.getNetworkFee(
14529
- params.executionFeeToken
14532
+ params.executionFeeToken,
14533
+ params.chainId
14530
14534
  );
14531
14535
  if (params.tpSize !== "0" && params.slSize !== "0") {
14532
14536
  const data2 = [
@@ -19392,10 +19396,10 @@ var Utils = class {
19392
19396
  };
19393
19397
  }
19394
19398
  }
19395
- async getNetworkFee(quoteAddress) {
19399
+ async getNetworkFee(quoteAddress, chainId) {
19396
19400
  const config = this.configManager.getConfig();
19397
19401
  const orderManagerAddress = getContractAddressByChainId(
19398
- config.chainId
19402
+ chainId
19399
19403
  ).ORDER_MANAGER;
19400
19404
  const provider = await getJSONProvider(config.chainId);
19401
19405
  const orderManagerContract = new ethers7.Contract(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myx-trade/sdk",
3
- "version": "0.1.89",
3
+ "version": "0.1.91",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"