icns-frontend/types/api-response.ts

92 lines
1.7 KiB
TypeScript
Raw Permalink Normal View History

import { TwitterPublicMetrics } from "../pages/api/twitter-auth-info";
2022-12-05 11:01:24 +00:00
export interface TwitterAuthUrlResponse {
authUrl: string;
}
export interface TwitterAuthInfoResponse {
accessToken: string;
id: string;
name: string;
username: string;
profile_image_url: string;
description: string;
public_metrics: TwitterPublicMetrics;
2022-12-05 11:01:24 +00:00
}
2022-12-05 15:02:30 +00:00
export interface IcnsVerificationResponse {
2022-12-12 06:31:52 +00:00
verificationList: (
| {
status: "fulfilled";
value: {
errors: Error[];
data: {
2022-12-12 08:50:40 +00:00
// JSON string
2022-12-12 06:31:52 +00:00
verifying_msg: string;
2022-12-12 08:50:40 +00:00
// Base64 encoded
public_key: string;
// Base64 encoded
signature: string;
2022-12-12 06:31:52 +00:00
algorithm: string;
};
};
}
| {
status: "rejected";
reason: Error;
}
)[];
}
2022-12-14 11:36:08 +00:00
2022-12-23 13:30:35 +00:00
export interface IcnsVerificationResponseOnFrontend {
verificationList: (
| {
status: "fulfilled";
value: {
errors: Error[];
data: {
// JSON string
verifying_msg: string;
// Base64 encoded
public_key: string;
// Base64 encoded
signature: string;
algorithm: string;
};
};
}
| {
status: "rejected";
reason: string;
}
)[];
}
2022-12-14 11:36:08 +00:00
export interface NameByTwitterIdQueryResponse {
data: {
name: string;
};
}
export interface AddressesQueryResponse {
data: {
addresses: RegisteredAddresses[];
};
}
export interface RegisteredAddresses {
address: string;
bech32_prefix: string;
}
export interface QueryError {
code: number;
message: string;
}
2022-12-15 15:43:18 +00:00
export interface OwnerOfQueryResponse {
data: {
owner: string;
};
}