Registry / api-client / xplore-grpc-web-client

xplore-grpc-web-client

JSON →
library1.18.2jsnpmunverified

Generated gRPC-web client for the Xplore Aggregator service, providing TypeScript definitions and client implementations for interacting with Xplore's cross-chain aggregation. Version 1.18.2 includes support for aggregate calls and transaction record retrieval. This package is auto-generated from protobuf definitions and is primarily used in browser-based applications via gRPC-web. It ships with TypeScript types and is released as needed from the monorepo at github.com/routerprotocol/xplore-types. Unlike general-purpose gRPC clients, this one is specific to Xplore's API and handles protobuf serialization, metadata, and callbacks.

npm install xplore-grpc-web-client
INSTALL
IMPORT
SIG · XPLORE-GRPC-WEB-CL
X
xplore-grpc-web-client
api-clientjavascriptv1.18.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

AggregatorClient
import { AggregatorClient } from 'xplore-grpc-web-client/aggregator_pb_service'
import AggregatorClient from 'xplore-grpc-web-client'
Named export from a deep path. The package's main entry does not export this directly.
XploreRequest
import { XploreRequest } from 'xplore-grpc-web-client/aggregator_pb'
const XploreRequest = require('xplore-grpc-web-client').XploreRequest
ESM-only import. CommonJS require fails because the package uses ES modules.
ChainToken
import { ChainToken } from 'xplore-grpc-web-client/aggregator_pb'
import { ChainToken } from 'xplore-grpc-web-client'
Same as XploreRequest, from the same protobuf module.
TransactionRecordRequest
import { TransactionRecordRequest } from 'xplore-grpc-web-client/aggregator_pb'

Shows creating an AggregatorClient, constructing a XploreRequest with a ChainToken, and making an aggregateCall with a callback.

import { AggregatorClient } from 'xplore-grpc-web-client/aggregator_pb_service'; import { XploreRequest, ChainToken } from 'xplore-grpc-web-client/aggregator_pb'; const client = new AggregatorClient(process.env.XPLORE_SERVER_URL ?? 'https://default-grpc-web-server.com'); const request = new XploreRequest(); const inputToken = new ChainToken(); inputToken.setChainId('chain-1'); inputToken.setAddress('0x123...'); request.setInputToken(inputToken); client.aggregateCall(request, {}, (err, response) => { if (err) { console.error(err); return; } console.log(response?.toObject()); });
Debug
Known issues
gotchaImport paths are not from the package root; must use deep imports like 'xplore-grpc-web-client/aggregator_pb'.
fix
Use full deep import paths for each module.
affects: >=1.0
gotchaPackage is ESM-only; CommonJS require will fail.
fix
Use ES module imports (import syntax). If using CommonJS, use dynamic import().
affects: >=1.0
gotchaThe package depends on 'grpc-web' and 'google-protobuf' but does not list them as peer dependencies.
fix
Install grpc-web and google-protobuf explicitly: npm install grpc-web google-protobuf
affects: >=1.0
gotchaClient methods expect callbacks; do not use Promise-based pattern without wrapping.
fix
Wrap in a Promise if you prefer async/await: new Promise((resolve, reject) => client.aggregateCall(req, {}, (err, res) => err ? reject(err) : resolve(res)))
affects: >=1.0
deprecatedprotobuf setter/getter methods (e.g., setChainId, toObject) are not type-safe and may be deprecated in future protobuf versions.
fix
Consider using plain objects or modern protobuf libraries like protobuf-es.
affects: >=1.18
Errors
Common errors & fixes
Error: Cannot find module 'xplore-grpc-web-client'
Importing from the package root instead of deep paths.
fix
Use 'xplore-grpc-web-client/aggregator_pb_service' or other deep paths.
TypeError: AggregatorClient is not a constructor
Using default import instead of named import from the correct path.
fix
Use import { AggregatorClient } from 'xplore-grpc-web-client/aggregator_pb_service'
ReferenceError: require is not defined in ES module scope
Attempting to use require() in an ESM project.
fix
Use import syntax instead of require().
Upgrade
Version history
1.18.2latest on npm
Audit
Dependencies
grpc-webrequiredRequired for gRPC-web client functionality (imports from 'grpc' namespace).
google-protobufrequiredUsed for protobuf message types like XploreRequest, ChainToken, etc.
Agent activity
44 hits · last 30 days
node
38
OpenAI (training)
2
Resources
xplore-grpc-web-client — npm install xplore-grpc-web-client · libregistry