Generate clients (#206)

This commit is contained in:
Janos Dobronszki
2021-09-16 12:52:36 +01:00
committed by GitHub
parent 552c321dd7
commit d4d9c1c176
334 changed files with 9334 additions and 45 deletions

View File

@@ -0,0 +1,6 @@
curl "https://api.m3o.com/v1/crypto/History" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MICRO_API_TOKEN" \
-d '{
"symbol": "BTCUSD"
}'

View File

@@ -0,0 +1,16 @@
package example
import (
"fmt"
"github.com/micro/services/clients/go/crypto"
"os"
)
// Returns the history for the previous close
func GetPreviousClose() {
cryptoService := crypto.NewCryptoService(os.Getenv("MICRO_API_TOKEN"))
rsp, err := cryptoService.History(&crypto.HistoryRequest{
Symbol: "BTCUSD",
})
fmt.Println(rsp, err)
}

View File

@@ -0,0 +1,12 @@
import * as crypto from "m3o/crypto";
// Returns the history for the previous close
async function GetPreviousClose() {
let cryptoService = new crypto.CryptoService(process.env.MICRO_API_TOKEN);
let rsp = await cryptoService.history({
symbol: "BTCUSD",
});
console.log(rsp);
}
await GetPreviousClose();

View File

@@ -0,0 +1,6 @@
curl "https://api.m3o.com/v1/crypto/Price" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MICRO_API_TOKEN" \
-d '{
"symbol": "BTCUSD"
}'

View File

@@ -0,0 +1,16 @@
package example
import (
"fmt"
"github.com/micro/services/clients/go/crypto"
"os"
)
// Get the last price for a given crypto ticker
func GetCryptocurrencyPrice() {
cryptoService := crypto.NewCryptoService(os.Getenv("MICRO_API_TOKEN"))
rsp, err := cryptoService.Price(&crypto.PriceRequest{
Symbol: "BTCUSD",
})
fmt.Println(rsp, err)
}

View File

@@ -0,0 +1,12 @@
import * as crypto from "m3o/crypto";
// Get the last price for a given crypto ticker
async function GetCryptocurrencyPrice() {
let cryptoService = new crypto.CryptoService(process.env.MICRO_API_TOKEN);
let rsp = await cryptoService.price({
symbol: "BTCUSD",
});
console.log(rsp);
}
await GetCryptocurrencyPrice();

View File

@@ -0,0 +1,6 @@
curl "https://api.m3o.com/v1/crypto/Quote" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MICRO_API_TOKEN" \
-d '{
"symbol": "BTCUSD"
}'

View File

@@ -0,0 +1,16 @@
package example
import (
"fmt"
"github.com/micro/services/clients/go/crypto"
"os"
)
// Get the last quote for a given crypto ticker
func GetAcryptocurrencyQuote() {
cryptoService := crypto.NewCryptoService(os.Getenv("MICRO_API_TOKEN"))
rsp, err := cryptoService.Quote(&crypto.QuoteRequest{
Symbol: "BTCUSD",
})
fmt.Println(rsp, err)
}

View File

@@ -0,0 +1,12 @@
import * as crypto from "m3o/crypto";
// Get the last quote for a given crypto ticker
async function GetAcryptocurrencyQuote() {
let cryptoService = new crypto.CryptoService(process.env.MICRO_API_TOKEN);
let rsp = await cryptoService.quote({
symbol: "BTCUSD",
});
console.log(rsp);
}
await GetAcryptocurrencyQuote();