@btc-vision/transaction 1.7.31 → 1.8.0-alpha.2

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 (64) hide show
  1. package/AUDIT/README.md +9 -0
  2. package/CHANGELOG.md +5 -0
  3. package/README.md +62 -18
  4. package/SECURITY.md +71 -0
  5. package/browser/_version.d.ts +1 -1
  6. package/browser/abi/ABICoder.d.ts +8 -0
  7. package/browser/buffer/BinaryReader.d.ts +16 -1
  8. package/browser/buffer/BinaryWriter.d.ts +11 -1
  9. package/browser/deterministic/ExtendedAddressMap.d.ts +19 -0
  10. package/browser/index.js +1201 -874
  11. package/browser/keypair/Address.d.ts +4 -1
  12. package/browser/mnemonic/Mnemonic.d.ts +1 -1
  13. package/browser/noble-curves.js +1087 -1116
  14. package/browser/noble-hashes.js +25 -25
  15. package/browser/opnet.d.ts +1 -0
  16. package/browser/transaction/browser/WalletNetworks.d.ts +3 -3
  17. package/browser/transaction/browser/types/Unisat.d.ts +2 -2
  18. package/browser/utils/lengths.d.ts +3 -1
  19. package/browser/utils/types.d.ts +3 -0
  20. package/browser/vendors.js +950 -911
  21. package/build/_version.d.ts +1 -1
  22. package/build/_version.js +1 -1
  23. package/build/abi/ABICoder.d.ts +8 -0
  24. package/build/abi/ABICoder.js +32 -0
  25. package/build/buffer/BinaryReader.d.ts +16 -1
  26. package/build/buffer/BinaryReader.js +66 -1
  27. package/build/buffer/BinaryWriter.d.ts +11 -1
  28. package/build/buffer/BinaryWriter.js +66 -1
  29. package/build/deterministic/ExtendedAddressMap.d.ts +19 -0
  30. package/build/deterministic/ExtendedAddressMap.js +87 -0
  31. package/build/keypair/Address.d.ts +4 -1
  32. package/build/keypair/Address.js +48 -13
  33. package/build/mnemonic/Mnemonic.d.ts +1 -1
  34. package/build/mnemonic/Mnemonic.js +2 -2
  35. package/build/opnet.d.ts +1 -0
  36. package/build/opnet.js +1 -0
  37. package/build/transaction/browser/WalletNetworks.d.ts +3 -3
  38. package/build/transaction/browser/WalletNetworks.js +3 -3
  39. package/build/transaction/browser/extensions/UnisatSigner.js +3 -3
  40. package/build/transaction/browser/types/Unisat.d.ts +2 -2
  41. package/build/transaction/builders/MultiSignTransaction.js +2 -2
  42. package/build/transaction/shared/TweakedTransaction.js +3 -3
  43. package/build/tsconfig.build.tsbuildinfo +1 -1
  44. package/build/utils/lengths.d.ts +3 -1
  45. package/build/utils/lengths.js +3 -1
  46. package/build/utils/types.d.ts +3 -0
  47. package/package.json +13 -13
  48. package/src/_version.ts +1 -1
  49. package/src/abi/ABICoder.ts +43 -0
  50. package/src/buffer/BinaryReader.ts +158 -2
  51. package/src/buffer/BinaryWriter.ts +143 -1
  52. package/src/deterministic/ExtendedAddressMap.ts +122 -0
  53. package/src/keypair/Address.ts +79 -14
  54. package/src/mnemonic/Mnemonic.ts +2 -2
  55. package/src/opnet.ts +1 -0
  56. package/src/transaction/browser/WalletNetworks.ts +3 -3
  57. package/src/transaction/browser/extensions/UnisatSigner.ts +3 -3
  58. package/src/transaction/browser/types/Unisat.ts +2 -2
  59. package/src/transaction/builders/MultiSignTransaction.ts +2 -2
  60. package/src/transaction/shared/TweakedTransaction.ts +3 -3
  61. package/src/utils/lengths.ts +3 -1
  62. package/src/utils/types.ts +4 -1
  63. package/test/binary-reader-writer.test.ts +457 -0
  64. package/test/derivePath.test.ts +26 -25
@@ -16,8 +16,9 @@ export declare class Address extends Uint8Array {
16
16
  static fromString(mldsaPublicKey: string, legacyPublicKey?: string): Address;
17
17
  static wrap(bytes: ArrayLike<number>): Address;
18
18
  static uncompressedToCompressed(publicKey: ArrayLike<number>): Buffer;
19
- static fromBigInt(value: bigint): Address;
19
+ static fromBigInt(value: bigint, tweakedValue?: bigint): Address;
20
20
  static fromUint64Array(w0: bigint, w1: bigint, w2: bigint, w3: bigint): Address;
21
+ private static bigintToUint8Array;
21
22
  toUint64Array(): [bigint, bigint, bigint, bigint];
22
23
  isDead(): boolean;
23
24
  toHex(): string;
@@ -30,6 +31,7 @@ export declare class Address extends Uint8Array {
30
31
  toHybridPublicKeyBuffer(): Buffer;
31
32
  originalPublicKeyBuffer(): Buffer;
32
33
  toBigInt(): bigint;
34
+ tweakedToBigInt(): bigint;
33
35
  equals(a: Address): boolean;
34
36
  lessThan(a: Address): boolean;
35
37
  greaterThan(a: Address): boolean;
@@ -48,6 +50,7 @@ export declare class Address extends Uint8Array {
48
50
  p2op(network: Network): string;
49
51
  toTweakedHybridPublicKeyHex(): string;
50
52
  toTweakedHybridPublicKeyBuffer(): Buffer;
53
+ private ensureTweakedUncompressed;
51
54
  private setMldsaKey;
52
55
  private ensureLegacyProcessed;
53
56
  private autoFormat;
@@ -22,7 +22,7 @@ export declare class Mnemonic {
22
22
  static generate(strength?: MnemonicStrength, passphrase?: string, network?: Network, securityLevel?: MLDSASecurityLevel): Mnemonic;
23
23
  static validate(phrase: string): boolean;
24
24
  derive(index?: number, account?: number, isChange?: boolean, bipStandard?: BIPStandard): Wallet;
25
- deriveUnisat(addressType?: AddressTypes, index?: number, account?: number, isChange?: boolean): Wallet;
25
+ deriveOPWallet(addressType?: AddressTypes, index?: number, account?: number, isChange?: boolean): Wallet;
26
26
  deriveMultipleUnisat(addressType?: AddressTypes, count?: number, startIndex?: number, account?: number, isChange?: boolean): Wallet[];
27
27
  deriveMultiple(count: number, startIndex?: number, account?: number, isChange?: boolean, bipStandard?: BIPStandard): Wallet[];
28
28
  deriveCustomPath(classicalPath: string, quantumPath: string): Wallet;