Enum Class Network

java.lang.Object
java.lang.Enum<Network>
com.tnsai.payment.x402.Network
All Implemented Interfaces:
Serializable, Comparable<Network>, Constable

public enum Network extends Enum<Network>
Settlement networks the x402 adapter can target.

The list is intentionally short. Each entry corresponds to a published scheme in the x402 spec (Base on EVM, Solana on SVM) and to a Coinbase facilitator that already accepts authorisations for that chain. Adding a new network here is a deliberate decision — it implies a tested chain RPC, a working facilitator, and a settlement-asset address (USDC etc.) that the adapter trusts.

Since:
0.10.5 (TNS-449 P2)
  • Enum Constant Details

    • BASE_MAINNET

      public static final Network BASE_MAINNET
      Base mainnet (EVM, chain id 8453). Real USDC, real money.
    • BASE_SEPOLIA

      public static final Network BASE_SEPOLIA
      Base Sepolia testnet (EVM, chain id 84532). Faucet USDC, no real value.
    • SOLANA_MAINNET

      public static final Network SOLANA_MAINNET
      Solana mainnet. SVM-shaped signing scheme, USDC settlement.
  • Method Details

    • values

      public static Network[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Network valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • canonicalId

      public String canonicalId()
      Stable lowercase identifier used in config files and on the wire. Matches the x402 spec's network slugs verbatim.
    • chainId

      public int chainId()
      EVM chain id (EIP-155). 0 for non-EVM networks — callers should switch on family() before reading this.
    • family

      public Network.Family family()
      Signing-scheme family.
    • ofCanonicalId

      public static Network ofCanonicalId(String id)
      Resolve a canonical id back to its enum value. Lookup is case-insensitive via Locale.ROOT to keep behaviour stable across user locales.
      Throws:
      IllegalArgumentException - if id doesn't match any known network