@fugashu/alphland-api-client
v1.0.5
Published
API client for Alphland on Alephium
Readme
AlphLand API Client
TypeScript/JavaScript client for the AlphLand API.
Installation
npm install alphland-api-clientUsage
import { Configuration, DAppDto, DAppsApi } from "@fugashu/alphland-api-client";
import { useEffect, useState } from "react";
// Initialize
const api = new DAppsApi(
new Configuration({
basePath: "https://publicapi.alph.land", // or 'http://localhost:3000' for local dev
})
);
// React example
export function DAppList() {
const [dapps, setDapps] = useState<DAppDto[]>([]);
useEffect(() => {
api
.dAppControllerGetAllDapps()
.then(({ data }) => setDapps(data))
.catch(console.error);
}, []);
return (
<div>
{dapps.map((dapp) => (
<div key={dapp.name}>
<h2>{dapp.name}</h2>
<img src={dapp.media.logoUrl} alt={`${dapp.name} logo`} />
</div>
))}
</div>
);
}dApp List
A list of all dApps can be found here:
https://github.com/Cojodi/alphland/tree/develop/data
