Skip to content
CLI and Javascript/Typescript methods for generating types for your OpenRPC API.
TypeScript JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
src
.gitignore
.releaserc
CHANGELOG.md
README.md
jest.config.js
package-lock.json
package.json
tsconfig.json
tsfmt.json
tslint.json

README.md

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");
You can’t perform that action at this time.