# Withdraw From Zebec

At first, you have to withdraw your assets from the Zebec. To withdraw you can do as follows.

```typescript
const withdrawer = signer.address

const withdrawerAddrInSolana = ZebecSolBridgeClient.getProxyUserKey(
   withdrawer,
   sourceChain,
   SOL_ZEBEC_BRIDGE_ADDRESS,
);

const tokenAddrInSolana = "<solana mint key>";
const amount = "1";

const reciept = await ethClient.withdraw(amount, withdrawer, tokenAddrInSolana);
```

Now you can find signed Vaa bytes of your payload sent from wormhole guardian rpc hosts.

```typescript
const sequence = parseSequenceFromLogEth(
   receipt, 
   getBridgeAddressForChain(sourceChain)
);
const zebecEmitterAddress = getEmitterAddressEth(BSC_ZEBEC_BRIDGE_ADDRESS);
const { vaaBytes } = await getSignedVAAWithRetry(
   WORMHOLE_RPC_HOSTS, 
   sourceChain, 
   zebecEmitterAddress, 
   sequence
);
```

Now post this signed vaa to wormhole solana core bridge program, parse the payloads from vaa and send the parsed data to solana zebec bridge program. Posting vaa and calling solana bridge (also called as proxy) program. This is optional because it's handled by zebec's specialized relayer.

<pre class="language-typescript"><code class="lang-typescript"><strong>
</strong>
const payerAddress = wallet.publicKey.toString();

const bridgeAddress = getBridgeAddressForChain(targetChain);
const tokenBridgeAddress = getTokenBridgeAddressForChain(targetChain);
const vaaBuf = Buffer.from(vaaBytes);

setDefaultWasm("node"); // use bundler for browser
const { parse_vaa } = await importCoreWasm();

// posting vaa in solana
await postVaaSolanaWithRetry(
   connection,
   wallet.signTransaction,
   bridgeAddress,
   payerAddress,
   vaaBuf,
   MAX_VAA_UPLOAD_RETRIES_SOLANA,
);

const { parse_vaa } = await importCoreWasm();
const parsedVaa = parse_vaa(tes)
const parsedPayload = parseZebecPayload(Buffer.from(parsedVaa.payload));

const result = await solanaClient.withdrawDeposit(withdrawVaa, parsedPayload as TokenWithdrawPayload);
</code></pre>


---

# 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://docs.zebec.io/zebec-bridge/bridge-sdk/withdraw-deposited/withdraw-from-zebec.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.
