bsv-wasm-bundler
Advanced tools
Comparing version 1.1.2 to 1.2.0-beta.1
@@ -18,66 +18,3 @@ /* tslint:disable */ | ||
/** | ||
*/ | ||
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) | ||
@@ -552,2 +489,65 @@ * | ||
*/ | ||
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, | ||
} | ||
/** | ||
*/ | ||
export enum PBKDF2Hashes { | ||
@@ -642,2 +642,28 @@ SHA1, | ||
/** | ||
*/ | ||
export class CipherKeys { | ||
free(): void; | ||
/** | ||
* @returns {Uint8Array} | ||
*/ | ||
get_iv(): Uint8Array; | ||
/** | ||
* @returns {Uint8Array} | ||
*/ | ||
get_ke(): Uint8Array; | ||
/** | ||
* @returns {Uint8Array} | ||
*/ | ||
get_km(): Uint8Array; | ||
} | ||
export class ECDH { | ||
free(): void; | ||
/** | ||
* @param {PrivateKey} priv_key | ||
* @param {PublicKey} pub_key | ||
* @returns {Uint8Array} | ||
*/ | ||
static deriveSharedKey(priv_key: PrivateKey, pub_key: PublicKey): Uint8Array; | ||
} | ||
/** | ||
* | ||
@@ -674,4 +700,65 @@ * * Utility struct for low level ECDSA primitives | ||
} | ||
export class ECIES { | ||
free(): void; | ||
/** | ||
* @param {Uint8Array} message | ||
* @param {PrivateKey} sender_priv_key | ||
* @param {PublicKey} recipient_pub_key | ||
* @param {boolean} exclude_pub_key | ||
* @returns {ECIESCiphertext} | ||
*/ | ||
static encrypt(message: Uint8Array, sender_priv_key: PrivateKey, recipient_pub_key: PublicKey, exclude_pub_key: boolean): ECIESCiphertext; | ||
/** | ||
* | ||
* * Encrypt with a randomly generate private key. | ||
* * This is intended to be used if you want to anonymously send a party an encrypted message. | ||
* | ||
* @param {Uint8Array} message | ||
* @param {PublicKey} recipient_pub_key | ||
* @returns {ECIESCiphertext} | ||
*/ | ||
static encryptWithEphemeralKey(message: Uint8Array, recipient_pub_key: PublicKey): ECIESCiphertext; | ||
/** | ||
* @param {ECIESCiphertext} ciphertext | ||
* @param {PrivateKey} recipient_priv_key | ||
* @param {PublicKey} sender_pub_key | ||
* @returns {Uint8Array} | ||
*/ | ||
static decrypt(ciphertext: ECIESCiphertext, recipient_priv_key: PrivateKey, sender_pub_key: PublicKey): Uint8Array; | ||
/** | ||
* @param {PrivateKey} priv_key | ||
* @param {PublicKey} pub_key | ||
* @returns {CipherKeys} | ||
*/ | ||
static deriveCipherKeys(priv_key: PrivateKey, pub_key: PublicKey): CipherKeys; | ||
} | ||
/** | ||
*/ | ||
export class ECIESCiphertext { | ||
free(): void; | ||
/** | ||
* @returns {Uint8Array} | ||
*/ | ||
extractCiphertext(): Uint8Array; | ||
/** | ||
* @returns {Uint8Array} | ||
*/ | ||
extractHMAC(): Uint8Array; | ||
/** | ||
* @returns {Uint8Array} | ||
*/ | ||
toBytes(): Uint8Array; | ||
/** | ||
* @returns {PublicKey} | ||
*/ | ||
extractPublicKey(): PublicKey; | ||
/** | ||
* @param {Uint8Array} buffer | ||
* @param {boolean} has_pub_key | ||
* @returns {ECIESCiphertext} | ||
*/ | ||
static fromBytes(buffer: Uint8Array, has_pub_key: boolean): ECIESCiphertext; | ||
} | ||
/** | ||
*/ | ||
export class ExtendedPrivateKey { | ||
@@ -880,2 +967,10 @@ free(): void; | ||
/** | ||
* @returns {Hash} | ||
*/ | ||
getHash(): Hash; | ||
/** | ||
* @returns {Uint8Array} | ||
*/ | ||
getSalt(): Uint8Array; | ||
/** | ||
* | ||
@@ -892,10 +987,30 @@ * * Implementation of PBKDF2 - when None is specified for salt, a random salt will be generated | ||
static pbkdf2(password: Uint8Array, salt: Uint8Array | undefined, hash_algo: number, rounds: number, output_length: number): KDF; | ||
} | ||
/** | ||
* @returns {Hash} | ||
*/ | ||
getHash(): Hash; | ||
export class MatchCriteria { | ||
free(): void; | ||
/** | ||
* @returns {Uint8Array} | ||
*/ | ||
getSalt(): Uint8Array; | ||
constructor(); | ||
/** | ||
* @param {Script} script | ||
* @returns {MatchCriteria} | ||
*/ | ||
setScript(script: Script): MatchCriteria; | ||
/** | ||
* @param {BigInt} value | ||
* @returns {MatchCriteria} | ||
*/ | ||
setValue(value: BigInt): MatchCriteria; | ||
/** | ||
* @param {BigInt} min | ||
* @returns {MatchCriteria} | ||
*/ | ||
setMin(min: BigInt): MatchCriteria; | ||
/** | ||
* @param {BigInt} max | ||
* @returns {MatchCriteria} | ||
*/ | ||
setMax(max: BigInt): MatchCriteria; | ||
} | ||
@@ -1027,2 +1142,19 @@ /** | ||
getPublicKey(): PublicKey; | ||
/** | ||
* | ||
* * Encrypt a message to the public key of this private key. | ||
* | ||
* @param {Uint8Array} message | ||
* @returns {ECIESCiphertext} | ||
*/ | ||
encryptMessage(message: Uint8Array): ECIESCiphertext; | ||
/** | ||
* | ||
* * Decrypt a message that was sent to the public key corresponding to this private key. | ||
* | ||
* @param {ECIESCiphertext} ciphertext | ||
* @param {PublicKey} sender_pub_key | ||
* @returns {Uint8Array} | ||
*/ | ||
decryptMessage(ciphertext: ECIESCiphertext, sender_pub_key: PublicKey): Uint8Array; | ||
} | ||
@@ -1084,2 +1216,8 @@ /** | ||
toDecompressed(): PublicKey; | ||
/** | ||
* @param {Uint8Array} message | ||
* @param {PrivateKey} sender_private_key | ||
* @returns {ECIESCiphertext} | ||
*/ | ||
encryptMessage(message: Uint8Array, sender_private_key: PrivateKey): ECIESCiphertext; | ||
} | ||
@@ -1199,25 +1337,2 @@ /** | ||
/** | ||
* @param {PublicKey} pub_key | ||
* @param {SighashSignature} sig | ||
* @returns {boolean} | ||
*/ | ||
verify(pub_key: PublicKey, sig: SighashSignature): boolean; | ||
/** | ||
* @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; | ||
/** | ||
* @returns {number} | ||
@@ -1280,2 +1395,50 @@ */ | ||
/** | ||
* | ||
* * Returns the first output index that matches the given parameters, returns None or null if not found. | ||
* | ||
* @param {MatchCriteria} criteria | ||
* @returns {number | undefined} | ||
*/ | ||
matchOutput(criteria: MatchCriteria): number | undefined; | ||
/** | ||
* | ||
* * Returns a list of outputs indexes that match the given parameters | ||
* | ||
* @param {MatchCriteria} criteria | ||
* @returns {Uint32Array} | ||
*/ | ||
matchOutputs(criteria: MatchCriteria): Uint32Array; | ||
/** | ||
* | ||
* * Returns the first input index that matches the given parameters, returns None or null if not found. | ||
* | ||
* @param {MatchCriteria} criteria | ||
* @returns {number | undefined} | ||
*/ | ||
matchInput(criteria: MatchCriteria): number | undefined; | ||
/** | ||
* | ||
* * Returns a list of input indexes that match the given parameters | ||
* | ||
* @param {MatchCriteria} criteria | ||
* @returns {Uint32Array} | ||
*/ | ||
matchInputs(criteria: MatchCriteria): Uint32Array; | ||
/** | ||
* | ||
* * XT Method: | ||
* * Returns the combined sum of all input satoshis. | ||
* * If any of the inputs dont have satoshis defined, this returns None or null | ||
* | ||
* @returns {BigInt | undefined} | ||
*/ | ||
satoshisIn(): BigInt | undefined; | ||
/** | ||
* | ||
* * Returns the combined sum of all output satoshis. | ||
* | ||
* @returns {BigInt} | ||
*/ | ||
satoshisOut(): BigInt; | ||
/** | ||
* @param {string} hex_str | ||
@@ -1308,2 +1471,9 @@ * @returns {Transaction} | ||
* | ||
* * Get size of current serialised Transaction object | ||
* | ||
* @returns {number} | ||
*/ | ||
getSize(): number; | ||
/** | ||
* | ||
* * Adds an array of TxIn's to the transaction | ||
@@ -1337,2 +1507,25 @@ * * @param {TxIn[]} tx_ins | ||
getIdBytes(): Uint8Array; | ||
/** | ||
* @param {PublicKey} pub_key | ||
* @param {SighashSignature} sig | ||
* @returns {boolean} | ||
*/ | ||
verify(pub_key: PublicKey, sig: SighashSignature): boolean; | ||
/** | ||
* @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; | ||
} | ||
@@ -1411,2 +1604,10 @@ /** | ||
/** | ||
* @param {BigInt} satoshis | ||
*/ | ||
setSatoshis(satoshis: BigInt): void; | ||
/** | ||
* @param {Script} unlocking_script | ||
*/ | ||
setUnlockingScript(unlocking_script: Script): void; | ||
/** | ||
* @param {string} hex_str | ||
@@ -1413,0 +1614,0 @@ * @returns {TxIn} |
@@ -7,3 +7,3 @@ { | ||
"description": "A Bitcoin SV library with WASM in mind.", | ||
"version": "1.1.2", | ||
"version": "1.2.0-beta.1", | ||
"license": "MIT", | ||
@@ -20,2 +20,2 @@ "files": [ | ||
"sideEffects": false | ||
} | ||
} |
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
689311
5227
2