Skip to content

Commit

Permalink
feat(network): add util for creating faucet service (#171)
Browse files Browse the repository at this point in the history
  • Loading branch information
alvrs committed Oct 3, 2022
1 parent 29d0b91 commit 9f50d9c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/network/src/createFaucetService.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { FaucetServiceClient } from "@latticexyz/services/protobuf/ts/faucet/faucet.client";
import { GrpcWebFetchTransport } from "@protobuf-ts/grpcweb-transport";

/**
* Create a FaucetServiceClient
* @param url FaucetService URL
* @returns FaucetServiceClient
*/
export function createFaucetService(url: string): FaucetServiceClient {
const transport = new GrpcWebFetchTransport({ baseUrl: url, format: "binary" });
return new FaucetServiceClient(transport);
}
1 change: 1 addition & 0 deletions packages/network/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ export * from "./createSystemExecutor";
export * from "./networkUtils";
export * from "./workers";
export * from "./createRelayerStream";
export * from "./createFaucetService";

0 comments on commit 9f50d9c

Please sign in to comment.