omnipin 2.1.0 → 2.1.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/dist/index.js +845 -511
- package/dist/rslib-runtime.js +3 -3
- package/package.json +10 -12
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var dag_pb_src_namespaceObject, car_namespaceObject, src_cbor_namespaceObject, schema_link_namespaceObject, request_namespaceObject, response_namespaceObject, sha256_namespaceObject, base10_namespaceObject, base16_namespaceObject, base2_namespaceObject, base256emoji_namespaceObject, base32_namespaceObject, base36_namespaceObject, base58_namespaceObject, base64_namespaceObject, base8_namespaceObject, bases_identity_namespaceObject, raw_namespaceObject, identity_namespaceObject, hashes_sha2_namespaceObject, MSB, MSBALL, INT, MSB$1, REST$1, _computedKey,
|
|
2
|
+
var dag_pb_src_namespaceObject, car_namespaceObject, src_cbor_namespaceObject, schema_link_namespaceObject, request_namespaceObject, response_namespaceObject, sha256_namespaceObject, base10_namespaceObject, base16_namespaceObject, base2_namespaceObject, base256emoji_namespaceObject, base32_namespaceObject, base36_namespaceObject, base58_namespaceObject, base64_namespaceObject, base8_namespaceObject, bases_identity_namespaceObject, raw_namespaceObject, identity_namespaceObject, hashes_sha2_namespaceObject, MSB, MSBALL, INT, MSB$1, REST$1, _computedKey, __require, Queue, Counter, Aborter, Walker, APIBuilder, Builder, codec_CODEC_TYPES, unixfs_Data, unixfs_UnixTime, unixfs_Metadata, COMPRESSED$1, COMPRESSED, curveDef, CODEC_TYPES, Data, DataType, __DataTypeValues, UnixTime, Metadata;
|
|
3
3
|
let _sha512Sync, _fsReadFn, _fsWriteFn, SHIFTED_RANK, EXCLUSIONS, DECOMP, RECOMP, MAPPED, IGNORED, CM, NSM, ESCAPE, GROUPS, WHOLE_VALID, WHOLE_MAP, VALID, EMOJI_LIST, EMOJI_ROOT, create, slab, SIZE, MAX, offset, __DataTypeValues1, _codec, _codec1, _codec2;
|
|
4
4
|
function makeFullPath(cli, path = []) {
|
|
5
5
|
return cli.parent ? makeFullPath(cli.parent, path) : path;
|
|
@@ -776,13 +776,7 @@ function Signature_toHex(signature) {
|
|
|
776
776
|
size: 32
|
|
777
777
|
}), fromNumber(s, {
|
|
778
778
|
size: 32
|
|
779
|
-
}), 'number' == typeof signature.yParity ? fromNumber(
|
|
780
|
-
if (0 === yParity) return 27;
|
|
781
|
-
if (1 === yParity) return 28;
|
|
782
|
-
throw new InvalidYParityError({
|
|
783
|
-
value: yParity
|
|
784
|
-
});
|
|
785
|
-
}(signature.yParity), {
|
|
779
|
+
}), 'number' == typeof signature.yParity ? fromNumber(yParityToV(signature.yParity), {
|
|
786
780
|
size: 1
|
|
787
781
|
}) : '0x');
|
|
788
782
|
}
|
|
@@ -794,6 +788,13 @@ function vToYParity(v) {
|
|
|
794
788
|
value: v
|
|
795
789
|
});
|
|
796
790
|
}
|
|
791
|
+
function yParityToV(yParity) {
|
|
792
|
+
if (0 === yParity) return 27;
|
|
793
|
+
if (1 === yParity) return 28;
|
|
794
|
+
throw new InvalidYParityError({
|
|
795
|
+
value: yParity
|
|
796
|
+
});
|
|
797
|
+
}
|
|
797
798
|
function Value_format(value, decimals = 0) {
|
|
798
799
|
let display = value.toString(), negative = display.startsWith('-');
|
|
799
800
|
negative && (display = display.slice(1));
|
|
@@ -1429,7 +1430,7 @@ function parseError(error) {
|
|
|
1429
1430
|
stack: error instanceof Error ? error.stack : void 0
|
|
1430
1431
|
});
|
|
1431
1432
|
}
|
|
1432
|
-
function Provider_from(provider
|
|
1433
|
+
function Provider_from(provider) {
|
|
1433
1434
|
if (!provider) throw new IsUndefinedError();
|
|
1434
1435
|
return {
|
|
1435
1436
|
...provider,
|
|
@@ -2127,18 +2128,18 @@ function AbiParameters_decode(parameters, data, options = {}) {
|
|
|
2127
2128
|
if ('address' === param.type) return function(cursor, options = {}) {
|
|
2128
2129
|
let address, { checksum = !1 } = options;
|
|
2129
2130
|
return [
|
|
2130
|
-
(address = Hex_fromBytes(function(value,
|
|
2131
|
+
(address = Hex_fromBytes(function(value, options = {}) {
|
|
2131
2132
|
let { strict } = options;
|
|
2132
2133
|
!1;
|
|
2133
2134
|
let value_ = value.slice(-20, void 0);
|
|
2134
|
-
return strict && function(value,
|
|
2135
|
+
return strict && function(value, end) {
|
|
2135
2136
|
if ('number' == typeof end && Bytes_size(value) !== end - -20) throw new Bytes_SliceOffsetOutOfBoundsError({
|
|
2136
2137
|
offset: end,
|
|
2137
2138
|
position: 'end',
|
|
2138
2139
|
size: Bytes_size(value)
|
|
2139
2140
|
});
|
|
2140
|
-
}(value_,
|
|
2141
|
-
}(cursor.readBytes(32)
|
|
2141
|
+
}(value_, void 0), value_;
|
|
2142
|
+
}(cursor.readBytes(32))), checksum ? Address_checksum(address) : address),
|
|
2142
2143
|
32
|
|
2143
2144
|
];
|
|
2144
2145
|
}(cursor, {
|
|
@@ -2430,7 +2431,7 @@ function AbiError_decode(...parameters) {
|
|
|
2430
2431
|
if (Array.isArray(parameters[0])) {
|
|
2431
2432
|
let [abi, name, data, options] = parameters;
|
|
2432
2433
|
return [
|
|
2433
|
-
function(abi, name
|
|
2434
|
+
function(abi, name) {
|
|
2434
2435
|
if ('Error' === name) return solidityError;
|
|
2435
2436
|
if ('Panic' === name) return solidityPanic;
|
|
2436
2437
|
if (validate(name, {
|
|
@@ -2981,7 +2982,7 @@ async function esm_verify(sig, message, publicKey) {
|
|
|
2981
2982
|
return k = modlLE(hashed), kA = ExtendedPoint.fromAffine(pub).multiplyUnsafe(k), ExtendedPoint.fromAffine(r).add(kA).subtract(SB).multiplyUnsafe(esm_CURVE.h).equals(ExtendedPoint.ZERO);
|
|
2982
2983
|
}
|
|
2983
2984
|
function bytesEncoder(bytes) {
|
|
2984
|
-
let bytesString =
|
|
2985
|
+
let bytesString = base64_base64.encode(bytes).slice(1);
|
|
2985
2986
|
return [
|
|
2986
2987
|
new Token(Type.map, 1 / 0, 1),
|
|
2987
2988
|
new Token(Type.string, '/', 1),
|
|
@@ -3026,35 +3027,20 @@ function parseAbility(ability) {
|
|
|
3026
3027
|
};
|
|
3027
3028
|
}
|
|
3028
3029
|
async function setup({ pk, proof }) {
|
|
3029
|
-
let
|
|
3030
|
+
let agentData = {
|
|
3030
3031
|
meta: {
|
|
3031
3032
|
name: 'agent',
|
|
3032
3033
|
type: 'device'
|
|
3033
3034
|
},
|
|
3034
|
-
principal,
|
|
3035
|
+
principal: signer_parse(pk),
|
|
3035
3036
|
delegations: new Map()
|
|
3036
3037
|
}, agent = new Agent(agentData);
|
|
3037
3038
|
try {
|
|
3038
3039
|
let delegation = await proof_parse(proof), space = fromDelegation(delegation);
|
|
3039
|
-
agentData.delegations.set(delegation.cid.toString(), {
|
|
3040
|
+
return agentData.delegations.set(delegation.cid.toString(), {
|
|
3040
3041
|
delegation,
|
|
3041
3042
|
meta: {}
|
|
3042
|
-
})
|
|
3043
|
-
let raw = {
|
|
3044
|
-
meta: agentData.meta,
|
|
3045
|
-
principal: principal.toArchive(),
|
|
3046
|
-
delegations: new Map()
|
|
3047
|
-
};
|
|
3048
|
-
for (let [key, value] of agentData.delegations)raw.delegations.set(key, {
|
|
3049
|
-
meta: value.meta,
|
|
3050
|
-
delegation: [
|
|
3051
|
-
...value.delegation.export()
|
|
3052
|
-
].map((b)=>({
|
|
3053
|
-
cid: b.cid.toString(),
|
|
3054
|
-
bytes: b.bytes.buffer.slice(b.bytes.byteOffset, b.bytes.byteOffset + b.bytes.byteLength)
|
|
3055
|
-
}))
|
|
3056
|
-
});
|
|
3057
|
-
return {
|
|
3043
|
+
}), {
|
|
3058
3044
|
agent,
|
|
3059
3045
|
space
|
|
3060
3046
|
};
|
|
@@ -3081,20 +3067,15 @@ async function retry(fn, options = {}) {
|
|
|
3081
3067
|
throw Error('Unexpected retry loop end');
|
|
3082
3068
|
}
|
|
3083
3069
|
async function poll(taskCid) {
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
return res.ok;
|
|
3089
|
-
}, {
|
|
3090
|
-
onFailedAttempt: console.warn,
|
|
3091
|
-
retries: REQUEST_RETRIES
|
|
3092
|
-
});
|
|
3070
|
+
await new Promise((r)=>setTimeout(r, WAIT_MS));
|
|
3071
|
+
let res = await receipts_get(taskCid);
|
|
3072
|
+
if (res.error) throw res.error;
|
|
3073
|
+
return res.ok;
|
|
3093
3074
|
}
|
|
3094
3075
|
async function receipts_get(taskCid) {
|
|
3095
3076
|
let url = new URL(taskCid.toString(), receiptsEndpoint), workflowResponse = await fetch(url);
|
|
3096
3077
|
if (404 === workflowResponse.status) return {
|
|
3097
|
-
error: new
|
|
3078
|
+
error: new DOMException('Receipt not found', 'NotFoundError')
|
|
3098
3079
|
};
|
|
3099
3080
|
let agentMessageBytes = new Uint8Array(await workflowResponse.arrayBuffer()), agentMessage = await request_decode({
|
|
3100
3081
|
body: agentMessageBytes,
|
|
@@ -3118,7 +3099,7 @@ async function receipts_get(taskCid) {
|
|
|
3118
3099
|
};
|
|
3119
3100
|
}
|
|
3120
3101
|
return {
|
|
3121
|
-
error: new
|
|
3102
|
+
error: new DOMException(`failed to fetch receipt for task: ${taskCid}`, 'AbortError')
|
|
3122
3103
|
};
|
|
3123
3104
|
}
|
|
3124
3105
|
return {
|
|
@@ -3581,7 +3562,7 @@ function normalizePattern(pattern, expandDirectories, cwd, props, isIgnore) {
|
|
|
3581
3562
|
newCommonPath.pop();
|
|
3582
3563
|
break;
|
|
3583
3564
|
}
|
|
3584
|
-
if (part !== props.commonPath[i] || function(pattern
|
|
3565
|
+
if (part !== props.commonPath[i] || function(pattern) {
|
|
3585
3566
|
let scan = picomatch.scan(pattern);
|
|
3586
3567
|
return scan.isGlob || scan.negated;
|
|
3587
3568
|
}(part) || i === parts.length - 1) break;
|
|
@@ -3684,12 +3665,12 @@ async function glob(patternsOrOptions, options) {
|
|
|
3684
3665
|
return "." !== relativePath && !partialMatcher(relativePath) || ignore(relativePath);
|
|
3685
3666
|
},
|
|
3686
3667
|
fs: options.fs ? {
|
|
3687
|
-
readdir: options.fs.readdir ||
|
|
3688
|
-
readdirSync: options.fs.readdirSync ||
|
|
3689
|
-
realpath: options.fs.realpath ||
|
|
3690
|
-
realpathSync: options.fs.realpathSync ||
|
|
3691
|
-
stat: options.fs.stat ||
|
|
3692
|
-
statSync: options.fs.statSync ||
|
|
3668
|
+
readdir: options.fs.readdir || fs_0.readdir,
|
|
3669
|
+
readdirSync: options.fs.readdirSync || fs_0.readdirSync,
|
|
3670
|
+
realpath: options.fs.realpath || fs_0.realpath,
|
|
3671
|
+
realpathSync: options.fs.realpathSync || fs_0.realpathSync,
|
|
3672
|
+
stat: options.fs.stat || fs_0.stat,
|
|
3673
|
+
statSync: options.fs.statSync || fs_0.statSync
|
|
3693
3674
|
} : void 0,
|
|
3694
3675
|
pathSeparator: "/",
|
|
3695
3676
|
relativePaths: !0,
|
|
@@ -4134,6 +4115,30 @@ async function* buildFileBatch(file, blockstore, options) {
|
|
|
4134
4115
|
function isSingleBlockImport(result) {
|
|
4135
4116
|
return !0 === result.single;
|
|
4136
4117
|
}
|
|
4118
|
+
function varintLen(x) {
|
|
4119
|
+
var x1;
|
|
4120
|
+
let n;
|
|
4121
|
+
return x % 2 == 0 && x++, Math.floor((n = 0, (x1 = x) >= pb_size_maxInt32 && (x1 = Math.floor(x1 / pb_size_maxInt32), n = 32), x1 >= 65536 && (x1 >>>= 16, n += 16), x1 >= 256 && (x1 >>>= 8, n += 8), (n + pb_size_len8tab[x1] + 6) / 7));
|
|
4122
|
+
}
|
|
4123
|
+
function utf8ByteLength(str) {
|
|
4124
|
+
let len = 0;
|
|
4125
|
+
for(let i = 0; i < str.length; i++){
|
|
4126
|
+
let c = str.charCodeAt(i);
|
|
4127
|
+
c < 0x80 ? len++ : c < 0x800 ? len += 2 : c >= 0xD800 && c <= 0xDBFF && i + 1 < str.length ? (i++, len += 4) : len += 3;
|
|
4128
|
+
}
|
|
4129
|
+
return len;
|
|
4130
|
+
}
|
|
4131
|
+
function estimateLinkSize(nameBytes, child) {
|
|
4132
|
+
return child?.cid != null && child?.size != null ? nameBytes + child.cid.byteLength : 0;
|
|
4133
|
+
}
|
|
4134
|
+
function calculateLinkSize(nameBytes, child) {
|
|
4135
|
+
if (child?.cid != null && child?.size != null) {
|
|
4136
|
+
var cidByteLength, tsize;
|
|
4137
|
+
let linkLen;
|
|
4138
|
+
return cidByteLength = child.cid.byteLength, tsize = Number(child.size), linkLen = 1 + varintLen(cidByteLength) + cidByteLength + (1 + varintLen(nameBytes) + nameBytes) + (1 + varintLen(tsize)), 1 + varintLen(linkLen) + linkLen;
|
|
4139
|
+
}
|
|
4140
|
+
return 0;
|
|
4141
|
+
}
|
|
4137
4142
|
function add64(a, b) {
|
|
4138
4143
|
let lo = a.lo + b.lo >>> 0, hi = a.hi + b.hi + +(lo < a.lo) >>> 0;
|
|
4139
4144
|
return {
|
|
@@ -4289,13 +4294,13 @@ async function* dir_sharded_flush(bucket, blockstore, shardRoot, options) {
|
|
|
4289
4294
|
if (child instanceof Bucket) {
|
|
4290
4295
|
let shard;
|
|
4291
4296
|
for await (let subShard of dir_sharded_flush(child, blockstore, null, options))shard = subShard;
|
|
4292
|
-
if (null == shard) throw Error('Could not flush sharded directory, no
|
|
4297
|
+
if (null == shard) throw Error('Could not flush sharded directory, no sub-shard found');
|
|
4293
4298
|
links.push({
|
|
4294
4299
|
Name: labelPrefix,
|
|
4295
4300
|
Tsize: Number(shard.size),
|
|
4296
4301
|
Hash: shard.cid
|
|
4297
4302
|
}), childrenSize += shard.size;
|
|
4298
|
-
} else if (
|
|
4303
|
+
} else if (dir_sharded_isDir(child.value)) {
|
|
4299
4304
|
let flushedDir;
|
|
4300
4305
|
for await (let entry of child.value.flush(blockstore))flushedDir = entry, yield flushedDir;
|
|
4301
4306
|
if (null == flushedDir) throw Error('Did not flush dir');
|
|
@@ -4320,7 +4325,7 @@ async function* dir_sharded_flush(bucket, blockstore, shardRoot, options) {
|
|
|
4320
4325
|
type: 'hamt-sharded-directory',
|
|
4321
4326
|
data: Uint8Array.from(children.bitField().reverse()),
|
|
4322
4327
|
fanout: BigInt(bucket.tableSize()),
|
|
4323
|
-
hashType:
|
|
4328
|
+
hashType: DEFAULT_SHARD_HASH_CODE,
|
|
4324
4329
|
mtime: shardRoot?.mtime,
|
|
4325
4330
|
mode: shardRoot?.mode
|
|
4326
4331
|
}), buffer = dag_pb_src_encode(util_prepare({
|
|
@@ -4333,20 +4338,69 @@ async function* dir_sharded_flush(bucket, blockstore, shardRoot, options) {
|
|
|
4333
4338
|
size
|
|
4334
4339
|
};
|
|
4335
4340
|
}
|
|
4336
|
-
|
|
4337
|
-
|
|
4338
|
-
|
|
4341
|
+
function dir_sharded_isDir(obj) {
|
|
4342
|
+
return 'function' == typeof obj.flush;
|
|
4343
|
+
}
|
|
4344
|
+
async function calculateSize(bucket, shardRoot, blocks, options) {
|
|
4345
|
+
let children = bucket._children, padLength = (bucket.tableSize() - 1).toString(16).length, links = [], sizeEstimate = 0;
|
|
4346
|
+
for(let i = 0; i < children.length; i++){
|
|
4347
|
+
let child = children.get(i);
|
|
4348
|
+
if (null == child) continue;
|
|
4349
|
+
let labelPrefix = i.toString(16).toUpperCase().padStart(padLength, '0');
|
|
4350
|
+
if (child instanceof Bucket) {
|
|
4351
|
+
let { size, cid } = await calculateSize(child, null, blocks, options);
|
|
4352
|
+
links.push({
|
|
4353
|
+
Name: labelPrefix,
|
|
4354
|
+
Tsize: Number(size),
|
|
4355
|
+
Hash: cid
|
|
4356
|
+
}), sizeEstimate += labelPrefix.length + cid.byteLength;
|
|
4357
|
+
} else if (dir_sharded_isDir(child.value)) {
|
|
4358
|
+
let dir = child.value, size = dir.nodeSize;
|
|
4359
|
+
if (null == dir.cid) throw Error('Child directory has not been persisted');
|
|
4360
|
+
links.push({
|
|
4361
|
+
Name: labelPrefix + child.key,
|
|
4362
|
+
Tsize: Number(size),
|
|
4363
|
+
Hash: dir.cid
|
|
4364
|
+
}), sizeEstimate += labelPrefix.length + dir.cid.byteLength;
|
|
4365
|
+
} else {
|
|
4366
|
+
let value = child.value, label = labelPrefix + child.key, size = value.size;
|
|
4367
|
+
links.push({
|
|
4368
|
+
Name: label,
|
|
4369
|
+
Tsize: Number(size),
|
|
4370
|
+
Hash: value.cid
|
|
4371
|
+
}), sizeEstimate += labelPrefix.length + value.cid.byteLength;
|
|
4372
|
+
}
|
|
4373
|
+
}
|
|
4374
|
+
let buffer = dag_pb_src_encode(util_prepare({
|
|
4375
|
+
Data: new UnixFS({
|
|
4376
|
+
type: 'hamt-sharded-directory',
|
|
4377
|
+
data: Uint8Array.from(children.bitField().reverse()),
|
|
4378
|
+
fanout: BigInt(bucket.tableSize()),
|
|
4379
|
+
hashType: DEFAULT_SHARD_HASH_CODE,
|
|
4380
|
+
mtime: shardRoot?.mtime,
|
|
4381
|
+
mode: shardRoot?.mode
|
|
4382
|
+
}).marshal(),
|
|
4383
|
+
Links: links
|
|
4384
|
+
}));
|
|
4385
|
+
return {
|
|
4386
|
+
cid: await persist(buffer, blocks, options),
|
|
4387
|
+
size: 'links-bytes' === options.shardSplitStrategy ? sizeEstimate : buffer.length
|
|
4388
|
+
};
|
|
4389
|
+
}
|
|
4390
|
+
async function flatToShard(child, dir) {
|
|
4391
|
+
let newDir = dir, shardSplitThresholdBytes = dir.options.shardSplitThresholdBytes ?? 262144;
|
|
4392
|
+
dir instanceof DirFlat && await dir.estimateNodeSize() > shardSplitThresholdBytes && (newDir = await convertToShard(dir));
|
|
4339
4393
|
let parent = newDir.parent;
|
|
4340
4394
|
if (null != parent) {
|
|
4341
4395
|
if (newDir !== dir) {
|
|
4342
4396
|
if (null != child && (child.parent = newDir), null == newDir.parentKey) throw Error('No parent key found');
|
|
4343
4397
|
await parent.put(newDir.parentKey, newDir);
|
|
4344
4398
|
}
|
|
4345
|
-
return flatToShard(newDir, parent
|
|
4399
|
+
return flatToShard(newDir, parent);
|
|
4346
4400
|
}
|
|
4347
4401
|
return newDir;
|
|
4348
4402
|
}
|
|
4349
|
-
async function convertToShard(oldDir
|
|
4403
|
+
async function convertToShard(oldDir) {
|
|
4350
4404
|
let newDir = new dir_sharded({
|
|
4351
4405
|
root: oldDir.root,
|
|
4352
4406
|
dir: !0,
|
|
@@ -4357,7 +4411,7 @@ async function convertToShard(oldDir, options) {
|
|
|
4357
4411
|
flat: !1,
|
|
4358
4412
|
mtime: oldDir.mtime,
|
|
4359
4413
|
mode: oldDir.mode
|
|
4360
|
-
}, options);
|
|
4414
|
+
}, oldDir.options);
|
|
4361
4415
|
for (let { key, child } of oldDir.eachChildSeries())await newDir.put(key, child);
|
|
4362
4416
|
return newDir;
|
|
4363
4417
|
}
|
|
@@ -4367,7 +4421,7 @@ async function addToTree(elem, tree, options) {
|
|
|
4367
4421
|
let pathElem = pathElems[i];
|
|
4368
4422
|
currentPath += `${'' !== currentPath ? '/' : ''}${pathElem}`;
|
|
4369
4423
|
let last = i === lastIndex;
|
|
4370
|
-
if (parent.dirty = !0, parent.cid = void 0, parent.size = void 0, last) await parent.put(pathElem, elem), tree = await flatToShard(null, parent
|
|
4424
|
+
if (parent.dirty = !0, parent.cid = void 0, parent.size = void 0, last) await parent.put(pathElem, elem), tree = await flatToShard(null, parent);
|
|
4371
4425
|
else {
|
|
4372
4426
|
let dir = await parent.get(pathElem);
|
|
4373
4427
|
null != dir && dir instanceof Dir || (dir = new DirFlat({
|
|
@@ -4393,21 +4447,25 @@ async function* flushAndYield(tree, blockstore) {
|
|
|
4393
4447
|
yield* tree.flush(blockstore);
|
|
4394
4448
|
}
|
|
4395
4449
|
async function* src_importer(source, blockstore, options = {}) {
|
|
4396
|
-
var options1, options2, options3;
|
|
4397
|
-
let candidates, maxChildrenPerNode;
|
|
4450
|
+
var options1, options2, options3, options4;
|
|
4451
|
+
let candidates, chunkSize, maxChildrenPerNode, maxChildrenPerNode1;
|
|
4398
4452
|
candidates = Symbol.asyncIterator in source || Symbol.iterator in source ? source : [
|
|
4399
4453
|
source
|
|
4400
|
-
];
|
|
4401
|
-
let wrapWithDirectory = options.wrapWithDirectory ?? !1, shardSplitThresholdBytes = options.shardSplitThresholdBytes ?? 262144, shardFanoutBits = options.shardFanoutBits ?? 8, cidVersion = options.cidVersion ?? 1, rawLeaves = options.rawLeaves ?? !0, leafType = options.leafType ??
|
|
4454
|
+
], 'unixfs-v0-2015' === options.profile ? (options.shardSplitStrategy = options.shardSplitStrategy ?? 'links-bytes', options.cidVersion = options.cidVersion ?? 0, options.rawLeaves = options.rawLeaves ?? !1, chunkSize = 262144, maxChildrenPerNode = 174) : 'unixfs-v1-2025' === options.profile && (options.shardSplitStrategy = options.shardSplitStrategy ?? 'block-bytes', options.cidVersion = options.cidVersion ?? 1, options.rawLeaves = options.rawLeaves ?? !0, chunkSize = DEFAULT_CHUNK_SIZE_1MIB, maxChildrenPerNode = 1024);
|
|
4455
|
+
let wrapWithDirectory = options.wrapWithDirectory ?? !1, shardSplitThresholdBytes = options.shardSplitThresholdBytes ?? 262144, shardSplitStrategy = options.shardSplitStrategy ?? DEFAULT_SHARD_SPLIT_STRATEGY, shardFanoutBits = options.shardFanoutBits ?? 8, cidVersion = options.cidVersion ?? 1, rawLeaves = options.rawLeaves ?? !0, leafType = options.leafType ?? "file", fileImportConcurrency = options.fileImportConcurrency ?? 50, blockWriteConcurrency = options.blockWriteConcurrency ?? 10, reduceSingleLeafToSelf = options.reduceSingleLeafToSelf ?? !0, chunker = options.chunker ?? fixedSize({
|
|
4456
|
+
chunkSize
|
|
4457
|
+
}), chunkValidator = options.chunkValidator ?? defaultChunkValidator(), buildDag = options.dagBuilder ?? (options3 = {
|
|
4402
4458
|
chunker,
|
|
4403
4459
|
chunkValidator,
|
|
4404
4460
|
wrapWithDirectory,
|
|
4405
|
-
layout: options.layout ?? (
|
|
4461
|
+
layout: options.layout ?? (options1 = {
|
|
4462
|
+
maxChildrenPerNode
|
|
4463
|
+
}, maxChildrenPerNode1 = options1?.maxChildrenPerNode ?? DEFAULT_MAX_CHILDREN_PER_NODE, async function balancedLayout(source, reduce) {
|
|
4406
4464
|
let roots = [];
|
|
4407
|
-
for await (let chunked of dist_src(source,
|
|
4465
|
+
for await (let chunked of dist_src(source, maxChildrenPerNode1))roots.push(await reduce(chunked));
|
|
4408
4466
|
return roots.length > 1 ? balancedLayout(roots, reduce) : roots[0];
|
|
4409
4467
|
}),
|
|
4410
|
-
bufferImporter: options.bufferImporter ?? (
|
|
4468
|
+
bufferImporter: options.bufferImporter ?? (options2 = {
|
|
4411
4469
|
cidVersion,
|
|
4412
4470
|
rawLeaves,
|
|
4413
4471
|
leafType,
|
|
@@ -4417,18 +4475,18 @@ async function* src_importer(source, blockstore, options = {}) {
|
|
|
4417
4475
|
for await (let block of file.content)yield async ()=>{
|
|
4418
4476
|
let unixfs, opts = {
|
|
4419
4477
|
codec: dag_pb_src_namespaceObject,
|
|
4420
|
-
cidVersion:
|
|
4421
|
-
onProgress:
|
|
4478
|
+
cidVersion: options2.cidVersion,
|
|
4479
|
+
onProgress: options2.onProgress
|
|
4422
4480
|
};
|
|
4423
|
-
|
|
4481
|
+
options2.rawLeaves ? (opts.codec = raw_namespaceObject, opts.cidVersion = 1) : block = dag_pb_src_encode({
|
|
4424
4482
|
Data: (unixfs = new UnixFS({
|
|
4425
|
-
type:
|
|
4483
|
+
type: options2.leafType,
|
|
4426
4484
|
data: block
|
|
4427
4485
|
})).marshal(),
|
|
4428
4486
|
Links: []
|
|
4429
4487
|
});
|
|
4430
4488
|
let cid = await persist(block, blockstore, opts);
|
|
4431
|
-
return bytesWritten += BigInt(block.byteLength),
|
|
4489
|
+
return bytesWritten += BigInt(block.byteLength), options2.onProgress?.(new CustomProgressEvent('unixfs:importer:progress:file:write', {
|
|
4432
4490
|
bytesWritten,
|
|
4433
4491
|
cid,
|
|
4434
4492
|
path: file.path
|
|
@@ -4456,7 +4514,7 @@ async function* src_importer(source, blockstore, options = {}) {
|
|
|
4456
4514
|
mode: entry.mode,
|
|
4457
4515
|
content: async function*() {
|
|
4458
4516
|
let bytesRead = 0n;
|
|
4459
|
-
for await (let chunk of
|
|
4517
|
+
for await (let chunk of options3.chunker(options3.chunkValidator(function(content) {
|
|
4460
4518
|
try {
|
|
4461
4519
|
if (content instanceof Uint8Array) return async function*() {
|
|
4462
4520
|
yield content;
|
|
@@ -4469,7 +4527,7 @@ async function* src_importer(source, blockstore, options = {}) {
|
|
|
4469
4527
|
throw new InvalidContentError('Content was invalid');
|
|
4470
4528
|
}(entry.content)))){
|
|
4471
4529
|
let currentChunkSize = BigInt(chunk.byteLength);
|
|
4472
|
-
bytesRead += currentChunkSize,
|
|
4530
|
+
bytesRead += currentChunkSize, options3.onProgress?.(new CustomProgressEvent('unixfs:importer:progress:file:read', {
|
|
4473
4531
|
bytesRead,
|
|
4474
4532
|
chunkSize: currentChunkSize,
|
|
4475
4533
|
path: entry.path
|
|
@@ -4477,22 +4535,23 @@ async function* src_importer(source, blockstore, options = {}) {
|
|
|
4477
4535
|
}
|
|
4478
4536
|
}(),
|
|
4479
4537
|
originalPath
|
|
4480
|
-
}, fileBuilder =
|
|
4481
|
-
yield async ()=>fileBuilder(file, blockstore,
|
|
4538
|
+
}, fileBuilder = options3.fileBuilder ?? defaultFileBuilder;
|
|
4539
|
+
yield async ()=>fileBuilder(file, blockstore, options3);
|
|
4482
4540
|
} else if (null != entry.path) {
|
|
4483
4541
|
let dir = {
|
|
4484
4542
|
path: entry.path,
|
|
4485
4543
|
mtime: entry.mtime,
|
|
4486
4544
|
mode: entry.mode,
|
|
4487
4545
|
originalPath
|
|
4488
|
-
}, dirBuilder =
|
|
4489
|
-
yield async ()=>dirBuilder(dir, blockstore,
|
|
4546
|
+
}, dirBuilder = options3.dirBuilder ?? defaultDirBuilder;
|
|
4547
|
+
yield async ()=>dirBuilder(dir, blockstore, options3);
|
|
4490
4548
|
} else throw Error('Import candidate must have content or path or both');
|
|
4491
4549
|
}
|
|
4492
4550
|
});
|
|
4493
|
-
for await (let entry of (options.treeBuilder ?? (
|
|
4551
|
+
for await (let entry of (options.treeBuilder ?? (options4 = {
|
|
4494
4552
|
wrapWithDirectory,
|
|
4495
4553
|
shardSplitThresholdBytes,
|
|
4554
|
+
shardSplitStrategy,
|
|
4496
4555
|
shardFanoutBits,
|
|
4497
4556
|
cidVersion,
|
|
4498
4557
|
onProgress: options.onProgress
|
|
@@ -4503,13 +4562,13 @@ async function* src_importer(source, blockstore, options = {}) {
|
|
|
4503
4562
|
path: '',
|
|
4504
4563
|
dirty: !0,
|
|
4505
4564
|
flat: !0
|
|
4506
|
-
},
|
|
4565
|
+
}, options4), singleRoot = !1;
|
|
4507
4566
|
for await (let entry of source){
|
|
4508
4567
|
if (null == entry) continue;
|
|
4509
4568
|
let dir = `${entry.originalPath ?? ''}`.split('/')[0];
|
|
4510
|
-
null != dir && '' !== dir && (null == rootDir ? (rootDir = dir, singleRoot = !0) : rootDir !== dir && (singleRoot = !1)), tree = await addToTree(entry, tree,
|
|
4569
|
+
null != dir && '' !== dir && (null == rootDir ? (rootDir = dir, singleRoot = !0) : rootDir !== dir && (singleRoot = !1)), tree = await addToTree(entry, tree, options4), entry.unixfs?.isDirectory() !== !0 && (yield entry);
|
|
4511
4570
|
}
|
|
4512
|
-
if (
|
|
4571
|
+
if (options4.wrapWithDirectory || singleRoot && tree.childCount() > 1) yield* flushAndYield(tree, block);
|
|
4513
4572
|
else for (let unwrapped of tree.eachChildSeries())null != unwrapped && (yield* flushAndYield(unwrapped.child, block));
|
|
4514
4573
|
}))(parallelBatch(buildDag(candidates, blockstore), fileImportConcurrency), blockstore))yield {
|
|
4515
4574
|
cid: entry.cid,
|
|
@@ -4934,12 +4993,13 @@ function _writeString(buffer, str, offset, size) {
|
|
|
4934
4993
|
function _leftPad(input, targetLength) {
|
|
4935
4994
|
return String(input).padStart(targetLength, "0");
|
|
4936
4995
|
}
|
|
4937
|
-
import * as __rspack_external_node_crypto_9ba42079 from "node:crypto";
|
|
4938
|
-
import * as __rspack_external_crypto from "crypto";
|
|
4939
|
-
import * as __rspack_external_fs from "fs";
|
|
4940
4996
|
import { __webpack_require__ } from "./rslib-runtime.js";
|
|
4941
4997
|
import { parseArgs, styleText } from "node:util";
|
|
4998
|
+
import node_crypto, * as __rspack_external_node_crypto_9ba42079 from "node:crypto";
|
|
4999
|
+
import { createHash, createHmac, randomInt } from "node:crypto";
|
|
4942
5000
|
import { setTimeout as promises_setTimeout } from "node:timers/promises";
|
|
5001
|
+
import crypto_0, * as __rspack_external_crypto from "crypto";
|
|
5002
|
+
import fs_0, * as __rspack_external_fs from "fs";
|
|
4943
5003
|
import { promisify } from "util";
|
|
4944
5004
|
import { Buffer } from "node:buffer";
|
|
4945
5005
|
import { constants, createReadStream, createWriteStream } from "node:fs";
|
|
@@ -6278,9 +6338,9 @@ __webpack_require__.add({
|
|
|
6278
6338
|
base58btc: ()=>base58_base58btc,
|
|
6279
6339
|
base58flickr: ()=>base58flickr
|
|
6280
6340
|
}), base64_namespaceObject = {}, __webpack_require__.r(base64_namespaceObject), __webpack_require__.d(base64_namespaceObject, {
|
|
6281
|
-
base64: ()=>
|
|
6282
|
-
base64pad: ()=>
|
|
6283
|
-
base64url: ()=>
|
|
6341
|
+
base64: ()=>base64_base64,
|
|
6342
|
+
base64pad: ()=>base64_base64pad,
|
|
6343
|
+
base64url: ()=>base64_base64url,
|
|
6284
6344
|
base64urlpad: ()=>base64urlpad
|
|
6285
6345
|
}), base8_namespaceObject = {}, __webpack_require__.r(base8_namespaceObject), __webpack_require__.d(base8_namespaceObject, {
|
|
6286
6346
|
base8: ()=>base8
|
|
@@ -6600,6 +6660,29 @@ class InvalidLabelhashError extends Error {
|
|
|
6600
6660
|
super(`${labelhash}: ${details}`);
|
|
6601
6661
|
}
|
|
6602
6662
|
}
|
|
6663
|
+
let defaultSpinner = {
|
|
6664
|
+
interval: 120,
|
|
6665
|
+
frames: [
|
|
6666
|
+
'⠋',
|
|
6667
|
+
'⠙',
|
|
6668
|
+
'⠹',
|
|
6669
|
+
'⠸',
|
|
6670
|
+
'⠼',
|
|
6671
|
+
'⠴',
|
|
6672
|
+
'⠦',
|
|
6673
|
+
'⠧',
|
|
6674
|
+
'⠇',
|
|
6675
|
+
'⠏'
|
|
6676
|
+
]
|
|
6677
|
+
}, simpleSpinner = {
|
|
6678
|
+
interval: 120,
|
|
6679
|
+
frames: [
|
|
6680
|
+
'-',
|
|
6681
|
+
'\\',
|
|
6682
|
+
'|',
|
|
6683
|
+
'/'
|
|
6684
|
+
]
|
|
6685
|
+
};
|
|
6603
6686
|
class AsciiBar {
|
|
6604
6687
|
formatString = '#spinner #bar #message';
|
|
6605
6688
|
total = 100;
|
|
@@ -6622,10 +6705,7 @@ class AsciiBar {
|
|
|
6622
6705
|
currentSpinnerSymbol = '';
|
|
6623
6706
|
current = 0;
|
|
6624
6707
|
constructor(options){
|
|
6625
|
-
|
|
6626
|
-
for(let opt in options)void 0 !== this[opt] && (this[opt] = options[opt]);
|
|
6627
|
-
'win32' === process.platform && (this.spinner = simpleSpinner), this.enableSpinner && (this.spinnerTimeout = setTimeout(this.updateSpinner, this.spinner.interval));
|
|
6628
|
-
}
|
|
6708
|
+
options && (void 0 !== options.formatString && (this.formatString = options.formatString), void 0 !== options.total && (this.total = options.total), void 0 !== options.startDate && (this.startDate = options.startDate), void 0 !== options.stream && (this.stream = options.stream), void 0 !== options.width && (this.width = options.width), void 0 !== options.doneSymbol && (this.doneSymbol = options.doneSymbol), void 0 !== options.undoneSymbol && (this.undoneSymbol = options.undoneSymbol), void 0 !== options.print && (this.print = options.print), void 0 !== options.start && (this.current = options.start), void 0 !== options.enableSpinner && (this.enableSpinner = options.enableSpinner), void 0 !== options.lastUpdateForTiming && (this.lastUpdateForTiming = options.lastUpdateForTiming), void 0 !== options.autoStop && (this.autoStop = options.autoStop), void 0 !== options.hideCursor && (this.hideCursor = options.hideCursor), 'win32' === process.platform && (this.spinner = simpleSpinner), this.enableSpinner && (this.spinnerTimeout = setTimeout(this.updateSpinner, this.spinner.interval)));
|
|
6629
6709
|
}
|
|
6630
6710
|
renderLine() {
|
|
6631
6711
|
let plusCount = Math.round(this.current / this.total * this.width), minusCount = this.width - plusCount, plusString = '', minusString = '';
|
|
@@ -6663,35 +6743,10 @@ class AsciiBar {
|
|
|
6663
6743
|
}
|
|
6664
6744
|
let colorCodes = {
|
|
6665
6745
|
Reset: '\x1b[0m',
|
|
6666
|
-
|
|
6667
|
-
Blink: '\x1b[5m',
|
|
6668
|
-
Reverse: '\x1b[7m',
|
|
6669
|
-
Hidden: '\x1b[8m',
|
|
6746
|
+
Bright: '\x1b[1m',
|
|
6670
6747
|
Green: '\x1b[32m',
|
|
6671
6748
|
HideCursor: '\x1B[?25l',
|
|
6672
6749
|
ShowCursor: '\x1B[?25h'
|
|
6673
|
-
}, defaultSpinner = {
|
|
6674
|
-
interval: 120,
|
|
6675
|
-
frames: [
|
|
6676
|
-
'⠋',
|
|
6677
|
-
'⠙',
|
|
6678
|
-
'⠹',
|
|
6679
|
-
'⠸',
|
|
6680
|
-
'⠼',
|
|
6681
|
-
'⠴',
|
|
6682
|
-
'⠦',
|
|
6683
|
-
'⠧',
|
|
6684
|
-
'⠇',
|
|
6685
|
-
'⠏'
|
|
6686
|
-
]
|
|
6687
|
-
}, simpleSpinner = {
|
|
6688
|
-
interval: 120,
|
|
6689
|
-
frames: [
|
|
6690
|
-
'-',
|
|
6691
|
-
'\\',
|
|
6692
|
-
'|',
|
|
6693
|
-
'/'
|
|
6694
|
-
]
|
|
6695
6750
|
}, logger = {
|
|
6696
6751
|
start (...args) {
|
|
6697
6752
|
console.log('📦', ...args);
|
|
@@ -7522,8 +7577,8 @@ class HMAC extends utils_Hash {
|
|
|
7522
7577
|
this.destroyed = !0, this.oHash.destroy(), this.iHash.destroy();
|
|
7523
7578
|
}
|
|
7524
7579
|
}
|
|
7525
|
-
let
|
|
7526
|
-
|
|
7580
|
+
let hmac_hmac = (hash, key, message)=>new HMAC(hash, key).update(message).digest();
|
|
7581
|
+
hmac_hmac.create = (hash, key)=>new HMAC(hash, key);
|
|
7527
7582
|
let utils_0n = BigInt(0), utils_1n = BigInt(1), utils_hasHexBuiltin = 'function' == typeof Uint8Array.from([]).toHex && 'function' == typeof Uint8Array.fromHex, abstract_utils_hexes = Array.from({
|
|
7528
7583
|
length: 256
|
|
7529
7584
|
}, (_, i)=>i.toString(16).padStart(2, '0')), utils_asciis = {
|
|
@@ -8207,7 +8262,7 @@ let utils_0n = BigInt(0), utils_1n = BigInt(1), utils_hasHexBuiltin = 'function'
|
|
|
8207
8262
|
})({
|
|
8208
8263
|
...curveDef,
|
|
8209
8264
|
hash: hash,
|
|
8210
|
-
hmac: (key, ...msgs)=>
|
|
8265
|
+
hmac: (key, ...msgs)=>hmac_hmac(hash, key, function(...arrays) {
|
|
8211
8266
|
let sum = 0;
|
|
8212
8267
|
for(let i = 0; i < arrays.length; i++){
|
|
8213
8268
|
let a = arrays[i];
|
|
@@ -8375,7 +8430,7 @@ let aleph_te = new TextEncoder(), pinToAleph = async ({ cid, token, chain, verbo
|
|
|
8375
8430
|
return requestOptions = ((token, requestOptions)=>{
|
|
8376
8431
|
let [accessKeyId, secretAccessKey] = atob(token).split(':');
|
|
8377
8432
|
if (!accessKeyId || !secretAccessKey) throw Error('Missing access key ID and secret access key');
|
|
8378
|
-
let amzDate = new Date().toISOString().replace(/[:-]|\.\d{3}/g, '') + 'Z', dateStamp = amzDate.slice(0, 8), payloadHash =
|
|
8433
|
+
let amzDate = new Date().toISOString().replace(/[:-]|\.\d{3}/g, '') + 'Z', dateStamp = amzDate.slice(0, 8), payloadHash = createHash('sha256').update('').digest('hex'), canonicalHeaders = `content-length:${requestOptions.headers['Content-Length']}\nhost:${requestOptions.host}\nx-amz-content-sha256:${payloadHash}\nx-amz-date:${amzDate}\n`, signedHeaders = 'content-length;host;x-amz-content-sha256;x-amz-date', canonicalRequest = [
|
|
8379
8434
|
requestOptions.method,
|
|
8380
8435
|
requestOptions.path,
|
|
8381
8436
|
'',
|
|
@@ -8383,16 +8438,16 @@ let aleph_te = new TextEncoder(), pinToAleph = async ({ cid, token, chain, verbo
|
|
|
8383
8438
|
signedHeaders,
|
|
8384
8439
|
payloadHash
|
|
8385
8440
|
].join(`
|
|
8386
|
-
`), hashedCanonicalRequest =
|
|
8441
|
+
`), hashedCanonicalRequest = createHash('sha256').update(canonicalRequest).digest('hex'), credentialScope = `${dateStamp}/${requestOptions.region}/${requestOptions.service}/aws4_request`, stringToSign = [
|
|
8387
8442
|
'AWS4-HMAC-SHA256',
|
|
8388
8443
|
amzDate,
|
|
8389
8444
|
credentialScope,
|
|
8390
8445
|
hashedCanonicalRequest
|
|
8391
8446
|
].join(`
|
|
8392
|
-
`), kDate =
|
|
8447
|
+
`), kDate = createHmac('sha256', 'AWS4' + secretAccessKey).update(dateStamp).digest(), kRegion = createHmac('sha256', kDate).update(requestOptions.region).digest(), kService = createHmac('sha256', kRegion).update(requestOptions.service).digest(), kSigning = createHmac('sha256', kService).update('aws4_request').digest(), signature = createHmac('sha256', kSigning).update(stringToSign).digest('hex');
|
|
8393
8448
|
return requestOptions.headers['X-Amz-Content-Sha256'] = payloadHash, requestOptions.headers['X-Amz-Date'] = amzDate, requestOptions.headers.Authorization = `AWS4-HMAC-SHA256 Credential=${accessKeyId}/${credentialScope}, SignedHeaders=${signedHeaders}, Signature=${signature}`, requestOptions;
|
|
8394
8449
|
})(token, requestOptions), await fetch(`https://${requestOptions.host}/`, requestOptions).then((res)=>200 == res.status);
|
|
8395
|
-
}, utils_sign = (key, msg)=>new Uint8Array(
|
|
8450
|
+
}, utils_sign = (key, msg)=>new Uint8Array(createHmac('sha256', key).update(msg).digest());
|
|
8396
8451
|
class HttpRequest {
|
|
8397
8452
|
method;
|
|
8398
8453
|
protocol;
|
|
@@ -8466,9 +8521,9 @@ let createPresignedUrl = async ({ bucketName, apiUrl, file, token })=>{
|
|
|
8466
8521
|
'AWS4-HMAC-SHA256',
|
|
8467
8522
|
amzDate,
|
|
8468
8523
|
credentialScope,
|
|
8469
|
-
|
|
8524
|
+
createHash('sha256').update(canonicalRequest).digest('hex')
|
|
8470
8525
|
].join(`
|
|
8471
|
-
`),
|
|
8526
|
+
`), signature = createHmac('sha256', (kDate = utils_sign(`AWS4${secretAccessKey}`, dateStamp), kRegion = utils_sign(kDate, region), kService = utils_sign(kRegion, 's3'), utils_sign(kService, 'aws4_request'))).update(stringToSign).digest('hex');
|
|
8472
8527
|
return {
|
|
8473
8528
|
...request,
|
|
8474
8529
|
query: {
|
|
@@ -8520,6 +8575,7 @@ let createPresignedUrl = async ({ bucketName, apiUrl, file, token })=>{
|
|
|
8520
8575
|
verbose,
|
|
8521
8576
|
name,
|
|
8522
8577
|
car,
|
|
8578
|
+
size: car.size,
|
|
8523
8579
|
token
|
|
8524
8580
|
})).headers.get('x-amz-meta-cid'),
|
|
8525
8581
|
status: 'queued'
|
|
@@ -8589,7 +8645,7 @@ class digest_Digest {
|
|
|
8589
8645
|
}
|
|
8590
8646
|
let node_digest = (payload)=>{
|
|
8591
8647
|
let digest = new Uint8Array(digest_prefix.length + 32);
|
|
8592
|
-
return digest.set(digest_prefix, 0), digest.set(
|
|
8648
|
+
return digest.set(digest_prefix, 0), digest.set(node_crypto.createHash('sha256').update(payload).digest(), digest_prefix.length), new digest_Digest(digest);
|
|
8593
8649
|
}, sha256_code = 18, objectTypeNames = [
|
|
8594
8650
|
'Object',
|
|
8595
8651
|
'RegExp',
|
|
@@ -11275,7 +11331,7 @@ class TipAboveFeeCapError extends BaseError {
|
|
|
11275
11331
|
});
|
|
11276
11332
|
}
|
|
11277
11333
|
}
|
|
11278
|
-
let serializedType = '0x02', TxEnvelopeEip1559_type = 'eip1559', estimateGas = async ({ provider, to, data, from, value = '0x0' })=>toBigInt(await provider.request({
|
|
11334
|
+
let serializedType = '0x02', TxEnvelopeEip1559_type = 'eip1559', SIMULATION_GAS_LIMIT = fromNumber(16777216), estimateGas = async ({ provider, to, data, from, value = '0x0' })=>toBigInt(await provider.request({
|
|
11279
11335
|
method: 'eth_estimateGas',
|
|
11280
11336
|
params: [
|
|
11281
11337
|
{
|
|
@@ -11283,7 +11339,7 @@ let serializedType = '0x02', TxEnvelopeEip1559_type = 'eip1559', estimateGas = a
|
|
|
11283
11339
|
to,
|
|
11284
11340
|
data,
|
|
11285
11341
|
value,
|
|
11286
|
-
gas:
|
|
11342
|
+
gas: SIMULATION_GAS_LIMIT
|
|
11287
11343
|
},
|
|
11288
11344
|
'latest'
|
|
11289
11345
|
]
|
|
@@ -11294,23 +11350,12 @@ let serializedType = '0x02', TxEnvelopeEip1559_type = 'eip1559', estimateGas = a
|
|
|
11294
11350
|
to,
|
|
11295
11351
|
data,
|
|
11296
11352
|
from,
|
|
11297
|
-
gas:
|
|
11353
|
+
gas: SIMULATION_GAS_LIMIT
|
|
11298
11354
|
},
|
|
11299
11355
|
'latest'
|
|
11300
11356
|
]
|
|
11301
11357
|
}), sendTransaction = async ({ provider, chainId, privateKey, to, data, from })=>{
|
|
11302
|
-
let
|
|
11303
|
-
method: 'eth_feeHistory',
|
|
11304
|
-
params: [
|
|
11305
|
-
'0x5',
|
|
11306
|
-
'latest',
|
|
11307
|
-
[
|
|
11308
|
-
10,
|
|
11309
|
-
50,
|
|
11310
|
-
90
|
|
11311
|
-
]
|
|
11312
|
-
]
|
|
11313
|
-
}), estimatedGas = await estimateGas({
|
|
11358
|
+
let estimatedGas = await estimateGas({
|
|
11314
11359
|
provider,
|
|
11315
11360
|
from,
|
|
11316
11361
|
to,
|
|
@@ -11323,9 +11368,17 @@ let serializedType = '0x02', TxEnvelopeEip1559_type = 'eip1559', estimateGas = a
|
|
|
11323
11368
|
from,
|
|
11324
11369
|
'latest'
|
|
11325
11370
|
]
|
|
11326
|
-
})),
|
|
11327
|
-
|
|
11328
|
-
|
|
11371
|
+
})), block = await provider.request({
|
|
11372
|
+
method: 'eth_getBlockByNumber',
|
|
11373
|
+
params: [
|
|
11374
|
+
'latest',
|
|
11375
|
+
!1
|
|
11376
|
+
]
|
|
11377
|
+
});
|
|
11378
|
+
if (!block) throw Error('Failed to fetch latest block');
|
|
11379
|
+
let baseFeePerGas = toBigInt(block.baseFeePerGas || '0x0'), maxPriorityFeePerGas = toBigInt(await provider.request({
|
|
11380
|
+
method: 'eth_maxPriorityFeePerGas'
|
|
11381
|
+
})), envelope = function(envelope, options = {}) {
|
|
11329
11382
|
let { signature } = options, envelope_ = 'string' == typeof envelope ? function(serialized) {
|
|
11330
11383
|
var value;
|
|
11331
11384
|
let to_, transactionArray = (value = Hex_slice(serialized, 1), to_ = 'Hex', function decodeRlpCursor(cursor, to = 'Hex') {
|
|
@@ -11410,8 +11463,8 @@ let serializedType = '0x02', TxEnvelopeEip1559_type = 'eip1559', estimateGas = a
|
|
|
11410
11463
|
};
|
|
11411
11464
|
}({
|
|
11412
11465
|
chainId,
|
|
11413
|
-
maxFeePerGas: 2n * baseFeePerGas +
|
|
11414
|
-
maxPriorityFeePerGas
|
|
11466
|
+
maxFeePerGas: 2n * baseFeePerGas + maxPriorityFeePerGas,
|
|
11467
|
+
maxPriorityFeePerGas,
|
|
11415
11468
|
to,
|
|
11416
11469
|
data,
|
|
11417
11470
|
value: 0n,
|
|
@@ -11444,43 +11497,44 @@ let serializedType = '0x02', TxEnvelopeEip1559_type = 'eip1559', estimateGas = a
|
|
|
11444
11497
|
});
|
|
11445
11498
|
}, waitForTransaction = async (provider, hash)=>{
|
|
11446
11499
|
for(let attempt = 0; attempt < 10; attempt++){
|
|
11447
|
-
|
|
11448
|
-
|
|
11449
|
-
|
|
11450
|
-
|
|
11451
|
-
|
|
11452
|
-
|
|
11453
|
-
if (rawReceipt) {
|
|
11454
|
-
var receipt;
|
|
11455
|
-
if ('0x0' === rawReceipt.status) throw Error(`Transaction ${hash} reverted`);
|
|
11456
|
-
let chainId = await provider.request({
|
|
11457
|
-
method: 'eth_chainId'
|
|
11500
|
+
try {
|
|
11501
|
+
let rawReceipt = await provider.request({
|
|
11502
|
+
method: 'eth_getTransactionReceipt',
|
|
11503
|
+
params: [
|
|
11504
|
+
hash
|
|
11505
|
+
]
|
|
11458
11506
|
});
|
|
11459
|
-
|
|
11460
|
-
|
|
11461
|
-
|
|
11462
|
-
|
|
11463
|
-
|
|
11464
|
-
|
|
11465
|
-
|
|
11466
|
-
|
|
11467
|
-
|
|
11468
|
-
|
|
11469
|
-
|
|
11470
|
-
|
|
11471
|
-
|
|
11507
|
+
if (rawReceipt) {
|
|
11508
|
+
var receipt;
|
|
11509
|
+
if ('0x0' === rawReceipt.status) throw Error(`Transaction ${hash} reverted`);
|
|
11510
|
+
let chainId = await provider.request({
|
|
11511
|
+
method: 'eth_chainId'
|
|
11512
|
+
});
|
|
11513
|
+
return {
|
|
11514
|
+
...receipt = {
|
|
11515
|
+
...rawReceipt,
|
|
11516
|
+
chainId
|
|
11517
|
+
},
|
|
11518
|
+
blobGasPrice: receipt.blobGasPrice ? BigInt(receipt.blobGasPrice) : void 0,
|
|
11519
|
+
blobGasUsed: receipt.blobGasUsed ? BigInt(receipt.blobGasUsed) : void 0,
|
|
11520
|
+
blockNumber: BigInt(receipt.blockNumber ?? 0n),
|
|
11521
|
+
cumulativeGasUsed: BigInt(receipt.cumulativeGasUsed ?? 0n),
|
|
11522
|
+
effectiveGasPrice: BigInt(receipt.effectiveGasPrice ?? 0n),
|
|
11523
|
+
gasUsed: BigInt(receipt.gasUsed ?? 0n),
|
|
11524
|
+
logs: receipt.logs.map((log)=>({
|
|
11472
11525
|
...log,
|
|
11473
11526
|
blockNumber: log.blockNumber ? BigInt(log.blockNumber) : null,
|
|
11474
11527
|
logIndex: log.logIndex ? Number(log.logIndex) : null,
|
|
11475
11528
|
transactionIndex: log.transactionIndex ? Number(log.transactionIndex) : null
|
|
11476
|
-
}
|
|
11477
|
-
|
|
11478
|
-
|
|
11479
|
-
|
|
11480
|
-
|
|
11481
|
-
|
|
11482
|
-
|
|
11483
|
-
|
|
11529
|
+
})),
|
|
11530
|
+
status: fromRpcStatus[receipt.status],
|
|
11531
|
+
transactionIndex: Number(receipt.transactionIndex ?? 0),
|
|
11532
|
+
type: fromRpcType[receipt.type] || receipt.type
|
|
11533
|
+
};
|
|
11534
|
+
}
|
|
11535
|
+
} catch (error) {
|
|
11536
|
+
if (-32603 === error.code || error.message?.includes('receipt not found')) ;
|
|
11537
|
+
else throw error;
|
|
11484
11538
|
}
|
|
11485
11539
|
let delay = Math.min(1000 * 2 ** attempt, 30000);
|
|
11486
11540
|
await promises_setTimeout(delay);
|
|
@@ -11530,7 +11584,7 @@ let serializedType = '0x02', TxEnvelopeEip1559_type = 'eip1559', estimateGas = a
|
|
|
11530
11584
|
calls
|
|
11531
11585
|
]),
|
|
11532
11586
|
to: chain.contracts.multicall3.address,
|
|
11533
|
-
gas:
|
|
11587
|
+
gas: SIMULATION_GAS_LIMIT
|
|
11534
11588
|
},
|
|
11535
11589
|
'latest'
|
|
11536
11590
|
]
|
|
@@ -11735,7 +11789,7 @@ let serializedType = '0x02', TxEnvelopeEip1559_type = 'eip1559', estimateGas = a
|
|
|
11735
11789
|
chain
|
|
11736
11790
|
});
|
|
11737
11791
|
if (balance < amount) throw Error(`Not enough USDfc to deposit (need: ${Value_format(amount - balance, 18).slice(0, 5)})`);
|
|
11738
|
-
let { r, s } = await signErc20Permit({
|
|
11792
|
+
let { r, s, yParity } = await signErc20Permit({
|
|
11739
11793
|
privateKey,
|
|
11740
11794
|
address,
|
|
11741
11795
|
amount,
|
|
@@ -11749,7 +11803,7 @@ let serializedType = '0x02', TxEnvelopeEip1559_type = 'eip1559', estimateGas = a
|
|
|
11749
11803
|
address,
|
|
11750
11804
|
amount,
|
|
11751
11805
|
deadline,
|
|
11752
|
-
27,
|
|
11806
|
+
void 0 !== yParity ? yParityToV(yParity) : 27,
|
|
11753
11807
|
fromNumber(r, {
|
|
11754
11808
|
size: 32
|
|
11755
11809
|
}),
|
|
@@ -11842,7 +11896,7 @@ let serializedType = '0x02', TxEnvelopeEip1559_type = 'eip1559', estimateGas = a
|
|
|
11842
11896
|
key: 'withIPFSIndexing',
|
|
11843
11897
|
value: ''
|
|
11844
11898
|
}
|
|
11845
|
-
], createDataSet_keys = metadata.map((item)=>item.key), createDataSet_values = metadata.map((item)=>item.value), priceBuffer = function(
|
|
11899
|
+
], createDataSet_keys = metadata.map((item)=>item.key), createDataSet_values = metadata.map((item)=>item.value), priceBuffer = function(decimals = 0) {
|
|
11846
11900
|
if (!/^(-?)([0-9]*)\.?([0-9]*)$/.test('0.5')) throw new InvalidDecimalNumberError({
|
|
11847
11901
|
value: '0.5'
|
|
11848
11902
|
});
|
|
@@ -11857,7 +11911,7 @@ let serializedType = '0x02', TxEnvelopeEip1559_type = 'eip1559', estimateGas = a
|
|
|
11857
11911
|
(fraction = rounded > 9 ? `${BigInt(left) + BigInt(1)}0`.padStart(left.length + 1, '0') : `${left}${rounded}`).length > decimals && (fraction = fraction.slice(1), integer = `${BigInt(integer) + 1n}`), fraction = fraction.slice(0, decimals);
|
|
11858
11912
|
} else fraction = fraction.padEnd(decimals, '0');
|
|
11859
11913
|
return BigInt(`${negative ? '-' : ''}${integer}${fraction}`);
|
|
11860
|
-
}(
|
|
11914
|
+
}(18), createDataSet = async ({ providerURL, privateKey, payee, address: payer, verbose, chain, perMonth })=>{
|
|
11861
11915
|
let provider = filProvider[chain.id], [funds] = await getAccountInfo({
|
|
11862
11916
|
address: payer,
|
|
11863
11917
|
chain
|
|
@@ -11873,7 +11927,7 @@ let serializedType = '0x02', TxEnvelopeEip1559_type = 'eip1559', estimateGas = a
|
|
|
11873
11927
|
});
|
|
11874
11928
|
logger.info(`Transaction pending: ${chain.blockExplorer}/tx/${hash}`), await waitForTransaction(provider, hash), logger.success('Transaction succeeded');
|
|
11875
11929
|
}
|
|
11876
|
-
let clientDataSetId = BigInt(
|
|
11930
|
+
let clientDataSetId = BigInt(randomInt(100000000));
|
|
11877
11931
|
logger.info(`Client data set ID: ${clientDataSetId}`);
|
|
11878
11932
|
let recordKeeper = chain.contracts.storage.address;
|
|
11879
11933
|
logger.info(`Record keeper address: ${recordKeeper}`);
|
|
@@ -12739,7 +12793,7 @@ let serializedType = '0x02', TxEnvelopeEip1559_type = 'eip1559', estimateGas = a
|
|
|
12739
12793
|
verbose,
|
|
12740
12794
|
datasetId,
|
|
12741
12795
|
privateKey,
|
|
12742
|
-
nonce: BigInt(
|
|
12796
|
+
nonce: BigInt(randomInt(100000000)),
|
|
12743
12797
|
clientDataSetId,
|
|
12744
12798
|
chain
|
|
12745
12799
|
});
|
|
@@ -12759,7 +12813,7 @@ let serializedType = '0x02', TxEnvelopeEip1559_type = 'eip1559', estimateGas = a
|
|
|
12759
12813
|
});
|
|
12760
12814
|
verbose && logger.request('POST', res.url, res.status);
|
|
12761
12815
|
let json = await res.json();
|
|
12762
|
-
if (!res.ok) throw new DeployError(lighthouse_providerName, json.error?.message || json.message || 'Unknown error');
|
|
12816
|
+
if (!res.ok) throw new DeployError(lighthouse_providerName, json.error?.message || json.error || json.message || json.details || 'Unknown error');
|
|
12763
12817
|
return {
|
|
12764
12818
|
cid: json.data?.Hash || cid
|
|
12765
12819
|
};
|
|
@@ -12776,7 +12830,7 @@ let serializedType = '0x02', TxEnvelopeEip1559_type = 'eip1559', estimateGas = a
|
|
|
12776
12830
|
});
|
|
12777
12831
|
verbose && logger.request('POST', res.url, res.status);
|
|
12778
12832
|
let json = await res.json();
|
|
12779
|
-
if (!res.ok) throw new DeployError(lighthouse_providerName, json.error.message);
|
|
12833
|
+
if (!res.ok) throw new DeployError(lighthouse_providerName, json.error?.message || json.error || json.message || json.details || 'Unknown error');
|
|
12780
12834
|
return {
|
|
12781
12835
|
cid,
|
|
12782
12836
|
status: 'queued'
|
|
@@ -13199,17 +13253,17 @@ class DIDKey extends did_DID {
|
|
|
13199
13253
|
return `did:key:${base58_base58btc.encode(this)}`;
|
|
13200
13254
|
}
|
|
13201
13255
|
}
|
|
13202
|
-
let
|
|
13256
|
+
let base64_base64 = rfc4648({
|
|
13203
13257
|
prefix: 'm',
|
|
13204
13258
|
name: 'base64',
|
|
13205
13259
|
alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',
|
|
13206
13260
|
bitsPerChar: 6
|
|
13207
|
-
}),
|
|
13261
|
+
}), base64_base64pad = rfc4648({
|
|
13208
13262
|
prefix: 'M',
|
|
13209
13263
|
name: 'base64pad',
|
|
13210
13264
|
alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=',
|
|
13211
13265
|
bitsPerChar: 6
|
|
13212
|
-
}),
|
|
13266
|
+
}), base64_base64url = rfc4648({
|
|
13213
13267
|
prefix: 'u',
|
|
13214
13268
|
name: 'base64url',
|
|
13215
13269
|
alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_',
|
|
@@ -13321,7 +13375,7 @@ let signature_algorithm = (signature)=>{
|
|
|
13321
13375
|
return signature_view(bytes);
|
|
13322
13376
|
}, signature_toJSON = (signature)=>({
|
|
13323
13377
|
"/": {
|
|
13324
|
-
bytes:
|
|
13378
|
+
bytes: base64_base64.baseEncode(signature)
|
|
13325
13379
|
}
|
|
13326
13380
|
}), withDID = (key, id)=>new VerifierWithDID(id, key);
|
|
13327
13381
|
class VerifierWithDID {
|
|
@@ -13427,7 +13481,7 @@ let PRIVATE_TAG_SIZE = encodingLength(0x1300), signer_SIZE = PRIVATE_TAG_SIZE +
|
|
|
13427
13481
|
if (0xed !== code) throw Error("Given bytes must contain public key in multiformats with 237 tag");
|
|
13428
13482
|
}
|
|
13429
13483
|
return new Ed25519Signer(bytes);
|
|
13430
|
-
}, signer_parse = (principal, decoder)=>signer_decode((decoder ||
|
|
13484
|
+
}, signer_parse = (principal, decoder)=>signer_decode((decoder || base64_base64pad).decode(principal));
|
|
13431
13485
|
class Ed25519Signer extends Uint8Array {
|
|
13432
13486
|
get code() {
|
|
13433
13487
|
return 0x1300;
|
|
@@ -13954,7 +14008,7 @@ class DagJsonTokenizer extends Tokenizer {
|
|
|
13954
14008
|
let breakToken = this._next();
|
|
13955
14009
|
if (!Type.equals(breakToken.type, Type.break)) throw Error('Invalid encoded Bytes form');
|
|
13956
14010
|
}
|
|
13957
|
-
let bytes =
|
|
14011
|
+
let bytes = base64_base64.decode(`m${innerValueToken.value}`);
|
|
13958
14012
|
return new Token(Type.bytes, bytes, innerValueToken.value.length);
|
|
13959
14013
|
}
|
|
13960
14014
|
this.tokenBuffer.push(innerValueToken);
|
|
@@ -13993,7 +14047,7 @@ let dag_json_src_encode = (node)=>{
|
|
|
13993
14047
|
}, options), decode_decode(buf, options);
|
|
13994
14048
|
};
|
|
13995
14049
|
new TextDecoder(), new TextEncoder();
|
|
13996
|
-
let formatHeader = (version, alg)=>
|
|
14050
|
+
let formatHeader = (version, alg)=>base64_base64url.baseEncode(encodeHeader(version, alg)), formatPayload = (data)=>base64_base64url.baseEncode(encodePayload(data)), encodeHeader = (v, alg)=>dag_json_src_encode({
|
|
13997
14051
|
alg,
|
|
13998
14052
|
ucv: v,
|
|
13999
14053
|
typ: "JWT"
|
|
@@ -14137,7 +14191,7 @@ class CBORView extends View {
|
|
|
14137
14191
|
format() {
|
|
14138
14192
|
var model;
|
|
14139
14193
|
let header, payload, signature, signature1;
|
|
14140
|
-
return header = formatHeader((model = this.model).v, model.s.algorithm), payload = formatPayload(model), signature1 = model.s, signature =
|
|
14194
|
+
return header = formatHeader((model = this.model).v, model.s.algorithm), payload = formatPayload(model), signature1 = model.s, signature = base64_base64url.baseEncode(signature1.raw), `${header}.${payload}.${signature}`;
|
|
14141
14195
|
}
|
|
14142
14196
|
encode() {
|
|
14143
14197
|
return codec_cbor_encode(this.model);
|
|
@@ -14161,11 +14215,11 @@ class JWTView extends View {
|
|
|
14161
14215
|
let hashes_sha2_sha256 = hasher_from({
|
|
14162
14216
|
name: 'sha2-256',
|
|
14163
14217
|
code: 0x12,
|
|
14164
|
-
encode: (input)=>coerce(
|
|
14218
|
+
encode: (input)=>coerce(crypto_0.createHash('sha256').update(input).digest())
|
|
14165
14219
|
}), sha2_sha512 = hasher_from({
|
|
14166
14220
|
name: 'sha2-512',
|
|
14167
14221
|
code: 0x13,
|
|
14168
|
-
encode: (input)=>coerce(
|
|
14222
|
+
encode: (input)=>coerce(crypto_0.createHash('sha512').update(input).digest())
|
|
14169
14223
|
}), defaultHasher = hashes_sha2_sha256, write = async (ucan, { hasher = defaultHasher } = {})=>{
|
|
14170
14224
|
let [code, bytes] = ucan.jwt ? [
|
|
14171
14225
|
raw_code,
|
|
@@ -14484,7 +14538,7 @@ class CarBufferReader {
|
|
|
14484
14538
|
return new CarBufferReader(header, blocks);
|
|
14485
14539
|
}
|
|
14486
14540
|
}
|
|
14487
|
-
let fsread =
|
|
14541
|
+
let fsread = fs_0.readSync;
|
|
14488
14542
|
class buffer_reader_CarBufferReader extends CarBufferReader {
|
|
14489
14543
|
static readRaw(fd, blockIndex) {
|
|
14490
14544
|
let read, { cid, blockLength, blockOffset } = blockIndex, bytes = new Uint8Array(blockLength);
|
|
@@ -15595,7 +15649,7 @@ let delegation_archive = async (delegation)=>{
|
|
|
15595
15649
|
...((jwt)=>{
|
|
15596
15650
|
var raw;
|
|
15597
15651
|
let source, code, segments = jwt.split("."), [header, payload, signature] = 3 === segments.length ? segments : schema_fail(`Can't parse UCAN: ${jwt}: Expected JWT format: 3 dot-separated base64url-encoded values.`), { ucv, alg } = ((header)=>{
|
|
15598
|
-
let { ucv, alg, typ } = dag_json_src_decode(
|
|
15652
|
+
let { ucv, alg, typ } = dag_json_src_decode(base64_base64url.baseDecode(header));
|
|
15599
15653
|
return {
|
|
15600
15654
|
typ: "JWT" === typ ? "JWT" : schema_ParseError.throw(`Expected typ to be a ${JSON.stringify("JWT")} instead got ${JSON.stringify(typ)}`),
|
|
15601
15655
|
ucv: readVersion(ucv, "ucv"),
|
|
@@ -15603,12 +15657,12 @@ let delegation_archive = async (delegation)=>{
|
|
|
15603
15657
|
};
|
|
15604
15658
|
})(header);
|
|
15605
15659
|
return {
|
|
15606
|
-
...(source = payload, readPayloadWith(dag_json_src_decode(
|
|
15660
|
+
...(source = payload, readPayloadWith(dag_json_src_decode(base64_base64url.baseDecode(source)), {
|
|
15607
15661
|
readPrincipal: readStringPrincipal,
|
|
15608
15662
|
readProof: readStringProof
|
|
15609
15663
|
})),
|
|
15610
15664
|
v: ucv,
|
|
15611
|
-
s: (raw =
|
|
15665
|
+
s: (raw = base64_base64url.baseDecode(signature), 0xd000 === (code = ((name)=>{
|
|
15612
15666
|
switch(name){
|
|
15613
15667
|
case "ES256K":
|
|
15614
15668
|
return 0xd0e7;
|
|
@@ -16225,7 +16279,7 @@ class Agent {
|
|
|
16225
16279
|
}
|
|
16226
16280
|
}
|
|
16227
16281
|
let proof_parse = async (str)=>{
|
|
16228
|
-
let cid = link_parse(str,
|
|
16282
|
+
let cid = link_parse(str, base64_base64);
|
|
16229
16283
|
if (cid.code !== car_code) throw Error(`non CAR codec found: 0x${cid.code.toString(16)}`);
|
|
16230
16284
|
let { ok, error } = await delegation_extract(cid.multihash.digest);
|
|
16231
16285
|
if (error) throw Error('failed to extract delegation', {
|
|
@@ -16238,9 +16292,6 @@ class SharedSpace {
|
|
|
16238
16292
|
constructor(model){
|
|
16239
16293
|
this.model = model;
|
|
16240
16294
|
}
|
|
16241
|
-
get meta() {
|
|
16242
|
-
return this.model.meta;
|
|
16243
|
-
}
|
|
16244
16295
|
did() {
|
|
16245
16296
|
return this.model.id;
|
|
16246
16297
|
}
|
|
@@ -16252,14 +16303,12 @@ let fromDelegation = ({ facts, capabilities })=>{
|
|
|
16252
16303
|
if (result.error) throw Error(`Invalid delegation, expected capabilities[0].with to be DID, ${result.error}`, {
|
|
16253
16304
|
cause: result.error
|
|
16254
16305
|
});
|
|
16255
|
-
let meta = facts[0]?.space ?? {};
|
|
16256
16306
|
return new SharedSpace({
|
|
16257
16307
|
id: result.ok,
|
|
16258
16308
|
delegation: {
|
|
16259
16309
|
facts,
|
|
16260
16310
|
capabilities
|
|
16261
|
-
}
|
|
16262
|
-
meta
|
|
16311
|
+
}
|
|
16263
16312
|
});
|
|
16264
16313
|
};
|
|
16265
16314
|
class Piece {
|
|
@@ -17210,26 +17259,7 @@ capability_capability({
|
|
|
17210
17259
|
}),
|
|
17211
17260
|
derives: (claim, from)=>utils_and(equalWith(claim, from)) ?? checkLink(claim.nb.proof, from.nb.proof, 'nb.proof')
|
|
17212
17261
|
});
|
|
17213
|
-
|
|
17214
|
-
name = 'ReceiptNotFound';
|
|
17215
|
-
taskCid;
|
|
17216
|
-
constructor(taskCid){
|
|
17217
|
-
super(), this.taskCid = taskCid;
|
|
17218
|
-
}
|
|
17219
|
-
get reason() {
|
|
17220
|
-
return `receipt not found for task ${this.taskCid} in the indexed workflow`;
|
|
17221
|
-
}
|
|
17222
|
-
}
|
|
17223
|
-
class ReceiptMissing extends Error {
|
|
17224
|
-
name = 'ReceiptMissing';
|
|
17225
|
-
taskCid;
|
|
17226
|
-
constructor(taskCid){
|
|
17227
|
-
super(), this.taskCid = taskCid;
|
|
17228
|
-
}
|
|
17229
|
-
get reason() {
|
|
17230
|
-
return `receipt missing for task ${this.taskCid}`;
|
|
17231
|
-
}
|
|
17232
|
-
}
|
|
17262
|
+
let WAIT_MS = 3000;
|
|
17233
17263
|
blob_add.can;
|
|
17234
17264
|
let blob_add_input = (digest, size)=>({
|
|
17235
17265
|
blob: {
|
|
@@ -17237,7 +17267,6 @@ let blob_add_input = (digest, size)=>({
|
|
|
17237
17267
|
size
|
|
17238
17268
|
}
|
|
17239
17269
|
}), CAR_V1_VERSION = 1;
|
|
17240
|
-
__rspack_external_fs.default;
|
|
17241
17270
|
class CarWriter {
|
|
17242
17271
|
constructor(roots, encoder){
|
|
17243
17272
|
this._encoder = encoder, this._mutex = encoder.setRoots(roots), this._ended = !1;
|
|
@@ -17325,7 +17354,7 @@ class writer_CarWriter extends CarWriter {
|
|
|
17325
17354
|
let bytes, readChunk, offset = 0;
|
|
17326
17355
|
if ('number' == typeof fd) readChunk = async ()=>{
|
|
17327
17356
|
var buffer, position;
|
|
17328
|
-
return (await (buffer = bytes, position = offset, !_fsReadFn && (_fsReadFn = promisify(
|
|
17357
|
+
return (await (buffer = bytes, position = offset, !_fsReadFn && (_fsReadFn = promisify(fs_0.read)), _fsReadFn(fd, buffer, 0, 256, position))).bytesRead;
|
|
17329
17358
|
};
|
|
17330
17359
|
else if ('object' == typeof fd && 'function' == typeof fd.read) readChunk = async ()=>(await fd.read(bytes, 0, 256, offset)).bytesRead;
|
|
17331
17360
|
else throw TypeError('Bad fd');
|
|
@@ -17339,7 +17368,7 @@ class writer_CarWriter extends CarWriter {
|
|
|
17339
17368
|
if (fdReader.pos !== newHeader.length) throw Error(`updateRoots() can only overwrite a header of the same length (old header is ${fdReader.pos} bytes, new header is ${newHeader.length} bytes)`);
|
|
17340
17369
|
if ('number' == typeof fd) {
|
|
17341
17370
|
var length;
|
|
17342
|
-
await (length = newHeader.length, !_fsWriteFn && (_fsWriteFn = promisify(
|
|
17371
|
+
await (length = newHeader.length, !_fsWriteFn && (_fsWriteFn = promisify(fs_0.write)), _fsWriteFn(fd, newHeader, 0, length, 0));
|
|
17343
17372
|
} else 'object' == typeof fd && 'function' == typeof fd.read && await fd.write(newHeader, 0, newHeader.length, 0);
|
|
17344
17373
|
}
|
|
17345
17374
|
}
|
|
@@ -17528,18 +17557,12 @@ let filecoin_offer_filecoinOffer = async (conf, piece, content)=>filecoinOffer.i
|
|
|
17528
17557
|
});
|
|
17529
17558
|
}
|
|
17530
17559
|
};
|
|
17531
|
-
_computedKey = Symbol.
|
|
17560
|
+
_computedKey = Symbol.iterator;
|
|
17532
17561
|
class DigestMap {
|
|
17533
17562
|
#data;
|
|
17534
17563
|
constructor(entries){
|
|
17535
17564
|
for (let [k, v] of (this.#data = new Map(), entries ?? []))this.set(k, v);
|
|
17536
17565
|
}
|
|
17537
|
-
get [_computedKey]() {
|
|
17538
|
-
return 'DigestMap';
|
|
17539
|
-
}
|
|
17540
|
-
clear() {
|
|
17541
|
-
this.#data.clear();
|
|
17542
|
-
}
|
|
17543
17566
|
get(key) {
|
|
17544
17567
|
let data = this.#data.get(toBase58String(key));
|
|
17545
17568
|
if (data) return data[1];
|
|
@@ -17550,7 +17573,7 @@ class DigestMap {
|
|
|
17550
17573
|
value
|
|
17551
17574
|
]), this;
|
|
17552
17575
|
}
|
|
17553
|
-
[
|
|
17576
|
+
[_computedKey]() {
|
|
17554
17577
|
return this.entries();
|
|
17555
17578
|
}
|
|
17556
17579
|
*entries() {
|
|
@@ -18388,14 +18411,17 @@ let fixedSize = (options = {})=>{
|
|
|
18388
18411
|
let chunkSize = options.chunkSize ?? 262144;
|
|
18389
18412
|
return async function*(source) {
|
|
18390
18413
|
let list = new Uint8ArrayList(), currentLength = 0, emitted = !1;
|
|
18391
|
-
for await (let buffer of source)for(list.append(buffer), currentLength += buffer.length; currentLength >= chunkSize;)
|
|
18392
|
-
|
|
18393
|
-
|
|
18394
|
-
|
|
18414
|
+
for await (let buffer of source)for(list.append(buffer), currentLength += buffer.length; currentLength >= chunkSize;){
|
|
18415
|
+
let buf = list.subarray(0, chunkSize);
|
|
18416
|
+
if (yield buf, emitted = !0, chunkSize === list.length) list = new Uint8ArrayList(), currentLength = 0;
|
|
18417
|
+
else {
|
|
18418
|
+
let newBl = new Uint8ArrayList();
|
|
18419
|
+
newBl.append(list.sublist(chunkSize)), list = newBl, currentLength -= chunkSize;
|
|
18420
|
+
}
|
|
18395
18421
|
}
|
|
18396
18422
|
(!emitted || currentLength > 0) && (yield list.subarray(0, currentLength));
|
|
18397
18423
|
};
|
|
18398
|
-
}, pb_decode_textDecoder = new TextDecoder(), pb_encode_textEncoder = new TextEncoder(), pb_encode_maxInt32 = 4294967296, maxUInt32 = 2147483648, len8tab = [
|
|
18424
|
+
}, DEFAULT_SHARD_HASH_CODE = BigInt(0x22), DEFAULT_SHARD_SPLIT_STRATEGY = 'links-bytes', DEFAULT_CHUNK_SIZE_1MIB = 1048576, pb_decode_textDecoder = new TextDecoder(), pb_encode_textEncoder = new TextEncoder(), pb_encode_maxInt32 = 4294967296, maxUInt32 = 2147483648, len8tab = [
|
|
18399
18425
|
0,
|
|
18400
18426
|
1,
|
|
18401
18427
|
2,
|
|
@@ -19339,7 +19365,7 @@ class CustomProgressEvent extends Event {
|
|
|
19339
19365
|
}
|
|
19340
19366
|
let persist = async (buffer, blockstore, options)=>{
|
|
19341
19367
|
null == options.codec && (options.codec = dag_pb_src_namespaceObject);
|
|
19342
|
-
let multihash = await hashes_sha2_sha256.digest(buffer), cid = cid_CID.create(options.cidVersion, options.codec.code, multihash);
|
|
19368
|
+
let multihash = await hashes_sha2_sha256.digest(buffer), cid = cid_CID.create(options.cidVersion ?? 1, options.codec.code, multihash);
|
|
19343
19369
|
return await blockstore.put(cid, buffer, options), cid;
|
|
19344
19370
|
};
|
|
19345
19371
|
class errors_InvalidParametersError extends Error {
|
|
@@ -19387,6 +19413,12 @@ class InvalidContentError extends Error {
|
|
|
19387
19413
|
super(message);
|
|
19388
19414
|
}
|
|
19389
19415
|
}
|
|
19416
|
+
class InvalidShardingStrategyError extends Error {
|
|
19417
|
+
static name = 'InvalidShardingStrategyError';
|
|
19418
|
+
static code = 'ERR_SHARDING_STRATEGY';
|
|
19419
|
+
name = InvalidContentError.name;
|
|
19420
|
+
code = InvalidContentError.code;
|
|
19421
|
+
}
|
|
19390
19422
|
let defaultDirBuilder = async (dir, blockstore, options)=>{
|
|
19391
19423
|
let unixfs = new UnixFS({
|
|
19392
19424
|
type: 'directory',
|
|
@@ -19419,13 +19451,13 @@ let defaultDirBuilder = async (dir, blockstore, options)=>{
|
|
|
19419
19451
|
cidVersion: options.cidVersion
|
|
19420
19452
|
}), leaf.size = BigInt(leaf.block.length)), options.onProgress?.(new CustomProgressEvent('unixfs:importer:progress:file:layout', {
|
|
19421
19453
|
cid: leaf.cid,
|
|
19422
|
-
path:
|
|
19454
|
+
path: file.originalPath
|
|
19423
19455
|
})), {
|
|
19424
19456
|
cid: leaf.cid,
|
|
19425
19457
|
path: file.path,
|
|
19426
19458
|
unixfs: leaf.unixfs,
|
|
19427
19459
|
size: leaf.size,
|
|
19428
|
-
originalPath:
|
|
19460
|
+
originalPath: file.originalPath
|
|
19429
19461
|
};
|
|
19430
19462
|
}
|
|
19431
19463
|
let f = new UnixFS({
|
|
@@ -19479,133 +19511,544 @@ class Dir {
|
|
|
19479
19511
|
this.options = options ?? {}, this.root = props.root, this.dir = props.dir, this.path = props.path, this.dirty = props.dirty, this.flat = props.flat, this.parent = props.parent, this.parentKey = props.parentKey, this.unixfs = props.unixfs, this.mode = props.mode, this.mtime = props.mtime;
|
|
19480
19512
|
}
|
|
19481
19513
|
}
|
|
19482
|
-
let
|
|
19483
|
-
|
|
19484
|
-
|
|
19485
|
-
|
|
19486
|
-
|
|
19487
|
-
|
|
19488
|
-
|
|
19489
|
-
|
|
19490
|
-
|
|
19491
|
-
|
|
19492
|
-
|
|
19493
|
-
|
|
19494
|
-
|
|
19495
|
-
|
|
19496
|
-
|
|
19497
|
-
|
|
19498
|
-
|
|
19499
|
-
|
|
19500
|
-
|
|
19501
|
-
|
|
19502
|
-
|
|
19503
|
-
|
|
19504
|
-
|
|
19505
|
-
|
|
19506
|
-
|
|
19507
|
-
|
|
19508
|
-
|
|
19509
|
-
|
|
19510
|
-
|
|
19511
|
-
|
|
19512
|
-
|
|
19513
|
-
|
|
19514
|
-
|
|
19515
|
-
|
|
19516
|
-
|
|
19517
|
-
|
|
19518
|
-
|
|
19519
|
-
|
|
19520
|
-
|
|
19521
|
-
|
|
19522
|
-
|
|
19523
|
-
|
|
19524
|
-
|
|
19525
|
-
|
|
19526
|
-
|
|
19527
|
-
|
|
19528
|
-
|
|
19529
|
-
|
|
19530
|
-
|
|
19531
|
-
|
|
19532
|
-
|
|
19533
|
-
|
|
19534
|
-
|
|
19535
|
-
|
|
19536
|
-
|
|
19537
|
-
|
|
19538
|
-
|
|
19539
|
-
|
|
19540
|
-
|
|
19541
|
-
|
|
19542
|
-
|
|
19543
|
-
|
|
19544
|
-
|
|
19545
|
-
|
|
19546
|
-
|
|
19547
|
-
|
|
19548
|
-
|
|
19549
|
-
|
|
19550
|
-
|
|
19551
|
-
|
|
19552
|
-
|
|
19553
|
-
|
|
19554
|
-
|
|
19555
|
-
|
|
19556
|
-
|
|
19557
|
-
|
|
19558
|
-
|
|
19559
|
-
|
|
19560
|
-
|
|
19561
|
-
|
|
19562
|
-
|
|
19563
|
-
|
|
19564
|
-
|
|
19565
|
-
|
|
19566
|
-
|
|
19567
|
-
|
|
19568
|
-
|
|
19569
|
-
|
|
19570
|
-
|
|
19571
|
-
|
|
19572
|
-
|
|
19573
|
-
|
|
19574
|
-
|
|
19575
|
-
|
|
19576
|
-
|
|
19577
|
-
|
|
19578
|
-
|
|
19579
|
-
|
|
19580
|
-
|
|
19581
|
-
|
|
19582
|
-
|
|
19583
|
-
|
|
19584
|
-
|
|
19585
|
-
|
|
19586
|
-
|
|
19587
|
-
|
|
19588
|
-
|
|
19589
|
-
|
|
19590
|
-
|
|
19591
|
-
|
|
19592
|
-
|
|
19593
|
-
|
|
19594
|
-
|
|
19595
|
-
|
|
19596
|
-
|
|
19597
|
-
|
|
19598
|
-
|
|
19599
|
-
|
|
19600
|
-
|
|
19601
|
-
|
|
19602
|
-
|
|
19603
|
-
|
|
19604
|
-
|
|
19605
|
-
|
|
19606
|
-
|
|
19607
|
-
|
|
19608
|
-
|
|
19514
|
+
let pb_size_maxInt32 = 4294967296, pb_size_len8tab = [
|
|
19515
|
+
0,
|
|
19516
|
+
1,
|
|
19517
|
+
2,
|
|
19518
|
+
2,
|
|
19519
|
+
3,
|
|
19520
|
+
3,
|
|
19521
|
+
3,
|
|
19522
|
+
3,
|
|
19523
|
+
4,
|
|
19524
|
+
4,
|
|
19525
|
+
4,
|
|
19526
|
+
4,
|
|
19527
|
+
4,
|
|
19528
|
+
4,
|
|
19529
|
+
4,
|
|
19530
|
+
4,
|
|
19531
|
+
5,
|
|
19532
|
+
5,
|
|
19533
|
+
5,
|
|
19534
|
+
5,
|
|
19535
|
+
5,
|
|
19536
|
+
5,
|
|
19537
|
+
5,
|
|
19538
|
+
5,
|
|
19539
|
+
5,
|
|
19540
|
+
5,
|
|
19541
|
+
5,
|
|
19542
|
+
5,
|
|
19543
|
+
5,
|
|
19544
|
+
5,
|
|
19545
|
+
5,
|
|
19546
|
+
5,
|
|
19547
|
+
6,
|
|
19548
|
+
6,
|
|
19549
|
+
6,
|
|
19550
|
+
6,
|
|
19551
|
+
6,
|
|
19552
|
+
6,
|
|
19553
|
+
6,
|
|
19554
|
+
6,
|
|
19555
|
+
6,
|
|
19556
|
+
6,
|
|
19557
|
+
6,
|
|
19558
|
+
6,
|
|
19559
|
+
6,
|
|
19560
|
+
6,
|
|
19561
|
+
6,
|
|
19562
|
+
6,
|
|
19563
|
+
6,
|
|
19564
|
+
6,
|
|
19565
|
+
6,
|
|
19566
|
+
6,
|
|
19567
|
+
6,
|
|
19568
|
+
6,
|
|
19569
|
+
6,
|
|
19570
|
+
6,
|
|
19571
|
+
6,
|
|
19572
|
+
6,
|
|
19573
|
+
6,
|
|
19574
|
+
6,
|
|
19575
|
+
6,
|
|
19576
|
+
6,
|
|
19577
|
+
6,
|
|
19578
|
+
6,
|
|
19579
|
+
7,
|
|
19580
|
+
7,
|
|
19581
|
+
7,
|
|
19582
|
+
7,
|
|
19583
|
+
7,
|
|
19584
|
+
7,
|
|
19585
|
+
7,
|
|
19586
|
+
7,
|
|
19587
|
+
7,
|
|
19588
|
+
7,
|
|
19589
|
+
7,
|
|
19590
|
+
7,
|
|
19591
|
+
7,
|
|
19592
|
+
7,
|
|
19593
|
+
7,
|
|
19594
|
+
7,
|
|
19595
|
+
7,
|
|
19596
|
+
7,
|
|
19597
|
+
7,
|
|
19598
|
+
7,
|
|
19599
|
+
7,
|
|
19600
|
+
7,
|
|
19601
|
+
7,
|
|
19602
|
+
7,
|
|
19603
|
+
7,
|
|
19604
|
+
7,
|
|
19605
|
+
7,
|
|
19606
|
+
7,
|
|
19607
|
+
7,
|
|
19608
|
+
7,
|
|
19609
|
+
7,
|
|
19610
|
+
7,
|
|
19611
|
+
7,
|
|
19612
|
+
7,
|
|
19613
|
+
7,
|
|
19614
|
+
7,
|
|
19615
|
+
7,
|
|
19616
|
+
7,
|
|
19617
|
+
7,
|
|
19618
|
+
7,
|
|
19619
|
+
7,
|
|
19620
|
+
7,
|
|
19621
|
+
7,
|
|
19622
|
+
7,
|
|
19623
|
+
7,
|
|
19624
|
+
7,
|
|
19625
|
+
7,
|
|
19626
|
+
7,
|
|
19627
|
+
7,
|
|
19628
|
+
7,
|
|
19629
|
+
7,
|
|
19630
|
+
7,
|
|
19631
|
+
7,
|
|
19632
|
+
7,
|
|
19633
|
+
7,
|
|
19634
|
+
7,
|
|
19635
|
+
7,
|
|
19636
|
+
7,
|
|
19637
|
+
7,
|
|
19638
|
+
7,
|
|
19639
|
+
7,
|
|
19640
|
+
7,
|
|
19641
|
+
7,
|
|
19642
|
+
7,
|
|
19643
|
+
8,
|
|
19644
|
+
8,
|
|
19645
|
+
8,
|
|
19646
|
+
8,
|
|
19647
|
+
8,
|
|
19648
|
+
8,
|
|
19649
|
+
8,
|
|
19650
|
+
8,
|
|
19651
|
+
8,
|
|
19652
|
+
8,
|
|
19653
|
+
8,
|
|
19654
|
+
8,
|
|
19655
|
+
8,
|
|
19656
|
+
8,
|
|
19657
|
+
8,
|
|
19658
|
+
8,
|
|
19659
|
+
8,
|
|
19660
|
+
8,
|
|
19661
|
+
8,
|
|
19662
|
+
8,
|
|
19663
|
+
8,
|
|
19664
|
+
8,
|
|
19665
|
+
8,
|
|
19666
|
+
8,
|
|
19667
|
+
8,
|
|
19668
|
+
8,
|
|
19669
|
+
8,
|
|
19670
|
+
8,
|
|
19671
|
+
8,
|
|
19672
|
+
8,
|
|
19673
|
+
8,
|
|
19674
|
+
8,
|
|
19675
|
+
8,
|
|
19676
|
+
8,
|
|
19677
|
+
8,
|
|
19678
|
+
8,
|
|
19679
|
+
8,
|
|
19680
|
+
8,
|
|
19681
|
+
8,
|
|
19682
|
+
8,
|
|
19683
|
+
8,
|
|
19684
|
+
8,
|
|
19685
|
+
8,
|
|
19686
|
+
8,
|
|
19687
|
+
8,
|
|
19688
|
+
8,
|
|
19689
|
+
8,
|
|
19690
|
+
8,
|
|
19691
|
+
8,
|
|
19692
|
+
8,
|
|
19693
|
+
8,
|
|
19694
|
+
8,
|
|
19695
|
+
8,
|
|
19696
|
+
8,
|
|
19697
|
+
8,
|
|
19698
|
+
8,
|
|
19699
|
+
8,
|
|
19700
|
+
8,
|
|
19701
|
+
8,
|
|
19702
|
+
8,
|
|
19703
|
+
8,
|
|
19704
|
+
8,
|
|
19705
|
+
8,
|
|
19706
|
+
8,
|
|
19707
|
+
8,
|
|
19708
|
+
8,
|
|
19709
|
+
8,
|
|
19710
|
+
8,
|
|
19711
|
+
8,
|
|
19712
|
+
8,
|
|
19713
|
+
8,
|
|
19714
|
+
8,
|
|
19715
|
+
8,
|
|
19716
|
+
8,
|
|
19717
|
+
8,
|
|
19718
|
+
8,
|
|
19719
|
+
8,
|
|
19720
|
+
8,
|
|
19721
|
+
8,
|
|
19722
|
+
8,
|
|
19723
|
+
8,
|
|
19724
|
+
8,
|
|
19725
|
+
8,
|
|
19726
|
+
8,
|
|
19727
|
+
8,
|
|
19728
|
+
8,
|
|
19729
|
+
8,
|
|
19730
|
+
8,
|
|
19731
|
+
8,
|
|
19732
|
+
8,
|
|
19733
|
+
8,
|
|
19734
|
+
8,
|
|
19735
|
+
8,
|
|
19736
|
+
8,
|
|
19737
|
+
8,
|
|
19738
|
+
8,
|
|
19739
|
+
8,
|
|
19740
|
+
8,
|
|
19741
|
+
8,
|
|
19742
|
+
8,
|
|
19743
|
+
8,
|
|
19744
|
+
8,
|
|
19745
|
+
8,
|
|
19746
|
+
8,
|
|
19747
|
+
8,
|
|
19748
|
+
8,
|
|
19749
|
+
8,
|
|
19750
|
+
8,
|
|
19751
|
+
8,
|
|
19752
|
+
8,
|
|
19753
|
+
8,
|
|
19754
|
+
8,
|
|
19755
|
+
8,
|
|
19756
|
+
8,
|
|
19757
|
+
8,
|
|
19758
|
+
8,
|
|
19759
|
+
8,
|
|
19760
|
+
8,
|
|
19761
|
+
8,
|
|
19762
|
+
8,
|
|
19763
|
+
8,
|
|
19764
|
+
8,
|
|
19765
|
+
8,
|
|
19766
|
+
8,
|
|
19767
|
+
8,
|
|
19768
|
+
8,
|
|
19769
|
+
8,
|
|
19770
|
+
8
|
|
19771
|
+
];
|
|
19772
|
+
class DirFlat extends Dir {
|
|
19773
|
+
_children;
|
|
19774
|
+
constructor(props, options){
|
|
19775
|
+
super(props, options), this._children = new Map();
|
|
19776
|
+
}
|
|
19777
|
+
async put(name, value) {
|
|
19778
|
+
if (void 0 !== this.nodeSize) {
|
|
19779
|
+
let oldChild = this._children.get(name), nameBytes = utf8ByteLength(name), strategy = this.options?.shardSplitStrategy;
|
|
19780
|
+
if ('links-bytes' === strategy) this.nodeSize -= estimateLinkSize(nameBytes, oldChild), this.nodeSize += estimateLinkSize(nameBytes, value);
|
|
19781
|
+
else if ('block-bytes' === strategy) this.nodeSize -= calculateLinkSize(nameBytes, oldChild), this.nodeSize += calculateLinkSize(nameBytes, value);
|
|
19782
|
+
else throw new InvalidShardingStrategyError(`Invalid shardSplitStrategy: ${strategy}`);
|
|
19783
|
+
this.nodeSize < 0 && (this.nodeSize = void 0);
|
|
19784
|
+
}
|
|
19785
|
+
this.cid = void 0, this.size = void 0, this._children.set(name, value);
|
|
19786
|
+
}
|
|
19787
|
+
async get(name) {
|
|
19788
|
+
return Promise.resolve(this._children.get(name));
|
|
19789
|
+
}
|
|
19790
|
+
childCount() {
|
|
19791
|
+
return this._children.size;
|
|
19792
|
+
}
|
|
19793
|
+
directChildrenCount() {
|
|
19794
|
+
return this.childCount();
|
|
19795
|
+
}
|
|
19796
|
+
onlyChild() {
|
|
19797
|
+
return this._children.values().next().value;
|
|
19798
|
+
}
|
|
19799
|
+
*eachChildSeries() {
|
|
19800
|
+
for (let [key, child] of this._children.entries())yield {
|
|
19801
|
+
key,
|
|
19802
|
+
child
|
|
19803
|
+
};
|
|
19804
|
+
}
|
|
19805
|
+
marshal() {
|
|
19806
|
+
let unixfs = new UnixFS({
|
|
19807
|
+
type: 'directory',
|
|
19808
|
+
mtime: this.mtime,
|
|
19809
|
+
mode: this.mode
|
|
19810
|
+
}), links = [];
|
|
19811
|
+
for (let [name, child] of this._children.entries())if (null != child.size && null != child.cid) {
|
|
19812
|
+
if (null == child.cid) throw Error('Directory contents must be flushed before marshaling');
|
|
19813
|
+
links.push({
|
|
19814
|
+
Hash: child.cid,
|
|
19815
|
+
Name: name,
|
|
19816
|
+
Tsize: null == child.size ? void 0 : Number(child.size)
|
|
19817
|
+
});
|
|
19818
|
+
}
|
|
19819
|
+
return dag_pb_src_encode(util_prepare({
|
|
19820
|
+
Data: unixfs.marshal(),
|
|
19821
|
+
Links: links
|
|
19822
|
+
}));
|
|
19823
|
+
}
|
|
19824
|
+
async estimateNodeSize() {
|
|
19825
|
+
if (void 0 !== this.nodeSize) return this.nodeSize;
|
|
19826
|
+
let strategy = this.options?.shardSplitStrategy;
|
|
19827
|
+
if ('links-bytes' === strategy) for (let [name, child] of (this.nodeSize = 0, this._children.entries()))this.nodeSize += estimateLinkSize(utf8ByteLength(name), child);
|
|
19828
|
+
else if ('block-bytes' === strategy) for (let [name, child] of (this.nodeSize = function(mode, mtime) {
|
|
19829
|
+
let innerSize = 2;
|
|
19830
|
+
if (void 0 !== mode && 493 !== mode && (innerSize += 1 + varintLen(mode)), null != mtime) {
|
|
19831
|
+
let mtimeInner = 0, secs = Number(mtime.secs);
|
|
19832
|
+
secs < 0 ? mtimeInner += 11 : mtimeInner += 1 + varintLen(secs), null != mtime.nsecs && (mtimeInner += 5), innerSize += 1 + varintLen(mtimeInner) + mtimeInner;
|
|
19833
|
+
}
|
|
19834
|
+
return 1 + varintLen(innerSize) + innerSize;
|
|
19835
|
+
}(this.mode, this.mtime), this._children.entries()))this.nodeSize += calculateLinkSize(utf8ByteLength(name), child);
|
|
19836
|
+
else throw new InvalidShardingStrategyError(`Invalid shardSplitStrategy: ${strategy}`);
|
|
19837
|
+
return this.nodeSize;
|
|
19838
|
+
}
|
|
19839
|
+
async *flush(block) {
|
|
19840
|
+
let links = [];
|
|
19841
|
+
for (let [name, child] of this._children.entries()){
|
|
19842
|
+
let result = child;
|
|
19843
|
+
if (child instanceof Dir) for await (let entry of child.flush(block))result = entry, yield entry;
|
|
19844
|
+
null != result.size && null != result.cid && links.push({
|
|
19845
|
+
Name: name,
|
|
19846
|
+
Tsize: Number(result.size),
|
|
19847
|
+
Hash: result.cid
|
|
19848
|
+
});
|
|
19849
|
+
}
|
|
19850
|
+
let unixfs = new UnixFS({
|
|
19851
|
+
type: 'directory',
|
|
19852
|
+
mtime: this.mtime,
|
|
19853
|
+
mode: this.mode
|
|
19854
|
+
}), node = {
|
|
19855
|
+
Data: unixfs.marshal(),
|
|
19856
|
+
Links: links
|
|
19857
|
+
}, buffer = dag_pb_src_encode(util_prepare(node)), cid = await persist(buffer, block, this.options), size = buffer.length + node.Links.reduce((acc, curr)=>acc + (curr.Tsize ?? 0), 0);
|
|
19858
|
+
this.cid = cid, this.size = size, yield {
|
|
19859
|
+
cid,
|
|
19860
|
+
unixfs,
|
|
19861
|
+
path: this.path,
|
|
19862
|
+
size: BigInt(size)
|
|
19863
|
+
};
|
|
19864
|
+
}
|
|
19865
|
+
}
|
|
19866
|
+
hasher_from({
|
|
19867
|
+
name: 'murmur3-32',
|
|
19868
|
+
code: 0x23,
|
|
19869
|
+
encode: (input)=>(function(number) {
|
|
19870
|
+
let bytes = [
|
|
19871
|
+
,
|
|
19872
|
+
,
|
|
19873
|
+
,
|
|
19874
|
+
,
|
|
19875
|
+
];
|
|
19876
|
+
for(let i = 0; i < 4; i++)bytes[i] = 0xff & number, number >>= 8;
|
|
19877
|
+
return new Uint8Array(bytes);
|
|
19878
|
+
})(function(key, seed = 0) {
|
|
19879
|
+
var k;
|
|
19880
|
+
let h1 = seed >>> 0, length = key.length, blocks = Math.floor(length / 4);
|
|
19881
|
+
for(let i = 0; i < blocks; i++){
|
|
19882
|
+
let k1 = function(key, i) {
|
|
19883
|
+
let offset = 4 * i;
|
|
19884
|
+
return (key[offset] | key[offset + 1] << 8 | key[offset + 2] << 16 | key[offset + 3] << 24) >>> 0;
|
|
19885
|
+
}(key, i);
|
|
19886
|
+
k1 = rotl32(k1 = mul32(k1, 0xcc9e2d51), 15), h1 ^= k1 = mul32(k1, 0x1b873593), h1 = mul32(h1 = rotl32(h1, 13), 5) + 0xe6546b64 >>> 0;
|
|
19887
|
+
}
|
|
19888
|
+
let tail = key.slice(4 * blocks), k1 = 0;
|
|
19889
|
+
switch(tail.length){
|
|
19890
|
+
case 3:
|
|
19891
|
+
k1 ^= tail[2] << 16;
|
|
19892
|
+
case 2:
|
|
19893
|
+
k1 ^= tail[1] << 8;
|
|
19894
|
+
case 1:
|
|
19895
|
+
k1 ^= tail[0], k1 = rotl32(k1 = mul32(k1, 0xcc9e2d51), 15), h1 ^= k1 = mul32(k1, 0x1b873593);
|
|
19896
|
+
}
|
|
19897
|
+
return h1 ^= length, k = h1, k ^= k >>> 16, k = mul32(k, 0x85ebca6b), k ^= k >>> 13, k = mul32(k, 0xc2b2ae35), h1 = k ^= k >>> 16;
|
|
19898
|
+
}(input))
|
|
19899
|
+
});
|
|
19900
|
+
let murmur3128 = hasher_from({
|
|
19901
|
+
name: 'murmur3-128',
|
|
19902
|
+
code: 0x22,
|
|
19903
|
+
encode: (input)=>murmurHash3_x64_128(input)
|
|
19904
|
+
});
|
|
19905
|
+
hasher_from({
|
|
19906
|
+
name: 'murmur3-x64-64',
|
|
19907
|
+
code: 0x22,
|
|
19908
|
+
encode: (input)=>murmurHash3_x64_128(input).subarray(0, 8)
|
|
19909
|
+
});
|
|
19910
|
+
class OpenFailedError extends Error {
|
|
19911
|
+
static name = 'OpenFailedError';
|
|
19912
|
+
static code = 'ERR_OPEN_FAILED';
|
|
19913
|
+
name = OpenFailedError.name;
|
|
19914
|
+
code = OpenFailedError.code;
|
|
19915
|
+
constructor(message = 'Open failed'){
|
|
19916
|
+
super(message);
|
|
19917
|
+
}
|
|
19918
|
+
}
|
|
19919
|
+
class CloseFailedError extends Error {
|
|
19920
|
+
static name = 'CloseFailedError';
|
|
19921
|
+
static code = 'ERR_CLOSE_FAILED';
|
|
19922
|
+
name = CloseFailedError.name;
|
|
19923
|
+
code = CloseFailedError.code;
|
|
19924
|
+
constructor(message = 'Close failed'){
|
|
19925
|
+
super(message);
|
|
19926
|
+
}
|
|
19927
|
+
}
|
|
19928
|
+
class PutFailedError extends Error {
|
|
19929
|
+
static name = 'PutFailedError';
|
|
19930
|
+
static code = 'ERR_PUT_FAILED';
|
|
19931
|
+
name = PutFailedError.name;
|
|
19932
|
+
code = PutFailedError.code;
|
|
19933
|
+
constructor(message = 'Put failed'){
|
|
19934
|
+
super(message);
|
|
19935
|
+
}
|
|
19936
|
+
}
|
|
19937
|
+
class GetFailedError extends Error {
|
|
19938
|
+
static name = 'GetFailedError';
|
|
19939
|
+
static code = 'ERR_GET_FAILED';
|
|
19940
|
+
name = GetFailedError.name;
|
|
19941
|
+
code = GetFailedError.code;
|
|
19942
|
+
constructor(message = 'Get failed'){
|
|
19943
|
+
super(message);
|
|
19944
|
+
}
|
|
19945
|
+
}
|
|
19946
|
+
class DeleteFailedError extends Error {
|
|
19947
|
+
static name = 'DeleteFailedError';
|
|
19948
|
+
static code = 'ERR_DELETE_FAILED';
|
|
19949
|
+
name = DeleteFailedError.name;
|
|
19950
|
+
code = DeleteFailedError.code;
|
|
19951
|
+
constructor(message = 'Delete failed'){
|
|
19952
|
+
super(message);
|
|
19953
|
+
}
|
|
19954
|
+
}
|
|
19955
|
+
class HasFailedError extends Error {
|
|
19956
|
+
static name = 'HasFailedError';
|
|
19957
|
+
static code = 'ERR_HAS_FAILED';
|
|
19958
|
+
name = HasFailedError.name;
|
|
19959
|
+
code = HasFailedError.code;
|
|
19960
|
+
constructor(message = 'Has failed'){
|
|
19961
|
+
super(message);
|
|
19962
|
+
}
|
|
19963
|
+
}
|
|
19964
|
+
class errors_NotFoundError extends Error {
|
|
19965
|
+
static name = 'NotFoundError';
|
|
19966
|
+
static code = 'ERR_NOT_FOUND';
|
|
19967
|
+
name = errors_NotFoundError.name;
|
|
19968
|
+
code = errors_NotFoundError.code;
|
|
19969
|
+
constructor(message = 'Not Found'){
|
|
19970
|
+
super(message);
|
|
19971
|
+
}
|
|
19972
|
+
}
|
|
19973
|
+
class AbortError extends Error {
|
|
19974
|
+
static name = 'AbortError';
|
|
19975
|
+
static code = 'ERR_ABORTED';
|
|
19976
|
+
name = AbortError.name;
|
|
19977
|
+
code = AbortError.code;
|
|
19978
|
+
constructor(message = 'Aborted'){
|
|
19979
|
+
super(message);
|
|
19980
|
+
}
|
|
19981
|
+
}
|
|
19982
|
+
class BaseBlockstore {
|
|
19983
|
+
has(key, options) {
|
|
19984
|
+
return Promise.reject(Error('.has is not implemented'));
|
|
19985
|
+
}
|
|
19986
|
+
put(key, val, options) {
|
|
19987
|
+
return Promise.reject(Error('.put is not implemented'));
|
|
19988
|
+
}
|
|
19989
|
+
async *putMany(source, options) {
|
|
19990
|
+
for await (let { cid, bytes } of source)await this.put(cid, bytes, options), yield cid;
|
|
19991
|
+
}
|
|
19992
|
+
get(key, options) {
|
|
19993
|
+
throw Error('.get is not implemented');
|
|
19994
|
+
}
|
|
19995
|
+
async *getMany(source, options) {
|
|
19996
|
+
for await (let key of source)yield {
|
|
19997
|
+
cid: key,
|
|
19998
|
+
bytes: this.get(key, options)
|
|
19999
|
+
};
|
|
20000
|
+
}
|
|
20001
|
+
delete(key, options) {
|
|
20002
|
+
return Promise.reject(Error('.delete is not implemented'));
|
|
20003
|
+
}
|
|
20004
|
+
async *deleteMany(source, options) {
|
|
20005
|
+
for await (let key of source)await this.delete(key, options), yield key;
|
|
20006
|
+
}
|
|
20007
|
+
async *getAll(options) {
|
|
20008
|
+
throw Error('.getAll is not implemented');
|
|
20009
|
+
}
|
|
20010
|
+
}
|
|
20011
|
+
class BlackHoleBlockstore extends BaseBlockstore {
|
|
20012
|
+
put(key, value, options) {
|
|
20013
|
+
return options?.signal?.throwIfAborted(), key;
|
|
20014
|
+
}
|
|
20015
|
+
get(key, options) {
|
|
20016
|
+
throw options?.signal?.throwIfAborted(), new errors_NotFoundError();
|
|
20017
|
+
}
|
|
20018
|
+
has(key, options) {
|
|
20019
|
+
return options?.signal?.throwIfAborted(), !1;
|
|
20020
|
+
}
|
|
20021
|
+
async delete(cid, options) {
|
|
20022
|
+
options?.signal?.throwIfAborted();
|
|
20023
|
+
}
|
|
20024
|
+
async *getAll(options) {
|
|
20025
|
+
options?.signal?.throwIfAborted();
|
|
20026
|
+
}
|
|
20027
|
+
}
|
|
20028
|
+
let sparse_array = __webpack_require__("./node_modules/sparse-array/index.js");
|
|
20029
|
+
class Bucket {
|
|
20030
|
+
_options;
|
|
20031
|
+
_popCount;
|
|
20032
|
+
_parent;
|
|
20033
|
+
_posAtParent;
|
|
20034
|
+
_children;
|
|
20035
|
+
key;
|
|
20036
|
+
constructor(options, parent, posAtParent = 0){
|
|
20037
|
+
this._options = options, this._popCount = 0, this._parent = parent, this._posAtParent = posAtParent, this._children = new sparse_array(), this.key = null;
|
|
20038
|
+
}
|
|
20039
|
+
async put(key, value) {
|
|
20040
|
+
let place = await this._findNewBucketAndPos(key);
|
|
20041
|
+
place.bucket._putAt(place, key, value);
|
|
20042
|
+
}
|
|
20043
|
+
async get(key) {
|
|
20044
|
+
let child = await this._findChild(key);
|
|
20045
|
+
if (null != child) return child.value;
|
|
20046
|
+
}
|
|
20047
|
+
async del(key) {
|
|
20048
|
+
let place = await this._findPlace(key), child = place.bucket._at(place.pos);
|
|
20049
|
+
null != child && child.key === key && place.bucket._delAt(place.pos);
|
|
20050
|
+
}
|
|
20051
|
+
leafCount() {
|
|
19609
20052
|
return this._children.compactArray().reduce((acc, child)=>child instanceof Bucket ? acc + child.leafCount() : acc + 1, 0);
|
|
19610
20053
|
}
|
|
19611
20054
|
childrenCount() {
|
|
@@ -19775,10 +20218,10 @@ class InfiniteHash {
|
|
|
19775
20218
|
this._buffers.push(buffer), this._availableBits += buffer.availableBits();
|
|
19776
20219
|
}
|
|
19777
20220
|
}
|
|
19778
|
-
let
|
|
19779
|
-
|
|
20221
|
+
let dir_sharded = class extends Dir {
|
|
20222
|
+
bucket;
|
|
19780
20223
|
constructor(props, options){
|
|
19781
|
-
super(props, options), this.
|
|
20224
|
+
super(props, options), this.bucket = function(options) {
|
|
19782
20225
|
var hashFn;
|
|
19783
20226
|
if (null == options || null == options.hashFn) throw Error('please define an options.hashFn');
|
|
19784
20227
|
return new Bucket({
|
|
@@ -19793,151 +20236,38 @@ let HAMT_HASH_CODE = BigInt(0x22), dir_sharded = class extends Dir {
|
|
|
19793
20236
|
});
|
|
19794
20237
|
}
|
|
19795
20238
|
async put(name, value) {
|
|
19796
|
-
this.cid = void 0, this.size = void 0, this.nodeSize = void 0, await this.
|
|
20239
|
+
this.cid = void 0, this.size = void 0, this.nodeSize = void 0, await this.bucket.put(name, value);
|
|
19797
20240
|
}
|
|
19798
20241
|
async get(name) {
|
|
19799
|
-
return this.
|
|
20242
|
+
return this.bucket.get(name);
|
|
19800
20243
|
}
|
|
19801
20244
|
childCount() {
|
|
19802
|
-
return this.
|
|
20245
|
+
return this.bucket.leafCount();
|
|
19803
20246
|
}
|
|
19804
20247
|
directChildrenCount() {
|
|
19805
|
-
return this.
|
|
20248
|
+
return this.bucket.childrenCount();
|
|
19806
20249
|
}
|
|
19807
20250
|
onlyChild() {
|
|
19808
|
-
return this.
|
|
20251
|
+
return this.bucket.onlyChild();
|
|
19809
20252
|
}
|
|
19810
20253
|
*eachChildSeries() {
|
|
19811
|
-
for (let { key, value } of this.
|
|
20254
|
+
for (let { key, value } of this.bucket.eachLeafSeries())yield {
|
|
19812
20255
|
key,
|
|
19813
20256
|
child: value
|
|
19814
20257
|
};
|
|
19815
20258
|
}
|
|
19816
|
-
estimateNodeSize() {
|
|
19817
|
-
|
|
19818
|
-
|
|
19819
|
-
|
|
19820
|
-
let child = children.get(i);
|
|
19821
|
-
if (null == child) continue;
|
|
19822
|
-
let labelPrefix = i.toString(16).toUpperCase().padStart(padLength, '0');
|
|
19823
|
-
if (child instanceof Bucket) {
|
|
19824
|
-
let size = calculateSize(child, null, options);
|
|
19825
|
-
links.push({
|
|
19826
|
-
Name: labelPrefix,
|
|
19827
|
-
Tsize: Number(size),
|
|
19828
|
-
Hash: 0 === options.cidVersion ? CID_V0 : CID_V1
|
|
19829
|
-
});
|
|
19830
|
-
} else if ('function' == typeof child.value.flush) {
|
|
19831
|
-
let size = child.value.nodeSize();
|
|
19832
|
-
links.push({
|
|
19833
|
-
Name: labelPrefix + child.key,
|
|
19834
|
-
Tsize: Number(size),
|
|
19835
|
-
Hash: 0 === options.cidVersion ? CID_V0 : CID_V1
|
|
19836
|
-
});
|
|
19837
|
-
} else {
|
|
19838
|
-
let value = child.value;
|
|
19839
|
-
if (null == value.cid) continue;
|
|
19840
|
-
let label = labelPrefix + child.key, size = value.size;
|
|
19841
|
-
links.push({
|
|
19842
|
-
Name: label,
|
|
19843
|
-
Tsize: Number(size),
|
|
19844
|
-
Hash: value.cid
|
|
19845
|
-
});
|
|
19846
|
-
}
|
|
19847
|
-
}
|
|
19848
|
-
return dag_pb_src_encode(util_prepare({
|
|
19849
|
-
Data: new UnixFS({
|
|
19850
|
-
type: 'hamt-sharded-directory',
|
|
19851
|
-
data: Uint8Array.from(children.bitField().reverse()),
|
|
19852
|
-
fanout: BigInt(bucket.tableSize()),
|
|
19853
|
-
hashType: HAMT_HASH_CODE,
|
|
19854
|
-
mtime: shardRoot?.mtime,
|
|
19855
|
-
mode: shardRoot?.mode
|
|
19856
|
-
}).marshal(),
|
|
19857
|
-
Links: links
|
|
19858
|
-
})).length;
|
|
19859
|
-
}(this._bucket, this, this.options)), this.nodeSize;
|
|
20259
|
+
async estimateNodeSize() {
|
|
20260
|
+
if (void 0 !== this.nodeSize) return this.nodeSize;
|
|
20261
|
+
let blockstore = new BlackHoleBlockstore(), result = await calculateSize(this.bucket, this, blockstore, this.options);
|
|
20262
|
+
return this.nodeSize = result.size, this.nodeSize;
|
|
19860
20263
|
}
|
|
19861
20264
|
async *flush(blockstore) {
|
|
19862
|
-
for await (let entry of dir_sharded_flush(this.
|
|
20265
|
+
for await (let entry of dir_sharded_flush(this.bucket, blockstore, this, this.options))yield {
|
|
19863
20266
|
...entry,
|
|
19864
20267
|
path: this.path
|
|
19865
20268
|
};
|
|
19866
20269
|
}
|
|
19867
|
-
}, toPathComponents = (path = '')=>path.split(/(?<!\\)\//).filter(Boolean)
|
|
19868
|
-
class OpenFailedError extends Error {
|
|
19869
|
-
static name = 'OpenFailedError';
|
|
19870
|
-
static code = 'ERR_OPEN_FAILED';
|
|
19871
|
-
name = OpenFailedError.name;
|
|
19872
|
-
code = OpenFailedError.code;
|
|
19873
|
-
constructor(message = 'Open failed'){
|
|
19874
|
-
super(message);
|
|
19875
|
-
}
|
|
19876
|
-
}
|
|
19877
|
-
class CloseFailedError extends Error {
|
|
19878
|
-
static name = 'CloseFailedError';
|
|
19879
|
-
static code = 'ERR_CLOSE_FAILED';
|
|
19880
|
-
name = CloseFailedError.name;
|
|
19881
|
-
code = CloseFailedError.code;
|
|
19882
|
-
constructor(message = 'Close failed'){
|
|
19883
|
-
super(message);
|
|
19884
|
-
}
|
|
19885
|
-
}
|
|
19886
|
-
class PutFailedError extends Error {
|
|
19887
|
-
static name = 'PutFailedError';
|
|
19888
|
-
static code = 'ERR_PUT_FAILED';
|
|
19889
|
-
name = PutFailedError.name;
|
|
19890
|
-
code = PutFailedError.code;
|
|
19891
|
-
constructor(message = 'Put failed'){
|
|
19892
|
-
super(message);
|
|
19893
|
-
}
|
|
19894
|
-
}
|
|
19895
|
-
class GetFailedError extends Error {
|
|
19896
|
-
static name = 'GetFailedError';
|
|
19897
|
-
static code = 'ERR_GET_FAILED';
|
|
19898
|
-
name = GetFailedError.name;
|
|
19899
|
-
code = GetFailedError.code;
|
|
19900
|
-
constructor(message = 'Get failed'){
|
|
19901
|
-
super(message);
|
|
19902
|
-
}
|
|
19903
|
-
}
|
|
19904
|
-
class DeleteFailedError extends Error {
|
|
19905
|
-
static name = 'DeleteFailedError';
|
|
19906
|
-
static code = 'ERR_DELETE_FAILED';
|
|
19907
|
-
name = DeleteFailedError.name;
|
|
19908
|
-
code = DeleteFailedError.code;
|
|
19909
|
-
constructor(message = 'Delete failed'){
|
|
19910
|
-
super(message);
|
|
19911
|
-
}
|
|
19912
|
-
}
|
|
19913
|
-
class HasFailedError extends Error {
|
|
19914
|
-
static name = 'HasFailedError';
|
|
19915
|
-
static code = 'ERR_HAS_FAILED';
|
|
19916
|
-
name = HasFailedError.name;
|
|
19917
|
-
code = HasFailedError.code;
|
|
19918
|
-
constructor(message = 'Has failed'){
|
|
19919
|
-
super(message);
|
|
19920
|
-
}
|
|
19921
|
-
}
|
|
19922
|
-
class errors_NotFoundError extends Error {
|
|
19923
|
-
static name = 'NotFoundError';
|
|
19924
|
-
static code = 'ERR_NOT_FOUND';
|
|
19925
|
-
name = errors_NotFoundError.name;
|
|
19926
|
-
code = errors_NotFoundError.code;
|
|
19927
|
-
constructor(message = 'Not Found'){
|
|
19928
|
-
super(message);
|
|
19929
|
-
}
|
|
19930
|
-
}
|
|
19931
|
-
class AbortError extends Error {
|
|
19932
|
-
static name = 'AbortError';
|
|
19933
|
-
static code = 'ERR_ABORTED';
|
|
19934
|
-
name = AbortError.name;
|
|
19935
|
-
code = AbortError.code;
|
|
19936
|
-
constructor(message = 'Aborted'){
|
|
19937
|
-
super(message);
|
|
19938
|
-
}
|
|
19939
|
-
}
|
|
19940
|
-
let it_all_dist_src = function(source) {
|
|
20270
|
+
}, toPathComponents = (path = '')=>path.split(/(?<!\\)\//).filter(Boolean), it_all_dist_src = function(source) {
|
|
19941
20271
|
if (null != source[Symbol.asyncIterator]) return (async ()=>{
|
|
19942
20272
|
let arr = [];
|
|
19943
20273
|
for await (let entry of source)arr.push(entry);
|
|
@@ -20159,7 +20489,8 @@ let addr_abi = {
|
|
|
20159
20489
|
namehash(name)
|
|
20160
20490
|
])
|
|
20161
20491
|
]),
|
|
20162
|
-
to: '0xeEeEEEeE14D718C2B47D9923Deab1335E144EeEe'
|
|
20492
|
+
to: '0xeEeEEEeE14D718C2B47D9923Deab1335E144EeEe',
|
|
20493
|
+
gas: SIMULATION_GAS_LIMIT
|
|
20163
20494
|
},
|
|
20164
20495
|
'latest'
|
|
20165
20496
|
]
|
|
@@ -20216,7 +20547,8 @@ let addr_abi = {
|
|
|
20216
20547
|
data: AbiFunction_encodeData(get_resolver_abi, [
|
|
20217
20548
|
Bytes_toHex(utils_packetToBytes(name))
|
|
20218
20549
|
]),
|
|
20219
|
-
to: '0xeEeEEEeE14D718C2B47D9923Deab1335E144EeEe'
|
|
20550
|
+
to: '0xeEeEEEeE14D718C2B47D9923Deab1335E144EeEe',
|
|
20551
|
+
gas: SIMULATION_GAS_LIMIT
|
|
20220
20552
|
},
|
|
20221
20553
|
'latest'
|
|
20222
20554
|
]
|
|
@@ -20323,7 +20655,8 @@ let addr_abi = {
|
|
|
20323
20655
|
zeroAddress,
|
|
20324
20656
|
zeroAddress,
|
|
20325
20657
|
txData.nonce
|
|
20326
|
-
])
|
|
20658
|
+
]),
|
|
20659
|
+
gas: SIMULATION_GAS_LIMIT
|
|
20327
20660
|
},
|
|
20328
20661
|
'latest'
|
|
20329
20662
|
]
|
|
@@ -20549,7 +20882,7 @@ let ENS_DEPLOYER_ROLE = keccak256(Bytes_fromString('ENS_DEPLOYER')), execTransac
|
|
|
20549
20882
|
let type, tokens = info.tokens = function(input, nf, ef) {
|
|
20550
20883
|
let ret = [], chars = [];
|
|
20551
20884
|
for(input = input.slice().reverse(); input.length;){
|
|
20552
|
-
let emoji = function(cps
|
|
20885
|
+
let emoji = function(cps) {
|
|
20553
20886
|
let emoji, node = EMOJI_ROOT, pos = cps.length;
|
|
20554
20887
|
for(; pos && (node = node.get(cps[--pos]));){
|
|
20555
20888
|
let { V } = node;
|
|
@@ -20698,7 +21031,8 @@ let ENS_DEPLOYER_ROLE = keccak256(Bytes_fromString('ENS_DEPLOYER')), execTransac
|
|
|
20698
21031
|
params: [
|
|
20699
21032
|
{
|
|
20700
21033
|
to: safe,
|
|
20701
|
-
data: AbiFunction_encodeData(getNonce)
|
|
21034
|
+
data: AbiFunction_encodeData(getNonce),
|
|
21035
|
+
gas: SIMULATION_GAS_LIMIT
|
|
20702
21036
|
},
|
|
20703
21037
|
'latest'
|
|
20704
21038
|
]
|