diff --git a/LICENSE b/LICENSE old mode 100755 new mode 100644 diff --git a/README.md b/README.md old mode 100755 new mode 100644 diff --git a/composer.json b/composer.json old mode 100755 new mode 100644 diff --git a/examples/README.md b/examples/README.md old mode 100755 new mode 100644 diff --git a/examples/altcoin_offline_wallet.php b/examples/altcoin_offline_wallet.php old mode 100755 new mode 100644 diff --git a/examples/bip32.php b/examples/bip32.php old mode 100755 new mode 100644 diff --git a/examples/bip32_preparing_multisig.php b/examples/bip32_preparing_multisig.php old mode 100755 new mode 100644 diff --git a/examples/bip32_sign.php b/examples/bip32_sign.php old mode 100755 new mode 100644 diff --git a/examples/bitcoin.php b/examples/bitcoin.php old mode 100755 new mode 100644 diff --git a/examples/electrum.php b/examples/electrum.php old mode 100755 new mode 100644 diff --git a/examples/electrum_address.php b/examples/electrum_address.php old mode 100755 new mode 100644 diff --git a/examples/electrum_sign_multisig.php b/examples/electrum_sign_multisig.php old mode 100755 new mode 100644 diff --git a/examples/multisig.php b/examples/multisig.php old mode 100755 new mode 100644 diff --git a/examples/prompt_sign_multisig.php b/examples/prompt_sign_multisig.php old mode 100755 new mode 100644 diff --git a/examples/raw_transaction.php b/examples/raw_transaction.php old mode 100755 new mode 100644 diff --git a/examples/sign_p2sh.php b/examples/sign_p2sh.php old mode 100755 new mode 100644 diff --git a/examples/sign_p2sh_stepbystep.php b/examples/sign_p2sh_stepbystep.php old mode 100755 new mode 100644 diff --git a/examples/signature_verification.php b/examples/signature_verification.php old mode 100755 new mode 100644 diff --git a/examples/test_bip32.php b/examples/test_bip32.php old mode 100755 new mode 100644 diff --git a/src/BIP32.php b/src/BIP32.php old mode 100755 new mode 100644 index 23e216e..a996b58 --- a/src/BIP32.php +++ b/src/BIP32.php @@ -64,6 +64,13 @@ class BIP32 public static $litecoin_testnet_public = '0436f6e1'; public static $litecoin_testnet_private = '0436ef7d'; public static $litecoin_testnet_version = '6f'; + // Monacoin + public static $monacoin_mainnet_public = ''; + public static $monacoin_mainnet_private = ''; + public static $monacoin_mainnet_version = '32'; + public static $monacoin_testnet_public = ''; + public static $monacoin_testnet_private = ''; + public static $monacoin_testnet_version = '6f'; /** * Master Key @@ -544,7 +551,7 @@ public static function extract_public_key($input) * @param string $extended_key * return string|FALSE */ - public static function key_to_address($extended_key) + public static function key_to_address($extended_key, $address_version=null) { $import = self::import($extended_key); @@ -555,7 +562,7 @@ public static function key_to_address($extended_key) } // Convert the public key to the address. - return BitcoinLib::public_key_to_address($public, $import['version']); + return BitcoinLib::public_key_to_address($public, $address_version!==null?$address_version:$import['version']); } /** diff --git a/src/BitcoinLib.php b/src/BitcoinLib.php old mode 100755 new mode 100644 diff --git a/src/Electrum.php b/src/Electrum.php old mode 100755 new mode 100644 diff --git a/src/Jsonrpcclient.php b/src/Jsonrpcclient.php old mode 100755 new mode 100644 diff --git a/src/RawTransaction.php b/src/RawTransaction.php old mode 100755 new mode 100644 index 66288ab..ecb73de --- a/src/RawTransaction.php +++ b/src/RawTransaction.php @@ -1086,7 +1086,7 @@ public static function sign($wallet, $raw_transaction, $inputs, $magic_byte = nu $inputs_arr = (array)json_decode($inputs); // Generate an association of expected hash160's and related information. - $decode = self::decode($raw_transaction); + $decode = self::decode($raw_transaction, $magic_byte, $magic_p2sh_byte); $req_sigs = 0; $sign_count = 0; diff --git a/tests/AgainstRPCTest.php b/tests/AgainstRPCTest.php old mode 100755 new mode 100644 diff --git a/tests/BIP32CoreTest.php b/tests/BIP32CoreTest.php old mode 100755 new mode 100644 diff --git a/tests/BIP32Test.php b/tests/BIP32Test.php old mode 100755 new mode 100644 diff --git a/tests/BitcoinLibTest.php b/tests/BitcoinLibTest.php old mode 100755 new mode 100644 diff --git a/tests/BitcoinLibTestNetTest.php b/tests/BitcoinLibTestNetTest.php old mode 100755 new mode 100644 diff --git a/tests/RawTransactionTest.php b/tests/RawTransactionTest.php old mode 100755 new mode 100644