@myx-trade/sdk 0.1.207 → 0.1.209

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
@@ -1486,10 +1486,12 @@ declare class Api {
1486
1486
  getHistoryOrders({ accessToken, address, ...params }: GetHistoryOrdersParams & AccessTokenRequest): Promise<ApiResponse<HistoryOrderItem[]>>;
1487
1487
  getPositionHistory({ accessToken, address, ...params }: GetHistoryOrdersParams & AccessTokenRequest): Promise<ApiResponse<PositionHistoryItem[]>>;
1488
1488
  getMarketList(): Promise<ApiResponse<MarketInfo[]>>;
1489
- getAccountVipInfo({ address, accessToken, chainId }: {
1489
+ getAccountVipInfo({ address, accessToken, chainId, deadline, nonce }: {
1490
1490
  address: string;
1491
1491
  accessToken: string;
1492
1492
  chainId: number;
1493
+ deadline: number;
1494
+ nonce: string;
1493
1495
  }): Promise<ApiResponse<any>>;
1494
1496
  }
1495
1497
 
@@ -1626,7 +1628,7 @@ declare class Account {
1626
1628
  message: string;
1627
1629
  data?: undefined;
1628
1630
  }>;
1629
- getAccountVipInfoByBackend(address: string, chainId: number): Promise<{
1631
+ getAccountVipInfoByBackend(address: string, chainId: number, deadline: number, nonce: string): Promise<{
1630
1632
  code: number;
1631
1633
  data: any;
1632
1634
  message?: undefined;
package/dist/index.d.ts CHANGED
@@ -1486,10 +1486,12 @@ declare class Api {
1486
1486
  getHistoryOrders({ accessToken, address, ...params }: GetHistoryOrdersParams & AccessTokenRequest): Promise<ApiResponse<HistoryOrderItem[]>>;
1487
1487
  getPositionHistory({ accessToken, address, ...params }: GetHistoryOrdersParams & AccessTokenRequest): Promise<ApiResponse<PositionHistoryItem[]>>;
1488
1488
  getMarketList(): Promise<ApiResponse<MarketInfo[]>>;
1489
- getAccountVipInfo({ address, accessToken, chainId }: {
1489
+ getAccountVipInfo({ address, accessToken, chainId, deadline, nonce }: {
1490
1490
  address: string;
1491
1491
  accessToken: string;
1492
1492
  chainId: number;
1493
+ deadline: number;
1494
+ nonce: string;
1493
1495
  }): Promise<ApiResponse<any>>;
1494
1496
  }
1495
1497
 
@@ -1626,7 +1628,7 @@ declare class Account {
1626
1628
  message: string;
1627
1629
  data?: undefined;
1628
1630
  }>;
1629
- getAccountVipInfoByBackend(address: string, chainId: number): Promise<{
1631
+ getAccountVipInfoByBackend(address: string, chainId: number, deadline: number, nonce: string): Promise<{
1630
1632
  code: number;
1631
1633
  data: any;
1632
1634
  message?: undefined;
package/dist/index.js CHANGED
@@ -1807,7 +1807,7 @@ var RotationProvider = class extends import_providers.BaseProvider {
1807
1807
  // package.json
1808
1808
  var package_default = {
1809
1809
  name: "@myx-trade/sdk",
1810
- version: "0.1.207",
1810
+ version: "0.1.209",
1811
1811
  private: false,
1812
1812
  publishConfig: {
1813
1813
  access: "public"
@@ -21317,7 +21317,7 @@ var Account = class {
21317
21317
  };
21318
21318
  }
21319
21319
  }
21320
- async getAccountVipInfoByBackend(address, chainId) {
21320
+ async getAccountVipInfoByBackend(address, chainId, deadline, nonce) {
21321
21321
  const accessToken = await this.configManager.getAccessToken();
21322
21322
  if (!accessToken) {
21323
21323
  throw new MyxSDKError(
@@ -21326,7 +21326,7 @@ var Account = class {
21326
21326
  );
21327
21327
  }
21328
21328
  try {
21329
- const res = await this.client.api.getAccountVipInfo({ address, accessToken, chainId });
21329
+ const res = await this.client.api.getAccountVipInfo({ address, accessToken, chainId, deadline, nonce });
21330
21330
  if (res.code !== 9200) {
21331
21331
  throw new MyxSDKError(
21332
21332
  "REQUEST_FAILED" /* RequestFailed */,
@@ -21364,13 +21364,21 @@ var Account = class {
21364
21364
  "Invalid deadline, please try again"
21365
21365
  );
21366
21366
  }
21367
+ const feeData = {
21368
+ user: address,
21369
+ nonce: params.nonce,
21370
+ deadline,
21371
+ feeData: {
21372
+ tier: params.tier,
21373
+ referrer: params.referrer || import_ethers26.ethers.ZeroAddress,
21374
+ totalReferralRebatePct: params.totalReferralRebatePct,
21375
+ referrerRebatePct: params.referrerRebatePct
21376
+ },
21377
+ signature
21378
+ };
21379
+ this.logger.info("setUserFeeData params --->", feeData);
21367
21380
  try {
21368
- const rs = await brokerContract.setUserFeeData([address, params.nonce, deadline, [
21369
- params.tier,
21370
- params.referrer,
21371
- params.totalReferralRebatePct,
21372
- params.referrerRebatePct
21373
- ]], signature);
21381
+ const rs = await brokerContract.setUserFeeData(feeData);
21374
21382
  const receipt = await rs?.wait(1);
21375
21383
  return {
21376
21384
  code: 0,
@@ -21659,10 +21667,10 @@ var Api = class {
21659
21667
  `${this.getHost()}/openapi/gateway/scan/market`
21660
21668
  );
21661
21669
  }
21662
- async getAccountVipInfo({ address, accessToken, chainId }) {
21670
+ async getAccountVipInfo({ address, accessToken, chainId, deadline, nonce }) {
21663
21671
  return http.get(
21664
21672
  `${this.getHost()}/openapi/gateway/vip/trade_config`,
21665
- { chainId },
21673
+ { chainId, deadline, nonce },
21666
21674
  {
21667
21675
  headers: {
21668
21676
  myx_openapi_account: address,
package/dist/index.mjs CHANGED
@@ -1731,7 +1731,7 @@ var RotationProvider = class extends BaseProvider {
1731
1731
  // package.json
1732
1732
  var package_default = {
1733
1733
  name: "@myx-trade/sdk",
1734
- version: "0.1.207",
1734
+ version: "0.1.209",
1735
1735
  private: false,
1736
1736
  publishConfig: {
1737
1737
  access: "public"
@@ -21241,7 +21241,7 @@ var Account = class {
21241
21241
  };
21242
21242
  }
21243
21243
  }
21244
- async getAccountVipInfoByBackend(address, chainId) {
21244
+ async getAccountVipInfoByBackend(address, chainId, deadline, nonce) {
21245
21245
  const accessToken = await this.configManager.getAccessToken();
21246
21246
  if (!accessToken) {
21247
21247
  throw new MyxSDKError(
@@ -21250,7 +21250,7 @@ var Account = class {
21250
21250
  );
21251
21251
  }
21252
21252
  try {
21253
- const res = await this.client.api.getAccountVipInfo({ address, accessToken, chainId });
21253
+ const res = await this.client.api.getAccountVipInfo({ address, accessToken, chainId, deadline, nonce });
21254
21254
  if (res.code !== 9200) {
21255
21255
  throw new MyxSDKError(
21256
21256
  "REQUEST_FAILED" /* RequestFailed */,
@@ -21288,13 +21288,21 @@ var Account = class {
21288
21288
  "Invalid deadline, please try again"
21289
21289
  );
21290
21290
  }
21291
+ const feeData = {
21292
+ user: address,
21293
+ nonce: params.nonce,
21294
+ deadline,
21295
+ feeData: {
21296
+ tier: params.tier,
21297
+ referrer: params.referrer || ethers8.ZeroAddress,
21298
+ totalReferralRebatePct: params.totalReferralRebatePct,
21299
+ referrerRebatePct: params.referrerRebatePct
21300
+ },
21301
+ signature
21302
+ };
21303
+ this.logger.info("setUserFeeData params --->", feeData);
21291
21304
  try {
21292
- const rs = await brokerContract.setUserFeeData([address, params.nonce, deadline, [
21293
- params.tier,
21294
- params.referrer,
21295
- params.totalReferralRebatePct,
21296
- params.referrerRebatePct
21297
- ]], signature);
21305
+ const rs = await brokerContract.setUserFeeData(feeData);
21298
21306
  const receipt = await rs?.wait(1);
21299
21307
  return {
21300
21308
  code: 0,
@@ -21583,10 +21591,10 @@ var Api = class {
21583
21591
  `${this.getHost()}/openapi/gateway/scan/market`
21584
21592
  );
21585
21593
  }
21586
- async getAccountVipInfo({ address, accessToken, chainId }) {
21594
+ async getAccountVipInfo({ address, accessToken, chainId, deadline, nonce }) {
21587
21595
  return http.get(
21588
21596
  `${this.getHost()}/openapi/gateway/vip/trade_config`,
21589
- { chainId },
21597
+ { chainId, deadline, nonce },
21590
21598
  {
21591
21599
  headers: {
21592
21600
  myx_openapi_account: address,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myx-trade/sdk",
3
- "version": "0.1.207",
3
+ "version": "0.1.209",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"