on 9ea2d6f help sign in
32 lines 705 B history raw
1import UrbitApi from '@urbit/http-api';
2console.log(`Initializing Urbit API at ${Date()}`);
3const api: UrbitApi = new UrbitApi('');
5function scry<T = any>(path: string): Promise<T> {
6 return api.scry<T>({ app: 'astrolabe', path });
7}
9function getPoint(patp: string): Promise<any> {
10 return scry<any>(`/point/${patp}`);
13function getSpawnedPoints(patp: string): Promise<any> {
14 return scry<any>(`/point/${patp}/spawned`);
17function searchPoints(search: string): Promise<any> {
18 return scry<any>(`/search/${search}`);
21function getDoc(path: string): Promise<string> {
22 return scry<string>(`/doc/${path}`);
25export {
26 api,
27 scry,
28 getPoint,
29 getSpawnedPoints,
30 searchPoints,
31 getDoc,
32};