Parameters
| Property | Description | Required |
|---|---|---|
| chainId | The chain id to deposit funds on | ✅ |
| toChainId | The chain id to execute the txs on | ✅ |
| value | Amount in wei to bridge | ✅ |
| wallet | A valid WalletClient from viem or an adapted wallet generated from an adapter that meets this interface. | ✅ |
| to | A valid address to send the funds to | ❌ |
| precheck | If set to true this will just fetch the quote without executing the bridge. Use this to display an estimated quote. | ❌ |
| onProgress | Callback to update UI state as execution progresses. Can also be used to get the transaction hash for a given step item. | ❌ |
Example
import { getClient, Execute } from "@reservoir0x/relay-sdk";
import { createWalletClient, http } from 'viem'
...
wallet = createWalletClient({
account: address,
transport: http()
})
getClient().actions.bridge({
chainId: 7777777,
toChainId: 8453,
value: "1000000"
wallet: wallet,
onProgress: (steps) => {
console.log(steps)
},
})