In addition to the SDK methods for interacting with identities, names, contracts, and documents, the SDK also provides direct access to HAPI client methods.

Prerequisites

Code

The following example demonstrates several of the Core HAPI client methods. HAPI client also has several Platform methods accessible via getDAPIClient().platform.*. The methods can be found here in the js-hapi-client repository.

`const Hellar = require('hellar');

const client = new Hellar.Client({ network: 'mainnet' });

async function hapiClientMethods() { console.log(await client.getHAPIClient().core.getBlockHash(1)); console.log(await client.getHAPIClient().core.getBestBlockHash()); console.log(await client.getHAPIClient().core.getBlockByHeight(1));

return client.getHAPIClient().core.getStatus(); }

hapiClientMethods() .then((d) => console.log('Core status:\n', d)) .catch((e) => console.error('Something went wrong:\n', e)) .finally(() => client.disconnect());`

📘 Examples using HAPI client to access many of the HAPI endpoints can be found in the HAPI Endpoint Reference section.