Publish Chain 138 RPC capability metadata
This commit is contained in:
@@ -11,6 +11,9 @@ var dualChainNetworksJSON []byte
|
||||
//go:embed config/metamask/DUAL_CHAIN_TOKEN_LIST.tokenlist.json
|
||||
var dualChainTokenListJSON []byte
|
||||
|
||||
//go:embed config/metamask/CHAIN138_RPC_CAPABILITIES.json
|
||||
var chain138RPCCapabilitiesJSON []byte
|
||||
|
||||
// handleConfigNetworks serves GET /api/config/networks (Chain 138 + Ethereum Mainnet params for wallet_addEthereumChain).
|
||||
func (s *Server) handleConfigNetworks(w http.ResponseWriter, r *http.Request) {
|
||||
if r.Method != http.MethodGet {
|
||||
@@ -34,3 +37,15 @@ func (s *Server) handleConfigTokenList(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Cache-Control", "public, max-age=3600")
|
||||
w.Write(dualChainTokenListJSON)
|
||||
}
|
||||
|
||||
// handleConfigCapabilities serves GET /api/config/capabilities (Chain 138 wallet/RPC capability matrix).
|
||||
func (s *Server) handleConfigCapabilities(w http.ResponseWriter, r *http.Request) {
|
||||
if r.Method != http.MethodGet {
|
||||
w.Header().Set("Allow", "GET")
|
||||
writeMethodNotAllowed(w)
|
||||
return
|
||||
}
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
w.Header().Set("Cache-Control", "public, max-age=900")
|
||||
w.Write(chain138RPCCapabilitiesJSON)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user