-
Notifications
You must be signed in to change notification settings - Fork 1
/
types.ts
111 lines (92 loc) · 2.19 KB
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
import {OffchainAttestationType} from "@ethereum-attestation-service/eas-sdk";
import {Game, Player} from "@prisma/client";
export type EASChainConfig = {
chainId: number;
chainName: string;
version: string;
contractAddress: string;
schemaRegistryAddress: string;
etherscanURL: string;
/** Must contain a trailing dot (unless mainnet). */
subdomain: string;
contractStartBlock: number;
rpcProvider: string;
};
export interface AttestationResult {
data: Data;
}
export interface MyAttestationResult {
data: MyData;
}
export interface EnsNamesResult {
data: {
ensNames: { id: string; name: string }[];
};
}
export interface Data {
attestation: Attestation | null;
}
export interface MyData {
attestations: Attestation[];
}
export type ResolvedAttestation = Attestation & {
name: string;
confirmation?: Attestation;
};
export type StoreAttestationRequest = { filename: string; textJson: string };
export type StoreIPFSActionReturn = {
error: null | string;
ipfsHash: string | null;
offchainAttestationId: string | null;
};
export interface AvailableChallengesResult {
data: Data;
}
export interface Data {
attestations: Attestation[];
}
export interface Attestation {
attester: string;
data: string;
decodedDataJson: string;
expirationTime: number;
id: string;
ipfsHash: string;
isOffchain: boolean;
recipient: string;
revocable: boolean;
refUID: string;
revocationTime: number;
revoked: boolean;
schemaId: string;
time: number;
timeCreated: number;
txid: string;
}
export type GameCommit = {
salt: string;
choice: number;
challengeUID: string;
};
export type AcceptedChallenge = {
UID: string;
opponentAddress: string;
playerChoice: number;
opponentChoice: number;
};
export type GameWithPlayers = Game & {
player1Object: Player;
player2Object: Player;
};
export type GameWithPlayersAndAttestations = GameWithPlayers & {relevantAttestations: {uid: string}[]};
// Type for Graph as object with key as string and value as array of strings
export type Graph = {
[key: string]: string[];
};
export type LeaderboardPlayer = {
address: string;
elo: number;
badges: string[];
ensName?: string;
ensAvatar?: string;
}