# Ethereum -> Algorand

### Code Flow

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

### Steps

1. getAllowanceEth()
2. approveEth()
3. transferFromEth()
4. getEmitterAddressEth()
5. parseSequenceFromLogEth()
6. getSignedVAA()
7. redeemOnAlgorand()

### 1. getAllowanceEth()

```javascript
const allowance: ethers.BigNumber = await getAllowanceEth("0xf72a04B891bA46819D83c75687d31f22f6d646c1","0xbF0482884043B7ea1eB55516770C217C77CC7A48",signer);
```

### 2. approveEth()

```javascript
await approveEth(
      "0xf72a04B891bA46819D83c75687d31f22f6d646c1",
      "0xbF0482884043B7ea1eB55516770C217C77CC7A48",
      signer, // Wallet from ethers js
      AMOUNT_TO_TRANSFER
    );
```

### 3. transferFromEth()

```javascript
const receipt: ethers.ContractReceipt = await transferFromEth(
      "0xf72a04B891bA46819D83c75687d31f22f6d646c1",
      signer, // Wallet from ethers js
      ethAsset,
      BigInt(1000000), // AMOUNT_TO_TRANSFER * (10 ^ ASSET_DECIMALS)
      CHAIN_ID_ALGORAND,
      algosdk.decodeAddress(wallet.addr).publicKey,
      "WORMHOLE"
  );
```

### 4. getEmitterAddressEth()

```javascript
const emitterAddr = getEmitterAddressEth("0xf72a04B891bA46819D83c75687d31f22f6d646c1");
```

### 5. parseSequenceFromLogEth()

```javascript
const sequence: string = parseSequenceFromLogEth(receipt, "0xE4DF23D087ef706a536527a41bef769a43656C91");
```

### 6. getSignedVAA()

```javascript
const signedVAA = await getSignedVAA(GUARDIAN_GRPC, emitterAddr, 'CHAIN_ID_ETHEREUM', sequence, 1000, 20)
```

### 7. redeemOnAlgorand()

```javascript
const redeemTxs = await redeemOnAlgorand(
      client, // Algodv2 from algosdk
      BigInt(114976173),
      BigInt(114976156),
      vaaBytes, // parsed signed vaa
      SENDER_ADDRESS
    );
```


---

# Agent Instructions: 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:

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

The question should be specific, self-contained, and written in natural language.
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.
