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 | protected $checksum; |
||
| 128 | |||
| 129 | /** |
||
| 130 | * @var bool |
||
| 131 | */ |
||
| 132 | protected $locked = true; |
||
| 133 | |||
| 134 | /** |
||
| 135 | * @var bool |
||
| 136 | */ |
||
| 137 | protected $isSegwit = false; |
||
| 138 | |||
| 139 | /** |
||
| 140 | * @var int |
||
| 141 | */ |
||
| 142 | protected $chainIndex; |
||
| 143 | |||
| 144 | /** |
||
| 145 | * @var int |
||
| 146 | */ |
||
| 147 | protected $changeIndex; |
||
| 148 | |||
| 149 | protected $highPriorityFeePerKB; |
||
| 150 | protected $optimalFeePerKB; |
||
| 151 | protected $lowPriorityFeePerKB; |
||
| 152 | protected $feePerKBAge; |
||
| 153 | protected $allowedSignModes = [SignInfo::MODE_DONTSIGN, SignInfo::MODE_SIGN]; |
||
| 154 | |||
| 155 | /** |
||
| 156 | * @param BlocktrailSDKInterface $sdk SDK instance used to do requests |
||
| 157 | * @param string $identifier identifier of the wallet |
||
| 158 | * @param BIP32Key[] $primaryPublicKeys |
||
| 159 | * @param BIP32Key $backupPublicKey should be BIP32 master public key M/ |
||
| 160 | * @param BIP32Key[] $blocktrailPublicKeys |
||
| 161 | * @param int $keyIndex |
||
| 162 | * @param string $network |
||
| 163 | * @param bool $testnet |
||
| 164 | * @param bool $segwit |
||
| 165 | * @param string $checksum |
||
| 166 | * @throws BlocktrailSDKException |
||
| 167 | */ |
||
| 168 | 22 | public function __construct(BlocktrailSDKInterface $sdk, $identifier, array $primaryPublicKeys, $backupPublicKey, array $blocktrailPublicKeys, $keyIndex, $network, $testnet, $segwit, $checksum) { |
|
| 201 | |||
| 202 | /** |
||
| 203 | * @param int|null $chainIndex |
||
| 204 | * @return WalletPath |
||
| 205 | * @throws BlocktrailSDKException |
||
| 206 | */ |
||
| 207 | 15 | protected function getWalletPath($chainIndex = null) { |
|
| 217 | |||
| 218 | /** |
||
| 219 | * @return bool |
||
| 220 | */ |
||
| 221 | 3 | public function isSegwit() { |
|
| 224 | |||
| 225 | /** |
||
| 226 | * return the wallet identifier |
||
| 227 | * |
||
| 228 | * @return string |
||
| 229 | */ |
||
| 230 | 10 | public function getIdentifier() { |
|
| 233 | |||
| 234 | /** |
||
| 235 | * Returns the wallets backup public key |
||
| 236 | * |
||
| 237 | * @return [xpub, path] |
||
|
|
|||
| 238 | */ |
||
| 239 | 1 | public function getBackupKey() { |
|
| 242 | |||
| 243 | /** |
||
| 244 | * return list of Blocktrail co-sign extended public keys |
||
| 245 | * |
||
| 246 | * @return array[] [ [xpub, path] ] |
||
| 247 | */ |
||
| 248 | 5 | public function getBlocktrailPublicKeys() { |
|
| 253 | |||
| 254 | /** |
||
| 255 | * check if wallet is locked |
||
| 256 | * |
||
| 257 | * @return bool |
||
| 258 | */ |
||
| 259 | 10 | public function isLocked() { |
|
| 262 | |||
| 263 | /** |
||
| 264 | * upgrade wallet to different blocktrail cosign key |
||
| 265 | * |
||
| 266 | * @param $keyIndex |
||
| 267 | * @return bool |
||
| 268 | * @throws \Exception |
||
| 269 | */ |
||
| 270 | 5 | public function upgradeKeyIndex($keyIndex) { |
|
| 297 | |||
| 298 | /** |
||
| 299 | * get a new BIP32 derivation for the next (unused) address |
||
| 300 | * by requesting it from the API |
||
| 301 | * |
||
| 302 | * @return string |
||
| 303 | * @param int|null $chainIndex |
||
| 304 | * @throws \Exception |
||
| 305 | */ |
||
| 306 | 15 | protected function getNewDerivation($chainIndex = null) { |
|
| 338 | |||
| 339 | /** |
||
| 340 | * @param string|BIP32Path $path |
||
| 341 | * @return BIP32Key|false |
||
| 342 | * @throws \Exception |
||
| 343 | * |
||
| 344 | * @TODO: hmm? |
||
| 345 | */ |
||
| 346 | 16 | protected function getParentPublicKey($path) { |
|
| 363 | |||
| 364 | /** |
||
| 365 | * get address for the specified path |
||
| 366 | * |
||
| 367 | * @param string|BIP32Path $path |
||
| 368 | * @return string |
||
| 369 | */ |
||
| 370 | 14 | public function getAddressByPath($path) { |
|
| 381 | |||
| 382 | /** |
||
| 383 | * @param string $path |
||
| 384 | * @return WalletScript |
||
| 385 | */ |
||
| 386 | 16 | public function getWalletScriptByPath($path) { |
|
| 398 | |||
| 399 | /** |
||
| 400 | * get address and redeemScript for specified path |
||
| 401 | * |
||
| 402 | * @param string $path |
||
| 403 | * @return array[string, ScriptInterface, ScriptInterface|null] [address, redeemScript, witnessScript] |
||
| 404 | */ |
||
| 405 | 15 | public function getRedeemScriptByPath($path) { |
|
| 412 | |||
| 413 | /** |
||
| 414 | * @param BIP32Key $key |
||
| 415 | * @param string|BIP32Path $path |
||
| 416 | * @return string |
||
| 417 | */ |
||
| 418 | protected function getAddressFromKey(BIP32Key $key, $path) { |
||
| 421 | |||
| 422 | /** |
||
| 423 | * @param BIP32Key $key |
||
| 424 | * @param string|BIP32Path $path |
||
| 425 | * @return WalletScript |
||
| 426 | * @throws \Exception |
||
| 427 | */ |
||
| 428 | 16 | protected function getWalletScriptFromKey(BIP32Key $key, $path) { |
|
| 454 | |||
| 455 | /** |
||
| 456 | * get the path (and redeemScript) to specified address |
||
| 457 | * |
||
| 458 | * @param string $address |
||
| 459 | * @return array |
||
| 460 | */ |
||
| 461 | 1 | public function getPathForAddress($address) { |
|
| 464 | |||
| 465 | /** |
||
| 466 | * @param string|BIP32Path $path |
||
| 467 | * @return BIP32Key |
||
| 468 | * @throws \Exception |
||
| 469 | */ |
||
| 470 | 16 | public function getBlocktrailPublicKey($path) { |
|
| 481 | |||
| 482 | /** |
||
| 483 | * generate a new derived key and return the new path and address for it |
||
| 484 | * |
||
| 485 | * @param int|null $chainIndex |
||
| 486 | * @return string[] [path, address] |
||
| 487 | */ |
||
| 488 | 15 | public function getNewAddressPair($chainIndex = null) { |
|
| 494 | |||
| 495 | /** |
||
| 496 | * generate a new derived private key and return the new address for it |
||
| 497 | * |
||
| 498 | * @param int|null $chainIndex |
||
| 499 | * @return string |
||
| 500 | */ |
||
| 501 | 7 | public function getNewAddress($chainIndex = null) { |
|
| 504 | |||
| 505 | /** |
||
| 506 | * generate a new derived private key and return the new address for it |
||
| 507 | * |
||
| 508 | * @return string |
||
| 509 | */ |
||
| 510 | 5 | public function getNewChangeAddress() { |
|
| 513 | |||
| 514 | /** |
||
| 515 | * get the balance for the wallet |
||
| 516 | * |
||
| 517 | * @return int[] [confirmed, unconfirmed] |
||
| 518 | */ |
||
| 519 | 9 | public function getBalance() { |
|
| 524 | |||
| 525 | /** |
||
| 526 | * do wallet discovery (slow) |
||
| 527 | * |
||
| 528 | * @param int $gap the gap setting to use for discovery |
||
| 529 | * @return int[] [confirmed, unconfirmed] |
||
| 530 | */ |
||
| 531 | 2 | public function doDiscovery($gap = 200) { |
|
| 536 | |||
| 537 | /** |
||
| 538 | * create, sign and send a transaction |
||
| 539 | * |
||
| 540 | * @param array $outputs [address => value, ] or [[address, value], ] or [['address' => address, 'value' => value], ] coins to send |
||
| 541 | * value should be INT |
||
| 542 | * @param string $changeAddress change address to use (autogenerated if NULL) |
||
| 543 | * @param bool $allowZeroConf |
||
| 544 | * @param bool $randomizeChangeIdx randomize the location of the change (for increased privacy / anonimity) |
||
| 545 | * @param string $feeStrategy |
||
| 546 | * @param null|int $forceFee set a fixed fee instead of automatically calculating the correct fee, not recommended! |
||
| 547 | * @param bool $apiCheckFee let the API apply sanity checks to the fee |
||
| 548 | * @return string the txid / transaction hash |
||
| 549 | * @throws \Exception |
||
| 550 | */ |
||
| 551 | 9 | public function pay(array $outputs, $changeAddress = null, $allowZeroConf = false, $randomizeChangeIdx = true, $feeStrategy = self::FEE_STRATEGY_OPTIMAL, $forceFee = null, $apiCheckFee = true) { |
|
| 579 | |||
| 580 | /** |
||
| 581 | * determine max spendable from wallet after fees |
||
| 582 | * |
||
| 583 | * @param bool $allowZeroConf |
||
| 584 | * @param string $feeStrategy |
||
| 585 | * @param null|int $forceFee set a fixed fee instead of automatically calculating the correct fee, not recommended! |
||
| 586 | * @param int $outputCnt |
||
| 587 | * @return string |
||
| 588 | * @throws BlocktrailSDKException |
||
| 589 | */ |
||
| 590 | public function getMaxSpendable($allowZeroConf = false, $feeStrategy = self::FEE_STRATEGY_OPTIMAL, $forceFee = null, $outputCnt = 1) { |
||
| 593 | |||
| 594 | /** |
||
| 595 | * parse outputs into normalized struct |
||
| 596 | * |
||
| 597 | * @param array $outputs [address => value, ] or [[address, value], ] or [['address' => address, 'value' => value], ] |
||
| 598 | * @return array [['address' => address, 'value' => value], ] |
||
| 599 | */ |
||
| 600 | 10 | public static function normalizeOutputsStruct(array $outputs) { |
|
| 628 | |||
| 629 | /** |
||
| 630 | * 'fund' the txBuilder with UTXOs (modified in place) |
||
| 631 | * |
||
| 632 | * @param TransactionBuilder $txBuilder |
||
| 633 | * @param bool|true $lockUTXOs |
||
| 634 | * @param bool|false $allowZeroConf |
||
| 635 | * @param null|int $forceFee |
||
| 636 | * @return TransactionBuilder |
||
| 637 | */ |
||
| 638 | 11 | public function coinSelectionForTxBuilder(TransactionBuilder $txBuilder, $lockUTXOs = true, $allowZeroConf = false, $forceFee = null) { |
|
| 666 | |||
| 667 | /** |
||
| 668 | * build inputs and outputs lists for TransactionBuilder |
||
| 669 | * |
||
| 670 | * @param TransactionBuilder $txBuilder |
||
| 671 | * @return [TransactionInterface, SignInfo[]] |
||
| 672 | * @throws \Exception |
||
| 673 | */ |
||
| 674 | 7 | public function buildTx(TransactionBuilder $txBuilder) { |
|
| 763 | |||
| 764 | 7 | public function determineFeeAndChange(TransactionBuilder $txBuilder, $highPriorityFeePerKB, $optimalFeePerKB, $lowPriorityFeePerKB) { |
|
| 824 | |||
| 825 | /** |
||
| 826 | * create, sign and send transction based on TransactionBuilder |
||
| 827 | * |
||
| 828 | * @param TransactionBuilder $txBuilder |
||
| 829 | * @param bool $apiCheckFee let the API check if the fee is correct |
||
| 830 | * @return string |
||
| 831 | * @throws \Exception |
||
| 832 | */ |
||
| 833 | 4 | public function sendTx(TransactionBuilder $txBuilder, $apiCheckFee = true) { |
|
| 838 | |||
| 839 | /** |
||
| 840 | * !! INTERNAL METHOD, public for testing purposes !! |
||
| 841 | * create, sign and send transction based on inputs and outputs |
||
| 842 | * |
||
| 843 | * @param Transaction $tx |
||
| 844 | * @param SignInfo[] $signInfo |
||
| 845 | * @param bool $apiCheckFee let the API check if the fee is correct |
||
| 846 | * @return string |
||
| 847 | * @throws \Exception |
||
| 848 | * @internal |
||
| 849 | */ |
||
| 850 | 4 | public function _sendTx(Transaction $tx, array $signInfo, $apiCheckFee = true) { |
|
| 872 | |||
| 873 | /** |
||
| 874 | * only supports estimating fee for 2of3 multsig UTXOs and P2PKH/P2SH outputs |
||
| 875 | * |
||
| 876 | * @todo: mark this as deprecated, insist on the utxo's or qualified scripts. |
||
| 877 | * @param int $utxoCnt number of unspent inputs in transaction |
||
| 878 | * @param int $outputCnt number of outputs in transaction |
||
| 879 | * @return float |
||
| 880 | * @access public reminder that people might use this! |
||
| 881 | */ |
||
| 882 | 1 | public static function estimateFee($utxoCnt, $outputCnt) { |
|
| 887 | |||
| 888 | /** |
||
| 889 | * @param int $size size in bytes |
||
| 890 | * @return int fee in satoshi |
||
| 891 | */ |
||
| 892 | 5 | public static function baseFeeForSize($size) { |
|
| 897 | |||
| 898 | /** |
||
| 899 | * @todo: variable varint |
||
| 900 | * @todo: deprecate |
||
| 901 | * @param int $txinSize |
||
| 902 | * @param int $txoutSize |
||
| 903 | * @return float |
||
| 904 | */ |
||
| 905 | 2 | public static function estimateSize($txinSize, $txoutSize) { |
|
| 908 | |||
| 909 | /** |
||
| 910 | * only supports estimating size for P2PKH/P2SH outputs |
||
| 911 | * |
||
| 912 | * @param int $outputCnt number of outputs in transaction |
||
| 913 | * @return float |
||
| 914 | */ |
||
| 915 | 2 | public static function estimateSizeOutputs($outputCnt) { |
|
| 918 | |||
| 919 | /** |
||
| 920 | * only supports estimating size for 2of3 multsig UTXOs |
||
| 921 | * |
||
| 922 | * @param int $utxoCnt number of unspent inputs in transaction |
||
| 923 | * @return float |
||
| 924 | */ |
||
| 925 | 3 | public static function estimateSizeUTXOs($utxoCnt) { |
|
| 961 | |||
| 962 | /** |
||
| 963 | * determine how much fee is required based on the inputs and outputs |
||
| 964 | * this is an estimation, not a proper 100% correct calculation |
||
| 965 | * |
||
| 966 | * @param UTXO[] $utxos |
||
| 967 | * @param array[] $outputs |
||
| 968 | * @param $feeStrategy |
||
| 969 | * @param $highPriorityFeePerKB |
||
| 970 | * @param $optimalFeePerKB |
||
| 971 | * @param $lowPriorityFeePerKB |
||
| 972 | * @return int |
||
| 973 | * @throws BlocktrailSDKException |
||
| 974 | */ |
||
| 975 | 7 | protected function determineFee($utxos, $outputs, $feeStrategy, $highPriorityFeePerKB, $optimalFeePerKB, $lowPriorityFeePerKB) { |
|
| 999 | |||
| 1000 | /** |
||
| 1001 | * determine how much change is left over based on the inputs and outputs and the fee |
||
| 1002 | * |
||
| 1003 | * @param UTXO[] $utxos |
||
| 1004 | * @param array[] $outputs |
||
| 1005 | * @param int $fee |
||
| 1006 | * @return int |
||
| 1007 | */ |
||
| 1008 | 7 | protected function determineChange($utxos, $outputs, $fee) { |
|
| 1016 | |||
| 1017 | /** |
||
| 1018 | * sign a raw transaction with the private keys that we have |
||
| 1019 | * |
||
| 1020 | * @param Transaction $tx |
||
| 1021 | * @param SignInfo[] $signInfo |
||
| 1022 | * @return TransactionInterface |
||
| 1023 | * @throws \Exception |
||
| 1024 | */ |
||
| 1025 | 4 | protected function signTransaction(Transaction $tx, array $signInfo) { |
|
| 1057 | |||
| 1058 | /** |
||
| 1059 | * send the transaction using the API |
||
| 1060 | * |
||
| 1061 | * @param string|array $signed |
||
| 1062 | * @param string[] $paths |
||
| 1063 | * @param bool $checkFee |
||
| 1064 | * @return string the complete raw transaction |
||
| 1065 | * @throws \Exception |
||
| 1066 | */ |
||
| 1067 | 4 | protected function sendTransaction($signed, $paths, $checkFee = false) { |
|
| 1070 | |||
| 1071 | /** |
||
| 1072 | * @param \array[] $outputs |
||
| 1073 | * @param bool $lockUTXO |
||
| 1074 | * @param bool $allowZeroConf |
||
| 1075 | * @param int|null|string $feeStrategy |
||
| 1076 | * @param null $forceFee |
||
| 1077 | * @return array |
||
| 1078 | */ |
||
| 1079 | 11 | public function coinSelection($outputs, $lockUTXO = true, $allowZeroConf = false, $feeStrategy = self::FEE_STRATEGY_OPTIMAL, $forceFee = null) { |
|
| 1089 | |||
| 1090 | 7 | public function getHighPriorityFeePerKB() { |
|
| 1097 | |||
| 1098 | 7 | public function getOptimalFeePerKB() { |
|
| 1105 | |||
| 1106 | 7 | public function getLowPriorityFeePerKB() { |
|
| 1113 | |||
| 1114 | 3 | public function updateFeePerKB() { |
|
| 1123 | |||
| 1124 | /** |
||
| 1125 | * delete the wallet |
||
| 1126 | * |
||
| 1127 | * @param bool $force ignore warnings (such as non-zero balance) |
||
| 1128 | * @return mixed |
||
| 1129 | * @throws \Exception |
||
| 1130 | */ |
||
| 1131 | 10 | public function deleteWallet($force = false) { |
|
| 1139 | |||
| 1140 | /** |
||
| 1141 | * create checksum to verify ownership of the master primary key |
||
| 1142 | * |
||
| 1143 | * @return string[] [address, signature] |
||
| 1144 | */ |
||
| 1145 | 10 | protected function createChecksumVerificationSignature() { |
|
| 1156 | |||
| 1157 | /** |
||
| 1158 | * setup a webhook for our wallet |
||
| 1159 | * |
||
| 1160 | * @param string $url URL to receive webhook events |
||
| 1161 | * @param string $identifier identifier for the webhook, defaults to WALLET-{$this->identifier} |
||
| 1162 | * @return array |
||
| 1163 | */ |
||
| 1164 | 1 | public function setupWebhook($url, $identifier = null) { |
|
| 1168 | |||
| 1169 | /** |
||
| 1170 | * @param string $identifier identifier for the webhook, defaults to WALLET-{$this->identifier} |
||
| 1171 | * @return mixed |
||
| 1172 | */ |
||
| 1173 | 1 | public function deleteWebhook($identifier = null) { |
|
| 1177 | |||
| 1178 | /** |
||
| 1179 | * lock a specific unspent output |
||
| 1180 | * |
||
| 1181 | * @param $txHash |
||
| 1182 | * @param $txIdx |
||
| 1183 | * @param int $ttl |
||
| 1184 | * @return bool |
||
| 1185 | */ |
||
| 1186 | public function lockUTXO($txHash, $txIdx, $ttl = 3) { |
||
| 1189 | |||
| 1190 | /** |
||
| 1191 | * unlock a specific unspent output |
||
| 1192 | * |
||
| 1193 | * @param $txHash |
||
| 1194 | * @param $txIdx |
||
| 1195 | * @return bool |
||
| 1196 | */ |
||
| 1197 | public function unlockUTXO($txHash, $txIdx) { |
||
| 1200 | |||
| 1201 | /** |
||
| 1202 | * get all transactions for the wallet (paginated) |
||
| 1203 | * |
||
| 1204 | * @param integer $page pagination: page number |
||
| 1205 | * @param integer $limit pagination: records per page (max 500) |
||
| 1206 | * @param string $sortDir pagination: sort direction (asc|desc) |
||
| 1207 | * @return array associative array containing the response |
||
| 1208 | */ |
||
| 1209 | 1 | public function transactions($page = 1, $limit = 20, $sortDir = 'asc') { |
|
| 1212 | |||
| 1213 | /** |
||
| 1214 | * get all addresses for the wallet (paginated) |
||
| 1215 | * |
||
| 1216 | * @param integer $page pagination: page number |
||
| 1217 | * @param integer $limit pagination: records per page (max 500) |
||
| 1218 | * @param string $sortDir pagination: sort direction (asc|desc) |
||
| 1219 | * @return array associative array containing the response |
||
| 1220 | */ |
||
| 1221 | 1 | public function addresses($page = 1, $limit = 20, $sortDir = 'asc') { |
|
| 1224 | |||
| 1225 | /** |
||
| 1226 | * get all UTXOs for the wallet (paginated) |
||
| 1227 | * |
||
| 1228 | * @param integer $page pagination: page number |
||
| 1229 | * @param integer $limit pagination: records per page (max 500) |
||
| 1230 | * @param string $sortDir pagination: sort direction (asc|desc) |
||
| 1231 | * @param boolean $zeroconf include zero confirmation transactions |
||
| 1232 | * @return array associative array containing the response |
||
| 1233 | */ |
||
| 1234 | 1 | public function utxos($page = 1, $limit = 20, $sortDir = 'asc', $zeroconf = true) { |
|
| 1237 | } |
||
| 1238 |
This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.