feat: invite codes

This commit is contained in:
2023-12-02 21:27:46 +00:00
parent 6f8e8eca0f
commit f26155ddd8
18 changed files with 5609 additions and 22 deletions

View File

@ -79,7 +79,8 @@ export interface RelayDistance {
}
export interface RefCodeResponse {
code: string
code: string;
pubkey: string;
}
export default class SnortApi {
@ -143,6 +144,10 @@ export default class SnortApi {
return this.#getJsonAuthd<RefCodeResponse>("api/v1/referral", "GET");
}
getRefCodeInfo(code: string) {
return this.#getJson<RefCodeResponse>(`api/v1/referral/${code}`, "GET");
}
async #getJsonAuthd<T>(
path: string,
method?: "GET" | string,