> 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/methods/guardian/getsignedvaa.md).

# getSignedVAA()

### Method Parameters

**host:** string

Guardian GRPC

**emitterAddress:** string

Emitter address

**emitterChain:** string

Emitter chain

**sequence:** string

Sequence number

### Optional Parameters

**retryTimeout:** number

Retry timeout number

**retryAttempts:** number

Retry attempts number

### Returns

Returns signed vaa as `string`

### Usage

<pre class="language-javascript"><code class="lang-javascript">import { ethers } from "ethers";
import algosdk, { Account, Algodv2, assignGroupID, waitForConfirmation } from "algosdk";
import { transferFromAlgorand, nativeToHexString, CHAIN_ID_ETH, getEmitterAddressAlgorand, parseSequenceFromLogAlgorand } from "@algo-foundry/messina-sdk";
import { TransactionSignerPair } from "@algo-foundry/messina-sdk/lib/cjs/algorand";
import { getSignedVAA } from "@algo-foundry/messina-sdk/lib/cjs/rpc/getSignedVAAUpdate";

const client: algosdk.Algodv2 = new Algodv2(&#x3C;ALGO_TOKEN>, &#x3C;ALGO_ADDRESS>, &#x3C;ALGOD_PORT>);
const wallet: Account = algosdk.mnemonicToSecretKey(&#x3C;ALGO_MNEMONIC>)

const provider = new ethers.providers.WebSocketProvider(
      &#x3C;ETH_NODE_URL>
    ) as any;   
const signer = new ethers.Wallet(&#x3C;ETH_PRIVATE_KEY>, provider);

const hexStr = nativeToHexString(
      signer.address,
      CHAIN_ID_ETH
    );

if (!hexStr) {
   throw new Error("Failed to convert to hexStr");
 }    
            
const transferTxs = await transferFromAlgorand(
      client,
      BigInt(114976173),
      BigInt(114976156),
      wallet.addr,
      BigInt(105449176),
      BigInt(10000000), // AMOUNT_TO_TRANSFER * (10 ^ ASSET_DECIMALS)
      hexStr,
      CHAIN_ID_ETH,
      BigInt(0)
    );

const transferResult = await signSendAndConfirmAlgorand(
      client,
      transferTxs,
      wallet,
      4
    );
    
const emitterAddr = getEmitterAddressAlgorand(BigInt(114976173));
const sequence = await parseSequenceFromLogAlgorand(transferResult);

//Only for localhost ganache (remove if use infura)
let interval = setInterval(async () => {
     await provider.send('evm_mine')
}, 1000)

let signedVAA = await getSignedVAA(&#x3C;GUARDIAN_GRPC>, emitterAddr, 'CHAIN_ID_ALGORAND', sequence, 1000, 5);    
// @ts-ignore
const vaaBytes = new Uint8Array(signedVAA!.match(/.{1,2}/g)!.map((byte: any) => parseInt(byte, 16)));  

//Only for localhost ganache (remove if use infura)
clearInterval(interval)
<strong>
</strong><strong>async function signSendAndConfirmAlgorand(
</strong>  algodClient: Algodv2,
  txs: TransactionSignerPair[],
  wallet: Account,
  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;
}    
    
</code></pre>


---

# 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/methods/guardian/getsignedvaa.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.
