mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-20 14:35:07 +00:00
Generate clients (#206)
This commit is contained in:
6
examples/crypto/history/curl/getPreviousClose.sh
Executable file
6
examples/crypto/history/curl/getPreviousClose.sh
Executable 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"
|
||||
}'
|
||||
16
examples/crypto/history/go/getPreviousClose.go
Executable file
16
examples/crypto/history/go/getPreviousClose.go
Executable 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)
|
||||
}
|
||||
12
examples/crypto/history/node/getPreviousClose.js
Executable file
12
examples/crypto/history/node/getPreviousClose.js
Executable 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();
|
||||
6
examples/crypto/price/curl/getCryptocurrencyPrice.sh
Executable file
6
examples/crypto/price/curl/getCryptocurrencyPrice.sh
Executable 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"
|
||||
}'
|
||||
16
examples/crypto/price/go/getCryptocurrencyPrice.go
Executable file
16
examples/crypto/price/go/getCryptocurrencyPrice.go
Executable 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)
|
||||
}
|
||||
12
examples/crypto/price/node/getCryptocurrencyPrice.js
Executable file
12
examples/crypto/price/node/getCryptocurrencyPrice.js
Executable 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();
|
||||
6
examples/crypto/quote/curl/getACryptocurrencyQuote.sh
Executable file
6
examples/crypto/quote/curl/getACryptocurrencyQuote.sh
Executable 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"
|
||||
}'
|
||||
16
examples/crypto/quote/go/getACryptocurrencyQuote.go
Executable file
16
examples/crypto/quote/go/getACryptocurrencyQuote.go
Executable 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)
|
||||
}
|
||||
12
examples/crypto/quote/node/getACryptocurrencyQuote.js
Executable file
12
examples/crypto/quote/node/getACryptocurrencyQuote.js
Executable 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();
|
||||
Reference in New Issue
Block a user