omnipin 2.2.5 → 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 +11 -15
- package/package.json +1 -1
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,
|