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 |
||
| 28 | abstract class Wallet implements WalletInterface { |
||
| 29 | |||
| 30 | const WALLET_VERSION_V1 = 'v1'; |
||
| 31 | const WALLET_VERSION_V2 = 'v2'; |
||
| 32 | const WALLET_VERSION_V3 = 'v3'; |
||
| 33 | |||
| 34 | const CHAIN_BTC_DEFAULT = 0; |
||
| 35 | const CHAIN_BCC_DEFAULT = 1; |
||
| 36 | const CHAIN_BTC_SEGWIT = 2; |
||
| 37 | |||
| 38 | const BASE_FEE = 10000; |
||
| 39 | |||
| 40 | /** |
||
| 41 | * development / debug setting |
||
| 42 | * when getting a new derivation from the API, |
||
| 43 | * will verify address / redeeemScript with the values the API provides |
||
| 44 | */ |
||
| 45 | const VERIFY_NEW_DERIVATION = true; |
||
| 46 | |||
| 47 | /** |
||
| 48 | * @var BlocktrailSDKInterface |
||
| 49 | */ |
||
| 50 | protected $sdk; |
||
| 51 | |||
| 52 | /** |
||
| 53 | * @var string |
||
| 54 | */ |
||
| 55 | protected $identifier; |
||
| 56 | |||
| 57 | /** |
||
| 58 | * BIP32 master primary private key (m/) |
||
| 59 | * |
||
| 60 | * @var BIP32Key |
||
| 61 | */ |
||
| 62 | protected $primaryPrivateKey; |
||
| 63 | |||
| 64 | /** |
||
| 65 | * @var BIP32Key[] |
||
| 66 | */ |
||
| 67 | protected $primaryPublicKeys; |
||
| 68 | |||
| 69 | /** |
||
| 70 | * BIP32 master backup public key (M/) |
||
| 71 | |||
| 72 | * @var BIP32Key |
||
| 73 | */ |
||
| 74 | protected $backupPublicKey; |
||
| 75 | |||
| 76 | /** |
||
| 77 | * map of blocktrail BIP32 public keys |
||
| 78 | * keyed by key index |
||
| 79 | * path should be `M / key_index'` |
||
| 80 | * |
||
| 81 | * @var BIP32Key[] |
||
| 82 | */ |
||
| 83 | protected $blocktrailPublicKeys; |
||
| 84 | |||
| 85 | /** |
||
| 86 | * the 'Blocktrail Key Index' that is used for new addresses |
||
| 87 | * |
||
| 88 | * @var int |
||
| 89 | */ |
||
| 90 | protected $keyIndex; |
||
| 91 | |||
| 92 | /** |
||
| 93 | * 'bitcoin' |
||
| 94 | * |
||
| 95 | * @var string |
||
| 96 | */ |
||
| 97 | protected $network; |
||
| 98 | |||
| 99 | /** |
||
| 100 | * testnet yes / no |
||
| 101 | * |
||
| 102 | * @var bool |
||
| 103 | */ |
||
| 104 | protected $testnet; |
||
| 105 | |||
| 106 | /** |
||
| 107 | * cache of public keys, by path |
||
| 108 | * |
||
| 109 | * @var BIP32Key[] |
||
| 110 | */ |
||
| 111 | protected $pubKeys = []; |
||
| 112 | |||
| 113 | /** |
||
| 114 | * cache of address / redeemScript, by path |
||
| 115 | * |
||
| 116 | * @var string[][] [[address, redeemScript)], ] |
||
| 117 | */ |
||
| 118 | protected $derivations = []; |
||
| 119 | |||
| 120 | /** |
||
| 121 | * reverse cache of paths by address |
||
| 122 | * |
||
| 123 | * @var string[] |
||
| 124 | */ |
||
| 125 | protected $derivationsByAddress = []; |
||
| 126 | |||
| 127 | /** |
||
| 128 | * @var WalletPath |
||
| 129 | * @deprecated |
||
| 130 | */ |
||
| 131 | protected $walletPath; |
||
| 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 | 19 | protected $optimalFeePerKB; |
|
| 156 | 19 | protected $lowPriorityFeePerKB; |
|
| 157 | protected $feePerKBAge; |
||
| 158 | 19 | protected $allowedSignModes = [SignInfo::MODE_DONTSIGN, SignInfo::MODE_SIGN]; |
|
| 159 | 19 | ||
| 160 | 19 | /** |
|
| 161 | * @param BlocktrailSDKInterface $sdk SDK instance used to do requests |
||
| 162 | 19 | * @param string $identifier identifier of the wallet |
|
| 163 | * @param BIP32Key[] $primaryPublicKeys |
||
| 164 | 19 | * @param BIP32Key $backupPublicKey should be BIP32 master public key M/ |
|
| 165 | 19 | * @param BIP32Key[] $blocktrailPublicKeys |
|
| 166 | 19 | * @param int $keyIndex |
|
| 167 | 19 | * @param string $network |
|
| 168 | * @param bool $testnet |
||
| 169 | 19 | * @param bool $segwit |
|
| 170 | 19 | * @param string $checksum |
|
| 171 | 2 | * @throws BlocktrailSDKException |
|
| 172 | */ |
||
| 173 | 19 | public function __construct(BlocktrailSDKInterface $sdk, $identifier, array $primaryPublicKeys, $backupPublicKey, array $blocktrailPublicKeys, $keyIndex, $network, $testnet, $segwit, $checksum) { |
|
| 207 | 10 | ||
| 208 | /** |
||
| 209 | * @param null $chainIndex |
||
| 210 | * @return BIP32Path |
||
| 211 | */ |
||
| 212 | protected function getWalletPath($chainIndex = null) { |
||
| 219 | |||
| 220 | /** |
||
| 221 | * @return bool |
||
| 222 | */ |
||
| 223 | public function isSegwit() { |
||
| 226 | 5 | ||
| 227 | 5 | /** |
|
| 228 | * return the wallet identifier |
||
| 229 | * |
||
| 230 | * @return string |
||
| 231 | */ |
||
| 232 | public function getIdentifier() { |
||
| 235 | 10 | ||
| 236 | 10 | /** |
|
| 237 | * Returns the wallets backup public key |
||
| 238 | * |
||
| 239 | * @return [xpub, path] |
||
| 240 | */ |
||
| 241 | public function getBackupKey() { |
||
| 244 | |||
| 245 | /** |
||
| 246 | 5 | * return list of Blocktrail co-sign extended public keys |
|
| 247 | 5 | * |
|
| 248 | 4 | * @return array[] [ [xpub, path] ] |
|
| 249 | */ |
||
| 250 | public function getBlocktrailPublicKeys() { |
||
| 255 | |||
| 256 | /** |
||
| 257 | 5 | * check if wallet is locked |
|
| 258 | * |
||
| 259 | 5 | * @return bool |
|
| 260 | */ |
||
| 261 | 5 | public function isLocked() { |
|
| 264 | |||
| 265 | 5 | /** |
|
| 266 | 5 | * upgrade wallet to different blocktrail cosign key |
|
| 267 | 5 | * |
|
| 268 | 5 | * @param $keyIndex |
|
| 269 | 5 | * @return bool |
|
| 270 | * @throws \Exception |
||
| 271 | */ |
||
| 272 | public function upgradeKeyIndex($keyIndex) { |
||
| 302 | |||
| 303 | /** |
||
| 304 | 13 | * get a new BIP32 derivation for the next (unused) address |
|
| 305 | 13 | * by requesting it from the API |
|
| 306 | * |
||
| 307 | * @return string |
||
| 308 | * @param int|null $chainIndex |
||
| 309 | * @throws \Exception |
||
| 310 | */ |
||
| 311 | 13 | protected function getNewDerivation($chainIndex = null) { |
|
| 343 | |||
| 344 | /** |
||
| 345 | 13 | * @param string|BIP32Path $path |
|
| 346 | 13 | * @return BIP32Key|false |
|
| 347 | 13 | * @throws \Exception |
|
| 348 | 13 | * |
|
| 349 | * @TODO: hmm? |
||
| 350 | 13 | */ |
|
| 351 | 13 | protected function getParentPublicKey($path) { |
|
| 368 | |||
| 369 | /** |
||
| 370 | * get address for the specified path |
||
| 371 | 14 | * |
|
| 372 | * @param string|BIP32Path $path |
||
| 373 | * @return string |
||
| 374 | */ |
||
| 375 | public function getAddressByPath($path) { |
||
| 386 | |||
| 387 | /** |
||
| 388 | * @param string $path |
||
| 389 | * @return WalletScript |
||
| 390 | */ |
||
| 391 | public function getWalletScriptByPath($path) { |
||
| 403 | 14 | ||
| 404 | 14 | /** |
|
| 405 | * get address and redeemScript for specified path |
||
| 406 | 14 | * |
|
| 407 | * @param string $path |
||
| 408 | 14 | * @return array[string, ScriptInterface, ScriptInterface|null] [address, redeemScript, witnessScript] |
|
| 409 | 14 | */ |
|
| 410 | 14 | public function getRedeemScriptByPath($path) { |
|
| 417 | 3 | ||
| 418 | 3 | /** |
|
| 419 | * @param BIP32Key $key |
||
| 420 | 14 | * @param string|BIP32Path $path |
|
| 421 | 14 | * @return string |
|
| 422 | 14 | */ |
|
| 423 | protected function getAddressFromKey(BIP32Key $key, $path) { |
||
| 426 | |||
| 427 | /** |
||
| 428 | * @param BIP32Key $key |
||
| 429 | * @param string|BIP32Path $path |
||
| 430 | * @return WalletScript |
||
| 431 | * @throws \Exception |
||
| 432 | */ |
||
| 433 | protected function getWalletScriptFromKey(BIP32Key $key, $path) { |
||
| 460 | 13 | ||
| 461 | 13 | /** |
|
| 462 | 13 | * get the path (and redeemScript) to specified address |
|
| 463 | * |
||
| 464 | 13 | * @param string $address |
|
| 465 | * @return array |
||
| 466 | */ |
||
| 467 | public function getPathForAddress($address) { |
||
| 470 | |||
| 471 | /** |
||
| 472 | 9 | * @param string|BIP32Path $path |
|
| 473 | 9 | * @return BIP32Key |
|
| 474 | * @throws \Exception |
||
| 475 | */ |
||
| 476 | public function getBlocktrailPublicKey($path) { |
||
| 487 | |||
| 488 | /** |
||
| 489 | * generate a new derived key and return the new path and address for it |
||
| 490 | * |
||
| 491 | * @param int|null $chainIndex |
||
| 492 | * @return string[] [path, address] |
||
| 493 | 2 | */ |
|
| 494 | 2 | public function getNewAddressPair($chainIndex = null) { |
|
| 500 | |||
| 501 | /** |
||
| 502 | * generate a new derived private key and return the new address for it |
||
| 503 | * |
||
| 504 | * @param int|null $chainIndex |
||
| 505 | * @return string |
||
| 506 | */ |
||
| 507 | public function getNewAddress($chainIndex = null) { |
||
| 510 | |||
| 511 | /** |
||
| 512 | 9 | * get the balance for the wallet |
|
| 513 | 9 | * |
|
| 514 | 4 | * @return int[] [confirmed, unconfirmed] |
|
| 515 | */ |
||
| 516 | public function getBalance() { |
||
| 521 | 9 | ||
| 522 | 9 | /** |
|
| 523 | * do wallet discovery (slow) |
||
| 524 | 9 | * |
|
| 525 | 9 | * @param int $gap the gap setting to use for discovery |
|
| 526 | * @return int[] [confirmed, unconfirmed] |
||
| 527 | */ |
||
| 528 | 9 | public function doDiscovery($gap = 200) { |
|
| 533 | |||
| 534 | /** |
||
| 535 | * create, sign and send a transaction |
||
| 536 | * |
||
| 537 | * @param array $outputs [address => value, ] or [[address, value], ] or [['address' => address, 'value' => value], ] coins to send |
||
| 538 | * value should be INT |
||
| 539 | * @param string $changeAddress change address to use (autogenerated if NULL) |
||
| 540 | * @param bool $allowZeroConf |
||
| 541 | * @param bool $randomizeChangeIdx randomize the location of the change (for increased privacy / anonimity) |
||
| 542 | * @param string $feeStrategy |
||
| 543 | * @param null|int $forceFee set a fixed fee instead of automatically calculating the correct fee, not recommended! |
||
| 544 | * @return string the txid / transaction hash |
||
| 545 | * @throws \Exception |
||
| 546 | */ |
||
| 547 | public function pay(array $outputs, $changeAddress = null, $allowZeroConf = false, $randomizeChangeIdx = true, $feeStrategy = self::FEE_STRATEGY_OPTIMAL, $forceFee = null) { |
||
| 569 | 1 | ||
| 570 | /** |
||
| 571 | 1 | * determine max spendable from wallet after fees |
|
| 572 | * |
||
| 573 | * @param bool $allowZeroConf |
||
| 574 | 10 | * @param string $feeStrategy |
|
| 575 | 10 | * @param null|int $forceFee set a fixed fee instead of automatically calculating the correct fee, not recommended! |
|
| 576 | * @param int $outputCnt |
||
| 577 | * @return string |
||
| 578 | 10 | * @throws BlocktrailSDKException |
|
| 579 | */ |
||
| 580 | public function getMaxSpendable($allowZeroConf = false, $feeStrategy = self::FEE_STRATEGY_OPTIMAL, $forceFee = null, $outputCnt = 1) { |
||
| 583 | |||
| 584 | /** |
||
| 585 | * parse outputs into normalized struct |
||
| 586 | * |
||
| 587 | * @param array $outputs [address => value, ] or [[address, value], ] or [['address' => address, 'value' => value], ] |
||
| 588 | * @return array [['address' => address, 'value' => value], ] |
||
| 589 | */ |
||
| 590 | public static function normalizeOutputsStruct(array $outputs) { |
||
| 618 | |||
| 619 | 5 | /** |
|
| 620 | * 'fund' the txBuilder with UTXOs (modified in place) |
||
| 621 | * |
||
| 622 | * @param TransactionBuilder $txBuilder |
||
| 623 | * @param bool|true $lockUTXOs |
||
| 624 | * @param bool|false $allowZeroConf |
||
| 625 | * @param null|int $forceFee |
||
| 626 | * @return TransactionBuilder |
||
| 627 | */ |
||
| 628 | public function coinSelectionForTxBuilder(TransactionBuilder $txBuilder, $lockUTXOs = true, $allowZeroConf = false, $forceFee = null) { |
||
| 656 | |||
| 657 | 7 | /** |
|
| 658 | 7 | * build inputs and outputs lists for TransactionBuilder |
|
| 659 | * |
||
| 660 | * @param TransactionBuilder $txBuilder |
||
| 661 | * @return [TransactionInterface, SignInfo[]] |
||
| 662 | 7 | * @throws \Exception |
|
| 663 | 6 | */ |
|
| 664 | 6 | public function buildTx(TransactionBuilder $txBuilder) { |
|
| 752 | |||
| 753 | public function determineFeeAndChange(TransactionBuilder $txBuilder, $optimalFeePerKB, $lowPriorityFeePerKB) { |
||
| 809 | |||
| 810 | 4 | /** |
|
| 811 | * create, sign and send transction based on TransactionBuilder |
||
| 812 | * |
||
| 813 | 4 | * @param TransactionBuilder $txBuilder |
|
| 814 | 4 | * @param bool $apiCheckFee let the API check if the fee is correct |
|
| 815 | * @return string |
||
| 816 | * @throws \Exception |
||
| 817 | */ |
||
| 818 | public function sendTx(TransactionBuilder $txBuilder, $apiCheckFee = true) { |
||
| 823 | |||
| 824 | /** |
||
| 825 | * !! INTERNAL METHOD, public for testing purposes !! |
||
| 826 | * create, sign and send transction based on inputs and outputs |
||
| 827 | * |
||
| 828 | * @param Transaction $tx |
||
| 829 | * @param SignInfo[] $signInfo |
||
| 830 | * @param bool $apiCheckFee let the API check if the fee is correct |
||
| 831 | * @return string |
||
| 832 | 1 | * @throws \Exception |
|
| 833 | 1 | * @internal |
|
| 834 | */ |
||
| 835 | 1 | public function _sendTx(Transaction $tx, array $signInfo, $apiCheckFee = true) { |
|
| 857 | |||
| 858 | /** |
||
| 859 | * only supports estimating fee for 2of3 multsig UTXOs and P2PKH/P2SH outputs |
||
| 860 | * |
||
| 861 | * @todo: mark this as deprecated, insist on the utxo's or qualified scripts. |
||
| 862 | * @param int $utxoCnt number of unspent inputs in transaction |
||
| 863 | * @param int $outputCnt number of outputs in transaction |
||
| 864 | 2 | * @return float |
|
| 865 | 2 | * @access public reminder that people might use this! |
|
| 866 | */ |
||
| 867 | public static function estimateFee($utxoCnt, $outputCnt) { |
||
| 872 | |||
| 873 | /** |
||
| 874 | 3 | * @param int $size size in bytes |
|
| 875 | 3 | * @return int fee in satoshi |
|
| 876 | */ |
||
| 877 | 3 | public static function baseFeeForSize($size) { |
|
| 882 | 3 | ||
| 883 | 3 | /** |
|
| 884 | 3 | * @todo: variable varint |
|
| 885 | 3 | * @param int $txinSize |
|
| 886 | * @param int $txoutSize |
||
| 887 | * @return float |
||
| 888 | 3 | */ |
|
| 889 | 3 | public static function estimateSize($txinSize, $txoutSize) { |
|
| 892 | 3 | ||
| 893 | /** |
||
| 894 | * only supports estimating size for P2PKH/P2SH outputs |
||
| 895 | 3 | * |
|
| 896 | * @param int $outputCnt number of outputs in transaction |
||
| 897 | * @return float |
||
| 898 | */ |
||
| 899 | public static function estimateSizeOutputs($outputCnt) { |
||
| 902 | |||
| 903 | /** |
||
| 904 | * only supports estimating size for 2of3 multsig UTXOs |
||
| 905 | * |
||
| 906 | * @param int $utxoCnt number of unspent inputs in transaction |
||
| 907 | * @return float |
||
| 908 | 3 | */ |
|
| 909 | public static function estimateSizeUTXOs($utxoCnt) { |
||
| 945 | |||
| 946 | /** |
||
| 947 | * determine how much fee is required based on the inputs and outputs |
||
| 948 | * this is an estimation, not a proper 100% correct calculation |
||
| 949 | * |
||
| 950 | 7 | * @param UTXO[] $utxos |
|
| 951 | * @param array[] $outputs |
||
| 952 | 7 | * @param $feeStrategy |
|
| 953 | 7 | * @param $optimalFeePerKB |
|
| 954 | 7 | * @param $lowPriorityFeePerKB |
|
| 955 | * @return int |
||
| 956 | 7 | * @throws BlocktrailSDKException |
|
| 957 | */ |
||
| 958 | protected function determineFee($utxos, $outputs, $feeStrategy, $optimalFeePerKB, $lowPriorityFeePerKB) { |
||
| 976 | |||
| 977 | /** |
||
| 978 | * determine how much change is left over based on the inputs and outputs and the fee |
||
| 979 | * |
||
| 980 | 4 | * @param UTXO[] $utxos |
|
| 981 | 4 | * @param array[] $outputs |
|
| 982 | * @param int $fee |
||
| 983 | 4 | * @return int |
|
| 984 | 4 | */ |
|
| 985 | 4 | protected function determineChange($utxos, $outputs, $fee) { |
|
| 993 | 4 | ||
| 994 | /** |
||
| 995 | * sign a raw transaction with the private keys that we have |
||
| 996 | * |
||
| 997 | 4 | * @param Transaction $tx |
|
| 998 | * @param SignInfo[] $signInfo |
||
| 999 | * @return TransactionInterface |
||
| 1000 | * @throws \Exception |
||
| 1001 | */ |
||
| 1002 | protected function signTransaction(Transaction $tx, array $signInfo) { |
||
| 1034 | |||
| 1035 | /** |
||
| 1036 | 7 | * send the transaction using the API |
|
| 1037 | * |
||
| 1038 | * @param string|array $signed |
||
| 1039 | 7 | * @param string[] $paths |
|
| 1040 | 7 | * @param bool $checkFee |
|
| 1041 | * @return string the complete raw transaction |
||
| 1042 | * @throws \Exception |
||
| 1043 | */ |
||
| 1044 | 7 | protected function sendTransaction($signed, $paths, $checkFee = false) { |
|
| 1047 | 3 | ||
| 1048 | 3 | /** |
|
| 1049 | * @param \array[] $outputs |
||
| 1050 | 3 | * @param bool $lockUTXO |
|
| 1051 | 3 | * @param bool $allowZeroConf |
|
| 1052 | * @param int|null|string $feeStrategy |
||
| 1053 | 3 | * @param null $forceFee |
|
| 1054 | 3 | * @return array |
|
| 1055 | */ |
||
| 1056 | public function coinSelection($outputs, $lockUTXO = true, $allowZeroConf = false, $feeStrategy = self::FEE_STRATEGY_OPTIMAL, $forceFee = null) { |
||
| 1065 | |||
| 1066 | public function getOptimalFeePerKB() { |
||
| 1073 | |||
| 1074 | public function getLowPriorityFeePerKB() { |
||
| 1081 | 10 | ||
| 1082 | public function updateFeePerKB() { |
||
| 1090 | |||
| 1091 | /** |
||
| 1092 | * delete the wallet |
||
| 1093 | * |
||
| 1094 | * @param bool $force ignore warnings (such as non-zero balance) |
||
| 1095 | * @return mixed |
||
| 1096 | 1 | * @throws \Exception |
|
| 1097 | 1 | */ |
|
| 1098 | 1 | public function deleteWallet($force = false) { |
|
| 1106 | 1 | ||
| 1107 | 1 | /** |
|
| 1108 | * create checksum to verify ownership of the master primary key |
||
| 1109 | * |
||
| 1110 | * @return string[] [address, signature] |
||
| 1111 | */ |
||
| 1112 | protected function createChecksumVerificationSignature() { |
||
| 1123 | |||
| 1124 | /** |
||
| 1125 | * setup a webhook for our wallet |
||
| 1126 | * |
||
| 1127 | * @param string $url URL to receive webhook events |
||
| 1128 | * @param string $identifier identifier for the webhook, defaults to WALLET-{$this->identifier} |
||
| 1129 | * @return array |
||
| 1130 | */ |
||
| 1131 | public function setupWebhook($url, $identifier = null) { |
||
| 1135 | |||
| 1136 | /** |
||
| 1137 | * @param string $identifier identifier for the webhook, defaults to WALLET-{$this->identifier} |
||
| 1138 | * @return mixed |
||
| 1139 | */ |
||
| 1140 | public function deleteWebhook($identifier = null) { |
||
| 1144 | |||
| 1145 | /** |
||
| 1146 | * lock a specific unspent output |
||
| 1147 | * |
||
| 1148 | * @param $txHash |
||
| 1149 | * @param $txIdx |
||
| 1150 | * @param int $ttl |
||
| 1151 | * @return bool |
||
| 1152 | */ |
||
| 1153 | 1 | public function lockUTXO($txHash, $txIdx, $ttl = 3) { |
|
| 1156 | |||
| 1157 | /** |
||
| 1158 | * unlock a specific unspent output |
||
| 1159 | * |
||
| 1160 | * @param $txHash |
||
| 1161 | * @param $txIdx |
||
| 1162 | * @return bool |
||
| 1163 | */ |
||
| 1164 | public function unlockUTXO($txHash, $txIdx) { |
||
| 1167 | 1 | ||
| 1168 | /** |
||
| 1169 | * get all transactions for the wallet (paginated) |
||
| 1170 | * |
||
| 1171 | * @param integer $page pagination: page number |
||
| 1172 | * @param integer $limit pagination: records per page (max 500) |
||
| 1173 | * @param string $sortDir pagination: sort direction (asc|desc) |
||
| 1174 | * @return array associative array containing the response |
||
| 1175 | */ |
||
| 1176 | public function transactions($page = 1, $limit = 20, $sortDir = 'asc') { |
||
| 1179 | |||
| 1180 | /** |
||
| 1181 | * get all addresses for the wallet (paginated) |
||
| 1182 | * |
||
| 1183 | * @param integer $page pagination: page number |
||
| 1184 | * @param integer $limit pagination: records per page (max 500) |
||
| 1185 | * @param string $sortDir pagination: sort direction (asc|desc) |
||
| 1186 | * @return array associative array containing the response |
||
| 1187 | */ |
||
| 1188 | public function addresses($page = 1, $limit = 20, $sortDir = 'asc') { |
||
| 1191 | |||
| 1192 | /** |
||
| 1193 | * get all UTXOs for the wallet (paginated) |
||
| 1194 | * |
||
| 1195 | * @param integer $page pagination: page number |
||
| 1196 | * @param integer $limit pagination: records per page (max 500) |
||
| 1197 | * @param string $sortDir pagination: sort direction (asc|desc) |
||
| 1198 | * @param boolean $zeroconf include zero confirmation transactions |
||
| 1199 | * @return array associative array containing the response |
||
| 1200 | */ |
||
| 1201 | public function utxos($page = 1, $limit = 20, $sortDir = 'asc', $zeroconf = true) { |
||
| 1204 | } |
||
| 1205 |
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..