Private/Test-PolymarketApproval.ps1

function Test-PolymarketApproval {
  [CmdletBinding()]
  param (
    [Parameter()]
    [string]$Address,

    [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'])

    # CLOB balance-allowance endpoint provides some info
    $result = $client.GetBalances()

    # We could filter the result here to show specifically the allowances for trade
    [PolymarketOutput]::Format($result, $Output)
  }
}