opnet 1.7.21 → 1.7.22

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.
Files changed (55) hide show
  1. package/browser/229.index.js +1 -0
  2. package/browser/_version.d.ts +1 -1
  3. package/browser/block/Block.d.ts +8 -2
  4. package/browser/cache/LRUCaching.d.ts +7 -0
  5. package/browser/cache/P2OPCache.d.ts +2 -0
  6. package/browser/fetch/fetch-browser.d.ts +1 -0
  7. package/browser/fetch/fetch.d.ts +2 -2
  8. package/browser/fetch/fetcher-type.d.ts +4 -0
  9. package/browser/index.js +1 -1
  10. package/browser/providers/JSONRpcProvider.d.ts +5 -2
  11. package/browser/threading/JSONThreader.d.ts +20 -0
  12. package/browser/threading/SharedThreader.d.ts +36 -0
  13. package/browser/threading/WorkerCreator.d.ts +3 -0
  14. package/browser/threading/interfaces/IThread.d.ts +28 -0
  15. package/browser/threading/worker-scripts/JSONWorker.d.ts +2 -0
  16. package/build/_version.d.ts +1 -1
  17. package/build/_version.js +1 -1
  18. package/build/block/Block.d.ts +8 -2
  19. package/build/block/Block.js +24 -10
  20. package/build/cache/LRUCaching.d.ts +7 -0
  21. package/build/cache/LRUCaching.js +28 -0
  22. package/build/cache/P2OPCache.d.ts +2 -0
  23. package/build/cache/P2OPCache.js +19 -0
  24. package/build/fetch/fetch.d.ts +2 -2
  25. package/build/fetch/fetch.js +9 -5
  26. package/build/fetch/fetcher-type.d.ts +4 -0
  27. package/build/providers/JSONRpcProvider.d.ts +5 -2
  28. package/build/providers/JSONRpcProvider.js +22 -6
  29. package/build/threading/JSONThreader.d.ts +20 -0
  30. package/build/threading/JSONThreader.js +38 -0
  31. package/build/threading/SharedThreader.d.ts +36 -0
  32. package/build/threading/SharedThreader.js +184 -0
  33. package/build/threading/WorkerCreator.d.ts +3 -0
  34. package/build/threading/WorkerCreator.js +57 -0
  35. package/build/threading/interfaces/IThread.d.ts +28 -0
  36. package/build/threading/interfaces/IThread.js +1 -0
  37. package/build/threading/worker-scripts/JSONWorker.d.ts +2 -0
  38. package/build/threading/worker-scripts/JSONWorker.js +76 -0
  39. package/build/transactions/metadata/TransactionReceipt.js +4 -8
  40. package/package.json +3 -2
  41. package/src/_version.ts +1 -1
  42. package/src/block/Block.ts +32 -14
  43. package/src/cache/LRUCaching.ts +30 -0
  44. package/src/cache/P2OPCache.ts +22 -0
  45. package/src/fetch/fetch-browser.js +3 -1
  46. package/src/fetch/fetch.ts +14 -9
  47. package/src/fetch/fetcher-type.ts +5 -0
  48. package/src/providers/JSONRpcProvider.ts +24 -10
  49. package/src/threading/JSONThreader.ts +62 -0
  50. package/src/threading/SharedThreader.ts +255 -0
  51. package/src/threading/WorkerCreator.ts +67 -0
  52. package/src/threading/interfaces/IThread.ts +38 -0
  53. package/src/threading/worker-scripts/JSONWorker.ts +78 -0
  54. package/src/transactions/metadata/TransactionReceipt.ts +5 -14
  55. package/webpack.config.js +2 -0
@@ -0,0 +1 @@
1
+ export const __webpack_esm_id__=229;export const __webpack_esm_ids__=[229];export const __webpack_esm_modules__={229(){}};
@@ -1 +1 @@
1
- export declare const version = "1.7.21";
1
+ export declare const version = "1.7.22";
@@ -2,6 +2,7 @@ import { Network } from '@btc-vision/bitcoin';
2
2
  import { Address } from '@btc-vision/transaction';
3
3
  import { BigNumberish } from '../common/CommonTypes.js';
4
4
  import { OPNetTransactionTypes } from '../interfaces/opnet/OPNetTransactionTypes.js';
5
+ import { ITransaction } from '../transactions/interfaces/ITransaction.js';
5
6
  import { TransactionBase } from '../transactions/Transaction.js';
6
7
  import { BlockHeaderChecksumProof, IBlock } from './interfaces/IBlock.js';
7
8
  export declare class Block implements Omit<IBlock, 'gasUsed' | 'ema' | 'baseGas' | 'deployments'> {
@@ -26,7 +27,12 @@ export declare class Block implements Omit<IBlock, 'gasUsed' | 'ema' | 'baseGas'
26
27
  readonly baseGas: bigint;
27
28
  readonly gasUsed: bigint;
28
29
  readonly checksumProofs: BlockHeaderChecksumProof;
29
- readonly transactions: TransactionBase<OPNetTransactionTypes>[];
30
- readonly deployments: Address[];
30
+ private readonly _rawBlock;
31
+ private readonly _network;
31
32
  constructor(block: IBlock, network: Network);
33
+ private _transactions?;
34
+ get transactions(): TransactionBase<OPNetTransactionTypes>[];
35
+ private _deployments?;
36
+ get deployments(): Address[];
37
+ get rawTransactions(): ITransaction[];
32
38
  }
@@ -0,0 +1,7 @@
1
+ export declare class LRUCache<K, V> {
2
+ private readonly cache;
3
+ private readonly maxSize;
4
+ constructor(maxSize: number);
5
+ get(key: K): V | undefined;
6
+ set(key: K, value: V): void;
7
+ }
@@ -0,0 +1,2 @@
1
+ import { Network } from '@btc-vision/bitcoin';
2
+ export declare const getP2op: (rawAddress: string, network: Network) => string;
@@ -1,4 +1,5 @@
1
1
  export class Agent {
2
+ close(): Promise<void>;
2
3
  }
3
4
  export default def;
4
5
  export function fetch(input: any, init: any): any;
@@ -1,4 +1,4 @@
1
1
  import { Agent } from 'undici';
2
- import { Fetcher } from './fetcher-type.js';
3
- export declare function getFetcher(configs: Agent.Options): Fetcher;
2
+ import { FetcherWithCleanup } from './fetcher-type.js';
3
+ export declare function getFetcher(configs: Agent.Options): FetcherWithCleanup;
4
4
  export default getFetcher;
@@ -1,2 +1,6 @@
1
1
  import { RequestInfo, RequestInit, Response } from 'undici';
2
2
  export type Fetcher = (input: RequestInfo, init?: RequestInit) => Promise<Response>;
3
+ export interface FetcherWithCleanup {
4
+ fetch: Fetcher;
5
+ close: () => Promise<void>;
6
+ }