2020-02-07 07:04:18 +04:00
|
|
|
import fetch from 'node-fetch';
|
|
|
|
|
2020-03-07 01:58:50 +04:00
|
|
|
const URL = 'https://api.tez.ie/keys/carthagenet/';
|
2020-02-07 07:04:18 +04:00
|
|
|
const AUTHORIZATION_HEADER = 'Bearer ligo-ide';
|
|
|
|
|
|
|
|
export async function fetchRandomPrivateKey(): Promise<string> {
|
|
|
|
const response = await fetch(URL, {
|
2020-03-07 01:58:50 +04:00
|
|
|
method: 'POST',
|
|
|
|
headers: { Authorization: AUTHORIZATION_HEADER }
|
|
|
|
});
|
2020-02-07 07:04:18 +04:00
|
|
|
|
2020-03-07 01:58:50 +04:00
|
|
|
return response.text();
|
2020-02-07 07:04:18 +04:00
|
|
|
}
|