Options
All
  • Public
  • Public/Protected
  • All
Menu

@open-rpc/typings

OpenRPC Typings

CircleCI branch Dependabot status Chat on Discord npm GitHub release GitHub commits since latest release

Installing

npm install @open-rpc/typings

CLI

$ open-rpc-typings --help
Usage: cli [options]

Options:
  -v, --version                     output the version number
  -d, --document [openrpcDocument]  JSON string or a Path/Url pointing to an open rpc schema (default: "./openrpc.json")
  --output-rs [directory]           output dir of rust typings
  --output-ts [directory]           output dir of typescript typings
  --output-go [directory]           output dir of go typings
  --name-rs [file]                  File name of rust typings (default: "./index")
  --name-ts [file]                  File name of typescript typings (default: "./index")
  --name-go [file]                  File name of go typings (default: "./index")
  -h, --help                        output usage information

JS/TS SDK

import OpenRPCTypings from "@open-rpc/typings";


const typings = new OpenRPCTypings(OpenRPCDocument);

await typings.generate()

const rustTypings = typings.toString("rust");