opnet 1.8.3 → 1.8.4
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/CHANGELOG.md +20 -0
- package/browser/_version.d.ts +1 -1
- package/browser/contracts/CallResult.d.ts +1 -0
- package/browser/index.js +9929 -10210
- package/browser/noble-curves.js +3049 -2135
- package/browser/noble-hashes.js +1812 -2504
- package/browser/protobuf.js +2695 -2103
- package/browser/rolldown-runtime.js +35 -0
- package/browser/vendors.js +36998 -45617
- package/browser/worker_threads-browser.js +7 -9
- package/build/_version.d.ts +1 -1
- package/build/_version.js +1 -1
- package/build/contracts/CallResult.d.ts +1 -0
- package/build/contracts/CallResult.js +5 -11
- package/build/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +17 -11
- package/src/_version.ts +1 -1
- package/src/contracts/CallResult.ts +21 -14
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
|
|
1
|
+
//#region src/shims/worker_threads-browser.js
|
|
2
|
+
var Worker = class {
|
|
3
|
+
constructor() {
|
|
4
|
+
throw new Error("worker_threads is not available in browser. Use Web Workers instead.");
|
|
5
|
+
}
|
|
6
|
+
};
|
|
7
|
+
//#endregion
|
|
10
8
|
export { Worker };
|
package/build/_version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "1.8.
|
|
1
|
+
export declare const version = "1.8.4";
|
package/build/_version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '1.8.
|
|
1
|
+
export const version = '1.8.4';
|
|
@@ -107,6 +107,7 @@ export declare class CallResult<T extends ContractDecodedObjectResult = {}, U ex
|
|
|
107
107
|
setEvents(events: U): void;
|
|
108
108
|
setCalldata(calldata: Uint8Array): void;
|
|
109
109
|
toOfflineBuffer(refundAddress: string, amount: bigint): Promise<Uint8Array>;
|
|
110
|
+
private max;
|
|
110
111
|
private acquire;
|
|
111
112
|
private bigintMax;
|
|
112
113
|
private getValuesFromAccessList;
|
|
@@ -427,6 +427,9 @@ export class CallResult {
|
|
|
427
427
|
}
|
|
428
428
|
}
|
|
429
429
|
}
|
|
430
|
+
max(a, b) {
|
|
431
|
+
return a > b ? a : b;
|
|
432
|
+
}
|
|
430
433
|
async acquire(interactionParams, amountAddition = 0n) {
|
|
431
434
|
if (!this.calldata) {
|
|
432
435
|
throw new Error('Calldata not set');
|
|
@@ -439,21 +442,12 @@ export class CallResult {
|
|
|
439
442
|
const addedOuts = interactionParams.extraOutputs ?? [];
|
|
440
443
|
const totalOuts = addedOuts.reduce((s, o) => s + BigInt(o.value), 0n);
|
|
441
444
|
const gasFee = this.bigintMax(this.estimatedSatGas, interactionParams.minGas ?? 0n);
|
|
442
|
-
const preWant = gasFee +
|
|
443
|
-
priority +
|
|
444
|
-
amountAddition +
|
|
445
|
-
totalOuts +
|
|
446
|
-
interactionParams.maximumAllowedSatToSpend;
|
|
445
|
+
const preWant = this.max(gasFee + priority + amountAddition + totalOuts, interactionParams.maximumAllowedSatToSpend);
|
|
447
446
|
let utxos = interactionParams.utxos ?? (await this.#fetchUTXOs(preWant, interactionParams));
|
|
448
447
|
let refetched = false;
|
|
449
448
|
while (true) {
|
|
450
449
|
const miningCost = TransactionHelper.estimateMiningCost(utxos, addedOuts, this.calldata.length + 200, interactionParams.network, feeRate);
|
|
451
|
-
const want = gasFee +
|
|
452
|
-
priority +
|
|
453
|
-
amountAddition +
|
|
454
|
-
totalOuts +
|
|
455
|
-
miningCost +
|
|
456
|
-
interactionParams.maximumAllowedSatToSpend;
|
|
450
|
+
const want = this.max(gasFee + priority + amountAddition + totalOuts + miningCost, interactionParams.maximumAllowedSatToSpend);
|
|
457
451
|
const have = utxos.reduce((s, u) => s + u.value, 0n);
|
|
458
452
|
if (have >= want)
|
|
459
453
|
break;
|