opnet 1.8.6 → 1.8.8
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 +18 -0
- package/browser/_version.d.ts +1 -1
- package/browser/index.js +11 -10
- package/browser/utxos/UTXOsManager.d.ts +1 -1
- package/browser/vendors.js +1 -7
- package/build/_version.d.ts +1 -1
- package/build/_version.js +1 -1
- package/build/tsconfig.build.tsbuildinfo +1 -1
- package/build/utxos/UTXOsManager.d.ts +1 -1
- package/build/utxos/UTXOsManager.js +13 -10
- package/package.json +6 -6
- package/src/_version.ts +1 -1
- package/src/utxos/UTXOsManager.ts +13 -10
- package/test/utxos-manager.test.ts +55 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [v1.8.7] - 2026-03-19
|
|
4
|
+
|
|
5
|
+
### Other Changes
|
|
6
|
+
|
|
7
|
+
- Fix csv UTXOs switching between locked/unlocked on refresh (wallet) ([#148](https://github.com/btc-vision/opnet/pull/148)) by @savardd
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
## [v1.8.6] - 2026-03-17
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
- Remove trusted from BlockWitness and providers ([#147](https://github.com/btc-vision/opnet/pull/147)) by @BlobMaster41
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
3
21
|
## [v1.8.5] - 2026-03-13
|
|
4
22
|
|
|
5
23
|
### Features
|
package/browser/_version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "1.8.
|
|
1
|
+
export declare const version = "1.8.8";
|
package/browser/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { a as __toESM, r as __exportAll } from "./rolldown-runtime.js";
|
|
|
2
2
|
import { A as bitcoin, C as AddressVerificator, D as fromHex, E as toBase64, M as regtest, N as testnet, O as toHex, S as AddressTypes, T as fromBase64, _ as BinaryWriter, a as ABICoder, b as AddressMap, c as isAbiTuple, d as process$1, f as P2MR_MS, g as Logger, h as TransactionFactory, i as NetEvent, j as opnetTestnet, k as fromBech32, l as ABIDataTypes, m as ChallengeSolution, n as Long, o as abiTypeToSelectorString, p as P2TR_MS, r as pLimit, s as isAbiStruct, t as BigNumber, u as init_dist, v as BinaryReader, w as decompile, x as Address, y as BufferHelper } from "./vendors.js";
|
|
3
3
|
import { t as require_protobuf_min } from "./protobuf.js";
|
|
4
4
|
//#region src/_version.ts
|
|
5
|
-
var version = "1.8.
|
|
5
|
+
var version = "1.8.8";
|
|
6
6
|
//#endregion
|
|
7
7
|
//#region src/interfaces/opnet/OPNetTransactionTypes.ts
|
|
8
8
|
var OPNetTransactionTypes = /* @__PURE__ */ function(OPNetTransactionTypes) {
|
|
@@ -1955,9 +1955,9 @@ var UTXOsManager = class {
|
|
|
1955
1955
|
/**
|
|
1956
1956
|
* Clean (reset) the data for a particular address or for all addresses if none is passed.
|
|
1957
1957
|
*/
|
|
1958
|
-
clean(address) {
|
|
1958
|
+
clean(address, threshold) {
|
|
1959
1959
|
if (address) {
|
|
1960
|
-
const addressData = this.getAddressData(address);
|
|
1960
|
+
const addressData = this.getAddressData(address, threshold);
|
|
1961
1961
|
addressData.spentUTXOs = [];
|
|
1962
1962
|
addressData.pendingUTXOs = [];
|
|
1963
1963
|
addressData.pendingUtxoDepth = {};
|
|
@@ -1983,7 +1983,7 @@ var UTXOsManager = class {
|
|
|
1983
1983
|
* @throws {Error} If something goes wrong
|
|
1984
1984
|
*/
|
|
1985
1985
|
async getUTXOs({ address, isCSV = false, optimize = true, mergePendingUTXOs = true, filterSpentUTXOs = true, olderThan }) {
|
|
1986
|
-
const addressData = this.getAddressData(address);
|
|
1986
|
+
const addressData = this.getAddressData(address, olderThan);
|
|
1987
1987
|
const fetchedData = await this.maybeFetchUTXOs(address, optimize, olderThan, isCSV);
|
|
1988
1988
|
const utxoKey = (utxo) => `${utxo.transactionId}:${utxo.outputIndex}`;
|
|
1989
1989
|
const spentRefKey = (ref) => `${ref.transactionId}:${ref.outputIndex}`;
|
|
@@ -2193,8 +2193,9 @@ var UTXOsManager = class {
|
|
|
2193
2193
|
/**
|
|
2194
2194
|
* Return the AddressData object for a given address. Initializes it if nonexistent.
|
|
2195
2195
|
*/
|
|
2196
|
-
getAddressData(address) {
|
|
2197
|
-
|
|
2196
|
+
getAddressData(address, threshold) {
|
|
2197
|
+
const addressWithThreshold = threshold ? `${address}_${threshold}` : address;
|
|
2198
|
+
if (!this.dataByAddress[addressWithThreshold]) this.dataByAddress[addressWithThreshold] = {
|
|
2198
2199
|
spentUTXOs: [],
|
|
2199
2200
|
pendingUTXOs: [],
|
|
2200
2201
|
pendingUtxoDepth: {},
|
|
@@ -2202,20 +2203,20 @@ var UTXOsManager = class {
|
|
|
2202
2203
|
lastFetchTimestamp: 0,
|
|
2203
2204
|
lastFetchedData: null
|
|
2204
2205
|
};
|
|
2205
|
-
return this.dataByAddress[
|
|
2206
|
+
return this.dataByAddress[addressWithThreshold];
|
|
2206
2207
|
}
|
|
2207
2208
|
/**
|
|
2208
2209
|
* Checks if we need to fetch fresh UTXOs or can return the cached data (per address).
|
|
2209
2210
|
*/
|
|
2210
2211
|
async maybeFetchUTXOs(address, optimize, olderThan, isCSV = false) {
|
|
2211
|
-
const addressData = this.getAddressData(address);
|
|
2212
|
+
const addressData = this.getAddressData(address, olderThan);
|
|
2212
2213
|
const now = Date.now();
|
|
2213
2214
|
const age = now - addressData.lastFetchTimestamp;
|
|
2214
|
-
if (now - addressData.lastCleanup > AUTO_PURGE_AFTER) this.clean(address);
|
|
2215
|
+
if (now - addressData.lastCleanup > AUTO_PURGE_AFTER) this.clean(address, olderThan);
|
|
2215
2216
|
if (addressData.lastFetchedData && age < FETCH_COOLDOWN) return addressData.lastFetchedData;
|
|
2216
2217
|
addressData.lastFetchedData = await this.fetchUTXOs(address, optimize, olderThan, isCSV);
|
|
2217
2218
|
addressData.lastFetchTimestamp = now;
|
|
2218
|
-
this.syncPendingDepthWithFetched(address);
|
|
2219
|
+
if (!olderThan) this.syncPendingDepthWithFetched(address);
|
|
2219
2220
|
return addressData.lastFetchedData;
|
|
2220
2221
|
}
|
|
2221
2222
|
/**
|
|
@@ -7,7 +7,7 @@ export declare class UTXOsManager {
|
|
|
7
7
|
constructor(provider: IProviderForUTXO);
|
|
8
8
|
spentUTXO(address: string, spent: UTXOs, newUTXOs: UTXOs): void;
|
|
9
9
|
getPendingUTXOs(address: string): UTXOs;
|
|
10
|
-
clean(address?: string): void;
|
|
10
|
+
clean(address?: string, threshold?: bigint): void;
|
|
11
11
|
getUTXOs({ address, isCSV, optimize, mergePendingUTXOs, filterSpentUTXOs, olderThan, }: RequestUTXOsParams): Promise<UTXOs>;
|
|
12
12
|
getUTXOsForAmount({ address, amount, csvAddress, optimize, mergePendingUTXOs, filterSpentUTXOs, throwErrors, olderThan, maxUTXOs, throwIfUTXOsLimitReached, }: RequestUTXOsParamsWithAmount): Promise<UTXOs>;
|
|
13
13
|
getMultipleUTXOs({ requests, mergePendingUTXOs, filterSpentUTXOs, }: RequestMultipleUTXOsParams): Promise<Record<string, UTXOs>>;
|
package/browser/vendors.js
CHANGED
|
@@ -25417,7 +25417,7 @@ var Generator = class Generator {
|
|
|
25417
25417
|
const writer = new BinaryWriter();
|
|
25418
25418
|
writer.writeBytes(feature.data.publicKey.toBuffer());
|
|
25419
25419
|
writer.writeBytes(feature.data.solution);
|
|
25420
|
-
if (feature.data.graffiti) writer.
|
|
25420
|
+
if (feature.data.graffiti) writer.writeBytes(feature.data.graffiti);
|
|
25421
25421
|
finalBuffer.writeBytesWithLength(writer.getBuffer());
|
|
25422
25422
|
}
|
|
25423
25423
|
encodeLinkRequest(feature, finalBuffer) {
|
|
@@ -26790,7 +26790,6 @@ var MessageSignerBase = class {
|
|
|
26790
26790
|
}
|
|
26791
26791
|
};
|
|
26792
26792
|
var MessageSigner = new MessageSignerBase();
|
|
26793
|
-
Symbol.dispose;
|
|
26794
26793
|
//#endregion
|
|
26795
26794
|
//#region node_modules/bip39/src/wordlists/czech.json
|
|
26796
26795
|
var czech_exports = /* @__PURE__ */ __exportAll({ default: () => czech_default });
|
|
@@ -27077,7 +27076,6 @@ var BIPStandard;
|
|
|
27077
27076
|
})(BIPStandard || (BIPStandard = {}));
|
|
27078
27077
|
require_src();
|
|
27079
27078
|
(0, import_cjs.BIP32Factory)(backend);
|
|
27080
|
-
Symbol.dispose;
|
|
27081
27079
|
//#endregion
|
|
27082
27080
|
//#region node_modules/@btc-vision/transaction/build/generators/MLDSAData.js
|
|
27083
27081
|
var MLDSAPublicKeyMetadata;
|
|
@@ -36522,9 +36520,6 @@ var ABICoder = class {
|
|
|
36522
36520
|
return new Uint8Array(new import_sha_js.default.sha256().update(buffer).digest());
|
|
36523
36521
|
}
|
|
36524
36522
|
};
|
|
36525
|
-
Symbol.dispose, Symbol.iterator;
|
|
36526
|
-
Symbol.dispose, Symbol.iterator;
|
|
36527
|
-
Symbol.dispose, Symbol.iterator;
|
|
36528
36523
|
//#endregion
|
|
36529
36524
|
//#region node_modules/@btc-vision/transaction/build/event/NetEvent.js
|
|
36530
36525
|
var NetEvent = class {
|
|
@@ -36548,7 +36543,6 @@ var SigningProtocol;
|
|
|
36548
36543
|
SigningProtocol["ECDSA"] = "ECDSA";
|
|
36549
36544
|
SigningProtocol["BIP322"] = "BIP322";
|
|
36550
36545
|
})(SigningProtocol || (SigningProtocol = {}));
|
|
36551
|
-
Symbol.dispose, Symbol.iterator;
|
|
36552
36546
|
//#endregion
|
|
36553
36547
|
//#region node_modules/yocto-queue/index.js
|
|
36554
36548
|
var Node = class {
|
package/build/_version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "1.8.
|
|
1
|
+
export declare const version = "1.8.8";
|
package/build/_version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '1.8.
|
|
1
|
+
export const version = '1.8.8';
|