Score SBT
Request
GET https://nomis.cc/api/{slug}/holder?address={address}
is-holder.ts
import { type Res } from "./type"
export const isHolder = async (address: string) => {
try {
const res = await fetch(
`https://nomis.cc/api/{slug}/holder?address=${address}`
);
if (!res.ok) throw new Error();
const data = (await res.json()) as Res;
if ("message" in data) throw new Error();
return data.isHolder ?? false;
} catch (error) {
return false;
}
};
console.log(await isHolder("0x..."))
Path Parameters
slug string Required
Nomis’ Score slug.
Score | Slug |
---|
Query Parameters
address string Required
Address of an account.
Response
Success
Success response will return when account address and score slug is valid.
Account with SBT
Nomis’ Score holder.
// https://nomis.cc/api/blast/holder?address=0x2C0356a346471A6502EbEC941752a7FE43536422
{
"owner": "0x2C0356a346471A6502EbEC941752a7FE43536422",
"isHolder": true,
"chainId": "81457",
"version": "0.9",
"calculationModel": "11",
"score": 7.19,
"tokenId": "2",
"updated_s": "1709257523",
"updated_ms": 1709257523000
}
Account without SBT
Not a Nomis’ Score holder.
{
"owner": "0x2C0356a346471A6502EbEC941752a7FE43536422",
"isHolder": false,
"chainId": "81457",
"version": null,
"calculationModel": "11",
"score": null,
"tokenId": null,
"updated_s": null,
"updated_ms": null
}
Error
Error response will return when:
- Account address is invalid;
- Score slug is invalid.
{
"message": "Provided address is not a zksync address"
}