forked from passportxyz/passport
-
Notifications
You must be signed in to change notification settings - Fork 0
/
verifiableCredentialResults.ts
107 lines (98 loc) · 2.79 KB
/
verifiableCredentialResults.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
import { CredentialResponseBody, VerifiableCredential, VerifiableCredentialRecord } from "@gitcoin/passport-types";
const credential: VerifiableCredential = {
"@context": ["https://www.w3.org/2018/credentials/v1"],
type: ["VerifiableCredential"],
credentialSubject: {
id: "did:ethr:Test",
"@context": [
{
hash: "https://schema.org/Text",
provider: "https://schema.org/Text",
},
],
hash: "randomValuesHash",
provider: "Ens",
},
issuer: "did:key:randomValuesIssuer",
issuanceDate: "2022-04-15T21:04:01.708Z",
proof: {
type: "Ed25519Signature2018",
proofPurpose: "assertionMethod",
verificationMethod: "did:key:randomValues",
created: "2022-04-15T21:04:01.708Z",
jws: "randomValues",
},
expirationDate: "2022-05-15T21:04:01.708Z",
};
export const SUCCESFUL_ENS_RESULT: VerifiableCredentialRecord = {
record: {
type: "Ens",
address: "0xcF323CE817E25b4F784bC1e14c9A99A525fDC50f",
version: "0.0.0",
ens: "test.eth",
},
signature: "0xbdbac10fdb0921e73df7575e47cbda484be550c......8af1ad6eeee1ee94c9a0794a3812ae861f8898a973233abea1c",
challenge: credential,
credential: credential,
};
export const SUCCESFUL_ENS_RESULTS: CredentialResponseBody = {
record: { type: "Ens", version: "0.0.0", ens: "jimmyjim.eth" },
credential,
};
export const UN_SUCCESSFUL_ENS_RESULT: CredentialResponseBody = {
code: 403,
error: "You can't claim this stamp",
};
export const SUCCESFUL_POAP_RESULT: VerifiableCredentialRecord = {
record: {
type: "POAP",
address: "0xcF323CE817E25b4F784bC1e14c9A99A525fDC50f",
version: "0.0.0",
poaps: "2734,2134,3256",
},
signature: "0x....",
challenge: credential,
credential: credential,
};
export const SUCCESFUL_POH_RESULT: VerifiableCredentialRecord = {
record: {
type: "Poh",
address: "0xcF323CE817E25b4F784bC1e14c9A99A525fDC50f",
version: "0.0.0",
poh: "Is registered",
},
signature: "0xbdbac10fdb0921e73df7575e47cbda484be550c......8af1ad6eeee1ee94c9a0794a3812ae861f8898a973233abea1c",
challenge: credential,
credential: credential,
};
export const SUCCESFUL_BRIGHTID_RESULT: VerifiableCredentialRecord = {
record: {
type: "Brightid",
address: "0xcF323CE817E25b4F784bC1e14c9A99A525fDC50f",
version: "0.0.0",
contextId: "somedata",
meets: "true",
},
signature: "0xbdbac10fdb0921e73df7575e47cbda484be550c......8af1ad6eeee1ee94c9a0794a3812ae861f8898a973233abea1c",
challenge: credential,
credential: credential,
};
export const VALID_LENS_VERIFICATION = {
providerType: "Lens",
payload: {
valid: true,
record: {
address: "0x123",
numberOfHandles: "1",
},
},
};
export const VALID_ENS_VERIFICATION = {
providerType: "Ens",
payload: {
valid: true,
record: {
ens: "MEME",
},
},
};