> For the complete documentation index, see [llms.txt](https://messinaone.gitbook.io/messina-sdk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://messinaone.gitbook.io/messina-sdk/bridging/algorand-greater-than-ethereum.md).

# Algorand -> Ethereum

### Code Flow

<figure><img src="/files/W19kuzghtDkuISsKuah1" alt=""><figcaption></figcaption></figure>

### Steps

1. transferFromAlgorand()
2. signSendAndConfirmTransaction()
3. getEmitterAddressAlgorand()
4. ParseSequenceFromLogAlgorand()
5. getSignedVAA()
6. redeemOnEth()

### 1. transferFromAlgorand()

```javascript
const transferTxs = await transferFromAlgorand(
      algoClient, // Algodv2 from algosdk
      BigInt(114976173),
      BigInt(114976156),
      SENDER_ADDRESS,
      BigInt(105449176),
      BigInt(10000000), // AMOUNT_TO_TRANSFER * (10 ^ ASSET_DECIMALS)
      RECEIVER_ADDRESS,
      CHAIN_ID_ETH,
      BigInt(0)
    );
```

### 2. signSendAndConfirmTransaction()

```javascript
async function signSendAndConfirmAlgorand(
  algodClient: Algodv2, // Algodv2 from algosdk
  txs: TransactionSignerPair[],
  wallet: Account, // Account from algosdk
  waitRounds = 1
) {
  assignGroupID(txs.map((tx) => tx.tx));
  const signedTxns: Uint8Array[] = [];
  for (const tx of txs) {
    if (tx.signer) {
      signedTxns.push(await tx.signer.signTxn(tx.tx));
    } else {
      signedTxns.push(tx.tx.signTxn(wallet.sk));
    }
  }
  await algodClient.sendRawTransaction(signedTxns).do();

  const result = await waitForConfirmation(
    algodClient,
    txs[txs.length - 1].tx.txID(),
    waitRounds
  );
  return result;
}

await signSendAndConfirmAlgorand(
      client,
      transferTxs,
      wallet,
      4
    );
```

### 3. getEmitterAddressAlgorand()

```javascript
const emitterAddr = getEmitterAddressAlgorand(BigInt(114976173));
```

### 4. parseSequenceFromLogAlgorand()

```javascript
const sequence = await parseSequenceFromLogAlgorand(transferResult);
```

### 5. getSignedVAA()

```javascript
let signedVAA = await getSignedVAA(GUARDIAN_GRPC, emitterAddr, 'CHAIN_ID_ALGORAND', sequence, 1000, 5);    
```

### 6. redeemOnEth()

```javascript
const redeem = await redeemOnEth(
      "0xf72a04B891bA46819D83c75687d31f22f6d646c1",
      signer, // Wallet from ethers js
      vaaBytes, // parsed signed vaa
      "WORMHOLE"
    );
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://messinaone.gitbook.io/messina-sdk/bridging/algorand-greater-than-ethereum.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
