feat: apply for leader
This commit is contained in:
6
packages/app/src/External/SnortApi.ts
vendored
6
packages/app/src/External/SnortApi.ts
vendored
@ -81,6 +81,8 @@ export interface RelayDistance {
|
||||
export interface RefCodeResponse {
|
||||
code: string;
|
||||
pubkey: string;
|
||||
revShare?: number;
|
||||
leaderState?: "pending" | "approved";
|
||||
}
|
||||
|
||||
export default class SnortApi {
|
||||
@ -148,6 +150,10 @@ export default class SnortApi {
|
||||
return this.#getJson<RefCodeResponse>(`api/v1/referral/${code}`, "GET");
|
||||
}
|
||||
|
||||
applyForLeader() {
|
||||
return this.#getJsonAuthd<RefCodeResponse>("api/v1/referral/leader-apply", "POST");
|
||||
}
|
||||
|
||||
async #getJsonAuthd<T>(
|
||||
path: string,
|
||||
method?: "GET" | string,
|
||||
|
Reference in New Issue
Block a user