bsv-wasm-bundler
Advanced tools
Comparing version 0.9.9 to 1.0.0
/* tslint:disable */ | ||
/* eslint-disable */ | ||
/** | ||
*/ | ||
export enum SigningHash { | ||
Sha256, | ||
Sha256d, | ||
} | ||
/** | ||
*/ | ||
export enum PBKDF2Hashes { | ||
SHA1, | ||
SHA256, | ||
SHA512, | ||
} | ||
/** | ||
*/ | ||
export enum SigHash { | ||
FORKID, | ||
ALL, | ||
NONE, | ||
SINGLE, | ||
ANYONECANPAY, | ||
/** | ||
* | ||
* * ALL | FORKID | ||
* | ||
*/ | ||
InputsOutputs, | ||
/** | ||
* | ||
* * NONE | FORKID | ||
* | ||
*/ | ||
Inputs, | ||
/** | ||
* | ||
* * SINGLE | FORKID | ||
* | ||
*/ | ||
InputsOutput, | ||
/** | ||
* | ||
* * ALL | ANYONECANPAY | FORKID | ||
* | ||
*/ | ||
InputOutputs, | ||
/** | ||
* | ||
* * NONE | ANYONECANPAY | FORKID | ||
* | ||
*/ | ||
Input, | ||
/** | ||
* | ||
* * SINGLE | ANYONECANPAY | FORKID | ||
* | ||
*/ | ||
InputOutput, | ||
/** | ||
* | ||
* * ALL | ANYONECANPAY | ||
* | ||
*/ | ||
Legacy_InputOutputs, | ||
/** | ||
* | ||
* * NONE | ANYONECANPAY | ||
* | ||
*/ | ||
Legacy_Input, | ||
/** | ||
* | ||
* * SINGLE | ANYONECANPAY | ||
* | ||
*/ | ||
Legacy_InputOutput, | ||
} | ||
/** | ||
* | ||
* * This entire page is borrowed from rust-sv (https://github.com/brentongunning/rust-sv/blob/master/src/script/op_codes.rs) | ||
@@ -474,9 +550,2 @@ * | ||
*/ | ||
export enum PBKDF2Hashes { | ||
SHA1, | ||
SHA256, | ||
SHA512, | ||
} | ||
/** | ||
*/ | ||
export class AES { | ||
@@ -514,3 +583,31 @@ free(): void; | ||
/** | ||
* | ||
* * A handy struct to allow calling of various utility methods | ||
* | ||
*/ | ||
export class Bytes { | ||
free(): void; | ||
/** | ||
* @returns {Uint8Array} | ||
*/ | ||
readReverse(): Uint8Array; | ||
/** | ||
* @returns {Uint8Array} | ||
*/ | ||
read(): Uint8Array; | ||
/** | ||
*/ | ||
reverse(): void; | ||
/** | ||
* @returns {string} | ||
*/ | ||
toHex(): string; | ||
/** | ||
* @param {string} hex_str | ||
* @returns {Bytes} | ||
*/ | ||
static fromHex(hex_str: string): Bytes; | ||
} | ||
/** | ||
*/ | ||
export class ExtendedPrivateKey { | ||
@@ -797,2 +894,6 @@ free(): void; | ||
/** | ||
* | ||
* * SHA256s and then signs the specified message. | ||
* * Secp256k1 signature inputs must be 32 bytes in length, SHA256 is to ensure this. | ||
* | ||
* @param {Uint8Array} msg | ||
@@ -862,2 +963,5 @@ * @returns {Signature} | ||
/** | ||
*/ | ||
remove_codeseparators(): void; | ||
/** | ||
* @returns {string} | ||
@@ -883,5 +987,22 @@ */ | ||
*/ | ||
export class SighashSignature { | ||
free(): void; | ||
/** | ||
* @returns {string} | ||
*/ | ||
toHex(): string; | ||
/** | ||
* @returns {Uint8Array} | ||
*/ | ||
toBytes(): Uint8Array; | ||
} | ||
/** | ||
*/ | ||
export class Signature { | ||
free(): void; | ||
/** | ||
* @returns {Uint8Array} | ||
*/ | ||
toDER(): Uint8Array; | ||
/** | ||
* @param {Uint8Array} bytes | ||
@@ -901,6 +1022,2 @@ * @returns {Signature} | ||
/** | ||
* @returns {Uint8Array} | ||
*/ | ||
toDER(): Uint8Array; | ||
/** | ||
* @param {Uint8Array} message | ||
@@ -964,2 +1081,12 @@ * @param {PublicKey} pub_key | ||
/** | ||
* @param {number} index | ||
* @param {TxIn} input | ||
*/ | ||
setInput(index: number, input: TxIn): void; | ||
/** | ||
* @param {number} index | ||
* @param {TxOut} output | ||
*/ | ||
setOutput(index: number, output: TxOut): void; | ||
/** | ||
* @param {string} hex_str | ||
@@ -970,6 +1097,15 @@ * @returns {Transaction} | ||
/** | ||
* @param {Uint8Array} tx_bytes | ||
* @returns {Transaction} | ||
*/ | ||
static fromBytes(tx_bytes: Uint8Array): Transaction; | ||
/** | ||
* @returns {string} | ||
*/ | ||
toJSON(): string; | ||
toString(): string; | ||
/** | ||
* @returns {any} | ||
*/ | ||
toJSON(): any; | ||
/** | ||
* @returns {Uint8Array} | ||
@@ -982,2 +1118,49 @@ */ | ||
toHex(): string; | ||
/** | ||
* | ||
* * Adds an array of TxIn's to the transaction | ||
* * @param {TxIn[]} tx_ins | ||
* | ||
* @param {any[]} tx_ins | ||
*/ | ||
addInputs(tx_ins: any[]): void; | ||
/** | ||
* | ||
* * Adds an array of TxOuts to the transaction | ||
* * @param {TxOut[]} tx_outs | ||
* | ||
* @param {any[]} tx_outs | ||
*/ | ||
addOutputs(tx_outs: any[]): void; | ||
/** | ||
* | ||
* * Gets the ID of the current transaction as a hex string. | ||
* | ||
* @returns {string} | ||
*/ | ||
getIdHex(): string; | ||
/** | ||
* | ||
* * Gets the ID of the current transaction as a Uint8Array. | ||
* | ||
* @returns {Uint8Array} | ||
*/ | ||
getIdBytes(): Uint8Array; | ||
/** | ||
* @param {PrivateKey} priv_key | ||
* @param {number} sighash | ||
* @param {number} n_tx_in | ||
* @param {Script} unsigned_script | ||
* @param {BigInt} value | ||
* @returns {SighashSignature} | ||
*/ | ||
sign(priv_key: PrivateKey, sighash: number, n_tx_in: number, unsigned_script: Script, value: BigInt): SighashSignature; | ||
/** | ||
* @param {number} sighash | ||
* @param {number} n_tx_in | ||
* @param {Script} unsigned_script | ||
* @param {BigInt} value | ||
* @returns {Uint8Array} | ||
*/ | ||
sighashPreimage(sighash: number, n_tx_in: number, unsigned_script: Script, value: BigInt): Uint8Array; | ||
} | ||
@@ -996,9 +1179,11 @@ /** | ||
/** | ||
* @param {boolean | undefined} little_endian | ||
* @returns {Uint8Array} | ||
*/ | ||
getPrevTxId(): Uint8Array; | ||
getPrevTxId(little_endian?: boolean): Uint8Array; | ||
/** | ||
* @param {boolean | undefined} little_endian | ||
* @returns {string} | ||
*/ | ||
getPrevTxIdHex(): string; | ||
getPrevTxIdHex(little_endian?: boolean): string; | ||
/** | ||
@@ -1029,10 +1214,28 @@ * @returns {number} | ||
/** | ||
* @param {boolean | undefined} little_endian | ||
* @returns {Uint8Array} | ||
*/ | ||
getOutpointBytes(): Uint8Array; | ||
getOutpointBytes(little_endian?: boolean): Uint8Array; | ||
/** | ||
* @param {boolean | undefined} little_endian | ||
* @returns {string} | ||
*/ | ||
getOutpointHex(): string; | ||
getOutpointHex(little_endian?: boolean): string; | ||
/** | ||
* @param {Script} script | ||
*/ | ||
setScript(script: Script): void; | ||
/** | ||
* @param {Uint8Array} txid | ||
*/ | ||
setPrevTxId(txid: Uint8Array): void; | ||
/** | ||
* @param {number} vout | ||
*/ | ||
setVOut(vout: number): void; | ||
/** | ||
* @param {number} sequence | ||
*/ | ||
setSequence(sequence: number): void; | ||
/** | ||
* @param {string} hex_str | ||
@@ -1043,2 +1246,10 @@ * @returns {TxIn} | ||
/** | ||
* @returns {any} | ||
*/ | ||
toJSON(): any; | ||
/** | ||
* @returns {string} | ||
*/ | ||
toString(): string; | ||
/** | ||
* @returns {Uint8Array} | ||
@@ -1094,2 +1305,10 @@ */ | ||
toHex(): string; | ||
/** | ||
* @returns {any} | ||
*/ | ||
toJSON(): any; | ||
/** | ||
* @returns {string} | ||
*/ | ||
toString(): string; | ||
} |
@@ -7,3 +7,3 @@ { | ||
"description": "A Bitcoin SV library with WASM in mind.", | ||
"version": "0.9.9", | ||
"version": "1.0.0", | ||
"license": "MIT", | ||
@@ -10,0 +10,0 @@ "files": [ |
@@ -12,2 +12,5 @@ # BSV.WASM | ||
Webpack: | ||
`npm i bsv-wasm-bundler --save` | ||
Rust: | ||
@@ -18,2 +21,4 @@ https://crates.io/crates/bsv-wasm | ||
- Hash (SHA256, SHA256d, SHA1, RIPEMD160, Hash160, SHA512) | ||
- KDF (PBKDF2) | ||
- Encryption (AES-CBC) | ||
- ECDSA (Private Key, Public Key, Signatures) | ||
@@ -23,13 +28,12 @@ - Transaction (Building, Serialising, Deserialising) | ||
- Addresses (P2PKH) | ||
- Sighash Support | ||
- Extended Private Keys and Child Derivation (BIP32, BIP42) | ||
## TODO: | ||
- [ ] SigHash Support | ||
- [ ] AES-CTR | ||
- [ ] ECIES | ||
- [ ] Script Builder | ||
- [ ] Isomorphic Package for JS | ||
- [ ] Write documentation | ||
- [ ] BIP32 | ||
- [ ] BIP44 | ||
- [ ] Write documentation (Inline on functions and structs) | ||
- [ ] Testnet Support | ||
- [ ] Nicer way to pass an array of TxIn and TxOut into things (currenly limited by https://github.com/rustwasm/wasm-bindgen/issues/111) | ||
@@ -36,0 +40,0 @@ ## Will not do: |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
579240
4100
1
45