@lovoai/x0-js-sdk
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

@lovoai/x0-js-sdk / Exports

@lovoai/x0-js-sdk

Table of contents

Enumerations

Classes

Installation

Install the package with:

npm install @lovoai/x0-js-sdk

Usage with TypeScript

X0 maintains types for the latest [API version][api-versions].

Instantiate it as new X0Api() and new X0Sdk() with the latest API version.

X0Sdk Example

// for Web3.js
const provider = new Web3.providers.HttpProvider(
    'https://eth-mainnet.alchemyapi.io/v2/' + alchemyApiKey,
);
const Web3X0Sdk = new X0Sdk({ provider, x0ApiKey });
const metadata = await Web3X0Sdk.getMetadataFrom(contractAddress, x0Address);
// for ethers.js
const provider = new ethers.providers.AlchemyProvider('mainnet', alchemyApiKey);
x0Sdk = new X0Sdk({ provider, x0ApiKey });
const metadata = await x0Sdk.getMetadataFrom(contractAddress, x0Address);

X0Api Example

import { X0Api } from '@x0/x0-api';
const x0Api = new X0Api({
    apiKey: 'YOUR_API_KEY',
});

X0Web3 Example

const x0Web3 = new X0Web3({
    provider: new ethers.providers.AlchemyProvider('mainnet', alchemyApiKey),
});

Readme

Keywords

none

Package Sidebar

Install

npm i @lovoai/x0-js-sdk

Weekly Downloads

1

Version

0.1.1

License

MIT

Unpacked Size

80.9 kB

Total Files

29

Last publish

Collaborators

  • lovoai