Commit from m3o/m3o action

This commit is contained in:
m3o-actions
2022-03-09 11:54:00 +00:00
parent 465010411d
commit 9cbd5c1988
25 changed files with 1616 additions and 1616 deletions

View File

@@ -4,6 +4,65 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/currency/api](
Endpoints:
## Convert
Convert returns the currency conversion rate between two pairs e.g USD/GBP
[https://m3o.com/currency/api#Convert](https://m3o.com/currency/api#Convert)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/currency"
)
// Convert returns the currency conversion rate between two pairs e.g USD/GBP
func ConvertUsdToGbp() {
currencyService := currency.NewCurrencyService(os.Getenv("M3O_API_TOKEN"))
rsp, err := currencyService.Convert(&currency.ConvertRequest{
From: "USD",
To: "GBP",
})
fmt.Println(rsp, err)
}
```
## Convert
Convert returns the currency conversion rate between two pairs e.g USD/GBP
[https://m3o.com/currency/api#Convert](https://m3o.com/currency/api#Convert)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/currency"
)
// Convert returns the currency conversion rate between two pairs e.g USD/GBP
func Convert10usdToGbp() {
currencyService := currency.NewCurrencyService(os.Getenv("M3O_API_TOKEN"))
rsp, err := currencyService.Convert(&currency.ConvertRequest{
Amount: 10,
From: "USD",
To: "GBP",
})
fmt.Println(rsp, err)
}
```
## History
Returns the historic rates for a currency on a given date
@@ -88,62 +147,3 @@ func GetRatesForUsd() {
}
```
## Convert
Convert returns the currency conversion rate between two pairs e.g USD/GBP
[https://m3o.com/currency/api#Convert](https://m3o.com/currency/api#Convert)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/currency"
)
// Convert returns the currency conversion rate between two pairs e.g USD/GBP
func ConvertUsdToGbp() {
currencyService := currency.NewCurrencyService(os.Getenv("M3O_API_TOKEN"))
rsp, err := currencyService.Convert(&currency.ConvertRequest{
From: "USD",
To: "GBP",
})
fmt.Println(rsp, err)
}
```
## Convert
Convert returns the currency conversion rate between two pairs e.g USD/GBP
[https://m3o.com/currency/api#Convert](https://m3o.com/currency/api#Convert)
```go
package example
import(
"fmt"
"os"
"go.m3o.com/currency"
)
// Convert returns the currency conversion rate between two pairs e.g USD/GBP
func Convert10usdToGbp() {
currencyService := currency.NewCurrencyService(os.Getenv("M3O_API_TOKEN"))
rsp, err := currencyService.Convert(&currency.ConvertRequest{
Amount: 10,
From: "USD",
To: "GBP",
})
fmt.Println(rsp, err)
}
```