@unicitylabs/sphere-sdk 0.16.0-dev.1 → 0.16.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.
- package/dist/connect/index.cjs +13 -3
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/index.js +13 -3
- package/dist/connect/index.js.map +1 -1
- package/dist/core/index.cjs +4 -3
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +2 -2
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.js +4 -3
- package/dist/core/index.js.map +1 -1
- package/dist/impl/browser/connect/index.cjs +3 -3
- package/dist/impl/browser/connect/index.cjs.map +1 -1
- package/dist/impl/browser/connect/index.js +3 -3
- package/dist/impl/browser/connect/index.js.map +1 -1
- package/dist/impl/browser/index.cjs +4 -4
- package/dist/impl/browser/index.cjs.map +1 -1
- package/dist/impl/browser/index.js +4 -4
- package/dist/impl/browser/index.js.map +1 -1
- package/dist/impl/nodejs/connect/index.cjs +2 -2
- package/dist/impl/nodejs/connect/index.cjs.map +1 -1
- package/dist/impl/nodejs/connect/index.js +2 -2
- package/dist/impl/nodejs/connect/index.js.map +1 -1
- package/dist/impl/nodejs/index.cjs +21 -5
- package/dist/impl/nodejs/index.cjs.map +1 -1
- package/dist/impl/nodejs/index.d.cts +2 -2
- package/dist/impl/nodejs/index.d.ts +2 -2
- package/dist/impl/nodejs/index.js +21 -5
- package/dist/impl/nodejs/index.js.map +1 -1
- package/dist/index.cjs +4 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- 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(
|
|
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
|
|
@@ -23731,7 +23731,7 @@ var NETWORKS = {
|
|
|
23731
23731
|
// old goggregator testnet spoke the removed v1 protocol — a v2 engine cannot
|
|
23732
23732
|
// run against it. 'testnet2' stays as an alias of the same configuration.
|
|
23733
23733
|
testnet: {
|
|
23734
|
-
name: "
|
|
23734
|
+
name: "Testnet",
|
|
23735
23735
|
networkId: 4,
|
|
23736
23736
|
// v2 state-transition gateway (networkId 4 comes from the trust base). apiKey is env-injected.
|
|
23737
23737
|
aggregatorUrl: "https://gateway.testnet2.unicity.network",
|
|
@@ -23741,7 +23741,7 @@ var NETWORKS = {
|
|
|
23741
23741
|
tokenRegistryUrl: "https://raw.githubusercontent.com/unicitynetwork/unicity-ids/refs/heads/main/unicity-ids.testnet2.json"
|
|
23742
23742
|
},
|
|
23743
23743
|
testnet2: {
|
|
23744
|
-
name: "
|
|
23744
|
+
name: "Testnet",
|
|
23745
23745
|
networkId: 4,
|
|
23746
23746
|
// v2 state-transition gateway (networkId 4 comes from the trust base). apiKey is env-injected.
|
|
23747
23747
|
aggregatorUrl: "https://gateway.testnet2.unicity.network",
|
|
@@ -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;
|