Complex classes like Wallet often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use Wallet, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 29 | abstract class Wallet implements WalletInterface { |
||
| 30 | |||
| 31 | const WALLET_VERSION_V1 = 'v1'; |
||
| 32 | const WALLET_VERSION_V2 = 'v2'; |
||
| 33 | const WALLET_VERSION_V3 = 'v3'; |
||
| 34 | |||
| 35 | const CHAIN_BTC_DEFAULT = 0; |
||
| 36 | const CHAIN_BCC_DEFAULT = 1; |
||
| 37 | const CHAIN_BTC_SEGWIT = 2; |
||
| 38 | |||
| 39 | const BASE_FEE = 10000; |
||
| 40 | |||
| 41 | /** |
||
| 42 | * development / debug setting |
||
| 43 | * when getting a new derivation from the API, |
||
| 44 | * will verify address / redeeemScript with the values the API provides |
||
| 45 | */ |
||
| 46 | const VERIFY_NEW_DERIVATION = true; |
||
| 47 | |||
| 48 | /** |
||
| 49 | * @var BlocktrailSDKInterface |
||
| 50 | */ |
||
| 51 | protected $sdk; |
||
| 52 | |||
| 53 | /** |
||
| 54 | * @var string |
||
| 55 | */ |
||
| 56 | protected $identifier; |
||
| 57 | |||
| 58 | /** |
||
| 59 | * BIP32 master primary private key (m/) |
||
| 60 | * |
||
| 61 | * @var BIP32Key |
||
| 62 | */ |
||
| 63 | protected $primaryPrivateKey; |
||
| 64 | |||
| 65 | /** |
||
| 66 | * @var BIP32Key[] |
||
| 67 | */ |
||
| 68 | protected $primaryPublicKeys; |
||
| 69 | |||
| 70 | /** |
||
| 71 | * BIP32 master backup public key (M/) |
||
| 72 | |||
| 73 | * @var BIP32Key |
||
| 74 | */ |
||
| 75 | protected $backupPublicKey; |
||
| 76 | |||
| 77 | /** |
||
| 78 | * map of blocktrail BIP32 public keys |
||
| 79 | * keyed by key index |
||
| 80 | * path should be `M / key_index'` |
||
| 81 | * |
||
| 82 | * @var BIP32Key[] |
||
| 83 | */ |
||
| 84 | protected $blocktrailPublicKeys; |
||
| 85 | |||
| 86 | /** |
||
| 87 | * the 'Blocktrail Key Index' that is used for new addresses |
||
| 88 | * |
||
| 89 | * @var int |
||
| 90 | */ |
||
| 91 | protected $keyIndex; |
||
| 92 | |||
| 93 | /** |
||
| 94 | * 'bitcoin' |
||
| 95 | * |
||
| 96 | * @var string |
||
| 97 | */ |
||
| 98 | protected $network; |
||
| 99 | |||
| 100 | /** |
||
| 101 | * @var NetworkInterface |
||
| 102 | */ |
||
| 103 | protected $networkParams; |
||
| 104 | |||
| 105 | /** |
||
| 106 | * testnet yes / no |
||
| 107 | * |
||
| 108 | * @var bool |
||
| 109 | */ |
||
| 110 | protected $testnet; |
||
| 111 | |||
| 112 | /** |
||
| 113 | * cache of public keys, by path |
||
| 114 | * |
||
| 115 | * @var BIP32Key[] |
||
| 116 | */ |
||
| 117 | protected $pubKeys = []; |
||
| 118 | |||
| 119 | /** |
||
| 120 | * cache of address / redeemScript, by path |
||
| 121 | * |
||
| 122 | * @var string[][] [[address, redeemScript)], ] |
||
| 123 | */ |
||
| 124 | protected $derivations = []; |
||
| 125 | |||
| 126 | /** |
||
| 127 | * reverse cache of paths by address |
||
| 128 | * |
||
| 129 | * @var string[] |
||
| 130 | */ |
||
| 131 | protected $derivationsByAddress = []; |
||
| 132 | |||
| 133 | protected $checksum; |
||
| 134 | |||
| 135 | /** |
||
| 136 | * @var bool |
||
| 137 | */ |
||
| 138 | protected $locked = true; |
||
| 139 | |||
| 140 | /** |
||
| 141 | * @var bool |
||
| 142 | */ |
||
| 143 | protected $isSegwit = false; |
||
| 144 | |||
| 145 | /** |
||
| 146 | * @var int |
||
| 147 | */ |
||
| 148 | protected $chainIndex; |
||
| 149 | |||
| 150 | /** |
||
| 151 | * @var int |
||
| 152 | */ |
||
| 153 | protected $changeIndex; |
||
| 154 | |||
| 155 | protected $optimalFeePerKB; |
||
| 156 | protected $lowPriorityFeePerKB; |
||
| 157 | protected $feePerKBAge; |
||
| 158 | protected $allowedSignModes = [SignInfo::MODE_DONTSIGN, SignInfo::MODE_SIGN]; |
||
| 159 | |||
| 160 | /** |
||
| 161 | * @param BlocktrailSDKInterface $sdk SDK instance used to do requests |
||
| 162 | * @param string $identifier identifier of the wallet |
||
| 163 | * @param BIP32Key[] $primaryPublicKeys |
||
| 164 | * @param BIP32Key $backupPublicKey should be BIP32 master public key M/ |
||
| 165 | * @param BIP32Key[] $blocktrailPublicKeys |
||
| 166 | * @param int $keyIndex |
||
| 167 | * @param bool $segwit |
||
| 168 | * @param string $checksum |
||
| 169 | * @throws BlocktrailSDKException |
||
| 170 | */ |
||
| 171 | 21 | public function __construct(BlocktrailSDKInterface $sdk, $identifier, array $primaryPublicKeys, $backupPublicKey, array $blocktrailPublicKeys, $keyIndex, $segwit, $checksum) { |
|
| 203 | |||
| 204 | /** |
||
| 205 | * @param int|null $chainIndex |
||
| 206 | * @return WalletPath |
||
| 207 | */ |
||
| 208 | 14 | protected function getWalletPath($chainIndex = null) { |
|
| 215 | |||
| 216 | /** |
||
| 217 | * @return bool |
||
| 218 | */ |
||
| 219 | 3 | public function isSegwit() { |
|
| 222 | |||
| 223 | /** |
||
| 224 | * return the wallet identifier |
||
| 225 | * |
||
| 226 | * @return string |
||
| 227 | */ |
||
| 228 | 10 | public function getIdentifier() { |
|
| 231 | |||
| 232 | /** |
||
| 233 | * Returns the wallets backup public key |
||
| 234 | * |
||
| 235 | * @return [xpub, path] |
||
| 236 | */ |
||
| 237 | 1 | public function getBackupKey() { |
|
| 240 | |||
| 241 | /** |
||
| 242 | * return list of Blocktrail co-sign extended public keys |
||
| 243 | * |
||
| 244 | * @return array[] [ [xpub, path] ] |
||
| 245 | */ |
||
| 246 | 5 | public function getBlocktrailPublicKeys() { |
|
| 251 | |||
| 252 | /** |
||
| 253 | * check if wallet is locked |
||
| 254 | * |
||
| 255 | * @return bool |
||
| 256 | */ |
||
| 257 | 10 | public function isLocked() { |
|
| 260 | |||
| 261 | /** |
||
| 262 | * upgrade wallet to different blocktrail cosign key |
||
| 263 | * |
||
| 264 | * @param $keyIndex |
||
| 265 | * @return bool |
||
| 266 | * @throws \Exception |
||
| 267 | */ |
||
| 268 | 5 | public function upgradeKeyIndex($keyIndex) { |
|
| 295 | |||
| 296 | /** |
||
| 297 | * get a new BIP32 derivation for the next (unused) address |
||
| 298 | * by requesting it from the API |
||
| 299 | * |
||
| 300 | * @return string |
||
| 301 | * @param int|null $chainIndex |
||
| 302 | * @throws \Exception |
||
| 303 | */ |
||
| 304 | 14 | protected function getNewDerivation($chainIndex = null) { |
|
| 336 | |||
| 337 | /** |
||
| 338 | * @param string|BIP32Path $path |
||
| 339 | * @return BIP32Key|false |
||
| 340 | * @throws \Exception |
||
| 341 | * |
||
| 342 | * @TODO: hmm? |
||
| 343 | */ |
||
| 344 | 16 | protected function getParentPublicKey($path) { |
|
| 361 | |||
| 362 | /** |
||
| 363 | * get address for the specified path |
||
| 364 | * |
||
| 365 | * @param string|BIP32Path $path |
||
| 366 | * @return string |
||
| 367 | */ |
||
| 368 | 14 | public function getAddressByPath($path) { |
|
| 379 | |||
| 380 | /** |
||
| 381 | * @param string $path |
||
| 382 | * @return WalletScript |
||
| 383 | */ |
||
| 384 | 16 | public function getWalletScriptByPath($path) { |
|
| 396 | |||
| 397 | /** |
||
| 398 | * get address and redeemScript for specified path |
||
| 399 | * |
||
| 400 | * @param string $path |
||
| 401 | * @return array[string, ScriptInterface, ScriptInterface|null] [address, redeemScript, witnessScript] |
||
| 402 | */ |
||
| 403 | 15 | public function getRedeemScriptByPath($path) { |
|
| 410 | |||
| 411 | /** |
||
| 412 | * @param BIP32Key $key |
||
| 413 | * @param string|BIP32Path $path |
||
| 414 | * @return string |
||
| 415 | */ |
||
| 416 | protected function getAddressFromKey(BIP32Key $key, $path) { |
||
| 419 | |||
| 420 | /** |
||
| 421 | * @param BIP32Key $key |
||
| 422 | * @param string|BIP32Path $path |
||
| 423 | * @return WalletScript |
||
| 424 | * @throws \Exception |
||
| 425 | */ |
||
| 426 | 16 | protected function getWalletScriptFromKey(BIP32Key $key, $path) { |
|
| 452 | |||
| 453 | /** |
||
| 454 | * get the path (and redeemScript) to specified address |
||
| 455 | * |
||
| 456 | * @param string $address |
||
| 457 | * @return array |
||
| 458 | */ |
||
| 459 | 1 | public function getPathForAddress($address) { |
|
| 462 | |||
| 463 | /** |
||
| 464 | * @param string|BIP32Path $path |
||
| 465 | * @return BIP32Key |
||
| 466 | * @throws \Exception |
||
| 467 | */ |
||
| 468 | 16 | public function getBlocktrailPublicKey($path) { |
|
| 479 | |||
| 480 | /** |
||
| 481 | * generate a new derived key and return the new path and address for it |
||
| 482 | * |
||
| 483 | * @param int|null $chainIndex |
||
| 484 | * @return string[] [path, address] |
||
| 485 | */ |
||
| 486 | 14 | public function getNewAddressPair($chainIndex = null) { |
|
| 492 | |||
| 493 | /** |
||
| 494 | * generate a new derived private key and return the new address for it |
||
| 495 | * |
||
| 496 | * @param int|null $chainIndex |
||
| 497 | * @return string |
||
| 498 | */ |
||
| 499 | 10 | public function getNewAddress($chainIndex = null) { |
|
| 502 | |||
| 503 | /** |
||
| 504 | * get the balance for the wallet |
||
| 505 | * |
||
| 506 | * @return int[] [confirmed, unconfirmed] |
||
| 507 | */ |
||
| 508 | 9 | public function getBalance() { |
|
| 513 | |||
| 514 | /** |
||
| 515 | * do wallet discovery (slow) |
||
| 516 | * |
||
| 517 | * @param int $gap the gap setting to use for discovery |
||
| 518 | * @return int[] [confirmed, unconfirmed] |
||
| 519 | */ |
||
| 520 | 2 | public function doDiscovery($gap = 200) { |
|
| 525 | |||
| 526 | /** |
||
| 527 | * @return TransactionBuilder |
||
| 528 | */ |
||
| 529 | 13 | public function createTransaction() { |
|
| 532 | |||
| 533 | /** |
||
| 534 | * create, sign and send a transaction |
||
| 535 | * |
||
| 536 | * @param array $outputs [address => value, ] or [[address, value], ] or [['address' => address, 'value' => value], ] coins to send |
||
| 537 | * value should be INT |
||
| 538 | * @param string $changeAddress change address to use (autogenerated if NULL) |
||
| 539 | * @param bool $allowZeroConf |
||
| 540 | * @param bool $randomizeChangeIdx randomize the location of the change (for increased privacy / anonimity) |
||
| 541 | * @param string $feeStrategy |
||
| 542 | * @param null|int $forceFee set a fixed fee instead of automatically calculating the correct fee, not recommended! |
||
| 543 | * @return string the txid / transaction hash |
||
| 544 | * @throws \Exception |
||
| 545 | */ |
||
| 546 | 9 | public function pay(array $outputs, $changeAddress = null, $allowZeroConf = false, $randomizeChangeIdx = true, $feeStrategy = self::FEE_STRATEGY_OPTIMAL, $forceFee = null) { |
|
| 568 | |||
| 569 | /** |
||
| 570 | * determine max spendable from wallet after fees |
||
| 571 | * |
||
| 572 | * @param bool $allowZeroConf |
||
| 573 | * @param string $feeStrategy |
||
| 574 | * @param null|int $forceFee set a fixed fee instead of automatically calculating the correct fee, not recommended! |
||
| 575 | * @param int $outputCnt |
||
| 576 | * @return string |
||
| 577 | * @throws BlocktrailSDKException |
||
| 578 | */ |
||
| 579 | public function getMaxSpendable($allowZeroConf = false, $feeStrategy = self::FEE_STRATEGY_OPTIMAL, $forceFee = null, $outputCnt = 1) { |
||
| 582 | |||
| 583 | /** |
||
| 584 | * parse outputs into normalized struct |
||
| 585 | * |
||
| 586 | * @param array $outputs [address => value, ] or [[address, value], ] or [['address' => address, 'value' => value], ] |
||
| 587 | * @return array [['address' => address, 'value' => value], ] |
||
| 588 | */ |
||
| 589 | 10 | public static function normalizeOutputsStruct(array $outputs) { |
|
| 617 | |||
| 618 | /** |
||
| 619 | * 'fund' the txBuilder with UTXOs (modified in place) |
||
| 620 | * |
||
| 621 | * @param TransactionBuilder $txBuilder |
||
| 622 | * @param bool|true $lockUTXOs |
||
| 623 | * @param bool|false $allowZeroConf |
||
| 624 | * @param null|int $forceFee |
||
| 625 | * @return TransactionBuilder |
||
| 626 | */ |
||
| 627 | 11 | public function coinSelectionForTxBuilder(TransactionBuilder $txBuilder, $lockUTXOs = true, $allowZeroConf = false, $forceFee = null) { |
|
| 655 | |||
| 656 | /** |
||
| 657 | * build inputs and outputs lists for TransactionBuilder |
||
| 658 | * |
||
| 659 | * @param TransactionBuilder $txBuilder |
||
| 660 | * @return [TransactionInterface, SignInfo[]] |
||
| 661 | * @throws \Exception |
||
| 662 | */ |
||
| 663 | 7 | public function buildTx(TransactionBuilder $txBuilder) { |
|
| 751 | |||
| 752 | 7 | public function determineFeeAndChange(TransactionBuilder $txBuilder, $optimalFeePerKB, $lowPriorityFeePerKB) { |
|
| 808 | |||
| 809 | /** |
||
| 810 | * create, sign and send transction based on TransactionBuilder |
||
| 811 | * |
||
| 812 | * @param TransactionBuilder $txBuilder |
||
| 813 | * @param bool $apiCheckFee let the API check if the fee is correct |
||
| 814 | * @return string |
||
| 815 | * @throws \Exception |
||
| 816 | */ |
||
| 817 | 4 | public function sendTx(TransactionBuilder $txBuilder, $apiCheckFee = true) { |
|
| 822 | |||
| 823 | /** |
||
| 824 | * !! INTERNAL METHOD, public for testing purposes !! |
||
| 825 | * create, sign and send transction based on inputs and outputs |
||
| 826 | * |
||
| 827 | * @param Transaction $tx |
||
| 828 | * @param SignInfo[] $signInfo |
||
| 829 | * @param bool $apiCheckFee let the API check if the fee is correct |
||
| 830 | * @return string |
||
| 831 | * @throws \Exception |
||
| 832 | * @internal |
||
| 833 | */ |
||
| 834 | 4 | public function _sendTx(Transaction $tx, array $signInfo, $apiCheckFee = true) { |
|
| 856 | |||
| 857 | /** |
||
| 858 | * only supports estimating fee for 2of3 multsig UTXOs and P2PKH/P2SH outputs |
||
| 859 | * |
||
| 860 | * @todo: mark this as deprecated, insist on the utxo's or qualified scripts. |
||
| 861 | * @param int $utxoCnt number of unspent inputs in transaction |
||
| 862 | * @param int $outputCnt number of outputs in transaction |
||
| 863 | * @return float |
||
| 864 | * @access public reminder that people might use this! |
||
| 865 | */ |
||
| 866 | 1 | public static function estimateFee($utxoCnt, $outputCnt) { |
|
| 871 | |||
| 872 | /** |
||
| 873 | * @param int $size size in bytes |
||
| 874 | * @return int fee in satoshi |
||
| 875 | */ |
||
| 876 | 5 | public static function baseFeeForSize($size) { |
|
| 881 | |||
| 882 | /** |
||
| 883 | * @todo: variable varint |
||
| 884 | * @param int $txinSize |
||
| 885 | * @param int $txoutSize |
||
| 886 | * @return float |
||
| 887 | */ |
||
| 888 | 9 | public static function estimateSize($txinSize, $txoutSize) { |
|
| 891 | |||
| 892 | /** |
||
| 893 | * only supports estimating size for P2PKH/P2SH outputs |
||
| 894 | * |
||
| 895 | * @param int $outputCnt number of outputs in transaction |
||
| 896 | * @return float |
||
| 897 | */ |
||
| 898 | 2 | public static function estimateSizeOutputs($outputCnt) { |
|
| 901 | |||
| 902 | /** |
||
| 903 | * only supports estimating size for 2of3 multsig UTXOs |
||
| 904 | * |
||
| 905 | * @param int $utxoCnt number of unspent inputs in transaction |
||
| 906 | * @return float |
||
| 907 | */ |
||
| 908 | 3 | public static function estimateSizeUTXOs($utxoCnt) { |
|
| 944 | |||
| 945 | /** |
||
| 946 | * determine how much fee is required based on the inputs and outputs |
||
| 947 | * this is an estimation, not a proper 100% correct calculation |
||
| 948 | * |
||
| 949 | * @param UTXO[] $utxos |
||
| 950 | * @param array[] $outputs |
||
| 951 | * @param $feeStrategy |
||
| 952 | * @param $optimalFeePerKB |
||
| 953 | * @param $lowPriorityFeePerKB |
||
| 954 | * @return int |
||
| 955 | * @throws BlocktrailSDKException |
||
| 956 | */ |
||
| 957 | 7 | protected function determineFee($utxos, $outputs, $feeStrategy, $optimalFeePerKB, $lowPriorityFeePerKB) { |
|
| 975 | |||
| 976 | /** |
||
| 977 | * determine how much change is left over based on the inputs and outputs and the fee |
||
| 978 | * |
||
| 979 | * @param UTXO[] $utxos |
||
| 980 | * @param array[] $outputs |
||
| 981 | * @param int $fee |
||
| 982 | * @return int |
||
| 983 | */ |
||
| 984 | 7 | protected function determineChange($utxos, $outputs, $fee) { |
|
| 992 | |||
| 993 | /** |
||
| 994 | * sign a raw transaction with the private keys that we have |
||
| 995 | * |
||
| 996 | * @param Transaction $tx |
||
| 997 | * @param SignInfo[] $signInfo |
||
| 998 | * @return TransactionInterface |
||
| 999 | * @throws \Exception |
||
| 1000 | */ |
||
| 1001 | 4 | protected function signTransaction(Transaction $tx, array $signInfo) { |
|
| 1033 | |||
| 1034 | /** |
||
| 1035 | * send the transaction using the API |
||
| 1036 | * |
||
| 1037 | * @param string|array $signed |
||
| 1038 | * @param string[] $paths |
||
| 1039 | * @param bool $checkFee |
||
| 1040 | * @return string the complete raw transaction |
||
| 1041 | * @throws \Exception |
||
| 1042 | */ |
||
| 1043 | 4 | protected function sendTransaction($signed, $paths, $checkFee = false) { |
|
| 1046 | |||
| 1047 | /** |
||
| 1048 | * @param \array[] $outputs |
||
| 1049 | * @param bool $lockUTXO |
||
| 1050 | * @param bool $allowZeroConf |
||
| 1051 | * @param int|null|string $feeStrategy |
||
| 1052 | * @param null $forceFee |
||
| 1053 | * @return array |
||
| 1054 | */ |
||
| 1055 | 11 | public function coinSelection($outputs, $lockUTXO = true, $allowZeroConf = false, $feeStrategy = self::FEE_STRATEGY_OPTIMAL, $forceFee = null) { |
|
| 1064 | |||
| 1065 | 7 | public function getOptimalFeePerKB() { |
|
| 1072 | |||
| 1073 | 7 | public function getLowPriorityFeePerKB() { |
|
| 1080 | |||
| 1081 | 3 | public function updateFeePerKB() { |
|
| 1089 | |||
| 1090 | /** |
||
| 1091 | * delete the wallet |
||
| 1092 | * |
||
| 1093 | * @param bool $force ignore warnings (such as non-zero balance) |
||
| 1094 | * @return mixed |
||
| 1095 | * @throws \Exception |
||
| 1096 | */ |
||
| 1097 | 10 | public function deleteWallet($force = false) { |
|
| 1105 | |||
| 1106 | /** |
||
| 1107 | * create checksum to verify ownership of the master primary key |
||
| 1108 | * |
||
| 1109 | * @return string[] [address, signature] |
||
| 1110 | */ |
||
| 1111 | 10 | protected function createChecksumVerificationSignature() { |
|
| 1122 | |||
| 1123 | /** |
||
| 1124 | * setup a webhook for our wallet |
||
| 1125 | * |
||
| 1126 | * @param string $url URL to receive webhook events |
||
| 1127 | * @param string $identifier identifier for the webhook, defaults to WALLET-{$this->identifier} |
||
| 1128 | * @return array |
||
| 1129 | */ |
||
| 1130 | 1 | public function setupWebhook($url, $identifier = null) { |
|
| 1134 | |||
| 1135 | /** |
||
| 1136 | * @param string $identifier identifier for the webhook, defaults to WALLET-{$this->identifier} |
||
| 1137 | * @return mixed |
||
| 1138 | */ |
||
| 1139 | 1 | public function deleteWebhook($identifier = null) { |
|
| 1143 | |||
| 1144 | /** |
||
| 1145 | * lock a specific unspent output |
||
| 1146 | * |
||
| 1147 | * @param $txHash |
||
| 1148 | * @param $txIdx |
||
| 1149 | * @param int $ttl |
||
| 1150 | * @return bool |
||
| 1151 | */ |
||
| 1152 | public function lockUTXO($txHash, $txIdx, $ttl = 3) { |
||
| 1155 | |||
| 1156 | /** |
||
| 1157 | * unlock a specific unspent output |
||
| 1158 | * |
||
| 1159 | * @param $txHash |
||
| 1160 | * @param $txIdx |
||
| 1161 | * @return bool |
||
| 1162 | */ |
||
| 1163 | public function unlockUTXO($txHash, $txIdx) { |
||
| 1166 | |||
| 1167 | /** |
||
| 1168 | * get all transactions for the wallet (paginated) |
||
| 1169 | * |
||
| 1170 | * @param integer $page pagination: page number |
||
| 1171 | * @param integer $limit pagination: records per page (max 500) |
||
| 1172 | * @param string $sortDir pagination: sort direction (asc|desc) |
||
| 1173 | * @return array associative array containing the response |
||
| 1174 | */ |
||
| 1175 | 1 | public function transactions($page = 1, $limit = 20, $sortDir = 'asc') { |
|
| 1178 | |||
| 1179 | /** |
||
| 1180 | * get all addresses for the wallet (paginated) |
||
| 1181 | * |
||
| 1182 | * @param integer $page pagination: page number |
||
| 1183 | * @param integer $limit pagination: records per page (max 500) |
||
| 1184 | * @param string $sortDir pagination: sort direction (asc|desc) |
||
| 1185 | * @return array associative array containing the response |
||
| 1186 | */ |
||
| 1187 | 1 | public function addresses($page = 1, $limit = 20, $sortDir = 'asc') { |
|
| 1190 | |||
| 1191 | /** |
||
| 1192 | * get all UTXOs for the wallet (paginated) |
||
| 1193 | * |
||
| 1194 | * @param integer $page pagination: page number |
||
| 1195 | * @param integer $limit pagination: records per page (max 500) |
||
| 1196 | * @param string $sortDir pagination: sort direction (asc|desc) |
||
| 1197 | * @param boolean $zeroconf include zero confirmation transactions |
||
| 1198 | * @return array associative array containing the response |
||
| 1199 | */ |
||
| 1200 | 1 | public function utxos($page = 1, $limit = 20, $sortDir = 'asc', $zeroconf = true) { |
|
| 1203 | } |
||
| 1204 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..