@orca-so/tx-sender
    Preparing search index...

    Function setRpc

    • Initializes the global RPC configuration and returns an RPC instance.

      Parameters

      • url: string

        The Solana RPC endpoint URL.

      • Optionaloptions: {
            pollIntervalMs?: number;
            resendOnPoll?: boolean;
            supportsPriorityFeePercentile?: boolean;
        } = {}

        Optional RPC configuration

        • OptionalpollIntervalMs?: number

          Milliseconds between confirmation status checks. Set to 0 for continuous polling (default).

        • OptionalresendOnPoll?: boolean

          Whether to resend the transaction on each poll attempt (default: true).

        • OptionalsupportsPriorityFeePercentile?: boolean

          Whether the RPC supports percentile-based priority fees. Set this to true if the RPC provider is Triton.

      Returns Promise<Rpc<SolanaRpcApiForTestClusters>>

      A Promise that resolves to an RPC instance configured for the specified endpoint.

      // Premium RPC: Use defaults for maximum landing rate
      const rpc = await setRpc("https://mainnet.helius-rpc.com/?api-key=...");

      // Lower tier RPCs: Configure to reduce RPC usage
      const rpc = await setRpc("https://api.devnet.solana.com", {
      pollIntervalMs: 1000,
      resendOnPoll: false,
      });