@btc-vision/transaction 1.6.0 → 1.6.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.
Files changed (49) hide show
  1. package/browser/_version.d.ts +1 -1
  2. package/browser/epoch/ChallengeSolution.d.ts +3 -3
  3. package/browser/epoch/validator/EpochValidator.d.ts +5 -6
  4. package/browser/generators/builders/DeploymentGenerator.d.ts +1 -1
  5. package/browser/generators/builders/LegacyCalldataGenerator.d.ts +1 -1
  6. package/browser/index.js +1 -1
  7. package/browser/keypair/AddressVerificator.d.ts +2 -1
  8. package/browser/transaction/TransactionFactory.d.ts +2 -2
  9. package/browser/transaction/builders/DeploymentTransaction.d.ts +1 -1
  10. package/browser/transaction/builders/TransactionBuilder.d.ts +3 -0
  11. package/browser/transaction/interfaces/ITransactionParameters.d.ts +1 -0
  12. package/browser/transaction/shared/TweakedTransaction.d.ts +18 -0
  13. package/browser/utxo/OPNetLimitedProvider.d.ts +0 -4
  14. package/build/_version.d.ts +1 -1
  15. package/build/_version.js +1 -1
  16. package/build/epoch/ChallengeSolution.d.ts +3 -3
  17. package/build/epoch/ChallengeSolution.js +4 -4
  18. package/build/epoch/validator/EpochValidator.d.ts +5 -6
  19. package/build/epoch/validator/EpochValidator.js +16 -17
  20. package/build/generators/builders/DeploymentGenerator.d.ts +1 -1
  21. package/build/generators/builders/DeploymentGenerator.js +5 -5
  22. package/build/generators/builders/LegacyCalldataGenerator.d.ts +1 -1
  23. package/build/generators/builders/LegacyCalldataGenerator.js +2 -2
  24. package/build/keypair/AddressVerificator.d.ts +2 -1
  25. package/build/keypair/AddressVerificator.js +4 -0
  26. package/build/transaction/TransactionFactory.d.ts +2 -2
  27. package/build/transaction/TransactionFactory.js +2 -2
  28. package/build/transaction/builders/DeploymentTransaction.d.ts +1 -1
  29. package/build/transaction/builders/DeploymentTransaction.js +4 -4
  30. package/build/transaction/builders/TransactionBuilder.d.ts +3 -0
  31. package/build/transaction/builders/TransactionBuilder.js +18 -3
  32. package/build/transaction/interfaces/ITransactionParameters.d.ts +1 -0
  33. package/build/transaction/shared/TweakedTransaction.d.ts +18 -0
  34. package/build/transaction/shared/TweakedTransaction.js +135 -18
  35. package/build/utxo/OPNetLimitedProvider.d.ts +0 -4
  36. package/build/utxo/OPNetLimitedProvider.js +0 -7
  37. package/package.json +2 -2
  38. package/src/_version.ts +1 -1
  39. package/src/epoch/ChallengeSolution.ts +10 -10
  40. package/src/epoch/validator/EpochValidator.ts +18 -22
  41. package/src/generators/builders/DeploymentGenerator.ts +6 -6
  42. package/src/generators/builders/LegacyCalldataGenerator.ts +3 -3
  43. package/src/keypair/AddressVerificator.ts +7 -1
  44. package/src/transaction/TransactionFactory.ts +4 -4
  45. package/src/transaction/builders/DeploymentTransaction.ts +5 -5
  46. package/src/transaction/builders/TransactionBuilder.ts +30 -3
  47. package/src/transaction/interfaces/ITransactionParameters.ts +1 -0
  48. package/src/transaction/shared/TweakedTransaction.ts +210 -23
  49. package/src/utxo/OPNetLimitedProvider.ts +0 -17
@@ -1 +1 @@
1
- export declare const version = "1.6.0";
1
+ export declare const version = "1.6.4";
@@ -29,14 +29,14 @@ export declare class ChallengeSolution implements IChallengeSolution {
29
29
  readonly verification: ChallengeVerification;
30
30
  private readonly submission?;
31
31
  constructor(data: RawChallenge);
32
- static validateRaw(data: RawChallenge): Promise<boolean>;
32
+ static validateRaw(data: RawChallenge): boolean;
33
33
  verifySubmissionSignature(): boolean;
34
34
  getSubmission(): ChallengeSubmission | undefined;
35
- verify(): Promise<boolean>;
35
+ verify(): boolean;
36
36
  toBuffer(): Buffer;
37
37
  toHex(): string;
38
38
  toRaw(): RawChallenge;
39
- calculateSolution(): Promise<Buffer>;
39
+ calculateSolution(): Buffer;
40
40
  checkDifficulty(minDifficulty: number): {
41
41
  valid: boolean;
42
42
  difficulty: number;
@@ -1,17 +1,16 @@
1
1
  import { IChallengeSolution, RawChallenge } from '../interfaces/IChallengeSolution.js';
2
2
  export declare class EpochValidator {
3
3
  private static readonly BLOCKS_PER_EPOCH;
4
- private static readonly GRAFFITI_LENGTH;
5
4
  static bufferToUint8Array(buffer: Buffer): Uint8Array;
6
5
  static uint8ArrayToBuffer(array: Uint8Array): Buffer;
7
- static sha1(data: Uint8Array): Promise<Uint8Array>;
6
+ static sha1(data: Uint8Array | Buffer): Buffer;
8
7
  static calculatePreimage(checksumRoot: Buffer, publicKey: Buffer, salt: Buffer): Buffer;
9
8
  static countMatchingBits(hash1: Buffer, hash2: Buffer): number;
10
- static verifySolution(preimage: IChallengeSolution, log?: boolean): Promise<boolean>;
9
+ static verifySolution(challenge: IChallengeSolution, log?: boolean): boolean;
11
10
  static getMiningTargetBlock(epochNumber: bigint): bigint | null;
12
- static validateEpochWinner(epochData: RawChallenge): Promise<boolean>;
13
- static validatePreimage(preimage: IChallengeSolution): Promise<boolean>;
14
- static calculateSolution(targetChecksum: Buffer, publicKey: Buffer, salt: Buffer): Promise<Buffer>;
11
+ static validateEpochWinner(epochData: RawChallenge): boolean;
12
+ static validateChallengeSolution(challenge: IChallengeSolution): boolean;
13
+ static calculateSolution(targetChecksum: Buffer, publicKey: Buffer, salt: Buffer): Buffer;
15
14
  static checkDifficulty(solution: Buffer, targetHash: Buffer, minDifficulty: number): {
16
15
  valid: boolean;
17
16
  difficulty: number;
@@ -6,6 +6,6 @@ export declare const OPNET_DEPLOYMENT_VERSION = 0;
6
6
  export declare const versionBuffer: Buffer<ArrayBuffer>;
7
7
  export declare class DeploymentGenerator extends Generator {
8
8
  constructor(senderPubKey: Buffer, contractSaltPubKey: Buffer, network?: Network);
9
- compile(contractBytecode: Buffer, contractSalt: Buffer, preimage: ChallengeSolution, maxPriority: bigint, calldata?: Buffer, features?: Feature<Features>[]): Buffer;
9
+ compile(contractBytecode: Buffer, contractSalt: Buffer, challenge: ChallengeSolution, maxPriority: bigint, calldata?: Buffer, features?: Feature<Features>[]): Buffer;
10
10
  private getAsm;
11
11
  }
@@ -4,5 +4,5 @@ import { Feature, Features } from '../Features.js';
4
4
  export declare class LegacyCalldataGenerator extends Generator {
5
5
  constructor(senderPubKey: Buffer, network?: Network);
6
6
  static getPubKeyAsBuffer(witnessKeys: Buffer[], network: Network): Buffer;
7
- compile(calldata: Buffer, contractSecret: Buffer, preimage: Buffer, maxPriority: bigint, features?: Feature<Features>[]): Buffer;
7
+ compile(calldata: Buffer, contractSecret: Buffer, challenge: Buffer, maxPriority: bigint, features?: Feature<Features>[]): Buffer;
8
8
  }