Get Sore
Primitives
Every score has it’s own model and id, so you need to provide them to get the score.
Model represents the calculating model of the score, and id is the unique identifier of the score.
Score | Chain | Model | Id |
---|---|---|---|
11 (Common V3) | 3776 | ||
11 (Common V3) | 80085 | ||
11 (Common V3) | 81457 | ||
11 (Common V3) | 81457 | ||
11 (Common V3) | 1116 | ||
11 (Common V3) | 25 | ||
5 (Rubic) | 22202022 | ||
11 (Common V3) | 39797 | ||
11 (Common V3) | 119 | ||
21 (Eywa) | 137 | ||
11 (Common V3) | 100 | ||
11 (Common V3) | 255 | ||
12 (LayerZero) | 11101011 | ||
11 (Common V3) | 1890 | ||
14 (Linea) | 59144 | ||
19 (Manta) | 169 | ||
11 (Common V3) | 1088 | ||
11 (Common V3) | 888080688 | ||
11 (Common V3) | 34443 | ||
11 (Common V3) | 1284 | ||
11 (Common V3) | 9999999999999 | ||
11 (Common V3) | 245022934 | ||
11 (Common V3) | 59144 | ||
11 (Common V3) | 161221135 | ||
11 (Common V3) | 1101 | ||
16 (Scroll) | 534352 | ||
11 (Common V3) | 888080688 | ||
11 (Common V3) | 167008 | ||
22 (Web3 Social) | 888080688 | ||
11 (Common V3) | 7001 | ||
11 (Common V3) | 42766 | ||
11 (Common V3) | 810180 | ||
11 (Common V3) | 324 |
Example
Here is an example for the Multichain Score on the Polygon chain:
import { type Address, createPublicClient, getContract, http } from "viem";
import { polygon } from "viem/chains";
import { abi } from "./abi";
const model = 11;
const id = 9999999999999n;
const publicClient = createPublicClient({
chain: polygon,
transport: http(),
});
const contract = getContract({
abi,
address: "0x4724F4B3936B4c2d52f8F452719870c5d4c86b4D",
client: publicClient,
});
const getScore = async (address: Address) => {
try {
const [score, timestamp, tokenId] = await contract.read.getScore([
address,
id,
model,
]);
return score / 100;
} catch (error) {
console.error(error);
}
};
console.log(await getScore("0x..."));