generated from Borodutch/frontend-starter
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathattestor.ts
More file actions
48 lines (43 loc) · 1.16 KB
/
attestor.ts
File metadata and controls
48 lines (43 loc) · 1.16 KB
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
import BalanceSignature from 'models/BalanceSignature'
import FarcasterSignature from 'models/FarcasterSignature'
import Network from 'models/Network'
import PublicKey from 'models/PublicKey'
import Signature from 'models/Signature'
import axios from 'axios'
import env from 'helpers/env'
const baseURL = `${env.VITE_VERIFY_URL}/v0.2.2/verify`
export async function requestAddressOwnershipAttestation(
signature: string,
message: string
) {
const { data } = await axios.post<Signature>(`${baseURL}/ethereum-address`, {
signature,
message,
})
return data
}
export async function requestBalanceAttestation(
tokenAddress: string,
network: Network,
ownerAddress: string
) {
const { data } = await axios.post<BalanceSignature>(`${baseURL}/balance`, {
tokenAddress,
network,
ownerAddress,
})
return data
}
export async function requestFarcasterAttestation(address: string) {
const { data } = await axios.post<FarcasterSignature>(
`${baseURL}/farcaster`,
{
address,
}
)
return data
}
export async function getEddsaPublicKey() {
const { data } = await axios.get<PublicKey>(`${baseURL}/eddsa-public-key`)
return data
}