NPM SDK
Installation
Install the @ethsign/sp-sdk
package to use the Sign Protocol SDK in your frontend or Node backend projects.
Creating an Index Service Client
new IndexService(env);
Parameters
Name
Type
Description
env
testnet
, mainnet
Whether the indexing service should be querying testnets or mainnets.
Example
async function getSchemaListFromIndexService() {
const indexService = new IndexService("testnet");
const res = await indexService.querySchemaList({ page: 1 });
}
async function getSchemaFromIndexService() {
const indexService = new IndexService("testnet");
const res = await indexService.querySchema("onchain_evm_80001_0x1");
}
async function getAttestationListFromIndexService() {
const indexService = new IndexService("testnet");
const res = await indexService.queryAttestationList({ page: 1 });
}
async function getAttestationFromIndexService() {
const indexService = new IndexService("testnet");
const res = await indexService.queryAttestation("onchain_evm_80001_0x1");
}
Last updated
Was this helpful?