From dc483771f178cc6d149af2ade9396d6cae1e841c Mon Sep 17 00:00:00 2001 From: Lem Smyth Date: Wed, 16 Feb 2022 13:15:46 -0600 Subject: [PATCH] create claim search method --- classes/LBRY_Daemon.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/classes/LBRY_Daemon.php b/classes/LBRY_Daemon.php index 08a1a23..92e6966 100644 --- a/classes/LBRY_Daemon.php +++ b/classes/LBRY_Daemon.php @@ -66,6 +66,30 @@ class LBRY_Daemon } } + /** + * Returns the info about a claim can get supports and initial bid amount when claim created among other information about a claim. + * TODO Can be build out later to accept more params + * @param string $claim_id + * @return object $result + */ + public function claim_search( $claim_id ) + { + $params = array( + 'claim_id' => $claim_id, + // 'name' => $norm_name, + // 'claim_type' => $claim_type, + ); + try { + $result = $this->request( 'claim_search', $params ); + $this->logger->log( 'Claim Search Results: ' . print_r( $result->result, true ) ); + return $result->result; + } catch ( LBRYDaemonException $e ) { + $this->logger->log( 'claim_search error', $e->getMessage() . ' | Code: ' . $e->getCode() ); + LBRY()->notice->set_notice( 'error', 'Issue getting claim search info' ); + return; + } + } + /** * Returns the available balance of a current LBRY account * https://lbry.tech/api/sdk#wallet_balance