Skip to content

Commit

Permalink
Merge pull request #190 from bitcoin-sv/fromAtomicBeefV2Support
Browse files Browse the repository at this point in the history
Update Transaction fromBEEF, fromAtomicBEEF to support v1 and v2.
  • Loading branch information
ty-everett authored Feb 7, 2025
2 parents cc4eae7 + 380088b commit c8b12e4
Show file tree
Hide file tree
Showing 15 changed files with 790 additions and 921 deletions.
94 changes: 47 additions & 47 deletions docs/auth.md

Large diffs are not rendered by default.

48 changes: 24 additions & 24 deletions docs/compat.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default class ECIES {
}
```

See also: [PrivateKey](#class-privatekey), [PublicKey](#class-publickey)
See also: [PrivateKey](./primitives.md#class-privatekey), [PublicKey](./primitives.md#class-publickey)

<details>

Expand All @@ -45,7 +45,7 @@ Decrypts a message encrypted using the Bitcore variant of ECIES.
```ts
public static bitcoreDecrypt(encBuf: number[], toPrivateKey: PrivateKey): number[]
```
See also: [PrivateKey](#class-privatekey)
See also: [PrivateKey](./primitives.md#class-privatekey)

Returns

Expand All @@ -65,7 +65,7 @@ Encrypts a given message using the Bitcore variant of ECIES.
```ts
public static bitcoreEncrypt(messageBuf: number[], toPublicKey: PublicKey, fromPrivateKey?: PrivateKey, ivBuf?: number[]): number[]
```
See also: [PrivateKey](#class-privatekey), [PublicKey](#class-publickey)
See also: [PrivateKey](./primitives.md#class-privatekey), [PublicKey](./primitives.md#class-publickey)

Returns

Expand All @@ -89,7 +89,7 @@ Decrypts a message encrypted using the Electrum ECIES method.
```ts
public static electrumDecrypt(encBuf: number[], toPrivateKey: PrivateKey, fromPublicKey?: PublicKey): number[]
```
See also: [PrivateKey](#class-privatekey), [PublicKey](#class-publickey)
See also: [PrivateKey](./primitives.md#class-privatekey), [PublicKey](./primitives.md#class-publickey)

Returns

Expand All @@ -111,7 +111,7 @@ Encrypts a given message using the Electrum ECIES method.
```ts
public static electrumEncrypt(messageBuf: number[], toPublicKey: PublicKey, fromPrivateKey?: PrivateKey, noKey = false): number[]
```
See also: [PrivateKey](#class-privatekey), [PublicKey](#class-publickey)
See also: [PrivateKey](./primitives.md#class-privatekey), [PublicKey](./primitives.md#class-publickey)

Returns

Expand Down Expand Up @@ -140,7 +140,7 @@ public static ivkEkM(privKey: PrivateKey, pubKey: PublicKey): {
kM: number[];
}
```
See also: [PrivateKey](#class-privatekey), [PublicKey](#class-publickey)
See also: [PrivateKey](./primitives.md#class-privatekey), [PublicKey](./primitives.md#class-publickey)

Returns

Expand Down Expand Up @@ -191,7 +191,7 @@ export default class HD {
}
```

See also: [PrivateKey](#class-privatekey), [PublicKey](#class-publickey)
See also: [PrivateKey](./primitives.md#class-privatekey), [PublicKey](./primitives.md#class-publickey)

<details>

Expand All @@ -205,7 +205,7 @@ Initializes an HD wallet with optional parameters for version bytes, depth, pare
```ts
constructor(versionBytesNum?: number, depth?: number, parentFingerPrint?: number[], childIndex?: number, chainCode?: number[], privKey?: PrivateKey, pubKey?: PublicKey)
```
See also: [PrivateKey](#class-privatekey), [PublicKey](#class-publickey)
See also: [PrivateKey](./primitives.md#class-privatekey), [PublicKey](./primitives.md#class-publickey)

Argument Details

Expand All @@ -232,7 +232,7 @@ The path specifies the hierarchy of the child key to be derived.
```ts
public derive(path: string): HD
```
See also: [HD](#class-hd)
See also: [HD](./compat.md#class-hd)

Returns

Expand All @@ -251,7 +251,7 @@ This method generates either a private or public child key depending on the curr
```ts
public deriveChild(i: number): HD
```
See also: [HD](#class-hd)
See also: [HD](./compat.md#class-hd)

Returns

Expand All @@ -270,7 +270,7 @@ Parses a binary buffer to set up the wallet's properties.
```ts
public static fromBinary(buf: number[]): HD
```
See also: [HD](#class-hd)
See also: [HD](./compat.md#class-hd)

Returns

Expand Down Expand Up @@ -320,7 +320,7 @@ This method creates a root HD wallet with randomly generated private and public
```ts
public static fromRandom(): HD
```
See also: [HD](#class-hd)
See also: [HD](./compat.md#class-hd)

Returns

Expand All @@ -334,7 +334,7 @@ This method generates keys and other properties from a given seed, conforming to
```ts
public static fromSeed(bytes: number[]): HD
```
See also: [HD](#class-hd)
See also: [HD](./compat.md#class-hd)

Returns

Expand Down Expand Up @@ -371,7 +371,7 @@ This method decodes a provided string to set up the HD wallet's properties.
```ts
public static fromString(str: string): HD
```
See also: [HD](#class-hd)
See also: [HD](./compat.md#class-hd)

Returns

Expand Down Expand Up @@ -434,7 +434,7 @@ This method strips away the private key information, leaving only the public par
```ts
public toPublic(): HD
```
See also: [HD](#class-hd)
See also: [HD](./compat.md#class-hd)

Returns

Expand Down Expand Up @@ -489,7 +489,7 @@ export default class Mnemonic {
}
```

See also: [wordList](#variable-wordlist)
See also: [wordList](./compat.md#variable-wordlist)

<details>

Expand All @@ -502,7 +502,7 @@ Constructs a Mnemonic object.
```ts
constructor(mnemonic?: string, seed?: number[], wordlist = wordList)
```
See also: [wordList](#variable-wordlist)
See also: [wordList](./compat.md#variable-wordlist)

Argument Details

Expand Down Expand Up @@ -600,7 +600,7 @@ Static method to create a Mnemonic instance from a given entropy.
```ts
public static fromEntropy(buf: number[]): Mnemonic
```
See also: [Mnemonic](#class-mnemonic)
See also: [Mnemonic](./compat.md#class-mnemonic)

Returns

Expand Down Expand Up @@ -639,7 +639,7 @@ Static method to generate a Mnemonic instance with a random mnemonic.
```ts
public static fromRandom(bits?: number): Mnemonic
```
See also: [Mnemonic](#class-mnemonic)
See also: [Mnemonic](./compat.md#class-mnemonic)

Returns

Expand Down Expand Up @@ -674,7 +674,7 @@ Static method to create a Mnemonic instance from a mnemonic string.
```ts
public static fromString(str: string): Mnemonic
```
See also: [Mnemonic](#class-mnemonic)
See also: [Mnemonic](./compat.md#class-mnemonic)

Returns

Expand Down Expand Up @@ -823,7 +823,7 @@ export default function fromUtxo(utxo: jsonUtxo, unlockingScriptTemplate: {
}): TransactionInput
```

See also: [Transaction](#class-transaction), [TransactionInput](#interface-transactioninput), [UnlockingScript](#class-unlockingscript), [sign](#variable-sign)
See also: [Transaction](./transaction.md#class-transaction), [TransactionInput](./transaction.md#interface-transactioninput), [UnlockingScript](./script.md#class-unlockingscript), [sign](./compat.md#variable-sign)

<details>

Expand Down Expand Up @@ -873,7 +873,7 @@ magicHash = (messageBuf: number[]): number[] => {
}
```

See also: [Writer](#class-writer), [hash256](#variable-hash256), [toArray](#variable-toarray)
See also: [Writer](./primitives.md#class-writer), [hash256](./primitives.md#variable-hash256), [toArray](./primitives.md#variable-toarray)

Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)

Expand All @@ -893,7 +893,7 @@ sign = (message: number[], privateKey: PrivateKey, mode: "raw" | "base64" = "bas
}
```

See also: [BigNumber](#class-bignumber), [PrivateKey](#class-privatekey), [Signature](#class-signature), [magicHash](#variable-magichash)
See also: [BigNumber](./primitives.md#class-bignumber), [PrivateKey](./primitives.md#class-privatekey), [Signature](./primitives.md#class-signature), [magicHash](./compat.md#variable-magichash)

Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)

Expand All @@ -907,7 +907,7 @@ verify = (message: number[], sig: Signature, pubKey: PublicKey): boolean => {
}
```

See also: [BigNumber](#class-bignumber), [PublicKey](#class-publickey), [Signature](#class-signature), [magicHash](#variable-magichash)
See also: [BigNumber](./primitives.md#class-bignumber), [PublicKey](./primitives.md#class-publickey), [Signature](./primitives.md#class-signature), [magicHash](./compat.md#variable-magichash)

Links: [API](#api), [Interfaces](#interfaces), [Classes](#classes), [Functions](#functions), [Types](#types), [Enums](#enums), [Variables](#variables)

Expand Down
8 changes: 4 additions & 4 deletions docs/messages.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ decrypt = (message: number[], recipient: PrivateKey): number[] => {
}
```

See also: [PrivateKey](#class-privatekey), [PublicKey](#class-publickey), [Reader](#class-reader), [SymmetricKey](#class-symmetrickey), [encode](#variable-encode), [toBase64](#function-tobase64), [toHex](#variable-tohex)
See also: [PrivateKey](./primitives.md#class-privatekey), [PublicKey](./primitives.md#class-publickey), [Reader](./primitives.md#class-reader), [SymmetricKey](./primitives.md#class-symmetrickey), [encode](./primitives.md#variable-encode), [toBase64](./primitives.md#function-tobase64), [toHex](./primitives.md#variable-tohex)

Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)

Expand Down Expand Up @@ -76,7 +76,7 @@ encrypt = (message: number[], sender: PrivateKey, recipient: PublicKey): number[
}
```

See also: [PrivateKey](#class-privatekey), [PublicKey](#class-publickey), [SymmetricKey](#class-symmetrickey), [encode](#variable-encode), [toArray](#variable-toarray), [toBase64](#function-tobase64)
See also: [PrivateKey](./primitives.md#class-privatekey), [PublicKey](./primitives.md#class-publickey), [SymmetricKey](./primitives.md#class-symmetrickey), [encode](./primitives.md#variable-encode), [toArray](./primitives.md#variable-toarray), [toBase64](./primitives.md#function-tobase64)

Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)

Expand Down Expand Up @@ -109,7 +109,7 @@ sign = (message: number[], signer: PrivateKey, verifier?: PublicKey): number[] =
}
```

See also: [Curve](#class-curve), [PrivateKey](#class-privatekey), [PublicKey](#class-publickey), [encode](#variable-encode), [toArray](#variable-toarray), [toBase64](#function-tobase64)
See also: [Curve](./primitives.md#class-curve), [PrivateKey](./primitives.md#class-privatekey), [PublicKey](./primitives.md#class-publickey), [encode](./primitives.md#variable-encode), [toArray](./primitives.md#variable-toarray), [toBase64](./primitives.md#function-tobase64)

Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)

Expand Down Expand Up @@ -149,7 +149,7 @@ verify = (message: number[], sig: number[], recipient?: PrivateKey): boolean =>
}
```

See also: [PrivateKey](#class-privatekey), [PublicKey](#class-publickey), [Reader](#class-reader), [Signature](#class-signature), [encode](#variable-encode), [toBase64](#function-tobase64), [toHex](#variable-tohex)
See also: [PrivateKey](./primitives.md#class-privatekey), [PublicKey](./primitives.md#class-publickey), [Reader](./primitives.md#class-reader), [Signature](./primitives.md#class-signature), [encode](./primitives.md#variable-encode), [toBase64](./primitives.md#function-tobase64), [toHex](./primitives.md#variable-tohex)

Links: [API](#api), [Classes](#classes), [Functions](#functions), [Variables](#variables)

Expand Down
Loading

0 comments on commit c8b12e4

Please sign in to comment.