Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
onchainid.getIdentity(GetIdentity)
string
found
not_found
'found'
'not_found'
status
import 'dotenv/config'; import { RWA, Chain, type SDKInit, type GetIdentity } from '@peaq-network/rwa'; import { JsonRpcProvider } from "ethers"; async function main() { // 0. Create rwa_sdk instance and get provider const provider = new JsonRpcProvider(process.env.HTTPS_BASE_URL); const init: SDKInit = { chainId: Chain.AGUNG, provider: provider }; const rwa_sdk = new RWA(init); // 1. Get Alice public address const alice = process.env.ALICE_PUBLIC_ADDRESS!; // 2. Query ONCHAINID Identity const params: GetIdentity = { subject: alice }; const result = await rwa_sdk.onchainid.getIdentity(params); console.log("Result", result); } main().catch((err) => { console.error(err); process.exit(1); });
import 'dotenv/config'; import { RWA, Chain } from "@peaq-network/rwa"; import { JsonRpcProvider } from "ethers"; async function main() { // 0. Create rwa_sdk instance and get provider const provider = new JsonRpcProvider(process.env.HTTPS_BASE_URL); const rwa_sdk = new RWA({ chainId: Chain.AGUNG, provider: provider }); // 1. Get Alice public address const alice = process.env.ALICE_PUBLIC_ADDRESS // 2. Query ONCHAINID Identity const result = await rwa_sdk.onchainid.getIdentity({ subject: alice }); console.log("Result", result); } main().catch((err) => { console.error(err); process.exit(1); });
Result { status: 'found', identity: '0xF16b0871271C2135b4Ffc374676e74a16aaDC2c9' }
Result { status: 'not_found' }