From 983c65e4f889aecdc03983502c73ad2c948397ab Mon Sep 17 00:00:00 2001 From: MaysWind Date: Mon, 2 Feb 2026 23:04:28 +0800 Subject: [PATCH] add latest exchange rates command --- scripts/ebktools.ps1 | 25 +++++++++++++++++++++++++ scripts/ebktools.sh | 25 +++++++++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/scripts/ebktools.ps1 b/scripts/ebktools.ps1 index 6f507dec..d7830f0d 100755 --- a/scripts/ebktools.ps1 +++ b/scripts/ebktools.ps1 @@ -460,6 +460,31 @@ $API_CONFIGS = @( "}" ) } + @{ + Name = "exchangerates-latest" + Description = "Get latest exchange rates" + Method = "GET" + Path = "exchange_rates/latest.json" + RequiresTimezone = $false + RequiredParams = @() + OptionalParams = @() + ParamTypes = @{} + ParamDescriptions = @{} + ResponseStructure = @( + "{" + " `"dataSource`": `"string (Exchange rate data source name)`"," + " `"referenceUrl`": `"string (Exchange rate data reference URL)`"," + " `"updateTime`": `"integer (Exchange rate data update unix time)`"," + " `"baseCurrency`": `"string (Base currency code)`"," + " `"exchangeRates`": [" + " {" + " `"currency`": `"string (Currency code)`"," + " `"rate`": `"string (Exchange rate, 1 unit of base currency equals to how many units of this currency)`"" + " }" + " ]" + "}" + ) + } ) # Reference: https://github.com/unicode-org/cldr/blob/main/common/supplemental/windowsZones.xml diff --git a/scripts/ebktools.sh b/scripts/ebktools.sh index 1796fae8..61d27c9c 100755 --- a/scripts/ebktools.sh +++ b/scripts/ebktools.sh @@ -445,6 +445,31 @@ API_CONFIGS='[ " \"editable\": \"boolean (Whether the transaction is editable)\"", "}" ] + }, + { + "Name": "exchangerates-latest", + "Description": "Get latest exchange rates", + "Method": "GET", + "Path": "exchange_rates/latest.json", + "RequiresTimezone": false, + "RequiredParams": [], + "OptionalParams": [], + "ParamTypes": {}, + "ParamDescriptions": {}, + "ResponseStructure": [ + "{", + " \"dataSource\": \"string (Exchange rate data source name)\",", + " \"referenceUrl\": \"string (Exchange rate data reference URL)\",", + " \"updateTime\": \"integer (Exchange rate data update unix time)\",", + " \"baseCurrency\": \"string (Base currency code)\",", + " \"exchangeRates\": [", + " {", + " \"currency\": \"string (Currency code)\",", + " \"rate\": \"string (Exchange rate, 1 unit of base currency equals to how many units of this currency)\"", + " }", + " ]", + "}" + ] } ]'