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 |
||
| 34 | abstract class Wallet implements WalletInterface { |
||
| 35 | |||
| 36 | const WALLET_VERSION_V1 = 'v1'; |
||
| 37 | const WALLET_VERSION_V2 = 'v2'; |
||
| 38 | const WALLET_VERSION_V3 = 'v3'; |
||
| 39 | |||
| 40 | const CHAIN_BTC_DEFAULT = 0; |
||
| 41 | const CHAIN_BCC_DEFAULT = 1; |
||
| 42 | const CHAIN_BTC_SEGWIT = 2; |
||
| 43 | |||
| 44 | const BASE_FEE = 10000; |
||
| 45 | |||
| 46 | /** |
||
| 47 | * development / debug setting |
||
| 48 | * when getting a new derivation from the API, |
||
| 49 | * will verify address / redeeemScript with the values the API provides |
||
| 50 | */ |
||
| 51 | const VERIFY_NEW_DERIVATION = true; |
||
| 52 | |||
| 53 | /** |
||
| 54 | * @var BlocktrailSDKInterface |
||
| 55 | */ |
||
| 56 | protected $sdk; |
||
| 57 | |||
| 58 | /** |
||
| 59 | * @var string |
||
| 60 | */ |
||
| 61 | protected $identifier; |
||
| 62 | |||
| 63 | /** |
||
| 64 | * BIP32 master primary private key (m/) |
||
| 65 | * |
||
| 66 | * @var BIP32Key |
||
| 67 | */ |
||
| 68 | protected $primaryPrivateKey; |
||
| 69 | |||
| 70 | /** |
||
| 71 | * @var BIP32Key[] |
||
| 72 | */ |
||
| 73 | protected $primaryPublicKeys; |
||
| 74 | |||
| 75 | /** |
||
| 76 | * BIP32 master backup public key (M/) |
||
| 77 | |||
| 78 | * @var BIP32Key |
||
| 79 | */ |
||
| 80 | protected $backupPublicKey; |
||
| 81 | |||
| 82 | /** |
||
| 83 | * map of blocktrail BIP32 public keys |
||
| 84 | * keyed by key index |
||
| 85 | * path should be `M / key_index'` |
||
| 86 | * |
||
| 87 | * @var BIP32Key[] |
||
| 88 | */ |
||
| 89 | protected $blocktrailPublicKeys; |
||
| 90 | |||
| 91 | /** |
||
| 92 | * the 'Blocktrail Key Index' that is used for new addresses |
||
| 93 | * |
||
| 94 | * @var int |
||
| 95 | */ |
||
| 96 | protected $keyIndex; |
||
| 97 | |||
| 98 | /** |
||
| 99 | * 'bitcoin' |
||
| 100 | * |
||
| 101 | * @var string |
||
| 102 | */ |
||
| 103 | protected $network; |
||
| 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 | /** |
||
| 134 | * @var string |
||
| 135 | */ |
||
| 136 | protected $checksum; |
||
| 137 | |||
| 138 | /** |
||
| 139 | * @var bool |
||
| 140 | */ |
||
| 141 | protected $locked = true; |
||
| 142 | |||
| 143 | /** |
||
| 144 | * @var bool |
||
| 145 | */ |
||
| 146 | protected $isSegwit = false; |
||
| 147 | |||
| 148 | /** |
||
| 149 | * @var int |
||
| 150 | */ |
||
| 151 | protected $chainIndex; |
||
| 152 | |||
| 153 | /** |
||
| 154 | * @var int |
||
| 155 | */ |
||
| 156 | protected $changeIndex; |
||
| 157 | |||
| 158 | /** |
||
| 159 | * @var AddressReaderBase |
||
| 160 | */ |
||
| 161 | protected $addressReader; |
||
| 162 | |||
| 163 | protected $highPriorityFeePerKB; |
||
| 164 | protected $optimalFeePerKB; |
||
| 165 | protected $lowPriorityFeePerKB; |
||
| 166 | protected $feePerKBAge; |
||
| 167 | protected $allowedSignModes = [SignInfo::MODE_DONTSIGN, SignInfo::MODE_SIGN]; |
||
| 168 | |||
| 169 | /** |
||
| 170 | * @param BlocktrailSDKInterface $sdk SDK instance used to do requests |
||
| 171 | * @param string $identifier identifier of the wallet |
||
| 172 | * @param BIP32Key[] $primaryPublicKeys |
||
| 173 | * @param BIP32Key $backupPublicKey should be BIP32 master public key M/ |
||
| 174 | * @param BIP32Key[] $blocktrailPublicKeys |
||
| 175 | * @param int $keyIndex |
||
| 176 | * @param string $network |
||
| 177 | * @param bool $testnet |
||
| 178 | * @param bool $segwit |
||
| 179 | * @param string $checksum |
||
| 180 | * @throws BlocktrailSDKException |
||
| 181 | */ |
||
| 182 | 22 | public function __construct(BlocktrailSDKInterface $sdk, $identifier, array $primaryPublicKeys, $backupPublicKey, array $blocktrailPublicKeys, $keyIndex, $network, $testnet, $segwit, AddressReaderBase $addressReader, $checksum) { |
|
| 216 | |||
| 217 | /** |
||
| 218 | * @return AddressReaderBase |
||
| 219 | */ |
||
| 220 | 5 | public function getAddressReader() { |
|
| 223 | |||
| 224 | /** |
||
| 225 | * @param int|null $chainIndex |
||
| 226 | * @return WalletPath |
||
| 227 | * @throws BlocktrailSDKException |
||
| 228 | */ |
||
| 229 | 15 | protected function getWalletPath($chainIndex = null) { |
|
| 239 | |||
| 240 | /** |
||
| 241 | * @return bool |
||
| 242 | */ |
||
| 243 | 3 | public function isSegwit() { |
|
| 246 | |||
| 247 | /** |
||
| 248 | * return the wallet identifier |
||
| 249 | * |
||
| 250 | * @return string |
||
| 251 | */ |
||
| 252 | 10 | public function getIdentifier() { |
|
| 255 | |||
| 256 | /** |
||
| 257 | * Returns the wallets backup public key |
||
| 258 | * |
||
| 259 | * @return [xpub, path] |
||
|
|
|||
| 260 | */ |
||
| 261 | 1 | public function getBackupKey() { |
|
| 264 | |||
| 265 | /** |
||
| 266 | * return list of Blocktrail co-sign extended public keys |
||
| 267 | * |
||
| 268 | * @return array[] [ [xpub, path] ] |
||
| 269 | */ |
||
| 270 | 5 | public function getBlocktrailPublicKeys() { |
|
| 275 | |||
| 276 | /** |
||
| 277 | * check if wallet is locked |
||
| 278 | * |
||
| 279 | * @return bool |
||
| 280 | */ |
||
| 281 | 10 | public function isLocked() { |
|
| 284 | |||
| 285 | /** |
||
| 286 | * upgrade wallet to different blocktrail cosign key |
||
| 287 | * |
||
| 288 | * @param $keyIndex |
||
| 289 | * @return bool |
||
| 290 | * @throws \Exception |
||
| 291 | */ |
||
| 292 | 5 | public function upgradeKeyIndex($keyIndex) { |
|
| 319 | |||
| 320 | /** |
||
| 321 | * get a new BIP32 derivation for the next (unused) address |
||
| 322 | * by requesting it from the API |
||
| 323 | * |
||
| 324 | * @return string |
||
| 325 | * @param int|null $chainIndex |
||
| 326 | * @throws \Exception |
||
| 327 | */ |
||
| 328 | 15 | protected function getNewDerivation($chainIndex = null) { |
|
| 385 | |||
| 386 | /** |
||
| 387 | * @param string|BIP32Path $path |
||
| 388 | * @return BIP32Key|false |
||
| 389 | * @throws \Exception |
||
| 390 | * |
||
| 391 | * @TODO: hmm? |
||
| 392 | */ |
||
| 393 | 16 | protected function getParentPublicKey($path) { |
|
| 410 | |||
| 411 | /** |
||
| 412 | * get address for the specified path |
||
| 413 | * |
||
| 414 | * @param string|BIP32Path $path |
||
| 415 | * @return string |
||
| 416 | */ |
||
| 417 | 14 | public function getAddressByPath($path) { |
|
| 428 | |||
| 429 | /** |
||
| 430 | * @param string $path |
||
| 431 | * @return WalletScript |
||
| 432 | */ |
||
| 433 | 16 | public function getWalletScriptByPath($path) { |
|
| 445 | |||
| 446 | /** |
||
| 447 | * get address and redeemScript for specified path |
||
| 448 | * |
||
| 449 | * @param string $path |
||
| 450 | * @return array[string, ScriptInterface, ScriptInterface|null] [address, redeemScript, witnessScript] |
||
| 451 | */ |
||
| 452 | 15 | public function getRedeemScriptByPath($path) { |
|
| 459 | |||
| 460 | /** |
||
| 461 | * @param BIP32Key $key |
||
| 462 | * @param string|BIP32Path $path |
||
| 463 | * @return string |
||
| 464 | */ |
||
| 465 | protected function getAddressFromKey(BIP32Key $key, $path) { |
||
| 468 | |||
| 469 | /** |
||
| 470 | * @param BIP32Key $key |
||
| 471 | * @param string|BIP32Path $path |
||
| 472 | * @return WalletScript |
||
| 473 | * @throws \Exception |
||
| 474 | */ |
||
| 475 | 16 | protected function getWalletScriptFromKey(BIP32Key $key, $path) { |
|
| 503 | |||
| 504 | /** |
||
| 505 | * get the path (and redeemScript) to specified address |
||
| 506 | * |
||
| 507 | * @param string $address |
||
| 508 | * @return array |
||
| 509 | */ |
||
| 510 | public function getPathForAddress($address) { |
||
| 518 | |||
| 519 | /** |
||
| 520 | * @param string|BIP32Path $path |
||
| 521 | * @return BIP32Key |
||
| 522 | * @throws \Exception |
||
| 523 | */ |
||
| 524 | 16 | public function getBlocktrailPublicKey($path) { |
|
| 535 | |||
| 536 | /** |
||
| 537 | * generate a new derived key and return the new path and address for it |
||
| 538 | * |
||
| 539 | * @param int|null $chainIndex |
||
| 540 | * @return string[] [path, address] |
||
| 541 | */ |
||
| 542 | 15 | public function getNewAddressPair($chainIndex = null) { |
|
| 548 | |||
| 549 | /** |
||
| 550 | * generate a new derived private key and return the new address for it |
||
| 551 | * |
||
| 552 | * @param int|null $chainIndex |
||
| 553 | * @return string |
||
| 554 | */ |
||
| 555 | 6 | public function getNewAddress($chainIndex = null) { |
|
| 558 | |||
| 559 | /** |
||
| 560 | * generate a new derived private key and return the new address for it |
||
| 561 | * |
||
| 562 | * @return string |
||
| 563 | */ |
||
| 564 | 5 | public function getNewChangeAddress() { |
|
| 567 | |||
| 568 | /** |
||
| 569 | * get the balance for the wallet |
||
| 570 | * |
||
| 571 | * @return int[] [confirmed, unconfirmed] |
||
| 572 | */ |
||
| 573 | 9 | public function getBalance() { |
|
| 578 | |||
| 579 | /** |
||
| 580 | * do wallet discovery (slow) |
||
| 581 | * |
||
| 582 | * @param int $gap the gap setting to use for discovery |
||
| 583 | * @return int[] [confirmed, unconfirmed] |
||
| 584 | */ |
||
| 585 | 2 | public function doDiscovery($gap = 200) { |
|
| 590 | |||
| 591 | /** |
||
| 592 | * create, sign and send a transaction |
||
| 593 | * |
||
| 594 | * @param array $outputs [address => value, ] or [[address, value], ] or [['address' => address, 'value' => value], ] coins to send |
||
| 595 | * value should be INT |
||
| 596 | * @param string $changeAddress change address to use (autogenerated if NULL) |
||
| 597 | * @param bool $allowZeroConf |
||
| 598 | * @param bool $randomizeChangeIdx randomize the location of the change (for increased privacy / anonimity) |
||
| 599 | * @param string $feeStrategy |
||
| 600 | * @param null|int $forceFee set a fixed fee instead of automatically calculating the correct fee, not recommended! |
||
| 601 | * @return string the txid / transaction hash |
||
| 602 | * @throws \Exception |
||
| 603 | */ |
||
| 604 | 9 | public function pay(array $outputs, $changeAddress = null, $allowZeroConf = false, $randomizeChangeIdx = true, $feeStrategy = self::FEE_STRATEGY_OPTIMAL, $forceFee = null) { |
|
| 626 | |||
| 627 | /** |
||
| 628 | * determine max spendable from wallet after fees |
||
| 629 | * |
||
| 630 | * @param bool $allowZeroConf |
||
| 631 | * @param string $feeStrategy |
||
| 632 | * @param null|int $forceFee set a fixed fee instead of automatically calculating the correct fee, not recommended! |
||
| 633 | * @param int $outputCnt |
||
| 634 | * @return string |
||
| 635 | * @throws BlocktrailSDKException |
||
| 636 | */ |
||
| 637 | public function getMaxSpendable($allowZeroConf = false, $feeStrategy = self::FEE_STRATEGY_OPTIMAL, $forceFee = null, $outputCnt = 1) { |
||
| 640 | |||
| 641 | /** |
||
| 642 | * parse outputs into normalized struct |
||
| 643 | * |
||
| 644 | * @param array $outputs [address => value, ] or [[address, value], ] or [['address' => address, 'value' => value], ] |
||
| 645 | * @return array [['address' => address, 'value' => value], ] |
||
| 646 | */ |
||
| 647 | 10 | public static function normalizeOutputsStruct(array $outputs) { |
|
| 675 | |||
| 676 | /** |
||
| 677 | * 'fund' the txBuilder with UTXOs (modified in place) |
||
| 678 | * |
||
| 679 | * @param TransactionBuilder $txBuilder |
||
| 680 | * @param bool|true $lockUTXOs |
||
| 681 | * @param bool|false $allowZeroConf |
||
| 682 | * @param null|int $forceFee |
||
| 683 | * @return TransactionBuilder |
||
| 684 | */ |
||
| 685 | 11 | public function coinSelectionForTxBuilder(TransactionBuilder $txBuilder, $lockUTXOs = true, $allowZeroConf = false, $forceFee = null) { |
|
| 713 | |||
| 714 | /** |
||
| 715 | * build inputs and outputs lists for TransactionBuilder |
||
| 716 | * |
||
| 717 | * @param TransactionBuilder $txBuilder |
||
| 718 | * @return [TransactionInterface, SignInfo[]] |
||
| 719 | * @throws \Exception |
||
| 720 | */ |
||
| 721 | 7 | public function buildTx(TransactionBuilder $txBuilder) { |
|
| 810 | |||
| 811 | 7 | public function determineFeeAndChange(TransactionBuilder $txBuilder, $highPriorityFeePerKB, $optimalFeePerKB, $lowPriorityFeePerKB) { |
|
| 867 | |||
| 868 | /** |
||
| 869 | * create, sign and send transction based on TransactionBuilder |
||
| 870 | * |
||
| 871 | * @param TransactionBuilder $txBuilder |
||
| 872 | * @param bool $apiCheckFee let the API check if the fee is correct |
||
| 873 | * @return string |
||
| 874 | * @throws \Exception |
||
| 875 | */ |
||
| 876 | 4 | public function sendTx(TransactionBuilder $txBuilder, $apiCheckFee = true) { |
|
| 881 | |||
| 882 | /** |
||
| 883 | * !! INTERNAL METHOD, public for testing purposes !! |
||
| 884 | * create, sign and send transction based on inputs and outputs |
||
| 885 | * |
||
| 886 | * @param Transaction $tx |
||
| 887 | * @param SignInfo[] $signInfo |
||
| 888 | * @param bool $apiCheckFee let the API check if the fee is correct |
||
| 889 | * @return string |
||
| 890 | * @throws \Exception |
||
| 891 | * @internal |
||
| 892 | */ |
||
| 893 | 4 | public function _sendTx(Transaction $tx, array $signInfo, $apiCheckFee = true) { |
|
| 915 | |||
| 916 | /** |
||
| 917 | * only supports estimating fee for 2of3 multsig UTXOs and P2PKH/P2SH outputs |
||
| 918 | * |
||
| 919 | * @todo: mark this as deprecated, insist on the utxo's or qualified scripts. |
||
| 920 | * @param int $utxoCnt number of unspent inputs in transaction |
||
| 921 | * @param int $outputCnt number of outputs in transaction |
||
| 922 | * @return float |
||
| 923 | * @access public reminder that people might use this! |
||
| 924 | */ |
||
| 925 | 1 | public static function estimateFee($utxoCnt, $outputCnt) { |
|
| 930 | |||
| 931 | /** |
||
| 932 | * @param int $size size in bytes |
||
| 933 | * @return int fee in satoshi |
||
| 934 | */ |
||
| 935 | 5 | public static function baseFeeForSize($size) { |
|
| 940 | |||
| 941 | /** |
||
| 942 | * @todo: variable varint |
||
| 943 | * @todo: deprecate |
||
| 944 | * @param int $txinSize |
||
| 945 | * @param int $txoutSize |
||
| 946 | * @return float |
||
| 947 | */ |
||
| 948 | 2 | public static function estimateSize($txinSize, $txoutSize) { |
|
| 951 | |||
| 952 | /** |
||
| 953 | * only supports estimating size for P2PKH/P2SH outputs |
||
| 954 | * |
||
| 955 | * @param int $outputCnt number of outputs in transaction |
||
| 956 | * @return float |
||
| 957 | */ |
||
| 958 | 2 | public static function estimateSizeOutputs($outputCnt) { |
|
| 961 | |||
| 962 | /** |
||
| 963 | * only supports estimating size for 2of3 multsig UTXOs |
||
| 964 | * |
||
| 965 | * @param int $utxoCnt number of unspent inputs in transaction |
||
| 966 | * @return float |
||
| 967 | */ |
||
| 968 | 3 | public static function estimateSizeUTXOs($utxoCnt) { |
|
| 1004 | |||
| 1005 | /** |
||
| 1006 | * determine how much fee is required based on the inputs and outputs |
||
| 1007 | * this is an estimation, not a proper 100% correct calculation |
||
| 1008 | * |
||
| 1009 | * @param UTXO[] $utxos |
||
| 1010 | * @param array[] $outputs |
||
| 1011 | * @param $feeStrategy |
||
| 1012 | * @param $highPriorityFeePerKB |
||
| 1013 | * @param $optimalFeePerKB |
||
| 1014 | * @param $lowPriorityFeePerKB |
||
| 1015 | * @return int |
||
| 1016 | * @throws BlocktrailSDKException |
||
| 1017 | */ |
||
| 1018 | 7 | protected function determineFee($utxos, $outputs, $feeStrategy, $highPriorityFeePerKB, $optimalFeePerKB, $lowPriorityFeePerKB) { |
|
| 1039 | |||
| 1040 | /** |
||
| 1041 | * determine how much change is left over based on the inputs and outputs and the fee |
||
| 1042 | * |
||
| 1043 | * @param UTXO[] $utxos |
||
| 1044 | * @param array[] $outputs |
||
| 1045 | * @param int $fee |
||
| 1046 | * @return int |
||
| 1047 | */ |
||
| 1048 | 7 | protected function determineChange($utxos, $outputs, $fee) { |
|
| 1056 | |||
| 1057 | /** |
||
| 1058 | * sign a raw transaction with the private keys that we have |
||
| 1059 | * |
||
| 1060 | * @param Transaction $tx |
||
| 1061 | * @param SignInfo[] $signInfo |
||
| 1062 | * @return TransactionInterface |
||
| 1063 | * @throws \Exception |
||
| 1064 | */ |
||
| 1065 | 4 | protected function signTransaction(Transaction $tx, array $signInfo) { |
|
| 1097 | |||
| 1098 | /** |
||
| 1099 | * send the transaction using the API |
||
| 1100 | * |
||
| 1101 | * @param string|array $signed |
||
| 1102 | * @param string[] $paths |
||
| 1103 | * @param bool $checkFee |
||
| 1104 | * @return string the complete raw transaction |
||
| 1105 | * @throws \Exception |
||
| 1106 | */ |
||
| 1107 | 4 | protected function sendTransaction($signed, $paths, $checkFee = false) { |
|
| 1110 | |||
| 1111 | /** |
||
| 1112 | * @param \array[] $outputs |
||
| 1113 | * @param bool $lockUTXO |
||
| 1114 | * @param bool $allowZeroConf |
||
| 1115 | * @param int|null|string $feeStrategy |
||
| 1116 | * @param null $forceFee |
||
| 1117 | * @return array |
||
| 1118 | */ |
||
| 1119 | 11 | public function coinSelection($outputs, $lockUTXO = true, $allowZeroConf = false, $feeStrategy = self::FEE_STRATEGY_OPTIMAL, $forceFee = null) { |
|
| 1129 | |||
| 1130 | 7 | public function getHighPriorityFeePerKB() { |
|
| 1137 | |||
| 1138 | 7 | public function getOptimalFeePerKB() { |
|
| 1145 | |||
| 1146 | 7 | public function getLowPriorityFeePerKB() { |
|
| 1153 | |||
| 1154 | 3 | public function updateFeePerKB() { |
|
| 1163 | |||
| 1164 | /** |
||
| 1165 | * delete the wallet |
||
| 1166 | * |
||
| 1167 | * @param bool $force ignore warnings (such as non-zero balance) |
||
| 1168 | * @return mixed |
||
| 1169 | * @throws \Exception |
||
| 1170 | */ |
||
| 1171 | 10 | public function deleteWallet($force = false) { |
|
| 1179 | |||
| 1180 | /** |
||
| 1181 | * create checksum to verify ownership of the master primary key |
||
| 1182 | * |
||
| 1183 | * @return string[] [address, signature] |
||
| 1184 | */ |
||
| 1185 | 10 | protected function createChecksumVerificationSignature() { |
|
| 1196 | |||
| 1197 | /** |
||
| 1198 | * setup a webhook for our wallet |
||
| 1199 | * |
||
| 1200 | * @param string $url URL to receive webhook events |
||
| 1201 | * @param string $identifier identifier for the webhook, defaults to WALLET-{$this->identifier} |
||
| 1202 | * @return array |
||
| 1203 | */ |
||
| 1204 | 1 | public function setupWebhook($url, $identifier = null) { |
|
| 1208 | |||
| 1209 | /** |
||
| 1210 | * @param string $identifier identifier for the webhook, defaults to WALLET-{$this->identifier} |
||
| 1211 | * @return mixed |
||
| 1212 | */ |
||
| 1213 | 1 | public function deleteWebhook($identifier = null) { |
|
| 1217 | |||
| 1218 | /** |
||
| 1219 | * lock a specific unspent output |
||
| 1220 | * |
||
| 1221 | * @param $txHash |
||
| 1222 | * @param $txIdx |
||
| 1223 | * @param int $ttl |
||
| 1224 | * @return bool |
||
| 1225 | */ |
||
| 1226 | public function lockUTXO($txHash, $txIdx, $ttl = 3) { |
||
| 1229 | |||
| 1230 | /** |
||
| 1231 | * unlock a specific unspent output |
||
| 1232 | * |
||
| 1233 | * @param $txHash |
||
| 1234 | * @param $txIdx |
||
| 1235 | * @return bool |
||
| 1236 | */ |
||
| 1237 | public function unlockUTXO($txHash, $txIdx) { |
||
| 1240 | |||
| 1241 | /** |
||
| 1242 | * get all transactions for the wallet (paginated) |
||
| 1243 | * |
||
| 1244 | * @param integer $page pagination: page number |
||
| 1245 | * @param integer $limit pagination: records per page (max 500) |
||
| 1246 | * @param string $sortDir pagination: sort direction (asc|desc) |
||
| 1247 | * @return array associative array containing the response |
||
| 1248 | */ |
||
| 1249 | 1 | public function transactions($page = 1, $limit = 20, $sortDir = 'asc') { |
|
| 1252 | |||
| 1253 | /** |
||
| 1254 | * get all addresses for the wallet (paginated) |
||
| 1255 | * |
||
| 1256 | * @param integer $page pagination: page number |
||
| 1257 | * @param integer $limit pagination: records per page (max 500) |
||
| 1258 | * @param string $sortDir pagination: sort direction (asc|desc) |
||
| 1259 | * @return array associative array containing the response |
||
| 1260 | */ |
||
| 1261 | 1 | public function addresses($page = 1, $limit = 20, $sortDir = 'asc') { |
|
| 1264 | |||
| 1265 | /** |
||
| 1266 | * get all UTXOs for the wallet (paginated) |
||
| 1267 | * |
||
| 1268 | * @param integer $page pagination: page number |
||
| 1269 | * @param integer $limit pagination: records per page (max 500) |
||
| 1270 | * @param string $sortDir pagination: sort direction (asc|desc) |
||
| 1271 | * @param boolean $zeroconf include zero confirmation transactions |
||
| 1272 | * @return array associative array containing the response |
||
| 1273 | */ |
||
| 1274 | 1 | public function utxos($page = 1, $limit = 20, $sortDir = 'asc', $zeroconf = true) { |
|
| 1277 | } |
||
| 1278 |
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.