@coopenomics/sdk 2025.11.8 → 2025.11.9-alpha-1

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.cjs CHANGED
@@ -8930,7 +8930,7 @@ const _Client = class _Client {
8930
8930
  __publicField(this, "vote");
8931
8931
  __publicField(this, "thunder");
8932
8932
  this.currentHeaders = options.headers || {};
8933
- this.thunder = _Client.createThunder(options.api_url);
8933
+ this.thunder = this.createThunder(options.api_url);
8934
8934
  this.account = new Account();
8935
8935
  this.blockchain = new Blockchain(options);
8936
8936
  this.document = new Document(options.wif);
@@ -8945,23 +8945,18 @@ const _Client = class _Client {
8945
8945
  }
8946
8946
  }
8947
8947
  /**
8948
- * Инициализация клиента с заданными опциями.
8948
+ * Создает экземпляр клиента с заданными опциями (для обратной совместимости).
8949
8949
  * @param options Параметры соединения.
8950
8950
  */
8951
8951
  static create(options) {
8952
- if (!this.instance) {
8953
- this.instance = new _Client(options);
8954
- }
8955
- return this.getInstance();
8952
+ return new _Client(options);
8956
8953
  }
8957
8954
  /**
8958
- * Возвращает текущий экземпляр клиента.
8955
+ * Создает новый экземпляр клиента.
8956
+ * @param options Параметры соединения.
8959
8957
  */
8960
- static getInstance() {
8961
- if (!this.instance) {
8962
- throw new Error("\u041A\u043B\u0438\u0435\u043D\u0442 \u043D\u0435 \u0438\u043D\u0438\u0446\u0438\u0430\u043B\u0438\u0437\u0438\u0440\u043E\u0432\u0430\u043D. \u0412\u044B\u0437\u043E\u0432\u0438\u0442\u0435 Client.create() \u043F\u0435\u0440\u0435\u0434 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435\u043C.");
8963
- }
8964
- return this.instance;
8958
+ static New(options) {
8959
+ return new _Client(options);
8965
8960
  }
8966
8961
  /**
8967
8962
  * Логин пользователя с использованием email и WIF.
@@ -9004,6 +8999,7 @@ const _Client = class _Client {
9004
8999
  }
9005
9000
  /**
9006
9001
  * Установка WIF.
9002
+ * @param username Имя пользователя.
9007
9003
  * @param wif WIF для установки.
9008
9004
  */
9009
9005
  setWif(username, wif) {
@@ -9064,14 +9060,14 @@ const _Client = class _Client {
9064
9060
  * @param baseUrl URL GraphQL API.
9065
9061
  * @returns Функция Thunder.
9066
9062
  */
9067
- static createThunder(baseUrl) {
9063
+ createThunder(baseUrl) {
9068
9064
  return Thunder(async (query, variables) => {
9069
9065
  const response = await fetch(baseUrl, {
9070
9066
  body: JSON.stringify({ query, variables }),
9071
9067
  method: "POST",
9072
9068
  headers: {
9073
9069
  "Content-Type": "application/json",
9074
- ..._Client.getInstance().currentHeaders
9070
+ ...this.currentHeaders
9075
9071
  }
9076
9072
  });
9077
9073
  if (!response.ok) {
@@ -9094,7 +9090,6 @@ const _Client = class _Client {
9094
9090
  }, { scalars: _Client.scalars });
9095
9091
  }
9096
9092
  };
9097
- __publicField(_Client, "instance", null);
9098
9093
  __publicField(_Client, "scalars", ZeusScalars({
9099
9094
  DateTime: {
9100
9095
  decode: (e) => new Date(e),
package/dist/index.d.cts CHANGED
@@ -50563,7 +50563,6 @@ declare namespace index {
50563
50563
 
50564
50564
  declare class Client {
50565
50565
  private readonly options;
50566
- private static instance;
50567
50566
  private currentHeaders;
50568
50567
  private account;
50569
50568
  private blockchain;
@@ -50572,16 +50571,17 @@ declare class Client {
50572
50571
  private vote;
50573
50572
  private thunder;
50574
50573
  private static scalars;
50575
- private constructor();
50574
+ constructor(options: ClientConnectionOptions);
50576
50575
  /**
50577
- * Инициализация клиента с заданными опциями.
50576
+ * Создает экземпляр клиента с заданными опциями (для обратной совместимости).
50578
50577
  * @param options Параметры соединения.
50579
50578
  */
50580
50579
  static create(options: ClientConnectionOptions): Client;
50581
50580
  /**
50582
- * Возвращает текущий экземпляр клиента.
50581
+ * Создает новый экземпляр клиента.
50582
+ * @param options Параметры соединения.
50583
50583
  */
50584
- static getInstance(): Client;
50584
+ static New(options: ClientConnectionOptions): Client;
50585
50585
  /**
50586
50586
  * Логин пользователя с использованием email и WIF.
50587
50587
  * @param email Email пользователя.
@@ -50596,6 +50596,7 @@ declare class Client {
50596
50596
  setToken(token: string): void;
50597
50597
  /**
50598
50598
  * Установка WIF.
50599
+ * @param username Имя пользователя.
50599
50600
  * @param wif WIF для установки.
50600
50601
  */
50601
50602
  setWif(username: string, wif: string): void;
@@ -51534,7 +51535,7 @@ declare class Client {
51534
51535
  * @param baseUrl URL GraphQL API.
51535
51536
  * @returns Функция Thunder.
51536
51537
  */
51537
- private static createThunder;
51538
+ private createThunder;
51538
51539
  }
51539
51540
 
51540
51541
  export { Classes, Client, Mutations, index$3 as Queries, index as Types, index$C as Zeus };
package/dist/index.d.mts CHANGED
@@ -50563,7 +50563,6 @@ declare namespace index {
50563
50563
 
50564
50564
  declare class Client {
50565
50565
  private readonly options;
50566
- private static instance;
50567
50566
  private currentHeaders;
50568
50567
  private account;
50569
50568
  private blockchain;
@@ -50572,16 +50571,17 @@ declare class Client {
50572
50571
  private vote;
50573
50572
  private thunder;
50574
50573
  private static scalars;
50575
- private constructor();
50574
+ constructor(options: ClientConnectionOptions);
50576
50575
  /**
50577
- * Инициализация клиента с заданными опциями.
50576
+ * Создает экземпляр клиента с заданными опциями (для обратной совместимости).
50578
50577
  * @param options Параметры соединения.
50579
50578
  */
50580
50579
  static create(options: ClientConnectionOptions): Client;
50581
50580
  /**
50582
- * Возвращает текущий экземпляр клиента.
50581
+ * Создает новый экземпляр клиента.
50582
+ * @param options Параметры соединения.
50583
50583
  */
50584
- static getInstance(): Client;
50584
+ static New(options: ClientConnectionOptions): Client;
50585
50585
  /**
50586
50586
  * Логин пользователя с использованием email и WIF.
50587
50587
  * @param email Email пользователя.
@@ -50596,6 +50596,7 @@ declare class Client {
50596
50596
  setToken(token: string): void;
50597
50597
  /**
50598
50598
  * Установка WIF.
50599
+ * @param username Имя пользователя.
50599
50600
  * @param wif WIF для установки.
50600
50601
  */
50601
50602
  setWif(username: string, wif: string): void;
@@ -51534,7 +51535,7 @@ declare class Client {
51534
51535
  * @param baseUrl URL GraphQL API.
51535
51536
  * @returns Функция Thunder.
51536
51537
  */
51537
- private static createThunder;
51538
+ private createThunder;
51538
51539
  }
51539
51540
 
51540
51541
  export { Classes, Client, Mutations, index$3 as Queries, index as Types, index$C as Zeus };
package/dist/index.d.ts CHANGED
@@ -50563,7 +50563,6 @@ declare namespace index {
50563
50563
 
50564
50564
  declare class Client {
50565
50565
  private readonly options;
50566
- private static instance;
50567
50566
  private currentHeaders;
50568
50567
  private account;
50569
50568
  private blockchain;
@@ -50572,16 +50571,17 @@ declare class Client {
50572
50571
  private vote;
50573
50572
  private thunder;
50574
50573
  private static scalars;
50575
- private constructor();
50574
+ constructor(options: ClientConnectionOptions);
50576
50575
  /**
50577
- * Инициализация клиента с заданными опциями.
50576
+ * Создает экземпляр клиента с заданными опциями (для обратной совместимости).
50578
50577
  * @param options Параметры соединения.
50579
50578
  */
50580
50579
  static create(options: ClientConnectionOptions): Client;
50581
50580
  /**
50582
- * Возвращает текущий экземпляр клиента.
50581
+ * Создает новый экземпляр клиента.
50582
+ * @param options Параметры соединения.
50583
50583
  */
50584
- static getInstance(): Client;
50584
+ static New(options: ClientConnectionOptions): Client;
50585
50585
  /**
50586
50586
  * Логин пользователя с использованием email и WIF.
50587
50587
  * @param email Email пользователя.
@@ -50596,6 +50596,7 @@ declare class Client {
50596
50596
  setToken(token: string): void;
50597
50597
  /**
50598
50598
  * Установка WIF.
50599
+ * @param username Имя пользователя.
50599
50600
  * @param wif WIF для установки.
50600
50601
  */
50601
50602
  setWif(username: string, wif: string): void;
@@ -51534,7 +51535,7 @@ declare class Client {
51534
51535
  * @param baseUrl URL GraphQL API.
51535
51536
  * @returns Функция Thunder.
51536
51537
  */
51537
- private static createThunder;
51538
+ private createThunder;
51538
51539
  }
51539
51540
 
51540
51541
  export { Classes, Client, Mutations, index$3 as Queries, index as Types, index$C as Zeus };
package/dist/index.mjs CHANGED
@@ -8911,7 +8911,7 @@ const _Client = class _Client {
8911
8911
  __publicField(this, "vote");
8912
8912
  __publicField(this, "thunder");
8913
8913
  this.currentHeaders = options.headers || {};
8914
- this.thunder = _Client.createThunder(options.api_url);
8914
+ this.thunder = this.createThunder(options.api_url);
8915
8915
  this.account = new Account();
8916
8916
  this.blockchain = new Blockchain(options);
8917
8917
  this.document = new Document(options.wif);
@@ -8926,23 +8926,18 @@ const _Client = class _Client {
8926
8926
  }
8927
8927
  }
8928
8928
  /**
8929
- * Инициализация клиента с заданными опциями.
8929
+ * Создает экземпляр клиента с заданными опциями (для обратной совместимости).
8930
8930
  * @param options Параметры соединения.
8931
8931
  */
8932
8932
  static create(options) {
8933
- if (!this.instance) {
8934
- this.instance = new _Client(options);
8935
- }
8936
- return this.getInstance();
8933
+ return new _Client(options);
8937
8934
  }
8938
8935
  /**
8939
- * Возвращает текущий экземпляр клиента.
8936
+ * Создает новый экземпляр клиента.
8937
+ * @param options Параметры соединения.
8940
8938
  */
8941
- static getInstance() {
8942
- if (!this.instance) {
8943
- throw new Error("\u041A\u043B\u0438\u0435\u043D\u0442 \u043D\u0435 \u0438\u043D\u0438\u0446\u0438\u0430\u043B\u0438\u0437\u0438\u0440\u043E\u0432\u0430\u043D. \u0412\u044B\u0437\u043E\u0432\u0438\u0442\u0435 Client.create() \u043F\u0435\u0440\u0435\u0434 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435\u043C.");
8944
- }
8945
- return this.instance;
8939
+ static New(options) {
8940
+ return new _Client(options);
8946
8941
  }
8947
8942
  /**
8948
8943
  * Логин пользователя с использованием email и WIF.
@@ -8985,6 +8980,7 @@ const _Client = class _Client {
8985
8980
  }
8986
8981
  /**
8987
8982
  * Установка WIF.
8983
+ * @param username Имя пользователя.
8988
8984
  * @param wif WIF для установки.
8989
8985
  */
8990
8986
  setWif(username, wif) {
@@ -9045,14 +9041,14 @@ const _Client = class _Client {
9045
9041
  * @param baseUrl URL GraphQL API.
9046
9042
  * @returns Функция Thunder.
9047
9043
  */
9048
- static createThunder(baseUrl) {
9044
+ createThunder(baseUrl) {
9049
9045
  return Thunder(async (query, variables) => {
9050
9046
  const response = await fetch(baseUrl, {
9051
9047
  body: JSON.stringify({ query, variables }),
9052
9048
  method: "POST",
9053
9049
  headers: {
9054
9050
  "Content-Type": "application/json",
9055
- ..._Client.getInstance().currentHeaders
9051
+ ...this.currentHeaders
9056
9052
  }
9057
9053
  });
9058
9054
  if (!response.ok) {
@@ -9075,7 +9071,6 @@ const _Client = class _Client {
9075
9071
  }, { scalars: _Client.scalars });
9076
9072
  }
9077
9073
  };
9078
- __publicField(_Client, "instance", null);
9079
9074
  __publicField(_Client, "scalars", ZeusScalars({
9080
9075
  DateTime: {
9081
9076
  decode: (e) => new Date(e),
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@coopenomics/sdk",
3
3
  "type": "module",
4
- "version": "2025.11.8",
4
+ "version": "2025.11.9-alpha-1",
5
5
  "private": false,
6
6
  "packageManager": "pnpm@9.9.0",
7
7
  "description": "",
@@ -48,7 +48,7 @@
48
48
  "@wharfkit/contract": "^1.1.5",
49
49
  "@wharfkit/session": "^1.4.0",
50
50
  "@wharfkit/wallet-plugin-privatekey": "^1.1.0",
51
- "cooptypes": "2025.11.8",
51
+ "cooptypes": "2025.11.9-alpha-1",
52
52
  "graphql": "^16.9.0",
53
53
  "graphql-request": "^7.1.2",
54
54
  "graphql-tag": "^2.12.6",
@@ -76,5 +76,5 @@
76
76
  "vite": "^5.4.3",
77
77
  "vitest": "^2.0.5"
78
78
  },
79
- "gitHead": "d0508cbd9652f5672a39d2be596af5fcfba7970a"
79
+ "gitHead": "8270801711836de12cce027677732785fab42dd1"
80
80
  }