> ## Documentation Index
> Fetch the complete documentation index at: https://docs.magic.link/llms.txt
> Use this file to discover all available pages before exploring further.

# Hedera

## Overview

[Hedera](https://hedera.com/) is an EVM-compatible decentralized, open-source and proof-of-stake Layer1 blockchain. It utilizes the leaderless, asynchronous Byzantine Fault Tolerance (aBFT) hashgraph, offering fast transactions and low fees.

**As Hedera is EVM compatible**, you can follow the [Ethereum](/embedded-wallets/blockchains/ethereum/javascript) documentation to send your first transaction and utilize all other wallet features.

## Installation

Magic interacts with the [Hedera](https://hedera.com/) blockchain via Magic's extension NPM package [`@magic-ext/hedera`](https://www.npmjs.com/package/@magic-ext/hedera). The Hedera extension also lets you interact with the blockchain using methods from the [Hiero SDK](https://www.npmjs.com/package/@hiero-ledger/sdk) ([Hiero](https://hiero.org) is the Linux Decentralized Trust Foundation's project that hosts the Hedera source code).

<CodeGroup>
  ```bash NPM icon="npm" theme={null}
  npm install --save @magic-ext/hedera
  ```

  ```bash Yarn icon="yarn" theme={null}
  yarn add @magic-ext/hedera
  ```
</CodeGroup>

## Configure Hedera

```js JavaScript icon="square-js" theme={null}
import { Magic } from 'magic-sdk';
import { HederaExtension } from '@magic-ext/hedera';

const magic = new Magic("YOUR_API_KEY", {
  extensions: [new HederaExtension({
    network: 'testnet' // 'mainnet' or 'testnet'
  })]
});
```

## Send Transaction

#### Call Extension Method

Note that the Magic Hedera extension follows the method names and conventions by the [Hiero SDK](https://www.npmjs.com/package/@hiero-ledger/sdk). To send a standard Hedera blockchain transaction, you can call the inject the MagicWallet to hedera-sdk-js. More details please reference to [example-hedera](https://github.com/magiclabs/example-hedera) github repo.

```js JavaScript icon="square-js" theme={null}
import { Magic } from 'magic-sdk';
import { HederaExtension } from '@magic-ext/hedera';

const magic = new Magic("YOUR_API_KEY", {
  extensions: [new HederaExtension({
    network: 'testnet' // 'mainnet' or 'testnet'
  })]
});

const { publicKeyDer } = await magic.hedera.getPublicKey()

const magicSign = message => magic.hedera.sign(message);
const magicWallet = new MagicWallet(publicAddress, new MagicProvider('testnet'), publicKeyDer, magicSign);

let transaction = await new TransferTransaction()
  .setNodeAccountIds([new AccountId(3)])
  .addHbarTransfer(publicAddress, -1 * sendAmount)
  .addHbarTransfer(destinationAddress, sendAmount)
  .freezeWithSigner(magicWallet);

transaction = await transaction.signWithSigner(magicWallet);
const result = await transaction.executeWithSigner(magicWallet);
const receipt = await result.getReceiptWithSigner(magicWallet);

console.log(receipt.status.toString());
```

## Compatibility

* All `Auth`, `User` module methods
* All EVM Provider functionality to respond to supported [RPC methods](/embedded-wallets/sdk/client-side/javascript#evm-rpc-methods)

*\*Some features are not yet compatible such as the Widget UI.*

*Need a feature or see a problem?* File an issue on our [github repo](https://github.com/magiclabs/magic-js).

## Resources & Tools

* Documentation: [https://docs.hedera.com/hedera/](https://docs.hedera.com/hedera/)
* Block Explorers: [https://hedera.com/ecosystem/network-explorers/](https://hedera.com/ecosystem/network-explorers)
* [Example](https://github.com/magiclabs/example-hedera)
