diff --git a/Functions/Invoke-CoinbaseRequest.ps1 b/Functions/Invoke-CoinbaseRequest.ps1 index e28be87..8cebbf7 100644 --- a/Functions/Invoke-CoinbaseRequest.ps1 +++ b/Functions/Invoke-CoinbaseRequest.ps1 @@ -3,9 +3,7 @@ function Invoke-CoinbaseProRequest { [Parameter()] $Request ) - $EpochStart = Get-Date -Date "01/01/1970" - $Timestamp = (New-TimeSpan -Start $EpochStart -End (Get-Date).ToUniversalTime()).TotalSeconds - $Timestamp = ([math]::Round($Timestamp, 0)).ToString() + $Timestamp = Get-Date -UFormat %s $Prehash = $Timestamp + $request.method.ToUpper() + $request.url + $request.body $Signature_b64 = Get-HMAC -Message $prehash -Secret $request.secret $Header = @{ diff --git a/Functions/Private/New-CoinbaseProLimitOrder.ps1 b/Functions/Private/New-CoinbaseProLimitOrder.ps1 index c264dec..2097035 100644 --- a/Functions/Private/New-CoinbaseProLimitOrder.ps1 +++ b/Functions/Private/New-CoinbaseProLimitOrder.ps1 @@ -8,9 +8,9 @@ function New-CoinbaseProLimitOrder { [parameter(Mandatory=$true)]$Size, [parameter(Mandatory=$true)][ValidateScript({ Test-Product $_ })]$ProductID, [parameter()]$OrderID, - [parameter()][ValidateSet("dd","co","cn","cb")][string]$STP, - [parameter()][ValidateSet("GTC","GTT","IOC","FOK")][string]$TimeinForce, - [parameter()]$CancelAfter, + [parameter()][ValidateSet("dc","co","cn","cb")][string]$STP = "dc", + [parameter()][ValidateSet("GTC","GTT","IOC","FOK")][string]$TimeinForce = "GTT", + [parameter()][ValidateSet("min","hour","day")][string]$CancelAfter, [parameter()][ValidateSet("true","false")]$PostOnly, [parameter()] [switch] $SandboxAPI )