@olane/o-protocol 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/.babelrc +6 -0
  2. package/README.md +24 -0
  3. package/dist/address/index.d.ts +1 -0
  4. package/dist/address/index.js +18 -0
  5. package/dist/address/index.js.map +1 -0
  6. package/dist/address/o-address.d.ts +4 -0
  7. package/dist/address/o-address.js +3 -0
  8. package/dist/address/o-address.js.map +1 -0
  9. package/dist/config.d.ts +1 -0
  10. package/dist/config.js +5 -0
  11. package/dist/config.js.map +1 -0
  12. package/dist/dependency/index.d.ts +1 -0
  13. package/dist/dependency/index.js +18 -0
  14. package/dist/dependency/index.js.map +1 -0
  15. package/dist/dependency/o-dependency.d.ts +7 -0
  16. package/dist/dependency/o-dependency.js +3 -0
  17. package/dist/dependency/o-dependency.js.map +1 -0
  18. package/dist/enums/index.d.ts +1 -0
  19. package/dist/enums/index.js +18 -0
  20. package/dist/enums/index.js.map +1 -0
  21. package/dist/enums/o-protocol-methods.enum.d.ts +8 -0
  22. package/dist/enums/o-protocol-methods.enum.js +13 -0
  23. package/dist/enums/o-protocol-methods.enum.js.map +1 -0
  24. package/dist/handshake/index.d.ts +1 -0
  25. package/dist/handshake/index.js +18 -0
  26. package/dist/handshake/index.js.map +1 -0
  27. package/dist/handshake/o-handshake.d.ts +18 -0
  28. package/dist/handshake/o-handshake.js +3 -0
  29. package/dist/handshake/o-handshake.js.map +1 -0
  30. package/dist/index.d.ts +10 -0
  31. package/dist/index.js +27 -0
  32. package/dist/index.js.map +1 -0
  33. package/dist/json-rpc/index.d.ts +1 -0
  34. package/dist/json-rpc/index.js +18 -0
  35. package/dist/json-rpc/index.js.map +1 -0
  36. package/dist/json-rpc/json-rpc.d.ts +58 -0
  37. package/dist/json-rpc/json-rpc.js +10 -0
  38. package/dist/json-rpc/json-rpc.js.map +1 -0
  39. package/dist/method/index.d.ts +1 -0
  40. package/dist/method/index.js +18 -0
  41. package/dist/method/index.js.map +1 -0
  42. package/dist/method/o-method.d.ts +8 -0
  43. package/dist/method/o-method.js +3 -0
  44. package/dist/method/o-method.js.map +1 -0
  45. package/dist/parameter/index.d.ts +1 -0
  46. package/dist/parameter/index.js +18 -0
  47. package/dist/parameter/index.js.map +1 -0
  48. package/dist/parameter/o-parameter.d.ts +7 -0
  49. package/dist/parameter/o-parameter.js +3 -0
  50. package/dist/parameter/o-parameter.js.map +1 -0
  51. package/dist/register/index.d.ts +1 -0
  52. package/dist/register/index.js +18 -0
  53. package/dist/register/index.js.map +1 -0
  54. package/dist/register/o-register.d.ts +13 -0
  55. package/dist/register/o-register.js +3 -0
  56. package/dist/register/o-register.js.map +1 -0
  57. package/dist/router/index.d.ts +1 -0
  58. package/dist/router/index.js +18 -0
  59. package/dist/router/index.js.map +1 -0
  60. package/dist/router/o-router.d.ts +11 -0
  61. package/dist/router/o-router.js +3 -0
  62. package/dist/router/o-router.js.map +1 -0
  63. package/dist/schema.ts +193 -0
  64. package/package.json +73 -0
  65. package/schema/v1.0.0/schema.ts +159 -0
  66. package/src/address/index.ts +1 -0
  67. package/src/address/o-address.ts +4 -0
  68. package/src/config.ts +1 -0
  69. package/src/dependency/index.ts +1 -0
  70. package/src/dependency/o-dependency.ts +8 -0
  71. package/src/enums/index.ts +1 -0
  72. package/src/enums/o-protocol-methods.enum.ts +8 -0
  73. package/src/handshake/index.ts +1 -0
  74. package/src/handshake/o-handshake.ts +24 -0
  75. package/src/index.ts +10 -0
  76. package/src/json-rpc/index.ts +1 -0
  77. package/src/json-rpc/json-rpc.ts +100 -0
  78. package/src/method/index.ts +1 -0
  79. package/src/method/o-method.ts +9 -0
  80. package/src/parameter/index.ts +1 -0
  81. package/src/parameter/o-parameter.ts +7 -0
  82. package/src/register/index.ts +1 -0
  83. package/src/register/o-register.ts +15 -0
  84. package/src/router/index.ts +1 -0
  85. package/src/router/o-router.ts +12 -0
  86. package/ts-aggregator-loader.js +91 -0
  87. package/tsconfig.json +29 -0
  88. package/webpack.config.js +30 -0
package/dist/schema.ts ADDED
@@ -0,0 +1,193 @@
1
+ export const LATEST_PROTOCOL_VERSION = '1.0.0';
2
+
3
+ export enum oProtocolMethods {
4
+ HANDSHAKE = "handshake",
5
+ REGISTER = "register",
6
+ ROUTE = "route",
7
+ INDEX_NETWORK = "index_network",
8
+ INTENT = "intent",
9
+ INTENT_METHOD_CONFIGURATION = "intent_method_configuration",
10
+ }
11
+
12
+
13
+
14
+
15
+ export interface oMethod {
16
+ name: string;
17
+ description: string;
18
+ parameters: oParameter[];
19
+ dependencies: oDependency[];
20
+ }
21
+
22
+ export const JSONRPC_VERSION = "2.0";
23
+
24
+ export type ConnectionId = string;
25
+
26
+ /**
27
+ * An opaque token used to represent a cursor for pagination.
28
+ */
29
+ export type Cursor = string;
30
+
31
+ export interface RequestParams {
32
+ _connectionId: ConnectionId;
33
+ _requestMethod: string;
34
+ [key: string]: unknown;
35
+ }
36
+
37
+ export interface Request {
38
+ method: string;
39
+ params: RequestParams;
40
+ }
41
+
42
+ export interface Notification {
43
+ method: string;
44
+ params?: {
45
+ _meta?: { [key: string]: unknown };
46
+ [key: string]: unknown;
47
+ };
48
+ }
49
+
50
+ export interface Result {
51
+ _connectionId: ConnectionId;
52
+ _requestMethod: string;
53
+ [key: string]: unknown;
54
+ }
55
+
56
+ /**
57
+ * A uniquely identifying ID for a request in JSON-RPC.
58
+ */
59
+ export type RequestId = string | number;
60
+
61
+ /**
62
+ * A request that expects a response.
63
+ */
64
+ export interface JSONRPCRequest extends Request {
65
+ jsonrpc: typeof JSONRPC_VERSION;
66
+ id: RequestId;
67
+ }
68
+
69
+ /**
70
+ * A notification which does not expect a response.
71
+ */
72
+ export interface JSONRPCNotification extends Notification {
73
+ jsonrpc: typeof JSONRPC_VERSION;
74
+ }
75
+
76
+ /**
77
+ * A successful (non-error) response to a request.
78
+ */
79
+ export interface JSONRPCResponse {
80
+ jsonrpc: typeof JSONRPC_VERSION;
81
+ id: RequestId;
82
+ result: Result;
83
+ }
84
+
85
+ // Standard JSON-RPC error codes
86
+ export const PARSE_ERROR = -32700;
87
+ export const INVALID_REQUEST = -32600;
88
+ export const METHOD_NOT_FOUND = -32601;
89
+ export const INVALID_PARAMS = -32602;
90
+ export const INTERNAL_ERROR = -32603;
91
+
92
+ /**
93
+ * A response to a request that indicates an error occurred.
94
+ */
95
+ export interface JSONRPCError {
96
+ jsonrpc: typeof JSONRPC_VERSION;
97
+ id: RequestId;
98
+ error: {
99
+ /**
100
+ * The error type that occurred.
101
+ */
102
+ code: number;
103
+ /**
104
+ * A short description of the error. The message SHOULD be limited to a concise single sentence.
105
+ */
106
+ message: string;
107
+ /**
108
+ * Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.).
109
+ */
110
+ data?: unknown;
111
+ };
112
+ }
113
+
114
+ /* Empty result */
115
+ /**
116
+ * A response that indicates success but carries no data.
117
+ */
118
+ export type EmptyResult = Result;
119
+
120
+ export interface oRequest extends JSONRPCRequest {}
121
+ export interface oResponse extends JSONRPCResponse {}
122
+
123
+ export interface oAddress {
124
+ transports: string[];
125
+ protocol: string;
126
+ }
127
+
128
+
129
+ export interface oDependency {
130
+ address: string;
131
+ version?: string;
132
+ method?: string;
133
+ parameters?: oParameter[];
134
+ }
135
+
136
+
137
+
138
+
139
+
140
+
141
+ export interface oHandshakeRequest extends JSONRPCRequest {
142
+ method: oProtocolMethods.HANDSHAKE;
143
+ params: RequestParams & {
144
+ address: string;
145
+ };
146
+ }
147
+
148
+ export interface oHandshakeResponse extends JSONRPCResponse {
149
+ result: {
150
+ _connectionId: string;
151
+ _requestMethod: oProtocolMethods.HANDSHAKE;
152
+ dependencies: oDependency[];
153
+ parameters: oParameter[];
154
+ };
155
+ }
156
+
157
+
158
+
159
+
160
+ export interface oRouterRequest extends JSONRPCRequest {
161
+ method: oProtocolMethods.ROUTE;
162
+ params: RequestParams & {
163
+ address: string;
164
+ payload: {
165
+ [key: string]: unknown;
166
+ };
167
+ };
168
+ }
169
+
170
+ export interface oParameter {
171
+ name: string;
172
+ type: string;
173
+ value?: any;
174
+ description?: string;
175
+ required?: boolean;
176
+ }
177
+
178
+
179
+
180
+
181
+ export interface oRegistrationParams extends RequestParams {
182
+ transports: string[];
183
+ peerId: string;
184
+ address: string;
185
+ protocols: string[];
186
+ ttl?: number;
187
+ }
188
+
189
+ export interface oRegisterRequest extends oRequest {
190
+ method: oProtocolMethods.REGISTER;
191
+ params: oRegistrationParams;
192
+ }
193
+
package/package.json ADDED
@@ -0,0 +1,73 @@
1
+ {
2
+ "name": "@olane/o-protocol",
3
+ "version": "0.1.0",
4
+ "description": "oLane Protocol specification and protocol schema",
5
+ "license": "MIT",
6
+ "author": "oLane Inc. (https://olane.com)",
7
+ "main": "dist/index.js",
8
+ "module": "dist/index.js",
9
+ "browser": "dist/index.js",
10
+ "node": "dist/index.js",
11
+ "types": "dist/index.d.ts",
12
+ "exports": {
13
+ ".": {
14
+ "require": "./dist/index.js",
15
+ "import": "./dist/index.js",
16
+ "browser": "./dist/index.js",
17
+ "node": "./dist/index.js",
18
+ "default": "./dist/index.js",
19
+ "types": "./dist/index.d.ts"
20
+ }
21
+ },
22
+ "engines": {
23
+ "node": ">=20"
24
+ },
25
+ "prettier": {
26
+ "overrides": [
27
+ {
28
+ "files": "*.{md,mdx}",
29
+ "options": {
30
+ "proseWrap": "preserve"
31
+ }
32
+ }
33
+ ]
34
+ },
35
+ "repository": {
36
+ "type": "git",
37
+ "url": "https://github.com/olane-labs/o-protocol.git"
38
+ },
39
+ "scripts": {
40
+ "check": "npm run check:schema && npm run check:docs",
41
+ "check:schema": "npm run check:schema:ts && npm run check:schema:json",
42
+ "check:schema:ts": "tsc",
43
+ "check:schema:json": "for f in schema/*/schema.ts; do typescript-json-schema --defaultNumberType integer --required --skipLibCheck \"$f\" \"*\" | cat | cmp \"${f%ts}json\" - || exit 1; done",
44
+ "check:docs": "npm run check:docs:format && npm run check:docs:links",
45
+ "check:docs:format": "prettier --check \"**/*.{md,mdx}\"",
46
+ "check:docs:links": "cd docs && mintlify broken-links",
47
+ "generate:json": "for f in schema/*/schema.ts; do typescript-json-schema --defaultNumberType integer --required --skipLibCheck \"$f\" \"*\" -o \"${f%ts}json\"; done",
48
+ "format": "prettier --write \"**/*.{md,mdx}\"",
49
+ "serve:docs": "cd docs && mintlify dev",
50
+ "build": "rm -rf dist && mkdir dist && touch dist/schema.ts && webpack --config webpack.config.js && tsc"
51
+ },
52
+ "devDependencies": {
53
+ "@babel/core": "^7.27.4",
54
+ "@babel/preset-env": "^7.27.2",
55
+ "@babel/preset-react": "^7.27.1",
56
+ "@babel/preset-typescript": "^7.27.1",
57
+ "ajv": "^8.17.1",
58
+ "ajv-formats": "^3.0.1",
59
+ "babel-loader": "^10.0.0",
60
+ "glob": "^11.0.0",
61
+ "mintlify": "^4.0.468",
62
+ "prettier": "^3.4.2",
63
+ "ts-loader": "^9.5.2",
64
+ "tsx": "^4.19.1",
65
+ "typescript": "^5.6.2",
66
+ "typescript-json-schema": "^0.65.1",
67
+ "webpack": "^5.99.9",
68
+ "webpack-cli": "^6.0.1"
69
+ },
70
+ "resolutions": {
71
+ "fast-json-patch": "^3.1.1"
72
+ }
73
+ }
@@ -0,0 +1,159 @@
1
+ export const LATEST_PROTOCOL_VERSION = "1.0.0";
2
+
3
+ export enum oProtocolMethods {
4
+ HANDSHAKE = "handshake",
5
+ REGISTER = "register",
6
+ ROUTE = "route",
7
+ }
8
+ export interface oDependency {
9
+ address: string;
10
+ version: string;
11
+ parameters: {
12
+ [key: string]: unknown;
13
+ };
14
+ }
15
+ export const JSONRPC_VERSION = "2.0";
16
+
17
+ export type ConnectionId = string;
18
+
19
+ /**
20
+ * An opaque token used to represent a cursor for pagination.
21
+ */
22
+ export type Cursor = string;
23
+
24
+ export interface RequestParams {
25
+ _connectionId: ConnectionId;
26
+ _requestMethod: string;
27
+ [key: string]: unknown;
28
+ }
29
+
30
+ export interface Request {
31
+ method: string;
32
+ params: RequestParams;
33
+ }
34
+
35
+ export interface Notification {
36
+ method: string;
37
+ params?: {
38
+ _meta?: { [key: string]: unknown };
39
+ [key: string]: unknown;
40
+ };
41
+ }
42
+
43
+ export interface Result {
44
+ _connectionId: ConnectionId;
45
+ _requestMethod: string;
46
+ [key: string]: unknown;
47
+ }
48
+
49
+ /**
50
+ * A uniquely identifying ID for a request in JSON-RPC.
51
+ */
52
+ export type RequestId = string | number;
53
+
54
+ /**
55
+ * A request that expects a response.
56
+ */
57
+ export interface JSONRPCRequest extends Request {
58
+ jsonrpc: typeof JSONRPC_VERSION;
59
+ id: RequestId;
60
+ }
61
+
62
+ /**
63
+ * A notification which does not expect a response.
64
+ */
65
+ export interface JSONRPCNotification extends Notification {
66
+ jsonrpc: typeof JSONRPC_VERSION;
67
+ }
68
+
69
+ /**
70
+ * A successful (non-error) response to a request.
71
+ */
72
+ export interface JSONRPCResponse {
73
+ jsonrpc: typeof JSONRPC_VERSION;
74
+ id: RequestId;
75
+ result: Result;
76
+ }
77
+
78
+ // Standard JSON-RPC error codes
79
+ export const PARSE_ERROR = -32700;
80
+ export const INVALID_REQUEST = -32600;
81
+ export const METHOD_NOT_FOUND = -32601;
82
+ export const INVALID_PARAMS = -32602;
83
+ export const INTERNAL_ERROR = -32603;
84
+
85
+ /**
86
+ * A response to a request that indicates an error occurred.
87
+ */
88
+ export interface JSONRPCError {
89
+ jsonrpc: typeof JSONRPC_VERSION;
90
+ id: RequestId;
91
+ error: {
92
+ /**
93
+ * The error type that occurred.
94
+ */
95
+ code: number;
96
+ /**
97
+ * A short description of the error. The message SHOULD be limited to a concise single sentence.
98
+ */
99
+ message: string;
100
+ /**
101
+ * Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.).
102
+ */
103
+ data?: unknown;
104
+ };
105
+ }
106
+
107
+ /* Empty result */
108
+ /**
109
+ * A response that indicates success but carries no data.
110
+ */
111
+ export type EmptyResult = Result;
112
+
113
+ export interface oRequest extends JSONRPCRequest {}
114
+ export interface oResponse extends JSONRPCResponse {}
115
+
116
+ export interface oAddress {
117
+ transports: string[];
118
+ protocol: string;
119
+ }
120
+
121
+ export interface oRouterRequest extends JSONRPCRequest {
122
+ method: oProtocolMethods.ROUTE;
123
+ params: RequestParams & {
124
+ address: string;
125
+ payload: {
126
+ [key: string]: unknown;
127
+ };
128
+ };
129
+ }
130
+
131
+ export interface oHandshakeRequest extends JSONRPCRequest {
132
+ method: oProtocolMethods.HANDSHAKE;
133
+ params: RequestParams & {
134
+ address: string;
135
+ };
136
+ }
137
+
138
+ export interface oHandshakeResponse extends JSONRPCResponse {
139
+ result: {
140
+ _connectionId: string;
141
+ _requestMethod: oProtocolMethods.HANDSHAKE;
142
+ method: string;
143
+ dependencies: oDependency[];
144
+ parameters: any;
145
+ };
146
+ }
147
+
148
+ export interface oRegistrationParams extends RequestParams {
149
+ transports: string[];
150
+ peerId: string;
151
+ address: string;
152
+ protocols: string[];
153
+ ttl?: number;
154
+ }
155
+
156
+ export interface oRegisterRequest extends oRequest {
157
+ method: oProtocolMethods.REGISTER;
158
+ params: oRegistrationParams;
159
+ }
@@ -0,0 +1 @@
1
+ export * from './o-address';
@@ -0,0 +1,4 @@
1
+ export interface oAddress {
2
+ transports: string[];
3
+ protocol: string;
4
+ }
package/src/config.ts ADDED
@@ -0,0 +1 @@
1
+ export const LATEST_PROTOCOL_VERSION = '1.0.0';
@@ -0,0 +1 @@
1
+ export * from './o-dependency';
@@ -0,0 +1,8 @@
1
+ import { oParameter } from "../parameter";
2
+
3
+ export interface oDependency {
4
+ address: string;
5
+ version?: string;
6
+ method?: string;
7
+ parameters?: oParameter[];
8
+ }
@@ -0,0 +1 @@
1
+ export * from './o-protocol-methods.enum';
@@ -0,0 +1,8 @@
1
+ export enum oProtocolMethods {
2
+ HANDSHAKE = "handshake",
3
+ REGISTER = "register",
4
+ ROUTE = "route",
5
+ INDEX_NETWORK = "index_network",
6
+ INTENT = "intent",
7
+ INTENT_METHOD_CONFIGURATION = "intent_method_configuration",
8
+ }
@@ -0,0 +1 @@
1
+ export * from './o-handshake';
@@ -0,0 +1,24 @@
1
+ import { oParameter } from "../parameter";
2
+ import { oDependency } from "../dependency";
3
+ import { oProtocolMethods } from "../enums";
4
+ import {
5
+ JSONRPCRequest,
6
+ JSONRPCResponse,
7
+ RequestParams,
8
+ } from "../json-rpc/json-rpc";
9
+
10
+ export interface oHandshakeRequest extends JSONRPCRequest {
11
+ method: oProtocolMethods.HANDSHAKE;
12
+ params: RequestParams & {
13
+ address: string;
14
+ };
15
+ }
16
+
17
+ export interface oHandshakeResponse extends JSONRPCResponse {
18
+ result: {
19
+ _connectionId: string;
20
+ _requestMethod: oProtocolMethods.HANDSHAKE;
21
+ dependencies: oDependency[];
22
+ parameters: oParameter[];
23
+ };
24
+ }
package/src/index.ts ADDED
@@ -0,0 +1,10 @@
1
+ export * from "./address";
2
+ export * from "./dependency";
3
+ export * from "./enums";
4
+ export * from "./handshake";
5
+ export * from "./json-rpc";
6
+ export * from "./router";
7
+ export * from "./config";
8
+ export * from "./register";
9
+ export * from "./parameter";
10
+ export * from "./method";
@@ -0,0 +1 @@
1
+ export * from './json-rpc';
@@ -0,0 +1,100 @@
1
+ export const JSONRPC_VERSION = "2.0";
2
+
3
+ export type ConnectionId = string;
4
+
5
+ /**
6
+ * An opaque token used to represent a cursor for pagination.
7
+ */
8
+ export type Cursor = string;
9
+
10
+ export interface RequestParams {
11
+ _connectionId: ConnectionId;
12
+ _requestMethod: string;
13
+ [key: string]: unknown;
14
+ }
15
+
16
+ export interface Request {
17
+ method: string;
18
+ params: RequestParams;
19
+ }
20
+
21
+ export interface Notification {
22
+ method: string;
23
+ params?: {
24
+ _meta?: { [key: string]: unknown };
25
+ [key: string]: unknown;
26
+ };
27
+ }
28
+
29
+ export interface Result {
30
+ _connectionId: ConnectionId;
31
+ _requestMethod: string;
32
+ [key: string]: unknown;
33
+ }
34
+
35
+ /**
36
+ * A uniquely identifying ID for a request in JSON-RPC.
37
+ */
38
+ export type RequestId = string | number;
39
+
40
+ /**
41
+ * A request that expects a response.
42
+ */
43
+ export interface JSONRPCRequest extends Request {
44
+ jsonrpc: typeof JSONRPC_VERSION;
45
+ id: RequestId;
46
+ }
47
+
48
+ /**
49
+ * A notification which does not expect a response.
50
+ */
51
+ export interface JSONRPCNotification extends Notification {
52
+ jsonrpc: typeof JSONRPC_VERSION;
53
+ }
54
+
55
+ /**
56
+ * A successful (non-error) response to a request.
57
+ */
58
+ export interface JSONRPCResponse {
59
+ jsonrpc: typeof JSONRPC_VERSION;
60
+ id: RequestId;
61
+ result: Result;
62
+ }
63
+
64
+ // Standard JSON-RPC error codes
65
+ export const PARSE_ERROR = -32700;
66
+ export const INVALID_REQUEST = -32600;
67
+ export const METHOD_NOT_FOUND = -32601;
68
+ export const INVALID_PARAMS = -32602;
69
+ export const INTERNAL_ERROR = -32603;
70
+
71
+ /**
72
+ * A response to a request that indicates an error occurred.
73
+ */
74
+ export interface JSONRPCError {
75
+ jsonrpc: typeof JSONRPC_VERSION;
76
+ id: RequestId;
77
+ error: {
78
+ /**
79
+ * The error type that occurred.
80
+ */
81
+ code: number;
82
+ /**
83
+ * A short description of the error. The message SHOULD be limited to a concise single sentence.
84
+ */
85
+ message: string;
86
+ /**
87
+ * Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.).
88
+ */
89
+ data?: unknown;
90
+ };
91
+ }
92
+
93
+ /* Empty result */
94
+ /**
95
+ * A response that indicates success but carries no data.
96
+ */
97
+ export type EmptyResult = Result;
98
+
99
+ export interface oRequest extends JSONRPCRequest {}
100
+ export interface oResponse extends JSONRPCResponse {}
@@ -0,0 +1 @@
1
+ export * from "./o-method";
@@ -0,0 +1,9 @@
1
+ import { oDependency } from "../dependency/o-dependency";
2
+ import { oParameter } from "../parameter/o-parameter";
3
+
4
+ export interface oMethod {
5
+ name: string;
6
+ description: string;
7
+ parameters: oParameter[];
8
+ dependencies: oDependency[];
9
+ }
@@ -0,0 +1 @@
1
+ export * from "./o-parameter";
@@ -0,0 +1,7 @@
1
+ export interface oParameter {
2
+ name: string;
3
+ type: string;
4
+ value?: any;
5
+ description?: string;
6
+ required?: boolean;
7
+ }
@@ -0,0 +1 @@
1
+ export * from "./o-register";
@@ -0,0 +1,15 @@
1
+ import { oProtocolMethods } from "../enums";
2
+ import { oRequest, RequestParams } from "../json-rpc";
3
+
4
+ export interface oRegistrationParams extends RequestParams {
5
+ transports: string[];
6
+ peerId: string;
7
+ address: string;
8
+ protocols: string[];
9
+ ttl?: number;
10
+ }
11
+
12
+ export interface oRegisterRequest extends oRequest {
13
+ method: oProtocolMethods.REGISTER;
14
+ params: oRegistrationParams;
15
+ }
@@ -0,0 +1 @@
1
+ export * from './o-router';
@@ -0,0 +1,12 @@
1
+ import { RequestParams, JSONRPCRequest } from "../json-rpc";
2
+ import { oProtocolMethods } from "../enums";
3
+
4
+ export interface oRouterRequest extends JSONRPCRequest {
5
+ method: oProtocolMethods.ROUTE;
6
+ params: RequestParams & {
7
+ address: string;
8
+ payload: {
9
+ [key: string]: unknown;
10
+ };
11
+ };
12
+ }