Complete buy flow
This commit is contained in:
@ -25,7 +25,11 @@ export type HandleAvailability = {
|
||||
|
||||
export type HandleQuote = {
|
||||
price: number,
|
||||
data: any
|
||||
data: HandleData
|
||||
}
|
||||
|
||||
export type HandleData = {
|
||||
type: string | "premium" | "short"
|
||||
}
|
||||
|
||||
export type HandleRegisterResponse = {
|
||||
@ -35,6 +39,12 @@ export type HandleRegisterResponse = {
|
||||
token: string
|
||||
}
|
||||
|
||||
export type CheckRegisterResponse = {
|
||||
available: boolean,
|
||||
paid: boolean,
|
||||
password: string
|
||||
}
|
||||
|
||||
export class ServiceProvider {
|
||||
readonly url: URL | string
|
||||
|
||||
@ -54,7 +64,7 @@ export class ServiceProvider {
|
||||
return await this._GetJson("/registration/register", "PUT", { name: handle, domain, pk: pubkey });
|
||||
}
|
||||
|
||||
async CheckRegistration(token: string): Promise<any> {
|
||||
async CheckRegistration(token: string): Promise<CheckRegisterResponse | ServiceError> {
|
||||
return await this._GetJson("/registration/register/check", "POST", undefined, {
|
||||
authorization: token
|
||||
});
|
||||
|
Reference in New Issue
Block a user