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 |
||
| 36 | abstract class Wallet implements WalletInterface { |
||
| 37 | |||
| 38 | const WALLET_VERSION_V1 = 'v1'; |
||
| 39 | const WALLET_VERSION_V2 = 'v2'; |
||
| 40 | const WALLET_VERSION_V3 = 'v3'; |
||
| 41 | |||
| 42 | const CHAIN_BTC_DEFAULT = 0; |
||
| 43 | const CHAIN_BCC_DEFAULT = 1; |
||
| 44 | const CHAIN_BTC_SEGWIT = 2; |
||
| 45 | |||
| 46 | const BASE_FEE = 10000; |
||
| 47 | |||
| 48 | /** |
||
| 49 | * development / debug setting |
||
| 50 | * when getting a new derivation from the API, |
||
| 51 | * will verify address / redeeemScript with the values the API provides |
||
| 52 | */ |
||
| 53 | const VERIFY_NEW_DERIVATION = true; |
||
| 54 | |||
| 55 | /** |
||
| 56 | * @var BlocktrailSDKInterface |
||
| 57 | */ |
||
| 58 | protected $sdk; |
||
| 59 | |||
| 60 | /** |
||
| 61 | * @var string |
||
| 62 | */ |
||
| 63 | protected $identifier; |
||
| 64 | |||
| 65 | /** |
||
| 66 | * BIP32 master primary private key (m/) |
||
| 67 | * |
||
| 68 | * @var BIP32Key |
||
| 69 | */ |
||
| 70 | protected $primaryPrivateKey; |
||
| 71 | |||
| 72 | /** |
||
| 73 | * @var BIP32Key[] |
||
| 74 | */ |
||
| 75 | protected $primaryPublicKeys; |
||
| 76 | |||
| 77 | /** |
||
| 78 | * BIP32 master backup public key (M/) |
||
| 79 | |||
| 80 | * @var BIP32Key |
||
| 81 | */ |
||
| 82 | protected $backupPublicKey; |
||
| 83 | |||
| 84 | /** |
||
| 85 | * map of blocktrail BIP32 public keys |
||
| 86 | * keyed by key index |
||
| 87 | * path should be `M / key_index'` |
||
| 88 | * |
||
| 89 | * @var BIP32Key[] |
||
| 90 | */ |
||
| 91 | protected $blocktrailPublicKeys; |
||
| 92 | |||
| 93 | /** |
||
| 94 | * the 'Blocktrail Key Index' that is used for new addresses |
||
| 95 | * |
||
| 96 | * @var int |
||
| 97 | */ |
||
| 98 | protected $keyIndex; |
||
| 99 | |||
| 100 | /** |
||
| 101 | * 'bitcoin' |
||
| 102 | * |
||
| 103 | * @var string |
||
| 104 | */ |
||
| 105 | protected $network; |
||
| 106 | |||
| 107 | /** |
||
| 108 | * testnet yes / no |
||
| 109 | * |
||
| 110 | * @var bool |
||
| 111 | */ |
||
| 112 | protected $testnet; |
||
| 113 | |||
| 114 | /** |
||
| 115 | * cache of public keys, by path |
||
| 116 | * |
||
| 117 | * @var BIP32Key[] |
||
| 118 | */ |
||
| 119 | protected $pubKeys = []; |
||
| 120 | |||
| 121 | /** |
||
| 122 | * cache of address / redeemScript, by path |
||
| 123 | * |
||
| 124 | * @var string[][] [[address, redeemScript)], ] |
||
| 125 | */ |
||
| 126 | protected $derivations = []; |
||
| 127 | |||
| 128 | /** |
||
| 129 | * reverse cache of paths by address |
||
| 130 | * |
||
| 131 | * @var string[] |
||
| 132 | */ |
||
| 133 | protected $derivationsByAddress = []; |
||
| 134 | |||
| 135 | /** |
||
| 136 | * @var string |
||
| 137 | */ |
||
| 138 | protected $checksum; |
||
| 139 | |||
| 140 | /** |
||
| 141 | * @var bool |
||
| 142 | */ |
||
| 143 | protected $locked = true; |
||
| 144 | |||
| 145 | /** |
||
| 146 | * @var bool |
||
| 147 | */ |
||
| 148 | protected $isSegwit = false; |
||
| 149 | |||
| 150 | /** |
||
| 151 | * @var int |
||
| 152 | */ |
||
| 153 | protected $chainIndex; |
||
| 154 | |||
| 155 | /** |
||
| 156 | * @var int |
||
| 157 | */ |
||
| 158 | protected $changeIndex; |
||
| 159 | |||
| 160 | /** |
||
| 161 | * @var BaseAddressCreator |
||
| 162 | */ |
||
| 163 | protected $addressReader; |
||
| 164 | |||
| 165 | protected $highPriorityFeePerKB; |
||
| 166 | protected $optimalFeePerKB; |
||
| 167 | protected $lowPriorityFeePerKB; |
||
| 168 | protected $feePerKBAge; |
||
| 169 | protected $allowedSignModes = [SignInfo::MODE_DONTSIGN, SignInfo::MODE_SIGN]; |
||
| 170 | |||
| 171 | /** |
||
| 172 | * @param BlocktrailSDKInterface $sdk SDK instance used to do requests |
||
| 173 | * @param string $identifier identifier of the wallet |
||
| 174 | * @param BIP32Key[] $primaryPublicKeys |
||
| 175 | * @param BIP32Key $backupPublicKey should be BIP32 master public key M/ |
||
| 176 | * @param BIP32Key[] $blocktrailPublicKeys |
||
| 177 | * @param int $keyIndex |
||
| 178 | * @param string $network |
||
| 179 | * @param bool $testnet |
||
| 180 | * @param bool $segwit |
||
| 181 | * @param string $checksum |
||
| 182 | * @throws BlocktrailSDKException |
||
| 183 | */ |
||
| 184 | 26 | public function __construct(BlocktrailSDKInterface $sdk, $identifier, array $primaryPublicKeys, $backupPublicKey, array $blocktrailPublicKeys, $keyIndex, $network, $testnet, $segwit, BaseAddressCreator $addressReader, $checksum) { |
|
| 218 | |||
| 219 | /** |
||
| 220 | * @return BaseAddressCreator |
||
| 221 | */ |
||
| 222 | 17 | public function getAddressReader() { |
|
| 225 | |||
| 226 | /** |
||
| 227 | * @param int|null $chainIndex |
||
| 228 | * @return WalletPath |
||
| 229 | * @throws BlocktrailSDKException |
||
| 230 | */ |
||
| 231 | 17 | protected function getWalletPath($chainIndex = null) { |
|
| 241 | |||
| 242 | /** |
||
| 243 | * @return bool |
||
| 244 | */ |
||
| 245 | 3 | public function isSegwit() { |
|
| 248 | |||
| 249 | /** |
||
| 250 | * return the wallet identifier |
||
| 251 | * |
||
| 252 | * @return string |
||
| 253 | */ |
||
| 254 | 10 | public function getIdentifier() { |
|
| 257 | |||
| 258 | /** |
||
| 259 | * Returns the wallets backup public key |
||
| 260 | * |
||
| 261 | * @return [xpub, path] |
||
|
|
|||
| 262 | */ |
||
| 263 | 1 | public function getBackupKey() { |
|
| 266 | |||
| 267 | /** |
||
| 268 | * return list of Blocktrail co-sign extended public keys |
||
| 269 | * |
||
| 270 | * @return array[] [ [xpub, path] ] |
||
| 271 | */ |
||
| 272 | 5 | public function getBlocktrailPublicKeys() { |
|
| 277 | |||
| 278 | /** |
||
| 279 | * check if wallet is locked |
||
| 280 | * |
||
| 281 | * @return bool |
||
| 282 | */ |
||
| 283 | 10 | public function isLocked() { |
|
| 286 | |||
| 287 | /** |
||
| 288 | * upgrade wallet to different blocktrail cosign key |
||
| 289 | * |
||
| 290 | * @param $keyIndex |
||
| 291 | * @return bool |
||
| 292 | * @throws \Exception |
||
| 293 | */ |
||
| 294 | 5 | public function upgradeKeyIndex($keyIndex) { |
|
| 321 | |||
| 322 | /** |
||
| 323 | * get a new BIP32 derivation for the next (unused) address |
||
| 324 | * by requesting it from the API |
||
| 325 | * |
||
| 326 | * @return string |
||
| 327 | * @param int|null $chainIndex |
||
| 328 | * @throws \Exception |
||
| 329 | */ |
||
| 330 | 17 | protected function getNewDerivation($chainIndex = null) { |
|
| 387 | |||
| 388 | /** |
||
| 389 | * @param string|BIP32Path $path |
||
| 390 | * @return BIP32Key|false |
||
| 391 | * @throws \Exception |
||
| 392 | * |
||
| 393 | * @TODO: hmm? |
||
| 394 | */ |
||
| 395 | 18 | protected function getParentPublicKey($path) { |
|
| 412 | |||
| 413 | /** |
||
| 414 | * get address for the specified path |
||
| 415 | * |
||
| 416 | * @param string|BIP32Path $path |
||
| 417 | * @return string |
||
| 418 | */ |
||
| 419 | 16 | public function getAddressByPath($path) { |
|
| 430 | |||
| 431 | /** |
||
| 432 | * @param string $path |
||
| 433 | * @return WalletScript |
||
| 434 | */ |
||
| 435 | 18 | public function getWalletScriptByPath($path) { |
|
| 447 | |||
| 448 | /** |
||
| 449 | * get address and redeemScript for specified path |
||
| 450 | * |
||
| 451 | * @param string $path |
||
| 452 | * @return array[string, ScriptInterface, ScriptInterface|null] [address, redeemScript, witnessScript] |
||
| 453 | */ |
||
| 454 | 17 | public function getRedeemScriptByPath($path) { |
|
| 461 | |||
| 462 | /** |
||
| 463 | * @param BIP32Key $key |
||
| 464 | * @param string|BIP32Path $path |
||
| 465 | * @return string |
||
| 466 | */ |
||
| 467 | protected function getAddressFromKey(BIP32Key $key, $path) { |
||
| 470 | |||
| 471 | /** |
||
| 472 | * @param BIP32Key $key |
||
| 473 | * @param string|BIP32Path $path |
||
| 474 | * @return WalletScript |
||
| 475 | * @throws \Exception |
||
| 476 | */ |
||
| 477 | 18 | protected function getWalletScriptFromKey(BIP32Key $key, $path) { |
|
| 505 | |||
| 506 | /** |
||
| 507 | * get the path (and redeemScript) to specified address |
||
| 508 | * |
||
| 509 | * @param string $address |
||
| 510 | * @return array |
||
| 511 | */ |
||
| 512 | 1 | public function getPathForAddress($address) { |
|
| 520 | |||
| 521 | /** |
||
| 522 | * @param string|BIP32Path $path |
||
| 523 | * @return BIP32Key |
||
| 524 | * @throws \Exception |
||
| 525 | */ |
||
| 526 | 18 | public function getBlocktrailPublicKey($path) { |
|
| 537 | |||
| 538 | /** |
||
| 539 | * generate a new derived key and return the new path and address for it |
||
| 540 | * |
||
| 541 | * @param int|null $chainIndex |
||
| 542 | * @return string[] [path, address] |
||
| 543 | */ |
||
| 544 | 17 | public function getNewAddressPair($chainIndex = null) { |
|
| 550 | |||
| 551 | /** |
||
| 552 | * generate a new derived private key and return the new address for it |
||
| 553 | * |
||
| 554 | * @param int|null $chainIndex |
||
| 555 | * @return string |
||
| 556 | */ |
||
| 557 | 9 | public function getNewAddress($chainIndex = null) { |
|
| 560 | |||
| 561 | /** |
||
| 562 | * generate a new derived private key and return the new address for it |
||
| 563 | * |
||
| 564 | * @return string |
||
| 565 | */ |
||
| 566 | 5 | public function getNewChangeAddress() { |
|
| 569 | |||
| 570 | /** |
||
| 571 | * get the balance for the wallet |
||
| 572 | * |
||
| 573 | * @return int[] [confirmed, unconfirmed] |
||
| 574 | */ |
||
| 575 | 9 | public function getBalance() { |
|
| 580 | |||
| 581 | /** |
||
| 582 | * create, sign and send a transaction |
||
| 583 | * |
||
| 584 | * @param array $outputs [address => value, ] or [[address, value], ] or [['address' => address, 'value' => value], ] coins to send |
||
| 585 | * value should be INT |
||
| 586 | * @param string $changeAddress change address to use (autogenerated if NULL) |
||
| 587 | * @param bool $allowZeroConf |
||
| 588 | * @param bool $randomizeChangeIdx randomize the location of the change (for increased privacy / anonimity) |
||
| 589 | * @param string $feeStrategy |
||
| 590 | * @param null|int $forceFee set a fixed fee instead of automatically calculating the correct fee, not recommended! |
||
| 591 | * @param bool $apiCheckFee let the API apply sanity checks to the fee |
||
| 592 | * @return string the txid / transaction hash |
||
| 593 | * @throws \Exception |
||
| 594 | */ |
||
| 595 | 9 | public function pay(array $outputs, $changeAddress = null, $allowZeroConf = false, $randomizeChangeIdx = true, $feeStrategy = self::FEE_STRATEGY_OPTIMAL, $forceFee = null, $apiCheckFee = true) { |
|
| 623 | |||
| 624 | /** |
||
| 625 | * determine max spendable from wallet after fees |
||
| 626 | * |
||
| 627 | * @param bool $allowZeroConf |
||
| 628 | * @param string $feeStrategy |
||
| 629 | * @param null|int $forceFee set a fixed fee instead of automatically calculating the correct fee, not recommended! |
||
| 630 | * @param int $outputCnt |
||
| 631 | * @return string |
||
| 632 | * @throws BlocktrailSDKException |
||
| 633 | */ |
||
| 634 | public function getMaxSpendable($allowZeroConf = false, $feeStrategy = self::FEE_STRATEGY_OPTIMAL, $forceFee = null, $outputCnt = 1) { |
||
| 637 | |||
| 638 | /** |
||
| 639 | * parse outputs into normalized struct |
||
| 640 | * |
||
| 641 | * @param array $outputs [address => value, ] or [[address, value], ] or [['address' => address, 'value' => value], ] |
||
| 642 | * @return array [['address' => address, 'value' => value], ] |
||
| 643 | */ |
||
| 644 | 1 | public static function normalizeOutputsStruct(array $outputs) { |
|
| 672 | |||
| 673 | /** |
||
| 674 | * 'fund' the txBuilder with UTXOs (modified in place) |
||
| 675 | * |
||
| 676 | * @param TransactionBuilder $txBuilder |
||
| 677 | * @param bool|true $lockUTXOs |
||
| 678 | * @param bool|false $allowZeroConf |
||
| 679 | * @param null|int $forceFee |
||
| 680 | * @return TransactionBuilder |
||
| 681 | */ |
||
| 682 | 11 | public function coinSelectionForTxBuilder(TransactionBuilder $txBuilder, $lockUTXOs = true, $allowZeroConf = false, $forceFee = null) { |
|
| 711 | |||
| 712 | /** |
||
| 713 | * build inputs and outputs lists for TransactionBuilder |
||
| 714 | * |
||
| 715 | * @param TransactionBuilder $txBuilder |
||
| 716 | * @return [TransactionInterface, SignInfo[]] |
||
| 717 | * @throws \Exception |
||
| 718 | */ |
||
| 719 | 7 | public function buildTx(TransactionBuilder $txBuilder) { |
|
| 808 | |||
| 809 | 7 | public function determineFeeAndChange(TransactionBuilder $txBuilder, $highPriorityFeePerKB, $optimalFeePerKB, $lowPriorityFeePerKB) { |
|
| 869 | |||
| 870 | /** |
||
| 871 | * create, sign and send transction based on TransactionBuilder |
||
| 872 | * |
||
| 873 | * @param TransactionBuilder $txBuilder |
||
| 874 | * @param bool $apiCheckFee let the API check if the fee is correct |
||
| 875 | * @return string |
||
| 876 | * @throws \Exception |
||
| 877 | */ |
||
| 878 | 4 | public function sendTx(TransactionBuilder $txBuilder, $apiCheckFee = true) { |
|
| 883 | |||
| 884 | /** |
||
| 885 | * !! INTERNAL METHOD, public for testing purposes !! |
||
| 886 | * create, sign and send transction based on inputs and outputs |
||
| 887 | * |
||
| 888 | * @param Transaction $tx |
||
| 889 | * @param SignInfo[] $signInfo |
||
| 890 | * @param bool $apiCheckFee let the API check if the fee is correct |
||
| 891 | * @return string |
||
| 892 | * @throws \Exception |
||
| 893 | * @internal |
||
| 894 | */ |
||
| 895 | 4 | public function _sendTx(Transaction $tx, array $signInfo, $apiCheckFee = true) { |
|
| 917 | |||
| 918 | /** |
||
| 919 | * only supports estimating fee for 2of3 multsig UTXOs and P2PKH/P2SH outputs |
||
| 920 | * |
||
| 921 | * @todo: mark this as deprecated, insist on the utxo's or qualified scripts. |
||
| 922 | * @param int $utxoCnt number of unspent inputs in transaction |
||
| 923 | * @param int $outputCnt number of outputs in transaction |
||
| 924 | * @return float |
||
| 925 | * @access public reminder that people might use this! |
||
| 926 | */ |
||
| 927 | 1 | public static function estimateFee($utxoCnt, $outputCnt) { |
|
| 932 | |||
| 933 | /** |
||
| 934 | * @param int $size size in bytes |
||
| 935 | * @return int fee in satoshi |
||
| 936 | */ |
||
| 937 | 5 | public static function baseFeeForSize($size) { |
|
| 942 | |||
| 943 | /** |
||
| 944 | * @todo: variable varint |
||
| 945 | * @todo: deprecate |
||
| 946 | * @param int $txinSize |
||
| 947 | * @param int $txoutSize |
||
| 948 | * @return float |
||
| 949 | */ |
||
| 950 | 2 | public static function estimateSize($txinSize, $txoutSize) { |
|
| 953 | |||
| 954 | /** |
||
| 955 | * only supports estimating size for P2PKH/P2SH outputs |
||
| 956 | * |
||
| 957 | * @param int $outputCnt number of outputs in transaction |
||
| 958 | * @return float |
||
| 959 | */ |
||
| 960 | 2 | public static function estimateSizeOutputs($outputCnt) { |
|
| 963 | |||
| 964 | /** |
||
| 965 | * only supports estimating size for 2of3 multsig UTXOs |
||
| 966 | * |
||
| 967 | * @param int $utxoCnt number of unspent inputs in transaction |
||
| 968 | * @return float |
||
| 969 | */ |
||
| 970 | 3 | public static function estimateSizeUTXOs($utxoCnt) { |
|
| 1006 | |||
| 1007 | /** |
||
| 1008 | * determine how much fee is required based on the inputs and outputs |
||
| 1009 | * this is an estimation, not a proper 100% correct calculation |
||
| 1010 | * |
||
| 1011 | * @param UTXO[] $utxos |
||
| 1012 | * @param array[] $outputs |
||
| 1013 | * @param $feeStrategy |
||
| 1014 | * @param $highPriorityFeePerKB |
||
| 1015 | * @param $optimalFeePerKB |
||
| 1016 | * @param $lowPriorityFeePerKB |
||
| 1017 | * @return int |
||
| 1018 | * @throws BlocktrailSDKException |
||
| 1019 | */ |
||
| 1020 | 7 | protected function determineFee($utxos, $outputs, $feeStrategy, $highPriorityFeePerKB, $optimalFeePerKB, $lowPriorityFeePerKB) { |
|
| 1044 | |||
| 1045 | /** |
||
| 1046 | * determine how much change is left over based on the inputs and outputs and the fee |
||
| 1047 | * |
||
| 1048 | * @param UTXO[] $utxos |
||
| 1049 | * @param array[] $outputs |
||
| 1050 | * @param int $fee |
||
| 1051 | * @return int |
||
| 1052 | */ |
||
| 1053 | 7 | protected function determineChange($utxos, $outputs, $fee) { |
|
| 1061 | |||
| 1062 | /** |
||
| 1063 | * sign a raw transaction with the private keys that we have |
||
| 1064 | * |
||
| 1065 | * @param Transaction $tx |
||
| 1066 | * @param SignInfo[] $signInfo |
||
| 1067 | * @return TransactionInterface |
||
| 1068 | * @throws \Exception |
||
| 1069 | */ |
||
| 1070 | 4 | protected function signTransaction(Transaction $tx, array $signInfo) { |
|
| 1103 | |||
| 1104 | /** |
||
| 1105 | * send the transaction using the API |
||
| 1106 | * |
||
| 1107 | * @param string|array $signed |
||
| 1108 | * @param string[] $paths |
||
| 1109 | * @param bool $checkFee |
||
| 1110 | * @return string the complete raw transaction |
||
| 1111 | * @throws \Exception |
||
| 1112 | */ |
||
| 1113 | 4 | protected function sendTransaction($signed, $paths, $checkFee = false) { |
|
| 1116 | |||
| 1117 | /** |
||
| 1118 | * @param \array[] $outputs |
||
| 1119 | * @param bool $lockUTXO |
||
| 1120 | * @param bool $allowZeroConf |
||
| 1121 | * @param int|null|string $feeStrategy |
||
| 1122 | * @param null $forceFee |
||
| 1123 | * @return array |
||
| 1124 | */ |
||
| 1125 | 12 | public function coinSelection($outputs, $lockUTXO = true, $allowZeroConf = false, $feeStrategy = self::FEE_STRATEGY_OPTIMAL, $forceFee = null) { |
|
| 1143 | |||
| 1144 | 7 | public function getHighPriorityFeePerKB() { |
|
| 1151 | |||
| 1152 | 7 | public function getOptimalFeePerKB() { |
|
| 1159 | |||
| 1160 | 7 | public function getLowPriorityFeePerKB() { |
|
| 1167 | |||
| 1168 | 2 | public function updateFeePerKB() { |
|
| 1177 | |||
| 1178 | /** |
||
| 1179 | * delete the wallet |
||
| 1180 | * |
||
| 1181 | * @param bool $force ignore warnings (such as non-zero balance) |
||
| 1182 | * @return mixed |
||
| 1183 | * @throws \Exception |
||
| 1184 | */ |
||
| 1185 | 10 | public function deleteWallet($force = false) { |
|
| 1193 | |||
| 1194 | /** |
||
| 1195 | * create checksum to verify ownership of the master primary key |
||
| 1196 | * |
||
| 1197 | * @return string[] [address, signature] |
||
| 1198 | */ |
||
| 1199 | 10 | protected function createChecksumVerificationSignature() { |
|
| 1209 | |||
| 1210 | /** |
||
| 1211 | * setup a webhook for our wallet |
||
| 1212 | * |
||
| 1213 | * @param string $url URL to receive webhook events |
||
| 1214 | * @param string $identifier identifier for the webhook, defaults to WALLET-{$this->identifier} |
||
| 1215 | * @return array |
||
| 1216 | */ |
||
| 1217 | 1 | public function setupWebhook($url, $identifier = null) { |
|
| 1221 | |||
| 1222 | /** |
||
| 1223 | * @param string $identifier identifier for the webhook, defaults to WALLET-{$this->identifier} |
||
| 1224 | * @return mixed |
||
| 1225 | */ |
||
| 1226 | 1 | public function deleteWebhook($identifier = null) { |
|
| 1230 | |||
| 1231 | /** |
||
| 1232 | * lock a specific unspent output |
||
| 1233 | * |
||
| 1234 | * @param $txHash |
||
| 1235 | * @param $txIdx |
||
| 1236 | * @param int $ttl |
||
| 1237 | * @return bool |
||
| 1238 | */ |
||
| 1239 | public function lockUTXO($txHash, $txIdx, $ttl = 3) { |
||
| 1242 | |||
| 1243 | /** |
||
| 1244 | * unlock a specific unspent output |
||
| 1245 | * |
||
| 1246 | * @param $txHash |
||
| 1247 | * @param $txIdx |
||
| 1248 | * @return bool |
||
| 1249 | */ |
||
| 1250 | public function unlockUTXO($txHash, $txIdx) { |
||
| 1253 | |||
| 1254 | /** |
||
| 1255 | * get all transactions for the wallet (paginated) |
||
| 1256 | * |
||
| 1257 | * @param integer $page pagination: page number |
||
| 1258 | * @param integer $limit pagination: records per page (max 500) |
||
| 1259 | * @param string $sortDir pagination: sort direction (asc|desc) |
||
| 1260 | * @return array associative array containing the response |
||
| 1261 | */ |
||
| 1262 | 1 | public function transactions($page = 1, $limit = 20, $sortDir = 'asc') { |
|
| 1265 | |||
| 1266 | /** |
||
| 1267 | * get all addresses for the wallet (paginated) |
||
| 1268 | * |
||
| 1269 | * @param integer $page pagination: page number |
||
| 1270 | * @param integer $limit pagination: records per page (max 500) |
||
| 1271 | * @param string $sortDir pagination: sort direction (asc|desc) |
||
| 1272 | * @return array associative array containing the response |
||
| 1273 | */ |
||
| 1274 | 1 | public function addresses($page = 1, $limit = 20, $sortDir = 'asc') { |
|
| 1277 | |||
| 1278 | /** |
||
| 1279 | * get all UTXOs for the wallet (paginated) |
||
| 1280 | * |
||
| 1281 | * @param integer $page pagination: page number |
||
| 1282 | * @param integer $limit pagination: records per page (max 500) |
||
| 1283 | * @param string $sortDir pagination: sort direction (asc|desc) |
||
| 1284 | * @param boolean $zeroconf include zero confirmation transactions |
||
| 1285 | * @return array associative array containing the response |
||
| 1286 | */ |
||
| 1287 | 1 | public function utxos($page = 1, $limit = 20, $sortDir = 'asc', $zeroconf = true) { |
|
| 1290 | } |
||
| 1291 |
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.