@wishknish/knishio-client-js 0.8.0 → 0.8.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wishknish/knishio-client-js",
3
- "version": "0.8.0",
3
+ "version": "0.8.2",
4
4
  "type": "module",
5
5
  "productName": "Knish.IO Javascript SDK Client",
6
6
  "description": "JavaScript implementation of the Knish.IO SDK to consume Knish.IO GraphQL APIs.",
package/src/Atom.js CHANGED
@@ -212,7 +212,7 @@ export default class Atom {
212
212
 
213
213
  /**
214
214
  * Returns JSON-ready object for cross-SDK compatibility (2025 JS best practices)
215
- *
215
+ *
216
216
  * Provides clean serialization of atomic operations with optional OTS fragments.
217
217
  * Follows 2025 JavaScript best practices with proper type safety and validation.
218
218
  *
@@ -226,15 +226,15 @@ export default class Atom {
226
226
  const {
227
227
  includeOtsFragments = true,
228
228
  validateFields = false
229
- } = options;
229
+ } = options
230
230
 
231
231
  try {
232
232
  // Validate required fields if requested
233
233
  if (validateFields) {
234
- const requiredFields = ['position', 'walletAddress', 'isotope', 'token'];
234
+ const requiredFields = ['position', 'walletAddress', 'isotope', 'token']
235
235
  for (const field of requiredFields) {
236
236
  if (!this[field]) {
237
- throw new Error(`Required field '${field}' is missing or empty`);
237
+ throw new Error(`Required field '${field}' is missing or empty`)
238
238
  }
239
239
  }
240
240
  }
@@ -258,23 +258,22 @@ export default class Atom {
258
258
  index: this.index,
259
259
  createdAt: this.createdAt,
260
260
  version: this.version
261
- };
261
+ }
262
262
 
263
263
  // Optional OTS fragments (can be large, so optional)
264
264
  if (includeOtsFragments && this.otsFragment) {
265
- serialized.otsFragment = this.otsFragment;
265
+ serialized.otsFragment = this.otsFragment
266
266
  }
267
267
 
268
- return serialized;
269
-
268
+ return serialized
270
269
  } catch (error) {
271
- throw new Error(`Atom serialization failed: ${error.message}`);
270
+ throw new Error(`Atom serialization failed: ${error.message}`)
272
271
  }
273
272
  }
274
273
 
275
274
  /**
276
275
  * Creates an Atom instance from JSON data (2025 JS best practices)
277
- *
276
+ *
278
277
  * Handles cross-SDK atom deserialization with robust error handling.
279
278
  * Essential for reconstructing atoms from other SDK implementations.
280
279
  *
@@ -289,18 +288,18 @@ export default class Atom {
289
288
  const {
290
289
  validateStructure = true,
291
290
  strictMode = false
292
- } = options;
291
+ } = options
293
292
 
294
293
  try {
295
294
  // Parse JSON safely
296
- const data = typeof json === 'string' ? JSON.parse(json) : json;
295
+ const data = typeof json === 'string' ? JSON.parse(json) : json
297
296
 
298
297
  // Validate required fields in strict mode
299
298
  if (strictMode || validateStructure) {
300
- const requiredFields = ['position', 'walletAddress', 'isotope', 'token'];
299
+ const requiredFields = ['position', 'walletAddress', 'isotope', 'token']
301
300
  for (const field of requiredFields) {
302
301
  if (!data[field]) {
303
- throw new Error(`Required field '${field}' is missing or empty`);
302
+ throw new Error(`Required field '${field}' is missing or empty`)
304
303
  }
305
304
  }
306
305
  }
@@ -318,20 +317,19 @@ export default class Atom {
318
317
  meta: data.meta,
319
318
  index: data.index,
320
319
  version: data.version
321
- });
320
+ })
322
321
 
323
322
  // Set additional properties that may not be in constructor
324
323
  if (data.otsFragment) {
325
- atom.otsFragment = data.otsFragment;
324
+ atom.otsFragment = data.otsFragment
326
325
  }
327
326
  if (data.createdAt) {
328
- atom.createdAt = data.createdAt;
327
+ atom.createdAt = data.createdAt
329
328
  }
330
329
 
331
- return atom;
332
-
330
+ return atom
333
331
  } catch (error) {
334
- throw new Error(`Atom deserialization failed: ${error.message}`);
332
+ throw new Error(`Atom deserialization failed: ${error.message}`)
335
333
  }
336
334
  }
337
335
 
@@ -127,7 +127,8 @@ export default class KnishIOClient {
127
127
  client = null,
128
128
  socket = null,
129
129
  serverSdkVersion = 3,
130
- logging = false
130
+ logging = false,
131
+ defaultRequestPolicy = null
131
132
  }) {
132
133
  this.initialize({
133
134
  uri,
@@ -135,7 +136,8 @@ export default class KnishIOClient {
135
136
  socket,
136
137
  client,
137
138
  serverSdkVersion,
138
- logging
139
+ logging,
140
+ defaultRequestPolicy
139
141
  })
140
142
  }
141
143
 
@@ -155,11 +157,16 @@ export default class KnishIOClient {
155
157
  socket = null,
156
158
  client = null,
157
159
  serverSdkVersion = 3,
158
- logging = false
160
+ logging = false,
161
+ defaultRequestPolicy = null
159
162
  }) {
160
163
  this.reset()
161
164
 
162
165
  this.$__logging = logging
166
+ // Client-level urql request policy applied to reads that omit a per-call
167
+ // policy. A long-lived server/sync client set to 'network-only' never serves
168
+ // a stale cache-first read; browser/SPA consumers leave this null (cache-first).
169
+ this.$__defaultRequestPolicy = defaultRequestPolicy
163
170
  this.$__authTokenObjects = {}
164
171
  this.$__authInProcess = false
165
172
  this.abortControllers = new Map()
@@ -247,6 +254,25 @@ export default class KnishIOClient {
247
254
  return this.$__serverSdkVersion
248
255
  }
249
256
 
257
+ /**
258
+ * Returns the client-level default urql request policy (or null)
259
+ *
260
+ * @return {string|null}
261
+ */
262
+ getDefaultRequestPolicy () {
263
+ return this.$__defaultRequestPolicy || null
264
+ }
265
+
266
+ /**
267
+ * Sets the client-level default urql request policy applied to reads that
268
+ * omit a per-call policy (e.g. 'network-only' for a long-lived server client)
269
+ *
270
+ * @param {string|null} policy - 'cache-first'|'cache-only'|'network-only'|'cache-and-network'|null
271
+ */
272
+ setDefaultRequestPolicy (policy) {
273
+ this.$__defaultRequestPolicy = policy
274
+ }
275
+
250
276
  /**
251
277
  * Reset common properties
252
278
  */
@@ -255,6 +281,7 @@ export default class KnishIOClient {
255
281
  this.$__bundle = ''
256
282
  this.remainderWallet = null
257
283
  this.$__capabilityCache = {}
284
+ this.$__defaultRequestPolicy = null
258
285
  }
259
286
 
260
287
  /**
@@ -555,15 +582,15 @@ export default class KnishIOClient {
555
582
  * @param molecule
556
583
  */
557
584
  async createMoleculeMutation ({
558
- mutationClass,
585
+ mutationClass: MutationClass,
559
586
  molecule = null
560
587
  }) {
561
- this.log('info', `KnishIOClient::createMoleculeQuery() - Creating a new ${ mutationClass.name } query...`)
588
+ this.log('info', `KnishIOClient::createMoleculeQuery() - Creating a new ${ MutationClass.name } query...`)
562
589
 
563
590
  // If you don't supply the molecule, we'll generate one for you
564
591
  const _molecule = molecule || await this.createMolecule({})
565
592
 
566
- const mutation = new mutationClass(this.client(), this, _molecule)
593
+ const mutation = new MutationClass(this.client(), this, _molecule)
567
594
 
568
595
  if (!(mutation instanceof MutationProposeMolecule)) {
569
596
  throw new CodeException(`${ this.constructor.name }::createMoleculeMutation() - This method only accepts MutationProposeMolecule!`)
@@ -580,7 +607,7 @@ export default class KnishIOClient {
580
607
  * @param variables
581
608
  * @returns {Promise<*>}
582
609
  */
583
- async executeQuery (query, variables = null) {
610
+ async executeQuery (query, variables = null, context = {}) {
584
611
  // Check and refresh authorization token if needed
585
612
  // Guard with $__authInProcess to prevent concurrent auth requests
586
613
  if (this.$__authToken && this.$__authToken.isExpired() && !this.$__authInProcess) {
@@ -601,13 +628,25 @@ export default class KnishIOClient {
601
628
  this.abortControllers.set(queryKey, abortController)
602
629
 
603
630
  try {
631
+ // Apply the client-level default request policy when neither the caller
632
+ // nor the query's own createQueryContext specifies one, so a long-lived
633
+ // server/sync client (defaultRequestPolicy:'network-only') never serves a
634
+ // stale cache-first read. Precedence: a query's own createQueryContext
635
+ // (e.g. ContinuId's network-only, applied in Query.execute's merge) >
636
+ // per-call context.requestPolicy > this client default > urql default.
637
+ const requestContext = { ...context }
638
+ if (this.$__defaultRequestPolicy && !requestContext.requestPolicy) {
639
+ requestContext.requestPolicy = this.$__defaultRequestPolicy
640
+ }
641
+
604
642
  // Use the existing query execution method, but add the abort signal
605
643
  const result = await query.execute({
606
644
  variables,
607
645
  context: {
608
646
  fetchOptions: {
609
647
  signal: abortController.signal
610
- }
648
+ },
649
+ ...requestContext
611
650
  }
612
651
  })
613
652
 
@@ -839,7 +878,8 @@ export default class KnishIOClient {
839
878
  throughMolecule = false,
840
879
  values = null,
841
880
  keys = null,
842
- atomValues = null
881
+ atomValues = null,
882
+ requestPolicy = null
843
883
  }) {
844
884
  this.log('info', `KnishIOClient::queryMeta() - Querying metaType: ${ metaType }, metaId: ${ metaId }...`)
845
885
 
@@ -903,7 +943,7 @@ export default class KnishIOClient {
903
943
  })
904
944
  }
905
945
 
906
- return this.executeQuery(query, variables)
946
+ return this.executeQuery(query, variables, requestPolicy ? { requestPolicy } : {})
907
947
  }
908
948
 
909
949
  /**
package/src/Molecule.js CHANGED
@@ -264,7 +264,13 @@ export default class Molecule {
264
264
  const condition = totalCondition ? mappedHashArray[index] < 8 : mappedHashArray[index] > -8
265
265
 
266
266
  if (condition) {
267
- const process = totalCondition ? [++mappedHashArray[index], ++total] : [--mappedHashArray[index], --total]
267
+ if (totalCondition) {
268
+ ++mappedHashArray[index]
269
+ ++total
270
+ } else {
271
+ --mappedHashArray[index]
272
+ --total
273
+ }
268
274
 
269
275
  if (total === 0) {
270
276
  break
@@ -716,7 +722,7 @@ export default class Molecule {
716
722
  }) {
717
723
  // Calculate final amount from all recipients
718
724
  let amount = 0
719
- for (const [recipientBundle, recipientAmount] of Object.entries(recipients || {})) {
725
+ for (const recipientAmount of Object.values(recipients || {})) {
720
726
  amount += recipientAmount
721
727
  }
722
728
  if (this.sourceWallet.balance - amount < 0) {
@@ -1184,7 +1190,7 @@ export default class Molecule {
1184
1190
  const {
1185
1191
  includeValidationContext = false,
1186
1192
  includeOtsFragments = true
1187
- } = options;
1193
+ } = options
1188
1194
 
1189
1195
  try {
1190
1196
  // Core molecule properties (server-compatible fields only)
@@ -1199,7 +1205,7 @@ export default class Molecule {
1199
1205
  atoms: this.atoms.map(atom => atom.toJSON({
1200
1206
  includeOtsFragments
1201
1207
  }))
1202
- };
1208
+ }
1203
1209
 
1204
1210
  // Parent molecular hashes for DAG linkage (only include when non-empty
1205
1211
  // to maintain backward compatibility with servers that don't support it)
@@ -1225,7 +1231,7 @@ export default class Molecule {
1225
1231
  tokenUnits: this.sourceWallet.tokenUnits || [],
1226
1232
  tradeRates: this.sourceWallet.tradeRates || {},
1227
1233
  molecules: this.sourceWallet.molecules || {}
1228
- };
1234
+ }
1229
1235
  }
1230
1236
 
1231
1237
  if (this.remainderWallet) {
@@ -1241,14 +1247,13 @@ export default class Molecule {
1241
1247
  tokenUnits: this.remainderWallet.tokenUnits || [],
1242
1248
  tradeRates: this.remainderWallet.tradeRates || {},
1243
1249
  molecules: this.remainderWallet.molecules || {}
1244
- };
1250
+ }
1245
1251
  }
1246
1252
  }
1247
1253
 
1248
- return serialized;
1249
-
1254
+ return serialized
1250
1255
  } catch (error) {
1251
- throw new Error(`Molecule serialization failed: ${error.message}`);
1256
+ throw new Error(`Molecule serialization failed: ${error.message}`)
1252
1257
  }
1253
1258
  }
1254
1259
 
@@ -1269,16 +1274,16 @@ export default class Molecule {
1269
1274
  const {
1270
1275
  includeValidationContext = false,
1271
1276
  validateStructure = true
1272
- } = options;
1277
+ } = options
1273
1278
 
1274
1279
  try {
1275
1280
  // Parse JSON safely
1276
- const data = typeof json === 'string' ? JSON.parse(json) : json;
1281
+ const data = typeof json === 'string' ? JSON.parse(json) : json
1277
1282
 
1278
1283
  // Validate required fields in strict mode
1279
1284
  if (validateStructure) {
1280
1285
  if (!data.molecularHash || !Array.isArray(data.atoms)) {
1281
- throw new Error('Invalid molecule data: missing molecularHash or atoms array');
1286
+ throw new Error('Invalid molecule data: missing molecularHash or atoms array')
1282
1287
  }
1283
1288
  }
1284
1289
 
@@ -1288,24 +1293,24 @@ export default class Molecule {
1288
1293
  bundle: data.bundle || null,
1289
1294
  cellSlug: data.cellSlug || null,
1290
1295
  version: data.version || null
1291
- });
1296
+ })
1292
1297
 
1293
1298
  // Populate core properties
1294
- molecule.status = data.status;
1295
- molecule.molecularHash = data.molecularHash;
1296
- molecule.createdAt = data.createdAt || String(+new Date());
1297
- molecule.cellSlugOrigin = data.cellSlugOrigin;
1298
- molecule.parentHashes = Array.isArray(data.parentHashes) ? [...data.parentHashes] : [];
1299
+ molecule.status = data.status
1300
+ molecule.molecularHash = data.molecularHash
1301
+ molecule.createdAt = data.createdAt || String(+new Date())
1302
+ molecule.cellSlugOrigin = data.cellSlugOrigin
1303
+ molecule.parentHashes = Array.isArray(data.parentHashes) ? [...data.parentHashes] : []
1299
1304
 
1300
1305
  // Reconstruct atoms array with proper Atom instances
1301
1306
  if (Array.isArray(data.atoms)) {
1302
1307
  molecule.atoms = data.atoms.map((atomData, index) => {
1303
1308
  try {
1304
- return Atom.fromJSON(atomData);
1309
+ return Atom.fromJSON(atomData)
1305
1310
  } catch (error) {
1306
- throw new Error(`Failed to reconstruct atom ${index}: ${error.message}`);
1311
+ throw new Error(`Failed to reconstruct atom ${index}: ${error.message}`)
1307
1312
  }
1308
- });
1313
+ })
1309
1314
  }
1310
1315
 
1311
1316
  // Reconstruct validation context if available and requested
@@ -1319,17 +1324,17 @@ export default class Molecule {
1319
1324
  bundle: data.sourceWallet.bundle,
1320
1325
  batchId: data.sourceWallet.batchId,
1321
1326
  characters: data.sourceWallet.characters
1322
- });
1327
+ })
1323
1328
 
1324
1329
  // Set additional properties for validation context
1325
- molecule.sourceWallet.balance = String(data.sourceWallet.balance != null ? data.sourceWallet.balance : 0);
1326
- molecule.sourceWallet.address = data.sourceWallet.address;
1330
+ molecule.sourceWallet.balance = String(data.sourceWallet.balance != null ? data.sourceWallet.balance : 0)
1331
+ molecule.sourceWallet.address = data.sourceWallet.address
1327
1332
  if (data.sourceWallet.pubkey) {
1328
- molecule.sourceWallet.pubkey = data.sourceWallet.pubkey;
1333
+ molecule.sourceWallet.pubkey = data.sourceWallet.pubkey
1329
1334
  }
1330
- molecule.sourceWallet.tokenUnits = data.sourceWallet.tokenUnits || [];
1331
- molecule.sourceWallet.tradeRates = data.sourceWallet.tradeRates || {};
1332
- molecule.sourceWallet.molecules = data.sourceWallet.molecules || {};
1335
+ molecule.sourceWallet.tokenUnits = data.sourceWallet.tokenUnits || []
1336
+ molecule.sourceWallet.tradeRates = data.sourceWallet.tradeRates || {}
1337
+ molecule.sourceWallet.molecules = data.sourceWallet.molecules || {}
1333
1338
  }
1334
1339
 
1335
1340
  if (data.remainderWallet) {
@@ -1341,24 +1346,23 @@ export default class Molecule {
1341
1346
  bundle: data.remainderWallet.bundle,
1342
1347
  batchId: data.remainderWallet.batchId,
1343
1348
  characters: data.remainderWallet.characters
1344
- });
1349
+ })
1345
1350
 
1346
1351
  // Set additional properties for validation context
1347
- molecule.remainderWallet.balance = String(data.remainderWallet.balance != null ? data.remainderWallet.balance : 0);
1348
- molecule.remainderWallet.address = data.remainderWallet.address;
1352
+ molecule.remainderWallet.balance = String(data.remainderWallet.balance != null ? data.remainderWallet.balance : 0)
1353
+ molecule.remainderWallet.address = data.remainderWallet.address
1349
1354
  if (data.remainderWallet.pubkey) {
1350
- molecule.remainderWallet.pubkey = data.remainderWallet.pubkey;
1355
+ molecule.remainderWallet.pubkey = data.remainderWallet.pubkey
1351
1356
  }
1352
- molecule.remainderWallet.tokenUnits = data.remainderWallet.tokenUnits || [];
1353
- molecule.remainderWallet.tradeRates = data.remainderWallet.tradeRates || {};
1354
- molecule.remainderWallet.molecules = data.remainderWallet.molecules || {};
1357
+ molecule.remainderWallet.tokenUnits = data.remainderWallet.tokenUnits || []
1358
+ molecule.remainderWallet.tradeRates = data.remainderWallet.tradeRates || {}
1359
+ molecule.remainderWallet.molecules = data.remainderWallet.molecules || {}
1355
1360
  }
1356
1361
  }
1357
1362
 
1358
- return molecule;
1359
-
1363
+ return molecule
1360
1364
  } catch (error) {
1361
- throw new Error(`Molecule deserialization failed: ${error.message}`);
1365
+ throw new Error(`Molecule deserialization failed: ${error.message}`)
1362
1366
  }
1363
1367
  }
1364
1368
 
package/src/Wallet.js CHANGED
@@ -283,11 +283,11 @@ export default class Wallet {
283
283
  * Initializes the ML-KEM key pair
284
284
  */
285
285
  initializeMLKEM () {
286
- // Generate a 64-byte (512-bit) seed from the Knish.IO private key
286
+ // Generate a 64-byte (512-bit) seed from the Knish.IO private key
287
287
  // Use deterministic approach: generateSecret(key, 128) → 128 hex chars = 64 bytes
288
- const seedHex = generateSecret(this.key, 128) // 128 hex chars = 64 bytes
288
+ const seedHex = generateSecret(this.key, 128) // 128 hex chars = 64 bytes
289
289
 
290
- // Convert the hex string to a Uint8Array
290
+ // Convert the hex string to a Uint8Array
291
291
  const seed = new Uint8Array(64)
292
292
  for (let i = 0; i < 64; i++) {
293
293
  seed[i] = parseInt(seedHex.substr(i * 2, 2), 16)
@@ -52,6 +52,7 @@ import { isNumeric } from '../../libraries/strings.js'
52
52
  import { intersect } from '../../libraries/array.js'
53
53
  import CodeException from '../../exception/CodeException.js'
54
54
 
55
+ /* eslint-disable accessor-pairs -- intentional setter-only fluent rule builder; values are read directly via __field, no getter needed */
55
56
  export default class Callback {
56
57
  /**
57
58
  *
@@ -47,9 +47,7 @@ License: https://github.com/WishKnish/KnishIO-Client-JS/blob/master/LICENSE
47
47
  */
48
48
 
49
49
  export default class Meta {
50
- constructor ({}) {
51
- const args = arguments[0]
52
-
50
+ constructor (args = {}) {
53
51
  for (const key in args) {
54
52
  this[`__${ key }`] = args[key]
55
53
  }
@@ -51,6 +51,7 @@ import Condition from './Condition.js'
51
51
  import RuleArgumentException from './exception/RuleArgumentException.js'
52
52
  import MetaMissingException from '../../exception/MetaMissingException.js'
53
53
 
54
+ /* eslint-disable accessor-pairs -- intentional setter-only fluent rule builder; values are read directly via __field, no getter needed */
54
55
  export default class Rule {
55
56
  /**
56
57
  *
@@ -1,5 +1,6 @@
1
1
  import Hex from './Hex.js'
2
2
 
3
+ /* eslint-disable no-extend-native -- intentional guarded String.prototype polyfill (trim) + SDK camel/snake-case helpers relied on across the codebase */
3
4
  if (!String.prototype.trim) {
4
5
  String.prototype.trim = function () {
5
6
  return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '')
@@ -67,15 +67,56 @@ class UrqlClientWrapper {
67
67
  })
68
68
  }
69
69
 
70
+ /**
71
+ * Builds the urql operation options forwarded with a query/mutation.
72
+ *
73
+ * Forwards the requestPolicy (so a long-lived client does not serve stale
74
+ * cache-first reads) and, when the caller supplied a per-query abort signal,
75
+ * the signal too — while re-supplying the X-Auth-Token header. urql REPLACES
76
+ * (not merges) the client-level fetchOptions with any operation-context
77
+ * fetchOptions (createRequestOperation builds the op context as
78
+ * {...baseOpts, ...opts}), so forwarding fetchOptions WITHOUT the header would
79
+ * drop X-Auth-Token and break auth. The header here is byte-identical to the
80
+ * client-level one set in createUrqlClient.
81
+ *
82
+ * @param {object} context
83
+ * @returns {object|undefined}
84
+ */
85
+ buildRequestOptions (context) {
86
+ if (!context) {
87
+ return undefined
88
+ }
89
+ const opts = {}
90
+ if (context.requestPolicy) {
91
+ opts.requestPolicy = context.requestPolicy
92
+ }
93
+ const callerSignal = context.fetchOptions && context.fetchOptions.signal
94
+ if (callerSignal) {
95
+ // Combine the per-query abort signal with the 60s timeout so either can
96
+ // cancel the request; fall back to the caller signal where AbortSignal.any
97
+ // is unavailable.
98
+ const signal = (typeof AbortSignal !== 'undefined' && typeof AbortSignal.any === 'function')
99
+ ? AbortSignal.any([callerSignal, AbortSignal.timeout(60000)])
100
+ : callerSignal
101
+ opts.fetchOptions = {
102
+ headers: { 'X-Auth-Token': this.$__authToken },
103
+ signal
104
+ }
105
+ }
106
+ return Object.keys(opts).length ? opts : undefined
107
+ }
108
+
70
109
  async query (request) {
71
- const { query, variables } = request
72
- const result = await this.$__client.query(query, variables).toPromise()
110
+ const { query, variables, context } = request
111
+ const opts = this.buildRequestOptions(context)
112
+ const result = await this.$__client.query(query, variables || {}, opts).toPromise()
73
113
  return this.formatResponse(result)
74
114
  }
75
115
 
76
116
  async mutate (request) {
77
- const { mutation, variables } = request
78
- const result = await this.$__client.mutation(mutation, variables).toPromise()
117
+ const { mutation, variables, context } = request
118
+ const opts = this.buildRequestOptions(context)
119
+ const result = await this.$__client.mutation(mutation, variables || {}, opts).toPromise()
79
120
  return this.formatResponse(result)
80
121
  }
81
122
 
@@ -48,7 +48,7 @@ License: https://github.com/WishKnish/KnishIO-Client-JS/blob/master/LICENSE
48
48
 
49
49
  import Query from './Query.js'
50
50
  import ResponsePolicy from '../response/ResponsePolicy.js'
51
- import { gql } from "@urql/core";
51
+ import { gql } from '@urql/core'
52
52
 
53
53
  export default class QueryPolicy extends Query {
54
54
  /**
@@ -176,7 +176,7 @@ export default class Response {
176
176
  /**
177
177
  * Enhanced interface methods for standardized response handling
178
178
  */
179
-
179
+
180
180
  /**
181
181
  * Get error reason (alias for error() to match standardized interface)
182
182
  * @return {string|null}
@@ -247,7 +247,7 @@ export default class Response {
247
247
  */
248
248
  debug (label = null) {
249
249
  const debugPrefix = label ? `[${label}]` : `[${this.constructor.name}]`
250
-
250
+
251
251
  if (this.success()) {
252
252
  console.debug(`${debugPrefix} Success:`, {
253
253
  payload: this.payload(),
@@ -261,7 +261,7 @@ export default class Response {
261
261
  rawData: this.$__response
262
262
  })
263
263
  }
264
-
264
+
265
265
  return this
266
266
  }
267
267
 
@@ -46,7 +46,6 @@ Please visit https://github.com/WishKnish/KnishIO-Client-JS for information.
46
46
  License: https://github.com/WishKnish/KnishIO-Client-JS/blob/master/LICENSE
47
47
  */
48
48
 
49
- import Query from '../query/Query.js'
50
49
  import Response from './Response.js'
51
50
 
52
51
  export default class ResponseActiveSession extends Response {
@@ -46,7 +46,6 @@ Please visit https://github.com/WishKnish/KnishIO-Client-JS for information.
46
46
  License: https://github.com/WishKnish/KnishIO-Client-JS/blob/master/LICENSE
47
47
  */
48
48
 
49
- import Query from '../query/Query.js'
50
49
  import Response from './Response.js'
51
50
 
52
51
  /**
@@ -46,7 +46,6 @@ Please visit https://github.com/WishKnish/KnishIO-Client-JS for information.
46
46
  License: https://github.com/WishKnish/KnishIO-Client-JS/blob/master/LICENSE
47
47
  */
48
48
 
49
- import Query from '../query/Query.js'
50
49
  import Response from './Response.js'
51
50
  import Dot from '../libraries/Dot.js'
52
51
  import InvalidResponseException from '../exception/InvalidResponseException.js'
@@ -45,7 +45,6 @@ Please visit https://github.com/WishKnish/KnishIO-Client-JS for information.
45
45
 
46
46
  License: https://github.com/WishKnish/KnishIO-Client-JS/blob/master/LICENSE
47
47
  */
48
- import Query from '../query/Query.js'
49
48
  import Response from './Response.js'
50
49
  import ResponseWalletList from './ResponseWalletList.js'
51
50
 
@@ -45,7 +45,6 @@ Please visit https://github.com/WishKnish/KnishIO-Client-JS for information.
45
45
 
46
46
  License: https://github.com/WishKnish/KnishIO-Client-JS/blob/master/LICENSE
47
47
  */
48
- import Query from '../query/Query.js'
49
48
  import Response from './Response.js'
50
49
  import Wallet from '../Wallet.js'
51
50
 
@@ -45,7 +45,6 @@ Please visit https://github.com/WishKnish/KnishIO-Client-JS for information.
45
45
 
46
46
  License: https://github.com/WishKnish/KnishIO-Client-JS/blob/master/LICENSE
47
47
  */
48
- import Query from '../query/Query.js'
49
48
  import Response from './Response.js'
50
49
  import Dot from '../libraries/Dot.js'
51
50
 
@@ -46,7 +46,6 @@ Please visit https://github.com/WishKnish/KnishIO-Client-JS for information.
46
46
  License: https://github.com/WishKnish/KnishIO-Client-JS/blob/master/LICENSE
47
47
  */
48
48
 
49
- import Query from '../query/Query.js'
50
49
  import Response from './Response.js'
51
50
 
52
51
  /**
@@ -46,7 +46,6 @@ Please visit https://github.com/WishKnish/KnishIO-Client-JS for information.
46
46
  License: https://github.com/WishKnish/KnishIO-Client-JS/blob/master/LICENSE
47
47
  */
48
48
 
49
- import Query from '../query/Query.js'
50
49
  import Response from './Response.js'
51
50
 
52
51
  export default class ResponseMetaTypeViaAtom extends Response {