1//NOTE if accessing this in a localhost configuration fails with "CORS request
2// did not succeed", you might need to visit localhost:3001 or whatever
3// explicitly and tell your browser that's safe to access.
4// https://stackoverflow.com/a/53011185/1334324
5import { isGoerli } from './flags';
7const port = isGoerli ? '3012' : '3002';
8const baseUrl = `https://onboarding-emails.urbit.org:${port}`;
10function sendRequest(where, what) {
11 return new Promise((resolve, reject) => {
12 fetch(baseUrl + where, {
16 'Content-Type': 'application/json',
18 body: JSON.stringify(what),
22 resolve(response.json());
31async function hasReceived(recipient) {
32 const res = await sendRequest('/has-received', { recipient });
33 return res.hasReceived;
36function sendMail(recipient, ticket, sender, message, tx) {
37 return sendRequest('/send-ticket', {
46export { hasReceived, sendMail };
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list