Private/Get-ClobRewards.ps1
|
function Get-ClobRewards { [CmdletBinding()] param ( [Parameter()] [string]$Date, [Parameter()] [ValidateSet('table', 'json')] [string]$Output = 'table' ) process { $client = [ClobClient]::new() $config = [PolymarketConfig]::Load() if (!$config.ContainsKey('api_key')) { throw "API credentials not found." } $client.SetCredentials($config['api_key'], $config['api_secret'], $config['api_passphrase']) $params = @{} if ($Date) { $params['date'] = $Date } $result = $client.GetAuth("/rewards-earnings", $params) [PolymarketOutput]::Format($result, $Output) } } |