ligo/tools/webide/packages/server/src/services/key.ts
2020-03-06 13:58:50 -08:00

14 lines
345 B
TypeScript

import fetch from 'node-fetch';
const URL = 'https://api.tez.ie/keys/carthagenet/';
const AUTHORIZATION_HEADER = 'Bearer ligo-ide';
export async function fetchRandomPrivateKey(): Promise<string> {
const response = await fetch(URL, {
method: 'POST',
headers: { Authorization: AUTHORIZATION_HEADER }
});
return response.text();
}