/
index.ts
46 lines (41 loc) · 945 Bytes
/
index.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
import {
readContract,
prepareWriteContract,
writeContract,
Address,
} from '@wagmi/core'
import { abi } from './abi'
type Bytes32 = string | number[]
type Bytes = string
export const readAttestation = async (
creator: Address,
about: Address,
key: Bytes32
) => {
return readContract({
address: '0xecb504d39723b0be0e3a9aa33d646642d1051ee1',
abi,
functionName: 'attestations',
args: [creator, about, key],
})
}
export const prepeareWriteAttestation = async (
about: Address,
key: Bytes32,
value: Bytes
) => {
return prepareWriteContract({
address: '0xecb504d39723b0be0e3a9aa33d646642d1051ee1',
abi,
functionName: 'attest',
args: [],
})
}
export const writeAttestation = async (address: string) => {
return prepareWriteContract({
address: '0xecb504d39723b0be0e3a9aa33d646642d1051ee1',
abi,
functionName: 'attest',
})
const { hash } = await writeContract(config)
}