wapi-client 0.18.0-beta.3 → 0.18.0

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.
Files changed (35) hide show
  1. package/dist/api/base-client.browser.cjs +0 -16
  2. package/dist/api/base-client.browser.js +0 -16
  3. package/dist/api/base-client.cjs +0 -16
  4. package/dist/api/base-client.js +0 -16
  5. package/dist/api/ws-client.browser.cjs +7 -3
  6. package/dist/api/ws-client.browser.js +7 -3
  7. package/dist/api/ws-client.cjs +7 -3
  8. package/dist/api/ws-client.js +7 -3
  9. package/dist/client.browser.cjs +17 -6
  10. package/dist/client.browser.js +17 -6
  11. package/dist/client.cjs +17 -6
  12. package/dist/client.js +17 -6
  13. package/dist/fns/find-transfers/find-transfers.browser.cjs +1 -1
  14. package/dist/fns/find-transfers/find-transfers.browser.js +1 -1
  15. package/dist/fns/find-transfers/find-transfers.cjs +1 -1
  16. package/dist/fns/find-transfers/find-transfers.js +1 -1
  17. package/dist/fns/find-transfers/find-transfers.schema.zod.browser.cjs +1 -1
  18. package/dist/fns/find-transfers/find-transfers.schema.zod.browser.js +1 -1
  19. package/dist/fns/find-transfers/find-transfers.schema.zod.cjs +1 -1
  20. package/dist/fns/find-transfers/find-transfers.schema.zod.js +1 -1
  21. package/dist/lib/env.browser.cjs +1 -1
  22. package/dist/lib/env.browser.js +1 -1
  23. package/dist/lib/env.cjs +1 -1
  24. package/dist/lib/env.js +1 -1
  25. package/dist/lib/stream-promise.browser.cjs +8 -1
  26. package/dist/lib/stream-promise.browser.js +8 -1
  27. package/dist/lib/stream-promise.cjs +8 -1
  28. package/dist/lib/stream-promise.js +8 -1
  29. package/dist/lib/utils.browser.cjs +3 -13
  30. package/dist/lib/utils.browser.js +3 -13
  31. package/dist/lib/utils.cjs +3 -13
  32. package/dist/lib/utils.js +3 -13
  33. package/dist/types/wapi-client.d.ts +4 -4
  34. package/dist/wapi-client.iife.js +6 -6
  35. package/package.json +2 -2
@@ -117,19 +117,6 @@ var BaseClient = class {
117
117
  _clearError() {
118
118
  this._error = false;
119
119
  }
120
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
121
- _send(input) {
122
- throw new Error("This method must be implemented by child class");
123
- }
124
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
125
- _reconnect(nrOfAttempts) {
126
- throw new Error("This method must be implemented by child class");
127
- }
128
- close() {
129
- return __async(this, null, function* () {
130
- throw new Error("This method must be implemented by child class");
131
- });
132
- }
133
120
  // Will fire this in case we lose connection
134
121
  // This is so we can terminate ongoing requests
135
122
  _connectionLost() {
@@ -194,9 +181,6 @@ var BaseClient = class {
194
181
  return;
195
182
  }
196
183
  const responseMessage = incoming;
197
- if (this.hooks.message) {
198
- this.hooks.message(responseMessage);
199
- }
200
184
  if (responseMessage.id === null) {
201
185
  (0, import_debug.debugLog)("Unexpected JSONRPCResponse", incoming);
202
186
  return;
@@ -98,19 +98,6 @@ var BaseClient = class {
98
98
  _clearError() {
99
99
  this._error = false;
100
100
  }
101
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
102
- _send(input) {
103
- throw new Error("This method must be implemented by child class");
104
- }
105
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
106
- _reconnect(nrOfAttempts) {
107
- throw new Error("This method must be implemented by child class");
108
- }
109
- close() {
110
- return __async(this, null, function* () {
111
- throw new Error("This method must be implemented by child class");
112
- });
113
- }
114
101
  // Will fire this in case we lose connection
115
102
  // This is so we can terminate ongoing requests
116
103
  _connectionLost() {
@@ -175,9 +162,6 @@ var BaseClient = class {
175
162
  return;
176
163
  }
177
164
  const responseMessage = incoming;
178
- if (this.hooks.message) {
179
- this.hooks.message(responseMessage);
180
- }
181
165
  if (responseMessage.id === null) {
182
166
  debugLog("Unexpected JSONRPCResponse", incoming);
183
167
  return;
@@ -117,19 +117,6 @@ var BaseClient = class {
117
117
  _clearError() {
118
118
  this._error = false;
119
119
  }
120
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
121
- _send(input) {
122
- throw new Error("This method must be implemented by child class");
123
- }
124
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
125
- _reconnect(nrOfAttempts) {
126
- throw new Error("This method must be implemented by child class");
127
- }
128
- close() {
129
- return __async(this, null, function* () {
130
- throw new Error("This method must be implemented by child class");
131
- });
132
- }
133
120
  // Will fire this in case we lose connection
134
121
  // This is so we can terminate ongoing requests
135
122
  _connectionLost() {
@@ -194,9 +181,6 @@ var BaseClient = class {
194
181
  return;
195
182
  }
196
183
  const responseMessage = incoming;
197
- if (this.hooks.message) {
198
- this.hooks.message(responseMessage);
199
- }
200
184
  if (responseMessage.id === null) {
201
185
  (0, import_debug.debugLog)("Unexpected JSONRPCResponse", incoming);
202
186
  return;
@@ -98,19 +98,6 @@ var BaseClient = class {
98
98
  _clearError() {
99
99
  this._error = false;
100
100
  }
101
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
102
- _send(input) {
103
- throw new Error("This method must be implemented by child class");
104
- }
105
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
106
- _reconnect(nrOfAttempts) {
107
- throw new Error("This method must be implemented by child class");
108
- }
109
- close() {
110
- return __async(this, null, function* () {
111
- throw new Error("This method must be implemented by child class");
112
- });
113
- }
114
101
  // Will fire this in case we lose connection
115
102
  // This is so we can terminate ongoing requests
116
103
  _connectionLost() {
@@ -175,9 +162,6 @@ var BaseClient = class {
175
162
  return;
176
163
  }
177
164
  const responseMessage = incoming;
178
- if (this.hooks.message) {
179
- this.hooks.message(responseMessage);
180
- }
181
165
  if (responseMessage.id === null) {
182
166
  debugLog("Unexpected JSONRPCResponse", incoming);
183
167
  return;
@@ -206,9 +206,13 @@ var WsClient = class extends import_base_client.BaseClient {
206
206
  const { data, type } = event;
207
207
  (0, import_debug.debugLog)(`message(type:${type},data:$0)`, data);
208
208
  if (type === "message") {
209
- const obj = JSON.parse(data.toString());
210
- this._handleMessage(obj);
211
- this._heartbeat();
209
+ try {
210
+ const obj = JSON.parse(data.toString());
211
+ this._handleMessage(obj);
212
+ this._heartbeat();
213
+ } catch (e) {
214
+ (0, import_debug.debugLog)(`Invalid JSON message(error:$1,type:${type})`, e);
215
+ }
212
216
  }
213
217
  };
214
218
  this._connection.onerror = (event) => {
@@ -181,9 +181,13 @@ var WsClient = class extends BaseClient {
181
181
  const { data, type } = event;
182
182
  debugLog(`message(type:${type},data:$0)`, data);
183
183
  if (type === "message") {
184
- const obj = JSON.parse(data.toString());
185
- this._handleMessage(obj);
186
- this._heartbeat();
184
+ try {
185
+ const obj = JSON.parse(data.toString());
186
+ this._handleMessage(obj);
187
+ this._heartbeat();
188
+ } catch (e) {
189
+ debugLog(`Invalid JSON message(error:$1,type:${type})`, e);
190
+ }
187
191
  }
188
192
  };
189
193
  this._connection.onerror = (event) => {
@@ -206,9 +206,13 @@ var WsClient = class extends import_base_client.BaseClient {
206
206
  const { data, type } = event;
207
207
  (0, import_debug.debugLog)(`message(type:${type},data:$0)`, data);
208
208
  if (type === "message") {
209
- const obj = JSON.parse(data.toString());
210
- this._handleMessage(obj);
211
- this._heartbeat();
209
+ try {
210
+ const obj = JSON.parse(data.toString());
211
+ this._handleMessage(obj);
212
+ this._heartbeat();
213
+ } catch (e) {
214
+ (0, import_debug.debugLog)(`Invalid JSON message(error:$1,type:${type})`, e);
215
+ }
212
216
  }
213
217
  };
214
218
  this._connection.onerror = (event) => {
@@ -181,9 +181,13 @@ var WsClient = class extends BaseClient {
181
181
  const { data, type } = event;
182
182
  debugLog(`message(type:${type},data:$0)`, data);
183
183
  if (type === "message") {
184
- const obj = JSON.parse(data.toString());
185
- this._handleMessage(obj);
186
- this._heartbeat();
184
+ try {
185
+ const obj = JSON.parse(data.toString());
186
+ this._handleMessage(obj);
187
+ this._heartbeat();
188
+ } catch (e) {
189
+ debugLog(`Invalid JSON message(error:$1,type:${type})`, e);
190
+ }
187
191
  }
188
192
  };
189
193
  this._connection.onerror = (event) => {
@@ -17,6 +17,18 @@ var __spreadValues = (a, b) => {
17
17
  }
18
18
  return a;
19
19
  };
20
+ var __objRest = (source, exclude) => {
21
+ var target = {};
22
+ for (var prop in source)
23
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
+ target[prop] = source[prop];
25
+ if (source != null && __getOwnPropSymbols)
26
+ for (var prop of __getOwnPropSymbols(source)) {
27
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
+ target[prop] = source[prop];
29
+ }
30
+ return target;
31
+ };
20
32
  var __export = (target, all) => {
21
33
  for (var name in all)
22
34
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -129,7 +141,7 @@ var Client = class {
129
141
  this.api = _apiClient;
130
142
  this.$connect = _apiClient.$connect;
131
143
  if (initialConf) {
132
- this.configure(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, initialConf.token && { token: initialConf.token }), initialConf.sendingTimeout && {
144
+ this.configure(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, initialConf.token !== void 0 && { token: initialConf.token }), initialConf.sendingTimeout && {
133
145
  sendingTimeout: initialConf.sendingTimeout
134
146
  }), initialConf.connectingTimeout && {
135
147
  connectingTimeout: initialConf.connectingTimeout
@@ -211,7 +223,7 @@ var Client = class {
211
223
  * @param {ClientConfig} newConf
212
224
  */
213
225
  configure(newConf) {
214
- if (newConf.token && typeof newConf.token !== "string" && typeof newConf.token !== "number") {
226
+ if (newConf.token !== void 0 && typeof newConf.token !== "string" && typeof newConf.token !== "number") {
215
227
  throw new import_errors.ConfigError("CONFIG_INVALID", {
216
228
  field: "token",
217
229
  error: `Must be a string|number, '${newConf.token}' provided`
@@ -223,16 +235,15 @@ var Client = class {
223
235
  "reconnectingTimeout",
224
236
  "requestTimeout"
225
237
  ].forEach((t) => {
226
- if (newConf[t] && typeof newConf[t] !== "number") {
238
+ if (newConf[t] !== void 0 && typeof newConf[t] !== "number") {
227
239
  throw new import_errors.ConfigError("CONFIG_INVALID", {
228
240
  field: t,
229
241
  error: `Must be a number, '${newConf[t]}' provided`
230
242
  });
231
243
  }
232
244
  });
233
- const hooks = newConf.hooks;
234
- delete newConf.hooks;
235
- this.config = __spreadValues(__spreadValues({}, this.config), newConf);
245
+ const _a = newConf, { hooks } = _a, restOfConf = __objRest(_a, ["hooks"]);
246
+ this.config = __spreadValues(__spreadValues({}, this.config), restOfConf);
236
247
  if ("sendingTimeout" in this.config) {
237
248
  this.api.sendingTimeout = this.config.sendingTimeout;
238
249
  }
@@ -14,6 +14,18 @@ var __spreadValues = (a, b) => {
14
14
  }
15
15
  return a;
16
16
  };
17
+ var __objRest = (source, exclude) => {
18
+ var target = {};
19
+ for (var prop in source)
20
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
21
+ target[prop] = source[prop];
22
+ if (source != null && __getOwnPropSymbols)
23
+ for (var prop of __getOwnPropSymbols(source)) {
24
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
25
+ target[prop] = source[prop];
26
+ }
27
+ return target;
28
+ };
17
29
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
18
30
  var __async = (__this, __arguments, generator) => {
19
31
  return new Promise((resolve, reject) => {
@@ -109,7 +121,7 @@ var Client = class {
109
121
  this.api = _apiClient;
110
122
  this.$connect = _apiClient.$connect;
111
123
  if (initialConf) {
112
- this.configure(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, initialConf.token && { token: initialConf.token }), initialConf.sendingTimeout && {
124
+ this.configure(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, initialConf.token !== void 0 && { token: initialConf.token }), initialConf.sendingTimeout && {
113
125
  sendingTimeout: initialConf.sendingTimeout
114
126
  }), initialConf.connectingTimeout && {
115
127
  connectingTimeout: initialConf.connectingTimeout
@@ -191,7 +203,7 @@ var Client = class {
191
203
  * @param {ClientConfig} newConf
192
204
  */
193
205
  configure(newConf) {
194
- if (newConf.token && typeof newConf.token !== "string" && typeof newConf.token !== "number") {
206
+ if (newConf.token !== void 0 && typeof newConf.token !== "string" && typeof newConf.token !== "number") {
195
207
  throw new ConfigError("CONFIG_INVALID", {
196
208
  field: "token",
197
209
  error: `Must be a string|number, '${newConf.token}' provided`
@@ -203,16 +215,15 @@ var Client = class {
203
215
  "reconnectingTimeout",
204
216
  "requestTimeout"
205
217
  ].forEach((t) => {
206
- if (newConf[t] && typeof newConf[t] !== "number") {
218
+ if (newConf[t] !== void 0 && typeof newConf[t] !== "number") {
207
219
  throw new ConfigError("CONFIG_INVALID", {
208
220
  field: t,
209
221
  error: `Must be a number, '${newConf[t]}' provided`
210
222
  });
211
223
  }
212
224
  });
213
- const hooks = newConf.hooks;
214
- delete newConf.hooks;
215
- this.config = __spreadValues(__spreadValues({}, this.config), newConf);
225
+ const _a = newConf, { hooks } = _a, restOfConf = __objRest(_a, ["hooks"]);
226
+ this.config = __spreadValues(__spreadValues({}, this.config), restOfConf);
216
227
  if ("sendingTimeout" in this.config) {
217
228
  this.api.sendingTimeout = this.config.sendingTimeout;
218
229
  }
package/dist/client.cjs CHANGED
@@ -17,6 +17,18 @@ var __spreadValues = (a, b) => {
17
17
  }
18
18
  return a;
19
19
  };
20
+ var __objRest = (source, exclude) => {
21
+ var target = {};
22
+ for (var prop in source)
23
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
+ target[prop] = source[prop];
25
+ if (source != null && __getOwnPropSymbols)
26
+ for (var prop of __getOwnPropSymbols(source)) {
27
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
+ target[prop] = source[prop];
29
+ }
30
+ return target;
31
+ };
20
32
  var __export = (target, all) => {
21
33
  for (var name in all)
22
34
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -129,7 +141,7 @@ var Client = class {
129
141
  this.api = _apiClient;
130
142
  this.$connect = _apiClient.$connect;
131
143
  if (initialConf) {
132
- this.configure(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, initialConf.token && { token: initialConf.token }), initialConf.sendingTimeout && {
144
+ this.configure(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, initialConf.token !== void 0 && { token: initialConf.token }), initialConf.sendingTimeout && {
133
145
  sendingTimeout: initialConf.sendingTimeout
134
146
  }), initialConf.connectingTimeout && {
135
147
  connectingTimeout: initialConf.connectingTimeout
@@ -211,7 +223,7 @@ var Client = class {
211
223
  * @param {ClientConfig} newConf
212
224
  */
213
225
  configure(newConf) {
214
- if (newConf.token && typeof newConf.token !== "string" && typeof newConf.token !== "number") {
226
+ if (newConf.token !== void 0 && typeof newConf.token !== "string" && typeof newConf.token !== "number") {
215
227
  throw new import_errors.ConfigError("CONFIG_INVALID", {
216
228
  field: "token",
217
229
  error: `Must be a string|number, '${newConf.token}' provided`
@@ -223,16 +235,15 @@ var Client = class {
223
235
  "reconnectingTimeout",
224
236
  "requestTimeout"
225
237
  ].forEach((t) => {
226
- if (newConf[t] && typeof newConf[t] !== "number") {
238
+ if (newConf[t] !== void 0 && typeof newConf[t] !== "number") {
227
239
  throw new import_errors.ConfigError("CONFIG_INVALID", {
228
240
  field: t,
229
241
  error: `Must be a number, '${newConf[t]}' provided`
230
242
  });
231
243
  }
232
244
  });
233
- const hooks = newConf.hooks;
234
- delete newConf.hooks;
235
- this.config = __spreadValues(__spreadValues({}, this.config), newConf);
245
+ const _a = newConf, { hooks } = _a, restOfConf = __objRest(_a, ["hooks"]);
246
+ this.config = __spreadValues(__spreadValues({}, this.config), restOfConf);
236
247
  if ("sendingTimeout" in this.config) {
237
248
  this.api.sendingTimeout = this.config.sendingTimeout;
238
249
  }
package/dist/client.js CHANGED
@@ -14,6 +14,18 @@ var __spreadValues = (a, b) => {
14
14
  }
15
15
  return a;
16
16
  };
17
+ var __objRest = (source, exclude) => {
18
+ var target = {};
19
+ for (var prop in source)
20
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
21
+ target[prop] = source[prop];
22
+ if (source != null && __getOwnPropSymbols)
23
+ for (var prop of __getOwnPropSymbols(source)) {
24
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
25
+ target[prop] = source[prop];
26
+ }
27
+ return target;
28
+ };
17
29
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
18
30
  var __async = (__this, __arguments, generator) => {
19
31
  return new Promise((resolve, reject) => {
@@ -109,7 +121,7 @@ var Client = class {
109
121
  this.api = _apiClient;
110
122
  this.$connect = _apiClient.$connect;
111
123
  if (initialConf) {
112
- this.configure(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, initialConf.token && { token: initialConf.token }), initialConf.sendingTimeout && {
124
+ this.configure(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, initialConf.token !== void 0 && { token: initialConf.token }), initialConf.sendingTimeout && {
113
125
  sendingTimeout: initialConf.sendingTimeout
114
126
  }), initialConf.connectingTimeout && {
115
127
  connectingTimeout: initialConf.connectingTimeout
@@ -191,7 +203,7 @@ var Client = class {
191
203
  * @param {ClientConfig} newConf
192
204
  */
193
205
  configure(newConf) {
194
- if (newConf.token && typeof newConf.token !== "string" && typeof newConf.token !== "number") {
206
+ if (newConf.token !== void 0 && typeof newConf.token !== "string" && typeof newConf.token !== "number") {
195
207
  throw new ConfigError("CONFIG_INVALID", {
196
208
  field: "token",
197
209
  error: `Must be a string|number, '${newConf.token}' provided`
@@ -203,16 +215,15 @@ var Client = class {
203
215
  "reconnectingTimeout",
204
216
  "requestTimeout"
205
217
  ].forEach((t) => {
206
- if (newConf[t] && typeof newConf[t] !== "number") {
218
+ if (newConf[t] !== void 0 && typeof newConf[t] !== "number") {
207
219
  throw new ConfigError("CONFIG_INVALID", {
208
220
  field: t,
209
221
  error: `Must be a number, '${newConf[t]}' provided`
210
222
  });
211
223
  }
212
224
  });
213
- const hooks = newConf.hooks;
214
- delete newConf.hooks;
215
- this.config = __spreadValues(__spreadValues({}, this.config), newConf);
225
+ const _a = newConf, { hooks } = _a, restOfConf = __objRest(_a, ["hooks"]);
226
+ this.config = __spreadValues(__spreadValues({}, this.config), restOfConf);
216
227
  if ("sendingTimeout" in this.config) {
217
228
  this.api.sendingTimeout = this.config.sendingTimeout;
218
229
  }
@@ -30,7 +30,7 @@ var import_find_transfer_many_schema_zod = require("../../txs/find-transfer-many
30
30
  var import_utils = require("../../lib/utils.browser.cjs");
31
31
  var transferFilterFullInputSchemaRequired = import_find_transfer_many_schema_zod.transferFilterFullInputSchema.extend({
32
32
  token: import_find_transfers_schema_zod.findTransfersInputSchema.shape.token,
33
- wallet: import_find_transfers_schema_zod.findTransfersInputSchema.shape.token
33
+ wallet: import_find_transfers_schema_zod.findTransfersInputSchema.shape.wallet
34
34
  }).required();
35
35
  function findTransfers(options, input, fnOptions) {
36
36
  const { client } = options;
@@ -11,7 +11,7 @@ import { transferFilterFullInputSchema } from "../../txs/find-transfer-many/find
11
11
  import { mergeFnOptions } from "../../lib/utils.browser.js";
12
12
  var transferFilterFullInputSchemaRequired = transferFilterFullInputSchema.extend({
13
13
  token: findTransfersInputSchema.shape.token,
14
- wallet: findTransfersInputSchema.shape.token
14
+ wallet: findTransfersInputSchema.shape.wallet
15
15
  }).required();
16
16
  function findTransfers(options, input, fnOptions) {
17
17
  const { client } = options;
@@ -30,7 +30,7 @@ var import_find_transfer_many_schema_zod = require("../../txs/find-transfer-many
30
30
  var import_utils = require("../../lib/utils.cjs");
31
31
  var transferFilterFullInputSchemaRequired = import_find_transfer_many_schema_zod.transferFilterFullInputSchema.extend({
32
32
  token: import_find_transfers_schema_zod.findTransfersInputSchema.shape.token,
33
- wallet: import_find_transfers_schema_zod.findTransfersInputSchema.shape.token
33
+ wallet: import_find_transfers_schema_zod.findTransfersInputSchema.shape.wallet
34
34
  }).required();
35
35
  function findTransfers(options, input, fnOptions) {
36
36
  const { client } = options;
@@ -11,7 +11,7 @@ import { transferFilterFullInputSchema } from "../../txs/find-transfer-many/find
11
11
  import { mergeFnOptions } from "../../lib/utils.js";
12
12
  var transferFilterFullInputSchemaRequired = transferFilterFullInputSchema.extend({
13
13
  token: findTransfersInputSchema.shape.token,
14
- wallet: findTransfersInputSchema.shape.token
14
+ wallet: findTransfersInputSchema.shape.wallet
15
15
  }).required();
16
16
  function findTransfers(options, input, fnOptions) {
17
17
  const { client } = options;
@@ -52,7 +52,7 @@ var import_transfer_schema_zod = require("../../db/transfer/transfer.schema.zod.
52
52
  var import_consts2 = require("../../db/consts.browser.cjs");
53
53
  var findTransfersFnExtraOptionsSchema = import_zod.z.object({
54
54
  return_running_balance: import_zod.z.boolean().describe("return running balance for specified wallet under filter"),
55
- return_signed_amount: import_zod.z.boolean().describe("return running balance for specified wallet under filter"),
55
+ return_signed_amount: import_zod.z.boolean().describe("return signed amount for specified wallet under filter"),
56
56
  return_running_balance_for_wallet: import_consts.allowedStringIntForForeign.describe(
57
57
  "foreign key for which wallet should running balance be returned for"
58
58
  ),
@@ -33,7 +33,7 @@ import {
33
33
  import { DbFilterMetadataSchema } from "../../db/consts.browser.js";
34
34
  var findTransfersFnExtraOptionsSchema = z.object({
35
35
  return_running_balance: z.boolean().describe("return running balance for specified wallet under filter"),
36
- return_signed_amount: z.boolean().describe("return running balance for specified wallet under filter"),
36
+ return_signed_amount: z.boolean().describe("return signed amount for specified wallet under filter"),
37
37
  return_running_balance_for_wallet: allowedStringIntForForeign.describe(
38
38
  "foreign key for which wallet should running balance be returned for"
39
39
  ),
@@ -52,7 +52,7 @@ var import_transfer_schema_zod = require("../../db/transfer/transfer.schema.zod.
52
52
  var import_consts2 = require("../../db/consts.cjs");
53
53
  var findTransfersFnExtraOptionsSchema = import_zod.z.object({
54
54
  return_running_balance: import_zod.z.boolean().describe("return running balance for specified wallet under filter"),
55
- return_signed_amount: import_zod.z.boolean().describe("return running balance for specified wallet under filter"),
55
+ return_signed_amount: import_zod.z.boolean().describe("return signed amount for specified wallet under filter"),
56
56
  return_running_balance_for_wallet: import_consts.allowedStringIntForForeign.describe(
57
57
  "foreign key for which wallet should running balance be returned for"
58
58
  ),
@@ -33,7 +33,7 @@ import {
33
33
  import { DbFilterMetadataSchema } from "../../db/consts.js";
34
34
  var findTransfersFnExtraOptionsSchema = z.object({
35
35
  return_running_balance: z.boolean().describe("return running balance for specified wallet under filter"),
36
- return_signed_amount: z.boolean().describe("return running balance for specified wallet under filter"),
36
+ return_signed_amount: z.boolean().describe("return signed amount for specified wallet under filter"),
37
37
  return_running_balance_for_wallet: allowedStringIntForForeign.describe(
38
38
  "foreign key for which wallet should running balance be returned for"
39
39
  ),
@@ -24,7 +24,7 @@ __export(env_exports, {
24
24
  getEnvConfig: () => getEnvConfig
25
25
  });
26
26
  module.exports = __toCommonJS(env_exports);
27
- var CLIENT_VERSION = "0.18.0-beta.2";
27
+ var CLIENT_VERSION = "0.18.0";
28
28
  function getEnvConfig(key, defaultValue) {
29
29
  const val = getVariable(key);
30
30
  if (val === void 0) {
@@ -1,5 +1,5 @@
1
1
  // src/lib/env.ts
2
- var CLIENT_VERSION = "0.18.0-beta.2";
2
+ var CLIENT_VERSION = "0.18.0";
3
3
  function getEnvConfig(key, defaultValue) {
4
4
  const val = getVariable(key);
5
5
  if (val === void 0) {
package/dist/lib/env.cjs CHANGED
@@ -24,7 +24,7 @@ __export(env_exports, {
24
24
  getEnvConfig: () => getEnvConfig
25
25
  });
26
26
  module.exports = __toCommonJS(env_exports);
27
- var CLIENT_VERSION = "0.18.0-beta.2";
27
+ var CLIENT_VERSION = "0.18.0";
28
28
  function getEnvConfig(key, defaultValue) {
29
29
  const val = getVariable(key);
30
30
  if (val === void 0) {
package/dist/lib/env.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // src/lib/env.ts
2
- var CLIENT_VERSION = "0.18.0-beta.2";
2
+ var CLIENT_VERSION = "0.18.0";
3
3
  function getEnvConfig(key, defaultValue) {
4
4
  const val = getVariable(key);
5
5
  if (val === void 0) {
@@ -81,7 +81,13 @@ var StreamPromise = class {
81
81
  (_a = this.resolve) == null ? void 0 : _a.call(this, void 0);
82
82
  return;
83
83
  }
84
- this.makeRequest(this.streamObject).catch(this.reject);
84
+ this.makeRequest(this.streamObject).catch((err) => {
85
+ if (this.mode === "stream") {
86
+ this.outStreamObject.destroy(err);
87
+ } else if (this.reject) {
88
+ this.reject(err);
89
+ }
90
+ });
85
91
  const internalArr = [];
86
92
  if (this.mode === "stream") {
87
93
  this.streamObject.on(
@@ -90,6 +96,7 @@ var StreamPromise = class {
90
96
  (0, import_debug.debugLog)("stream data", chunk);
91
97
  if (!chunk) {
92
98
  this.outStreamObject.push(chunk);
99
+ return;
93
100
  }
94
101
  if (chunk.error) {
95
102
  const error = (0, import_errors.getError)(chunk.error);
@@ -60,7 +60,13 @@ var StreamPromise = class {
60
60
  (_a = this.resolve) == null ? void 0 : _a.call(this, void 0);
61
61
  return;
62
62
  }
63
- this.makeRequest(this.streamObject).catch(this.reject);
63
+ this.makeRequest(this.streamObject).catch((err) => {
64
+ if (this.mode === "stream") {
65
+ this.outStreamObject.destroy(err);
66
+ } else if (this.reject) {
67
+ this.reject(err);
68
+ }
69
+ });
64
70
  const internalArr = [];
65
71
  if (this.mode === "stream") {
66
72
  this.streamObject.on(
@@ -69,6 +75,7 @@ var StreamPromise = class {
69
75
  debugLog("stream data", chunk);
70
76
  if (!chunk) {
71
77
  this.outStreamObject.push(chunk);
78
+ return;
72
79
  }
73
80
  if (chunk.error) {
74
81
  const error = getError(chunk.error);
@@ -81,7 +81,13 @@ var StreamPromise = class {
81
81
  (_a = this.resolve) == null ? void 0 : _a.call(this, void 0);
82
82
  return;
83
83
  }
84
- this.makeRequest(this.streamObject).catch(this.reject);
84
+ this.makeRequest(this.streamObject).catch((err) => {
85
+ if (this.mode === "stream") {
86
+ this.outStreamObject.destroy(err);
87
+ } else if (this.reject) {
88
+ this.reject(err);
89
+ }
90
+ });
85
91
  const internalArr = [];
86
92
  if (this.mode === "stream") {
87
93
  this.streamObject.on(
@@ -90,6 +96,7 @@ var StreamPromise = class {
90
96
  (0, import_debug.debugLog)("stream data", chunk);
91
97
  if (!chunk) {
92
98
  this.outStreamObject.push(chunk);
99
+ return;
93
100
  }
94
101
  if (chunk.error) {
95
102
  const error = (0, import_errors.getError)(chunk.error);
@@ -60,7 +60,13 @@ var StreamPromise = class {
60
60
  (_a = this.resolve) == null ? void 0 : _a.call(this, void 0);
61
61
  return;
62
62
  }
63
- this.makeRequest(this.streamObject).catch(this.reject);
63
+ this.makeRequest(this.streamObject).catch((err) => {
64
+ if (this.mode === "stream") {
65
+ this.outStreamObject.destroy(err);
66
+ } else if (this.reject) {
67
+ this.reject(err);
68
+ }
69
+ });
64
70
  const internalArr = [];
65
71
  if (this.mode === "stream") {
66
72
  this.streamObject.on(
@@ -69,6 +75,7 @@ var StreamPromise = class {
69
75
  debugLog("stream data", chunk);
70
76
  if (!chunk) {
71
77
  this.outStreamObject.push(chunk);
78
+ return;
72
79
  }
73
80
  if (chunk.error) {
74
81
  const error = getError(chunk.error);