Skip to content

Commit

Permalink
Add retainer endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
vekien committed Apr 19, 2019
1 parent 8779b92 commit 80758c0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 26 deletions.
6 changes: 4 additions & 2 deletions cli
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ $option = isset($argv[1]) ? trim($argv[1]) : false;
$arg1 = isset($argv[2]) ? trim($argv[2]) : false;

// setup xivapi
$api = new \XIVAPI\XIVAPI(\XIVAPI\XIVAPI::STAGING);
$api = new \XIVAPI\XIVAPI(\XIVAPI\XIVAPI::PROD);

$results = $api->market->item(3, [ 'Phoenix' ]);
#$results = $api->market->item(3, [ 'Phoenix' ]);

$results = $api->market->retainer('11fd65c0-e3ea-4f45-aa52-1586ca2f6fc8');

print_r($results);
die;
31 changes: 7 additions & 24 deletions src/XIVAPI/Api/Market.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,33 +28,11 @@ public function item(int $itemId, array $servers = [], string $dc = '')
]);
}

public function itemPrices(string $accessKey, int $itemId, string $server)
public function retainer(string $retainerId)
{
return Guzzle::get("/private/market/item", [
RequestOptions::QUERY => [
'companion_access_key' => $accessKey,
'item_id' => $itemId,
'server' => $server,
]
]);
}

public function itemHistory(string $accessKey, int $itemId, string $server)
{
return Guzzle::get("/private/market/item/history", [
RequestOptions::QUERY => [
'companion_access_key' => $accessKey,
'item_id' => $itemId,
'server' => $server,
]
]);
return Guzzle::get("/market/retainer/{$retainerId}");
}

public function stats()
{
return Guzzle::get("/market/stats");
}

public function search($elasticQuery)
{
return Guzzle::get("/market/search", [
Expand All @@ -66,4 +44,9 @@ public function categories()
{
return Guzzle::get("/market/categories");
}

public function stats()
{
return Guzzle::get("/market/stats");
}
}

0 comments on commit 80758c0

Please sign in to comment.