- Added createTx: create unsigned tx (resolves tx-hex )
- Updated createMultisigTx: resolve tx-hex instead of tx object
- Added signTx: (synchronized fn) sign the given tx (hex or object) with given private key and returns the signed txhex
- pass tx_data (hex or byte array) to bitjs.transaction to deserialize the transaction
ie, `tx = bitjs.transaction(tx_data)`
- invoking without any parameter `bitjs.transaction()` will create an empty tx as before (no change)
- Added toMultisigFloID: converts given multisig address to FLO multisig ID
- Improved verifyPubKey: also support verifying multisig redeemScript for the multisig address
- Improved isSameAddr: supports multisig bech32
- Improved decodeAddress: supports multisig bech32
- pubkeys2MultisigAddressBech32: returns another value 'scripthash'
- Fixed multisigBech32Address: returning scripthash as redeemScript. (now returns both scripthash and redeemScript
Changes:
- multisig addresses are accepted as receiver address in all send-tx fns
- multisig addresses are accepted in query fns
- sendTx: sender can be regular address only
Added 3 multisig transaction fns:
- createMultisigTx: creates unsigned tx for multisig sender
- sendMultisigTx: create signed multisig tx and broadcast it
- writeMultisigData: same as writeData(), but for multisig
- Added getMultisigAddress(pubkeys, required_sigs): returns a multisig address from given pubkey list and required signatures
- Added decodeRedeemScript (redeemScript): decodes the given redeemscript (of multisig)
- Updated validateFloID: now validates FLO regular and multisig address. optional argument regularOnly(default=false) if true validates only FLO regular address.
- Bitcoin.Address now supports multisg version
- new Bitcoin.Address (hex) will now assign the respective version when its regular or multisig address
- Added constants: Bitcoin.Address
.standardVersion= 0x23
.multisigVersion = 0x5e
.testnetVersion = 0x73
- Updated tx.addflodata: will now check if the data is valid or not
- Optimized tx.serialize: changed complex code for appending flodata to a simple one
- Added bitjs.strToBytes: converts string (ascii) to strToBytes
- Added bitjs.pubkeydecompress: decompresses the public key
- Added bitjs.verifySignature: verify the signature (of hash and pubkey)
- Added getTx.hex(txid): resolves the tx hex of the txid
- Update: api responses are checked for response.ok
- Fixed: getTx giving incorrect confirmation value for unconfirmed tx
- Added: fee_from_receiver option to create transaction.
- change_address and fee_from_receiver are passed as options for createTx, createSignedTx, sendTx and createMultiSigTx
- Fixed: getTx not rejecting properly when txid is invalid
- Changed broadcastTx to coinb API to eliminate $.ajax requirement
- Set default value for fee=null (automatic fee) to createSignedTx and createMultiSigTx
- Added createSignedTx: creates a signed tx (same as sendTx, but doesnt broadcast)
- Added transactionID: returns the txid of the tx_hex (or tx-object)
floCrypto v2.3.3e
- Adding options args to toFloID function. options object accept std and/or bech properties. if specified only converts if given address are from specified version
floBlockchainAPI v2.3.3c
- Fixed: tx failing due to dust amount in change value
- readData: when passes tx option as true, now also gives senders and receivers (Set)
btcOperator v1.0.10b
- Fixed: minor bugs
- Fixed: createTransaction not returning promise
- Fixed: script not correctly added for multisig inputs
- Fixed: signTx throwing syntax error
- Added checkSigned(tx, bool?): check if the tx is signed or not. (bool is optional, default=true, if true returns a boolean value, else returns a detailed array of input's length)
- Fixed minor bugs in lib.js
- Added floCrypto.tmpID: generates a random floID with no private key (use this only for one-time id)
- Added toFloID(address): returns equivalent floID (btc-segwit address NOT supported)
- Fixed bug: legacy addresses of length 33 not working in verifyPubKey and validateAddr
- Added createTx: Create an unsigned tx (no privkey required) [segwit sender not supported for now as redeem-script needed]
- Added createMultiSigTx: Create an unsigned tx for multisig address
- Optimised sendTx to reuse code (no functional change)
floDapps login:
- login to btc address when btc private key is entered
- login to flo id when flo (or any other) private key is entered
floCloudAPI user:
- accept userID and private key for user set
Others:
- Fixed: minor bugs
floCrypto.verifyPubKey: verify public key of any blockchain address
- Parameters:
1. pubKeyHex - public key hex
2. address - blockchain address
floCrypto.getAddress: get address respective to the blockchain
- Parameters:
1. privateKeyHex - private key (WIF)
2. strict - (optional, default=false) if false returns floID when no match of privatekey prefix found.