Private/Import-PolymanWallet.ps1

function Import-PolymanWallet {
  [CmdletBinding()]
  param (
    [Parameter(Mandatory = $true, Position = 0)]
    [string]$PrivateKey,

    [Parameter()]
    [ValidateSet('table', 'json')]
    [string]$Output = 'table'
  )

  process {
    try {
      [PolymarketWallet]::SaveKey($PrivateKey)
      $result = [ordered]@{
        Message = "Wallet imported and saved successfully."
        Status  = "Success"
      }
    } catch {
      $result = [ordered]@{
        Message = "Failed to import wallet: $($_.Exception.Message)"
        Status  = "Error"
      }
    }

    [PolymarketOutput]::Format($result, $Output)
  }
}