Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SimpleMath

Hierarchy

  • SimpleMath

Index

Constructors

constructor

Properties

rpc

rpc: Client

transport

transport: HTTPTransport | WebSocketTransport

Methods

addition

  • addition(params: [undefined | number, undefined | number]): Promise<any>

onError

  • onError(callback: function): void

onNotification

  • onNotification(callback: function): void

setDefaultTimeout

  • setDefaultTimeout(ms: undefined | number): void

startBatch

  • startBatch(): void

stopBatch

  • stopBatch(): void

subtraction

  • subtraction(params: [undefined | number, undefined | number]): Promise<any>

Object literals

Static openrpcDocument

openrpcDocument: object

methods

methods: object[] = [{"name": "addition", "params": [{"name": "a", "schema": {"type": "integer"}}, {"name": "b", "schema": {"type": "integer"}}], "result": {"name": "c", "schema": {"type": "integer"}}, "examples": [{"name": "simpleMathAdditionTwo", "params": [{"name": "two", "summary": "its a sample two", "description": "Im not sure how else to say two", "value": 2}, {"name": "two", "summary": "its a sample two", "description": "Im not sure how else to say two", "value": 2}], "result": {"name": "four", "summary": "its a sample four", "description": "Im not sure how else to say four", "value": 4}}, {"name": "simpleMathAdditionFour", "params": [{"name": "four", "summary": "its a sample four", "description": "Im not sure how else to say four", "value": 4}, {"name": "four", "summary": "its a sample four", "description": "Im not sure how else to say four", "value": 4}], "result": {"name": "eight", "summary": "its a sample eight", "description": "Im not sure how else to say eight", "value": 8}}], "links": [{"name": "subtractionLink", "description": "use the parameters from addition for subtraction", "method": "subtraction", "params": {"a": "$params.a", "b": "$params.b"}}]}, {"name": "subtraction", "params": [{"name": "a", "schema": {"type": "integer"}}, {"name": "b", "schema": {"type": "integer"}}], "result": {"name": "c", "schema": {"type": "integer"}}, "examples": [{"name": "examplesSubtractFourTwo", "params": [{"name": "four", "summary": "its a sample four", "description": "Im not sure how else to say four", "value": 4}, {"name": "two", "summary": "its a sample two", "description": "Im not sure how else to say two", "value": 2}], "result": {"name": "two", "summary": "its a sample two", "description": "Im not sure how else to say two", "value": 2}}, {"name": "examplesSubtractEightFour", "params": [{"name": "eight", "summary": "its a sample eight", "description": "Im not sure how else to say eight", "value": 8}, {"name": "four", "summary": "its a sample four", "description": "Im not sure how else to say four", "value": 4}], "result": {"name": "four", "summary": "its a sample four", "description": "Im not sure how else to say four", "value": 4}}], "links": [{"name": "additionLink", "description": "use the parameters from subtraction for addition", "method": "addition", "params": {"a": "$params.a", "b": "$params.b"}}]}]

openrpc

openrpc: "1.0.0-rc1" = "1.0.0-rc1"

servers

servers: object[] = [{"name": "my simple math server", "summary": "simple math server summary", "description": "simple math server description", "url": "http://${username}.simple-math.example.org:${port}/${basePath}/", "variables": {"username": {"default": "demo", "description": "this is applied to the url as the subdomain"}, "port": {"default": "443", "enum": ["8545", "443"]}, "basePath": {"default": "jsonrpc"}}}]

components

components: object

contentDescriptors

contentDescriptors: object

c

c: object

name

name: string = "c"

schema

schema: object

type

type: string = "integer"

examples

examples: object

integerEight

integerEight: object

description

description: string = "Im not sure how else to say eight"

name

name: string = "eight"

summary

summary: string = "its a sample eight"

value

value: number = 8

integerFour

integerFour: object

description

description: string = "Im not sure how else to say four"

name

name: string = "four"

summary

summary: string = "its a sample four"

value

value: number = 4

integerTwo

integerTwo: object

description

description: string = "Im not sure how else to say two"

name

name: string = "two"

summary

summary: string = "its a sample two"

value

value: number = 2

schemas

schemas: object

Integer

Integer: object

type

type: string = "integer"

info

info: object

description

description: string = "A simple math example"

title

title: string = "Simple Math"

version

version: string = "1.0.0"