@myx-trade/sdk 0.1.58 → 0.1.61

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
@@ -1213,6 +1213,7 @@ declare class ConfigManager {
1213
1213
  private accessTokenExpiry?;
1214
1214
  constructor(config: MyxClientConfig);
1215
1215
  clear(): void;
1216
+ startSeamlessMode(open: boolean): void;
1216
1217
  auth(params: Pick<MyxClientConfig, "signer" | "getAccessToken">): void;
1217
1218
  private validateConfig;
1218
1219
  /**
@@ -1671,7 +1672,7 @@ declare class Seamless {
1671
1672
  authorizeSeamlessAccount({ approve, seamlessAddress }: {
1672
1673
  approve: boolean;
1673
1674
  seamlessAddress: string;
1674
- }): Promise<ApiResponse<any>>;
1675
+ }): Promise<void>;
1675
1676
  unLockSeamlessWallet({ masterAddress, password, apiKey }: {
1676
1677
  masterAddress: string;
1677
1678
  password: string;
@@ -1705,6 +1706,14 @@ declare class Seamless {
1705
1706
  apiKey: string;
1706
1707
  };
1707
1708
  }>;
1709
+ startSeamlessMode({ open }: {
1710
+ open: boolean;
1711
+ }): Promise<{
1712
+ code: number;
1713
+ data: {
1714
+ open: boolean;
1715
+ };
1716
+ }>;
1708
1717
  createSeamless({ password }: {
1709
1718
  password: string;
1710
1719
  }): Promise<{
package/dist/index.d.ts CHANGED
@@ -1213,6 +1213,7 @@ declare class ConfigManager {
1213
1213
  private accessTokenExpiry?;
1214
1214
  constructor(config: MyxClientConfig);
1215
1215
  clear(): void;
1216
+ startSeamlessMode(open: boolean): void;
1216
1217
  auth(params: Pick<MyxClientConfig, "signer" | "getAccessToken">): void;
1217
1218
  private validateConfig;
1218
1219
  /**
@@ -1671,7 +1672,7 @@ declare class Seamless {
1671
1672
  authorizeSeamlessAccount({ approve, seamlessAddress }: {
1672
1673
  approve: boolean;
1673
1674
  seamlessAddress: string;
1674
- }): Promise<ApiResponse<any>>;
1675
+ }): Promise<void>;
1675
1676
  unLockSeamlessWallet({ masterAddress, password, apiKey }: {
1676
1677
  masterAddress: string;
1677
1678
  password: string;
@@ -1705,6 +1706,14 @@ declare class Seamless {
1705
1706
  apiKey: string;
1706
1707
  };
1707
1708
  }>;
1709
+ startSeamlessMode({ open }: {
1710
+ open: boolean;
1711
+ }): Promise<{
1712
+ code: number;
1713
+ data: {
1714
+ open: boolean;
1715
+ };
1716
+ }>;
1708
1717
  createSeamless({ password }: {
1709
1718
  password: string;
1710
1719
  }): Promise<{
package/dist/index.js CHANGED
@@ -1841,7 +1841,7 @@ var RotationProvider = class extends import_providers.BaseProvider {
1841
1841
  // package.json
1842
1842
  var package_default = {
1843
1843
  name: "@myx-trade/sdk",
1844
- version: "0.1.58",
1844
+ version: "0.1.61",
1845
1845
  private: false,
1846
1846
  publishConfig: {
1847
1847
  access: "public"
@@ -13660,6 +13660,12 @@ var ConfigManager = class {
13660
13660
  getAccessToken: void 0
13661
13661
  };
13662
13662
  }
13663
+ startSeamlessMode(open) {
13664
+ this.config = {
13665
+ ...this.config,
13666
+ seamlessMode: open
13667
+ };
13668
+ }
13663
13669
  auth(params) {
13664
13670
  this.clear();
13665
13671
  this.config = {
@@ -20671,11 +20677,17 @@ var Seamless = class {
20671
20677
  const getRs = await fetchForwarderGetApi({
20672
20678
  requestId: txRs.data?.requestId
20673
20679
  });
20674
- console.log("getRs-->", getRs);
20680
+ this.logger.info("authorizeSeamlessAccount result-->", getRs);
20675
20681
  if (getRs.data?.status === 9 /* EXECUTED */) {
20676
20682
  if (getRs.data?.txHash) {
20677
20683
  txRs.data.txHash = getRs.data.txHash;
20678
- return;
20684
+ return {
20685
+ code: 0,
20686
+ data: {
20687
+ seamlessAccount: seamlessAddress,
20688
+ authorized: approve2
20689
+ }
20690
+ };
20679
20691
  } else {
20680
20692
  throw new MyxSDKError("OPERATION_FAILED" /* OperationFailed */, "Operation failed, please try again later");
20681
20693
  }
@@ -20694,7 +20706,6 @@ var Seamless = class {
20694
20706
  }
20695
20707
  }
20696
20708
  }
20697
- return txRs;
20698
20709
  }
20699
20710
  async unLockSeamlessWallet({ masterAddress, password, apiKey }) {
20700
20711
  const key = import_crypto_js.default.enc.Utf8.parse(charFill(password));
@@ -20771,6 +20782,15 @@ var Seamless = class {
20771
20782
  }
20772
20783
  };
20773
20784
  }
20785
+ async startSeamlessMode({ open }) {
20786
+ this.configManager.startSeamlessMode(open);
20787
+ return {
20788
+ code: 0,
20789
+ data: {
20790
+ open
20791
+ }
20792
+ };
20793
+ }
20774
20794
  async createSeamless({ password }) {
20775
20795
  const config = this.configManager.getConfig();
20776
20796
  const signer = config.signer;
package/dist/index.mjs CHANGED
@@ -1752,7 +1752,7 @@ var RotationProvider = class extends BaseProvider {
1752
1752
  // package.json
1753
1753
  var package_default = {
1754
1754
  name: "@myx-trade/sdk",
1755
- version: "0.1.58",
1755
+ version: "0.1.61",
1756
1756
  private: false,
1757
1757
  publishConfig: {
1758
1758
  access: "public"
@@ -13571,6 +13571,12 @@ var ConfigManager = class {
13571
13571
  getAccessToken: void 0
13572
13572
  };
13573
13573
  }
13574
+ startSeamlessMode(open) {
13575
+ this.config = {
13576
+ ...this.config,
13577
+ seamlessMode: open
13578
+ };
13579
+ }
13574
13580
  auth(params) {
13575
13581
  this.clear();
13576
13582
  this.config = {
@@ -20582,11 +20588,17 @@ var Seamless = class {
20582
20588
  const getRs = await fetchForwarderGetApi({
20583
20589
  requestId: txRs.data?.requestId
20584
20590
  });
20585
- console.log("getRs-->", getRs);
20591
+ this.logger.info("authorizeSeamlessAccount result-->", getRs);
20586
20592
  if (getRs.data?.status === 9 /* EXECUTED */) {
20587
20593
  if (getRs.data?.txHash) {
20588
20594
  txRs.data.txHash = getRs.data.txHash;
20589
- return;
20595
+ return {
20596
+ code: 0,
20597
+ data: {
20598
+ seamlessAccount: seamlessAddress,
20599
+ authorized: approve2
20600
+ }
20601
+ };
20590
20602
  } else {
20591
20603
  throw new MyxSDKError("OPERATION_FAILED" /* OperationFailed */, "Operation failed, please try again later");
20592
20604
  }
@@ -20605,7 +20617,6 @@ var Seamless = class {
20605
20617
  }
20606
20618
  }
20607
20619
  }
20608
- return txRs;
20609
20620
  }
20610
20621
  async unLockSeamlessWallet({ masterAddress, password, apiKey }) {
20611
20622
  const key = CryptoJS.enc.Utf8.parse(charFill(password));
@@ -20682,6 +20693,15 @@ var Seamless = class {
20682
20693
  }
20683
20694
  };
20684
20695
  }
20696
+ async startSeamlessMode({ open }) {
20697
+ this.configManager.startSeamlessMode(open);
20698
+ return {
20699
+ code: 0,
20700
+ data: {
20701
+ open
20702
+ }
20703
+ };
20704
+ }
20685
20705
  async createSeamless({ password }) {
20686
20706
  const config = this.configManager.getConfig();
20687
20707
  const signer = config.signer;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myx-trade/sdk",
3
- "version": "0.1.58",
3
+ "version": "0.1.61",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"