コンテンツにスキップ

x402NetworkToChainId

このコンテンツはまだ日本語訳がありません。

x402NetworkToChainId(network): 137 | 80002

Defined in: src/x402/types.ts:367

Extracts the SupportedChainId from an X402Network.

Total over the X402Network type: if the input is eip155:80002 the result is 80002. Use isX402Network first to narrow an arbitrary string.

Parameters

network

"eip155:137" | "eip155:80002"

Returns

137 | 80002

Example

import { x402NetworkToChainId } from "kawasekit";
const chainId = x402NetworkToChainId("eip155:80002"); // 80002