opnet 1.4.2 → 1.4.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.
@@ -1 +1 @@
1
- export declare const version = "1.4.2";
1
+ export declare const version = "1.4.4";
package/build/_version.js CHANGED
@@ -1 +1 @@
1
- export const version = '1.4.2';
1
+ export const version = '1.4.4';
@@ -4,7 +4,7 @@ import { BigNumberish } from '../common/CommonTypes.js';
4
4
  import { OPNetTransactionTypes } from '../interfaces/opnet/OPNetTransactionTypes.js';
5
5
  import { TransactionBase } from '../transactions/Transaction.js';
6
6
  import { BlockHeaderChecksumProof, IBlock } from './interfaces/IBlock.js';
7
- export declare class Block implements Omit<IBlock, 'gasUsed' | 'ema' | 'baseGas' | 'deployedContracts'> {
7
+ export declare class Block implements Omit<IBlock, 'gasUsed' | 'ema' | 'baseGas' | 'deployments'> {
8
8
  readonly height: BigNumberish;
9
9
  readonly hash: string;
10
10
  readonly previousBlockHash: string;
@@ -27,6 +27,6 @@ export declare class Block implements Omit<IBlock, 'gasUsed' | 'ema' | 'baseGas'
27
27
  readonly gasUsed: bigint;
28
28
  readonly checksumProofs: BlockHeaderChecksumProof;
29
29
  readonly transactions: TransactionBase<OPNetTransactionTypes>[];
30
- readonly deployedContracts: Address[];
30
+ readonly deployments: Address[];
31
31
  constructor(block: IBlock, network: Network);
32
32
  }
@@ -23,7 +23,7 @@ export class Block {
23
23
  gasUsed;
24
24
  checksumProofs;
25
25
  transactions = [];
26
- deployedContracts = [];
26
+ deployments = [];
27
27
  constructor(block, network) {
28
28
  this.height = BigInt(block.height.toString());
29
29
  this.hash = block.hash;
@@ -47,8 +47,8 @@ export class Block {
47
47
  this.receiptRoot = block.receiptRoot;
48
48
  this.checksumProofs = block.checksumProofs;
49
49
  this.transactions = TransactionParser.parseTransactions(block.transactions, network);
50
- this.deployedContracts = block.deployedContracts
51
- ? block.deployedContracts.map((address) => {
50
+ this.deployments = block.deployments
51
+ ? block.deployments.map((address) => {
52
52
  return Address.fromString(address);
53
53
  })
54
54
  : [];
@@ -28,5 +28,5 @@ export interface IBlockCommon {
28
28
  }
29
29
  export interface IBlock extends IBlockCommon {
30
30
  transactions?: ITransaction[] | TransactionBase<OPNetTransactionTypes>[];
31
- deployedContracts?: string[];
31
+ deployments?: string[];
32
32
  }
@@ -1,3 +1,4 @@
1
+ import { Address } from '@btc-vision/transaction';
1
2
  export class ContractData {
2
3
  contractAddress;
3
4
  virtualAddress;
@@ -29,6 +30,9 @@ export class ContractData {
29
30
  this.contractSaltHash = Buffer.isBuffer(raw.contractSaltHash)
30
31
  ? raw.contractSaltHash
31
32
  : Buffer.from(raw.contractSaltHash, 'base64');
32
- this.deployerAddress = raw.deployerAddress;
33
+ this.deployerAddress =
34
+ !raw.deployerAddress && this.deployerPubKey
35
+ ? new Address(this.deployerPubKey)
36
+ : raw.deployerAddress;
33
37
  }
34
38
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "opnet",
3
3
  "type": "module",
4
- "version": "1.4.2",
4
+ "version": "1.4.4",
5
5
  "author": "OP_NET",
6
6
  "description": "The perfect library for building Bitcoin-based applications.",
7
7
  "engines": {
package/src/_version.ts CHANGED
@@ -1 +1 @@
1
- export const version = '1.4.2';
1
+ export const version = '1.4.4';
@@ -12,7 +12,7 @@ import { BlockHeaderChecksumProof, IBlock } from './interfaces/IBlock.js';
12
12
  * @class Block
13
13
  * @category Block
14
14
  */
15
- export class Block implements Omit<IBlock, 'gasUsed' | 'ema' | 'baseGas' | 'deployedContracts'> {
15
+ export class Block implements Omit<IBlock, 'gasUsed' | 'ema' | 'baseGas' | 'deployments'> {
16
16
  public readonly height: BigNumberish;
17
17
 
18
18
  public readonly hash: string;
@@ -43,7 +43,7 @@ export class Block implements Omit<IBlock, 'gasUsed' | 'ema' | 'baseGas' | 'depl
43
43
  public readonly checksumProofs: BlockHeaderChecksumProof;
44
44
 
45
45
  public readonly transactions: TransactionBase<OPNetTransactionTypes>[] = [];
46
- public readonly deployedContracts: Address[] = [];
46
+ public readonly deployments: Address[] = [];
47
47
 
48
48
  constructor(block: IBlock, network: Network) {
49
49
  this.height = BigInt(block.height.toString());
@@ -80,8 +80,8 @@ export class Block implements Omit<IBlock, 'gasUsed' | 'ema' | 'baseGas' | 'depl
80
80
  network,
81
81
  );
82
82
 
83
- this.deployedContracts = block.deployedContracts
84
- ? block.deployedContracts.map((address) => {
83
+ this.deployments = block.deployments
84
+ ? block.deployments.map((address) => {
85
85
  return Address.fromString(address);
86
86
  })
87
87
  : [];
@@ -47,5 +47,5 @@ export interface IBlockCommon {
47
47
  */
48
48
  export interface IBlock extends IBlockCommon {
49
49
  transactions?: ITransaction[] | TransactionBase<OPNetTransactionTypes>[];
50
- deployedContracts?: string[];
50
+ deployments?: string[];
51
51
  }
@@ -49,6 +49,9 @@ export class ContractData implements IRawContract {
49
49
  ? raw.contractSaltHash
50
50
  : Buffer.from(raw.contractSaltHash, 'base64');
51
51
 
52
- this.deployerAddress = raw.deployerAddress;
52
+ this.deployerAddress =
53
+ !raw.deployerAddress && this.deployerPubKey
54
+ ? new Address(this.deployerPubKey)
55
+ : raw.deployerAddress;
53
56
  }
54
57
  }