MiniBridge API Docs

0. TLDR: How to use bridge?

sending ETH to bridge address 0x00000000000007736e2F9aA5630B8c812E1F3fc9 , and make sure the value endswith confirm code 8000 + dest internalId (8004 to Linea for example)

1. How to query bridge config?

  • version: update time

  • chains: supported chains

    1. type currently we support evm, evm_erc20 and starknet

    2. internalId same as id, the id we use internally, part of confirm code in transfer value

    3. bridge bridge address

  • routes: chain to chain config, including fee and min/max amount

    1. from_id to_id interalId

    2. bridge = chains[from_id][”bridge”]

    3. fee_fixed fee amount

    4. fee_percentage currently all 0

    5. amount_min amount_max

    6. Example config from Arbitrum to Linea

          "from_id": 1,
          "from_chainid": 42161,
          "from_name": "Arbitrum",
          "to_id": 4,
          "to_chainid": 59144,
          "to_name": "Linea",
          "from_token": "ETH",
          "to_token": "ETH",
          "bridge": "0x00000000000007736e2F9aA5630B8c812E1F3fc9",
          "fee_fixed_original": 0.00045,
          "fee_fixed_discount": null,
          "fee_fixed": 0.00045,
          "fee_percentage": 0,
          "amount_min": 0.001,
          "amount_max": 0.03,
          "enabled": true,
          "is_native": true

For example, if you want to receive 0.01 ETH from Arbitrum to Linea, you can learn from the config that:

  • from_id Arbitrum = 1

  • to_id Linea = 4

  • the current fee is 0.00045 ETH (without considering discount)

2. How to trigger a bridge request on an EVM chain?

simply transfer ETH to bridge address 0x00000000000007736e2F9aA5630B8c812E1F3fc9 with transfer value set to expected receive amount + fee amount + 8000 + destination chain interalId

No API request needed, our server will process your bridge request automatically.

For example, if you want to bridge from Arbitrum to Linea and receive 0.01 ETH on Linea, you should set the transfer value to: 0.01*10**18 + 0.00045*10**18 + 8000 + 4 = 10450000000008004

example tx:

corresponding destination tx:

3. How to query the status of a bridge request?

Normally your bridge request will be finished in less than 1 minute, you don’t have to query the status, simply querying your destination chain wallet balance should be enough.

You can use this API to query the status of your bridge requests:

Replace the address to your own address which send ETH to bridge, and make sure use lowercase address.

Possible status:

  • pending: we have synced your src chain tx

  • locked: we have allocated destination nonce for your bridge request

  • sent: the destination chain tx has been sent, you can find totx in the API response

  • finished: we have confirmed the destination chain tx

  • failed: different fail status, see the status text for reason

  • retrying: please wait longer

If your bridge tx do not show up in this API response, please check your src tx status first, and wait for 5 minutes, if it repeat, you can contact us in Telegram group

Replace the address to your own address.

This API returns:

  • pETH and pMNB balance, and history

  • discount ratio (85% in this example), discount reason

  • invite count

If your address have available discount, you can multiple it to the fee_fixed to calculate the real fee. Or you can simply ignore it, and you’ll receive more ETH on destination chain than expected.

5. How to bridge to another address?

How to bridge to Starknet?

MiniBridge allows you to change destination chain ETH receive address, and this is a must if you’re bridging across EVM and non-EVM chains.

For EVM chain: use calldata as dest user address, example tx:

For evm_erc20 chain: append dest user address to the calldata, example tx:

6. How to bridge from evm_erc20 chain?

simply transfer ETH token to bridge address, using the same value mechainism (last 4 digits set to 8000+ dest chain internalId)

example tx:

7. How to bridge from Starknet?

Starknet support bundle multiple txs into a transaction, so we have a BridgeTo contract to help set destination address without requiring ETH approval.

To start a bridge request, you need to call 2 functions in a single transaction: BridgeTo.setBridgeTo(felt252) and ETH.transfer(felt252, uint256)

The ETH transfer value is the same mechanism as illustrated above.

example tx:

8. How to bridge to a evm_erc20 chain with gas refill?

add 0.005 ETH, change the confirm code to 8500+dest chain internalId

For example, if you want to bridge from Arbitrum to Mantle (id=11), and want to receive 0.01 ETH on Mantle with about $1 MNT, and assuming the fee is 0.00065 ETH, you need to send:

0.01*10**18 + 0.00065*10**18 + 0.0005*10**18 + 8500 + 11 = 11150000000008511

9. If you want to use contract to bridge

Note: zksync era is currently unsupported

Use our helper contract to send ETH, you can call it in a contract internal call

helper address: 0x000000000000Bd696655814b68C2f67e399ab4e5 , also in chains conf file

call Helper.transferETH(uint256 to)

Example tx:

Last updated