Private/Remove-ClobNotification.ps1
|
function Remove-ClobNotification { [CmdletBinding(SupportsShouldProcess)] param ( [Parameter(Mandatory = $true, ValueFromPipeline = $true)] [string]$Id, [Parameter()] [ValidateSet('table', 'json')] [string]$Output = 'table' ) process { if ($PSCmdlet.ShouldProcess("Notification $Id", "Delete notification on CLOB")) { $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']) $result = $client.DeleteNotification($Id) [PolymarketOutput]::Format($result, $Output) } } } |