This is an official integration repo for OTTP.
Run the following command to install:
npm i @ottp/sdk
This method fetches attesations made using OTTP protocol for a given FID (Farcaster ID). Set userInfo
to true
if you need user details of the attester and the attested to be returned.
import { OttpClient } from '@ottp/sdk'
const main = async () => {
const ottp = new OttpClient()
const attestations = await getOttpAttestations('316300', true)
}
main()
import { OttpClient } from '@ottp/sdk'
const main = async () => {
const ottp = new OttpClient()
const attestations = await getOttpAttestations('316300')
}
main()
This method fetches the ottp id from the chain for a given FID (Farcaster ID).
import { OttpClient } from '@ottp/sdk'
const main = async () => {
const ottp = new OttpClient()
ottp.getOttpId(316300)
}
main()
This method fetches the collaborators for a given FID (Farcaster ID).
import { OttpClient } from '@ottp/sdk'
const main = async () => {
const ottp = new OttpClient()
const collabs = await ottp.getCollaborators('316300')
console.log(collabs)
}
main()
This method would be typically used in web clients to validate usernames entered by users while attesting.
import { OttpClient } from '@ottp/sdk'
const main = async () => {
const ottp = new OttpClient()
const fids = await ottp.getTaggedUserFids('@lowcodekrish @ting')
console.log(fids)
}
main()
Refer the example repo.
If you're interested in contributing to this open-source project, please see CONTRIBUTING.
Note: Everything is a work in progress.