omnipin 2.2.4 → 2.2.6
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 +13 -17
- package/package.json +2 -3
package/dist/index.js
CHANGED
|
@@ -12321,7 +12321,15 @@ let serializedType = '0x02', TxEnvelopeEip1559_type = 'eip1559', SIMULATION_GAS_
|
|
|
12321
12321
|
}(bytes))), providerActiveDataSets = (await getClientDataSets({
|
|
12322
12322
|
chain,
|
|
12323
12323
|
address
|
|
12324
|
-
})).filter((ds)=>ds.providerId === providerId && 0n === ds.pdpEndEpoch), isNewDataSet = 0 === providerActiveDataSets.length || filecoinForceNewDataset
|
|
12324
|
+
})).filter((ds)=>ds.providerId === providerId && 0n === ds.pdpEndEpoch), isNewDataSet = 0 === providerActiveDataSets.length || filecoinForceNewDataset;
|
|
12325
|
+
verbose && logger.info('Uploading piece to provider'), await uploadPiece({
|
|
12326
|
+
providerURL,
|
|
12327
|
+
pieceCid: pieceCid.toString(),
|
|
12328
|
+
bytes: bytes
|
|
12329
|
+
}), verbose && logger.info('Waiting for piece to be stored at provider'), await findPiece(providerURL, pieceCid.toString(), {
|
|
12330
|
+
verbose
|
|
12331
|
+
});
|
|
12332
|
+
let costs = await getUploadCosts({
|
|
12325
12333
|
clientAddress: address,
|
|
12326
12334
|
dataSize: BigInt(size),
|
|
12327
12335
|
isNewDataSet,
|
|
@@ -12350,13 +12358,7 @@ let serializedType = '0x02', TxEnvelopeEip1559_type = 'eip1559', SIMULATION_GAS_
|
|
|
12350
12358
|
} else costs.needsFwssMaxApproval ? logger.info('Operator approval needed but no deposit; skipping (no-op).') : logger.info('Sufficient funds available, no deposit needed');
|
|
12351
12359
|
let nonce = BigInt(randomInt(100000000));
|
|
12352
12360
|
if (isNewDataSet) {
|
|
12353
|
-
logger.info('Creating new data set')
|
|
12354
|
-
providerURL,
|
|
12355
|
-
pieceCid: pieceCid.toString(),
|
|
12356
|
-
bytes: bytes
|
|
12357
|
-
}), verbose && logger.info('Waiting for piece to be stored at provider'), await findPiece(providerURL, pieceCid.toString(), {
|
|
12358
|
-
verbose
|
|
12359
|
-
});
|
|
12361
|
+
logger.info('Creating new data set');
|
|
12360
12362
|
let clientDataSetId = BigInt(randomInt(100000000)), createPayload = (({ chain, payee, payer, privateKey, clientDataSetId = BigInt(randomInt(100000000)) })=>{
|
|
12361
12363
|
let signature = Signature_toHex(Secp256k1_sign({
|
|
12362
12364
|
payload: getSignPayload({
|
|
@@ -12445,13 +12447,7 @@ let serializedType = '0x02', TxEnvelopeEip1559_type = 'eip1559', SIMULATION_GAS_
|
|
|
12445
12447
|
} else {
|
|
12446
12448
|
logger.info('Using existing data set');
|
|
12447
12449
|
let dataset = providerActiveDataSets[0];
|
|
12448
|
-
verbose && logger.info(`Data set ID: ${dataset.dataSetId}`)
|
|
12449
|
-
providerURL,
|
|
12450
|
-
pieceCid: pieceCid.toString(),
|
|
12451
|
-
bytes: bytes
|
|
12452
|
-
}), logger.info('Waiting for piece to be stored at provider'), await findPiece(providerURL, pieceCid.toString(), {
|
|
12453
|
-
verbose
|
|
12454
|
-
});
|
|
12450
|
+
verbose && logger.info(`Data set ID: ${dataset.dataSetId}`);
|
|
12455
12451
|
let extraData = await createUploadPiecesPayload({
|
|
12456
12452
|
pieceCid,
|
|
12457
12453
|
privateKey,
|
|
@@ -17977,7 +17973,7 @@ let uploadCAR = async (conf, car)=>{
|
|
|
17977
17973
|
return multihash = digest_create(0x1b, function(hex, options = {}) {
|
|
17978
17974
|
return fromHex(hex, options);
|
|
17979
17975
|
}(ref)).bytes, bytes = new Uint8Array((hashOffset = (codeOffset = varint_0.encodingLength(1)) + varint_0.encodingLength(0xfa)) + multihash.byteLength), varint_0.encode(1, bytes, 0), varint_0.encode(0xfa, bytes, codeOffset), bytes.set(multihash, hashOffset), bytes;
|
|
17980
|
-
}, referenceToCIDString = (ref)=>base32.encode(referenceToCID(ref)), swarmy_providerName = 'Swarmy', PROVIDERS = {
|
|
17976
|
+
}, referenceToCIDString = (ref)=>base32.encode(referenceToCID(ref)), DEFAULT_BEE_URL = 'http://localhost:1633', swarmy_providerName = 'Swarmy', PROVIDERS = {
|
|
17981
17977
|
STORACHA_TOKEN: {
|
|
17982
17978
|
name: 'Storacha',
|
|
17983
17979
|
upload: async ({ token, bytes, proof })=>{
|
|
@@ -18088,7 +18084,7 @@ let uploadCAR = async (conf, car)=>{
|
|
|
18088
18084
|
},
|
|
18089
18085
|
BEE_TOKEN: {
|
|
18090
18086
|
name: 'Bee',
|
|
18091
|
-
upload: async ({ token, bytes, verbose, beeURL, first })=>{
|
|
18087
|
+
upload: async ({ token, bytes, verbose, beeURL = DEFAULT_BEE_URL, first })=>{
|
|
18092
18088
|
if (!first) throw new PinningNotSupportedError('Bee');
|
|
18093
18089
|
let res = await fetch(`${beeURL}/bzz`, {
|
|
18094
18090
|
body: new Blob([
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omnipin",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.6",
|
|
4
4
|
"author": "v1rtl <hi@v1rtl.site>",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -32,8 +32,7 @@
|
|
|
32
32
|
"spektr": "^0.2.0",
|
|
33
33
|
"tinyglobby": "^0.2.15",
|
|
34
34
|
"typescript": "^5.9.3",
|
|
35
|
-
"varint": "^6.0.0"
|
|
36
|
-
"vitepress": "^1.6.4"
|
|
35
|
+
"varint": "^6.0.0"
|
|
37
36
|
},
|
|
38
37
|
"bin": {
|
|
39
38
|
"omnipin": "dist/index.js"
|