# @astar-network/astar-api-derive

> Astar JS API

Latest version **0.3.0** (published 2024-08-09) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @astar-network/astar-api-derive
pnpm add @astar-network/astar-api-derive
yarn add @astar-network/astar-api-derive
bun add @astar-network/astar-api-derive
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.0 |
| Published | 2024-08-09 |
| First published | 2021-12-22 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 14.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 30 |
| Author | Astar Network |
| Maintainers | astar-sys, gluneau, codespool |

## Links

- npm: https://www.npmjs.com/package/@astar-network/astar-api-derive
- Repository: https://github.com/AstarNetwork/astar.js
- Issues: https://github.com/AstarNetwork/astar.js/issues
- npm.io page: https://npm.io/package/@astar-network/astar-api-derive

## Dependencies (4)

- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^7.23.2
- [@polkadot/api-derive](https://npm.io/package/@polkadot/api-derive.md) 12.3.1
- [@open-web3/orml-types](https://npm.io/package/@open-web3/orml-types.md) ^1.0.2-0
- [@astar-network/astar-types](https://npm.io/package/@astar-network/astar-types.md) 0.3.0

## Recent versions

- 0.3.0 (latest) — 2024-08-09
- 0.1.5-7 (beta) — 2022-03-14
- 0.2.9 — 2024-04-09
- 0.2.8 — 2023-12-08
- 0.2.7 — 2023-11-28
- 0.2.6 — 2023-11-07
- 0.2.5 — 2023-07-14
- 0.2.4 — 2023-07-04
- 0.2.3 — 2023-04-17
- 0.2.2 — 2023-04-06
- 0.2.1 — 2023-03-13
- 0.1.19 — 2023-02-23
- 0.1.17 — 2023-02-20
- 0.1.16 — 2023-02-16
- 0.1.15 — 2023-02-15
- … 13 more at https://npm.io/package/@astar-network/astar-api-derive/versions

## README

![license](https://img.shields.io/badge/License-Apache%202.0-blue?logo=apache&style=flat-square)

# @astar-network/api-derive

Derived API calls that combine several queries to provide convinient results. This package is part of the Astar SDK.

## Example

```ts
import { ApiPromise, WsProvider } from '@polkadot/api';
import { options } from '@astar-network/astar-api';
import '@astar-network/astar-api-derive/augmentDerives';

const getAddressEnum = (address: string) => ({ Evm: address });

const endpoint = 'wss://shiden.api.onfinality.io/public-ws';
const provider = new WsProvider(endpoint);
const address = '0x072416b9df2382a62Df34956DffB7B0aDdf668F9';
const api = new ApiPromise(options({ provider }));

(async function main() {
  await api.isReadyOrError;
  const stakers = await api.derive.dappStaking.stakers(getAddressEnum(address));
  console.log({ stakers: stakers.map((s: any) => s.toHuman()) });
})()
  .then(() => api.disconnect())
  .then(() => process.exit());
```

## Development

Clone the repo, run `yarn` and you should be good to go.

## Issues

Please see the COMMUNITY docs for contact and communication channels.

---
_Source: https://npm.io/package/@astar-network/astar-api-derive · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
