@unicitylabs/sphere-sdk 0.16.0-dev.2 → 0.17.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 (61) hide show
  1. package/dist/connect/index.cjs +11 -5
  2. package/dist/connect/index.cjs.map +1 -1
  3. package/dist/connect/index.d.cts +4 -1
  4. package/dist/connect/index.d.ts +4 -1
  5. package/dist/connect/index.js +11 -5
  6. package/dist/connect/index.js.map +1 -1
  7. package/dist/core/index.cjs +568 -172
  8. package/dist/core/index.cjs.map +1 -1
  9. package/dist/core/index.d.cts +67 -0
  10. package/dist/core/index.d.ts +67 -0
  11. package/dist/core/index.js +568 -172
  12. package/dist/core/index.js.map +1 -1
  13. package/dist/impl/browser/connect/index.cjs +11 -5
  14. package/dist/impl/browser/connect/index.cjs.map +1 -1
  15. package/dist/impl/browser/connect/index.d.cts +3 -1
  16. package/dist/impl/browser/connect/index.d.ts +3 -1
  17. package/dist/impl/browser/connect/index.js +11 -5
  18. package/dist/impl/browser/connect/index.js.map +1 -1
  19. package/dist/impl/browser/index.cjs +2 -2
  20. package/dist/impl/browser/index.cjs.map +1 -1
  21. package/dist/impl/browser/index.js +2 -2
  22. package/dist/impl/browser/index.js.map +1 -1
  23. package/dist/impl/nodejs/connect/index.cjs +10 -4
  24. package/dist/impl/nodejs/connect/index.cjs.map +1 -1
  25. package/dist/impl/nodejs/connect/index.d.cts +1 -1
  26. package/dist/impl/nodejs/connect/index.d.ts +1 -1
  27. package/dist/impl/nodejs/connect/index.js +10 -4
  28. package/dist/impl/nodejs/connect/index.js.map +1 -1
  29. package/dist/impl/nodejs/index.cjs +19 -3
  30. package/dist/impl/nodejs/index.cjs.map +1 -1
  31. package/dist/impl/nodejs/index.d.cts +11 -0
  32. package/dist/impl/nodejs/index.d.ts +11 -0
  33. package/dist/impl/nodejs/index.js +19 -3
  34. package/dist/impl/nodejs/index.js.map +1 -1
  35. package/dist/impl/shared/wallet-api/index.d.cts +11 -0
  36. package/dist/impl/shared/wallet-api/index.d.ts +11 -0
  37. package/dist/impl/wallet-api-v2/index.cjs +2 -0
  38. package/dist/impl/wallet-api-v2/index.cjs.map +1 -1
  39. package/dist/impl/wallet-api-v2/index.d.cts +13 -0
  40. package/dist/impl/wallet-api-v2/index.d.ts +13 -0
  41. package/dist/impl/wallet-api-v2/index.js +2 -0
  42. package/dist/impl/wallet-api-v2/index.js.map +1 -1
  43. package/dist/index.cjs +568 -172
  44. package/dist/index.cjs.map +1 -1
  45. package/dist/index.d.cts +61 -1
  46. package/dist/index.d.ts +61 -1
  47. package/dist/index.js +568 -172
  48. package/dist/index.js.map +1 -1
  49. package/dist/modules/payments-v2/index.cjs +609 -269
  50. package/dist/modules/payments-v2/index.cjs.map +1 -1
  51. package/dist/modules/payments-v2/index.d.cts +88 -13
  52. package/dist/modules/payments-v2/index.d.ts +88 -13
  53. package/dist/modules/payments-v2/index.js +609 -269
  54. package/dist/modules/payments-v2/index.js.map +1 -1
  55. package/dist/token-engine/index.cjs +132 -34
  56. package/dist/token-engine/index.cjs.map +1 -1
  57. package/dist/token-engine/index.d.cts +19 -0
  58. package/dist/token-engine/index.d.ts +19 -0
  59. package/dist/token-engine/index.js +132 -34
  60. package/dist/token-engine/index.js.map +1 -1
  61. package/package.json +1 -1
@@ -12684,7 +12684,7 @@ var require_snapshot_recorder = __commonJS({
12684
12684
  "node_modules/undici/lib/mock/snapshot-recorder.js"(exports2, module2) {
12685
12685
  "use strict";
12686
12686
  var { writeFile, readFile, mkdir } = require("fs/promises");
12687
- var { dirname, resolve: resolve2 } = require("path");
12687
+ var { dirname: dirname2, resolve: resolve2 } = require("path");
12688
12688
  var { setTimeout: setTimeout2, clearTimeout: clearTimeout2 } = require("timers");
12689
12689
  var { InvalidArgumentError, UndiciError } = require_errors();
12690
12690
  var { hashId, isUrlExcludedFactory, normalizeHeaders, createHeaderFilters } = require_snapshot_utils();
@@ -12915,7 +12915,7 @@ var require_snapshot_recorder = __commonJS({
12915
12915
  throw new InvalidArgumentError("Snapshot path is required");
12916
12916
  }
12917
12917
  const resolvedPath = resolve2(path2);
12918
- await mkdir(dirname(resolvedPath), { recursive: true });
12918
+ await mkdir(dirname2(resolvedPath), { recursive: true });
12919
12919
  const data = Array.from(this.#snapshots.entries()).map(([hash, snapshot]) => ({
12920
12920
  hash,
12921
12921
  snapshot
@@ -23854,6 +23854,22 @@ function mergeTrackedAddresses(onDisk, incoming) {
23854
23854
  }
23855
23855
 
23856
23856
  // impl/nodejs/storage/FileStorageProvider.ts
23857
+ function canonicalPath(p) {
23858
+ const resolved = path.resolve(p);
23859
+ const tail = [];
23860
+ let cursor = resolved;
23861
+ while (!fs.existsSync(cursor)) {
23862
+ const parent = path.dirname(cursor);
23863
+ if (parent === cursor) return resolved;
23864
+ tail.unshift(path.basename(cursor));
23865
+ cursor = parent;
23866
+ }
23867
+ try {
23868
+ return path.join(fs.realpathSync(cursor), ...tail);
23869
+ } catch {
23870
+ return resolved;
23871
+ }
23872
+ }
23857
23873
  var FileStorageProvider = class {
23858
23874
  id = "file-storage";
23859
23875
  name = "File Storage";
@@ -23877,7 +23893,7 @@ var FileStorageProvider = class {
23877
23893
  this.network = config.network;
23878
23894
  }
23879
23895
  this.isTxtMode = this.filePath.endsWith(".txt");
23880
- this.backingStoreId = `file:${this.filePath}`;
23896
+ this.backingStoreId = `file:${path.join(canonicalPath(this.dataDir), path.basename(this.filePath))}`;
23881
23897
  }
23882
23898
  setIdentity(identity) {
23883
23899
  this._identity = identity;