Package com.tnsai.payment.x402
Enum Class Network
- All Implemented Interfaces:
Serializable,Comparable<Network>,Constable
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)
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionBase mainnet (EVM, chain id 8453).Base Sepolia testnet (EVM, chain id 84532).Solana mainnet. -
Method Summary
Modifier and TypeMethodDescriptionStable lowercase identifier used in config files and on the wire.intchainId()EVM chain id (EIP-155).family()Signing-scheme family.static NetworkofCanonicalId(String id) Resolve a canonical id back to its enum value.static NetworkReturns the enum constant of this class with the specified name.static Network[]values()Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Enum Constant Details
-
BASE_MAINNET
Base mainnet (EVM, chain id 8453). Real USDC, real money. -
BASE_SEPOLIA
Base Sepolia testnet (EVM, chain id 84532). Faucet USDC, no real value. -
SOLANA_MAINNET
Solana mainnet. SVM-shaped signing scheme, USDC settlement.
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
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).0for non-EVM networks — callers should switch onfamily()before reading this. -
family
Signing-scheme family. -
ofCanonicalId
Resolve a canonical id back to its enum value. Lookup is case-insensitive viaLocale.ROOTto keep behaviour stable across user locales.- Throws:
IllegalArgumentException- ifiddoesn't match any known network
-