RAILGUN Reloaded
    Preparing search index...

    Module @railgun-reloaded/broadcaster-client

    Source: dev 36c457d

    @railgun-reloaded/broadcaster-client

    Client for RAILGUN broadcasters over Waku. It reads signed fee quotes and sends an encrypted transact request to the broadcaster of a quote. The broadcaster sends the transaction from its own address and takes the fee from the first output note.

    The client matches the wire format of the running broadcasters (ppoi-safe-broadcaster-example-V2): Waku cluster 5, shard 1, and content topics /railgun/v2/0-{chainId}-{fees|transact|transact-response}/json.

    import { feeForGas, startBroadcasterClient } from '@railgun-reloaded/broadcaster-client/node'

    const client = await startBroadcasterClient(11155111)
    const quote = await client.waitForQuote(tokenAddress)
    // Build with wallet-sdk: a broadcaster transport with a fee note to quote.railgunAddress,
    // minGasPrice, and preTransactionPoi with quote.requiredPOIListKeys.
    const txHash = await client.send({ chainId: 11155111, to, data, minGasPrice, preTransactionPOIsPerTxidLeafPerList }, quote)
    await client.stop()

    Entry points

    • @railgun-reloaded/broadcaster-client has no Node built-ins. BroadcasterClient.start takes libp2p options.
    • @railgun-reloaded/broadcaster-client/node adds startBroadcasterClient, which uses the TCP transport. The edge peer of the broadcaster network listens on TCP only, so a browser cannot reach it yet.
    • A chain poll by nullifier when no response arrives.
    • The trusted fee signer check, DNS discovery, and the EIP-7702 request.
    BroadcasterTransactError
    BroadcasterTimeoutError
    BroadcasterClient
    feeForGas
    BroadcasterQuote
    TransactRequest