blue-js-sdk 2.0.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.
- package/CHANGELOG.md +446 -0
- package/LICENSE +21 -0
- package/README.md +75 -0
- package/ai-path/ADMIN-ELEVATION.md +116 -0
- package/ai-path/AI-MANIFESTO.md +185 -0
- package/ai-path/BREAKING.md +74 -0
- package/ai-path/CHECKLIST.md +619 -0
- package/ai-path/CONNECTION-STEPS.md +724 -0
- package/ai-path/DECISION-TREE.md +378 -0
- package/ai-path/DEPENDENCIES.md +459 -0
- package/ai-path/E2E-FLOW.md +1555 -0
- package/ai-path/FAILURES.md +403 -0
- package/ai-path/GUIDE.md +1217 -0
- package/ai-path/README.md +558 -0
- package/ai-path/SPLIT-TUNNEL.md +266 -0
- package/ai-path/cli.js +535 -0
- package/ai-path/connect.js +884 -0
- package/ai-path/discover.js +178 -0
- package/ai-path/environment.js +266 -0
- package/ai-path/errors.js +86 -0
- package/ai-path/examples/autonomous-agent.mjs +220 -0
- package/ai-path/examples/multi-region.mjs +174 -0
- package/ai-path/examples/one-shot.mjs +31 -0
- package/ai-path/index.js +60 -0
- package/ai-path/pricing.js +136 -0
- package/ai-path/recommend.js +413 -0
- package/ai-path/run-admin.vbs +25 -0
- package/ai-path/setup.js +291 -0
- package/ai-path/wallet.js +137 -0
- package/app-helpers.js +363 -0
- package/app-settings.js +95 -0
- package/app-types.js +267 -0
- package/audit.js +847 -0
- package/batch.js +293 -0
- package/bin/setup.js +376 -0
- package/chain/authz.js +109 -0
- package/chain/broadcast.js +472 -0
- package/chain/client.js +160 -0
- package/chain/fee-grants.js +305 -0
- package/chain/index.js +891 -0
- package/chain/lcd.js +313 -0
- package/chain/queries.js +547 -0
- package/chain/rpc.js +408 -0
- package/chain/wallet.js +141 -0
- package/cli/config.js +143 -0
- package/cli/index.js +463 -0
- package/cli/output.js +182 -0
- package/cli.js +491 -0
- package/client/index.js +251 -0
- package/client.js +271 -0
- package/config/index.js +255 -0
- package/connection/connect.js +849 -0
- package/connection/disconnect.js +180 -0
- package/connection/discovery.js +321 -0
- package/connection/index.js +76 -0
- package/connection/proxy.js +148 -0
- package/connection/resilience.js +428 -0
- package/connection/security.js +232 -0
- package/connection/state.js +369 -0
- package/connection/tunnel.js +691 -0
- package/consumer.js +132 -0
- package/cosmjs-setup.js +1884 -0
- package/defaults.js +366 -0
- package/disk-cache.js +107 -0
- package/dist/client.d.ts +108 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +400 -0
- package/dist/client.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/errors/index.js +112 -0
- package/errors.js +218 -0
- package/examples/README.md +64 -0
- package/examples/connect-direct.mjs +106 -0
- package/examples/connect-plan.mjs +125 -0
- package/examples/error-handling.mjs +109 -0
- package/examples/query-nodes.mjs +94 -0
- package/examples/wallet-basics.mjs +61 -0
- package/generated/amino/amino.ts +9 -0
- package/generated/cosmos/base/v1beta1/coin.ts +365 -0
- package/generated/cosmos_proto/cosmos.ts +323 -0
- package/generated/gogoproto/gogo.ts +9 -0
- package/generated/google/protobuf/descriptor.ts +7601 -0
- package/generated/google/protobuf/duration.ts +208 -0
- package/generated/google/protobuf/timestamp.ts +238 -0
- package/generated/sentinel/lease/v1/events.ts +924 -0
- package/generated/sentinel/lease/v1/lease.ts +292 -0
- package/generated/sentinel/lease/v1/msg.ts +949 -0
- package/generated/sentinel/lease/v1/params.ts +164 -0
- package/generated/sentinel/node/v3/events.ts +881 -0
- package/generated/sentinel/node/v3/msg.ts +1002 -0
- package/generated/sentinel/node/v3/node.ts +263 -0
- package/generated/sentinel/node/v3/params.ts +183 -0
- package/generated/sentinel/plan/v3/events.ts +675 -0
- package/generated/sentinel/plan/v3/msg.ts +1191 -0
- package/generated/sentinel/plan/v3/plan.ts +283 -0
- package/generated/sentinel/provider/v2/events.ts +171 -0
- package/generated/sentinel/provider/v2/msg.ts +480 -0
- package/generated/sentinel/provider/v2/params.ts +131 -0
- package/generated/sentinel/provider/v2/provider.ts +246 -0
- package/generated/sentinel/session/v3/events.ts +480 -0
- package/generated/sentinel/session/v3/msg.ts +616 -0
- package/generated/sentinel/session/v3/params.ts +260 -0
- package/generated/sentinel/session/v3/proof.ts +180 -0
- package/generated/sentinel/session/v3/session.ts +384 -0
- package/generated/sentinel/subscription/v3/events.ts +1181 -0
- package/generated/sentinel/subscription/v3/msg.ts +1305 -0
- package/generated/sentinel/subscription/v3/params.ts +167 -0
- package/generated/sentinel/subscription/v3/subscription.ts +315 -0
- package/generated/sentinel/types/v1/bandwidth.ts +124 -0
- package/generated/sentinel/types/v1/price.ts +149 -0
- package/generated/sentinel/types/v1/renewal.ts +87 -0
- package/generated/sentinel/types/v1/status.ts +54 -0
- package/generated/typeRegistry.ts +27 -0
- package/index.js +486 -0
- package/node-connect.js +3015 -0
- package/operator.js +134 -0
- package/package.json +113 -0
- package/plan-operations.js +199 -0
- package/preflight.js +352 -0
- package/pricing/index.js +262 -0
- package/proto/amino/amino.proto +84 -0
- package/proto/cosmos/base/v1beta1/coin.proto +61 -0
- package/proto/cosmos_proto/cosmos.proto +112 -0
- package/proto/gogoproto/gogo.proto +145 -0
- package/proto/google/api/annotations.proto +31 -0
- package/proto/google/api/http.proto +370 -0
- package/proto/google/protobuf/any.proto +106 -0
- package/proto/google/protobuf/duration.proto +115 -0
- package/proto/google/protobuf/timestamp.proto +145 -0
- package/proto/sentinel/lease/v1/events.proto +52 -0
- package/proto/sentinel/lease/v1/genesis.proto +15 -0
- package/proto/sentinel/lease/v1/lease.proto +25 -0
- package/proto/sentinel/lease/v1/msg.proto +62 -0
- package/proto/sentinel/lease/v1/params.proto +17 -0
- package/proto/sentinel/node/v3/events.proto +50 -0
- package/proto/sentinel/node/v3/genesis.proto +15 -0
- package/proto/sentinel/node/v3/msg.proto +63 -0
- package/proto/sentinel/node/v3/node.proto +27 -0
- package/proto/sentinel/node/v3/params.proto +21 -0
- package/proto/sentinel/node/v3/querier.proto +63 -0
- package/proto/sentinel/plan/v3/events.proto +41 -0
- package/proto/sentinel/plan/v3/genesis.proto +21 -0
- package/proto/sentinel/plan/v3/msg.proto +83 -0
- package/proto/sentinel/plan/v3/plan.proto +32 -0
- package/proto/sentinel/plan/v3/querier.proto +53 -0
- package/proto/sentinel/provider/v2/events.proto +16 -0
- package/proto/sentinel/provider/v2/genesis.proto +15 -0
- package/proto/sentinel/provider/v2/msg.proto +35 -0
- package/proto/sentinel/provider/v2/params.proto +17 -0
- package/proto/sentinel/provider/v2/provider.proto +24 -0
- package/proto/sentinel/provider/v3/genesis.proto +15 -0
- package/proto/sentinel/provider/v3/params.proto +13 -0
- package/proto/sentinel/session/v3/events.proto +30 -0
- package/proto/sentinel/session/v3/genesis.proto +15 -0
- package/proto/sentinel/session/v3/msg.proto +50 -0
- package/proto/sentinel/session/v3/params.proto +25 -0
- package/proto/sentinel/session/v3/proof.proto +25 -0
- package/proto/sentinel/session/v3/querier.proto +100 -0
- package/proto/sentinel/session/v3/session.proto +50 -0
- package/proto/sentinel/subscription/v2/allocation.proto +21 -0
- package/proto/sentinel/subscription/v2/payout.proto +22 -0
- package/proto/sentinel/subscription/v3/events.proto +65 -0
- package/proto/sentinel/subscription/v3/genesis.proto +17 -0
- package/proto/sentinel/subscription/v3/msg.proto +83 -0
- package/proto/sentinel/subscription/v3/params.proto +21 -0
- package/proto/sentinel/subscription/v3/subscription.proto +33 -0
- package/proto/sentinel/types/v1/bandwidth.proto +19 -0
- package/proto/sentinel/types/v1/price.proto +21 -0
- package/proto/sentinel/types/v1/renewal.proto +21 -0
- package/proto/sentinel/types/v1/status.proto +16 -0
- package/protocol/encoding.js +341 -0
- package/protocol/events.js +361 -0
- package/protocol/handshake.js +297 -0
- package/protocol/index.js +15 -0
- package/protocol/messages.js +346 -0
- package/protocol/plans.js +199 -0
- package/protocol/v2ray.js +268 -0
- package/protocol/v3.js +723 -0
- package/protocol/wireguard.js +125 -0
- package/security/index.js +132 -0
- package/session-manager.js +329 -0
- package/session-tracker.js +80 -0
- package/setup.js +376 -0
- package/speedtest/index.js +528 -0
- package/speedtest.js +567 -0
- package/src/client.ts +502 -0
- package/src/index.ts +20 -0
- package/state/index.js +347 -0
- package/state.js +516 -0
- package/test-all-chain-ops.js +493 -0
- package/test-all-logic.js +199 -0
- package/test-all-msg-types.js +292 -0
- package/test-every-connection.js +208 -0
- package/test-feegrant-connect.js +98 -0
- package/test-logic.js +148 -0
- package/test-mainnet.js +176 -0
- package/test-plan-lifecycle.js +335 -0
- package/tls-trust.js +132 -0
- package/tsconfig.build.json +20 -0
- package/tsconfig.json +34 -0
- package/types/chain.d.ts +746 -0
- package/types/connection.d.ts +425 -0
- package/types/errors.d.ts +174 -0
- package/types/index.d.ts +1380 -0
- package/types/nodes.d.ts +187 -0
- package/types/pricing.d.ts +156 -0
- package/types/protocol.d.ts +332 -0
- package/types/session.d.ts +236 -0
- package/types/settings.d.ts +192 -0
- package/v3protocol.js +1053 -0
- package/wallet/index.js +153 -0
- package/wireguard.js +307 -0
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.6
|
|
4
|
+
// protoc v7.34.0
|
|
5
|
+
// source: cosmos_proto/cosmos.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
9
|
+
import { messageTypeRegistry } from "../typeRegistry";
|
|
10
|
+
|
|
11
|
+
export const protobufPackage = "cosmos_proto";
|
|
12
|
+
|
|
13
|
+
export enum ScalarType {
|
|
14
|
+
SCALAR_TYPE_UNSPECIFIED = 0,
|
|
15
|
+
SCALAR_TYPE_STRING = 1,
|
|
16
|
+
SCALAR_TYPE_BYTES = 2,
|
|
17
|
+
UNRECOGNIZED = -1,
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function scalarTypeFromJSON(object: any): ScalarType {
|
|
21
|
+
switch (object) {
|
|
22
|
+
case 0:
|
|
23
|
+
case "SCALAR_TYPE_UNSPECIFIED":
|
|
24
|
+
return ScalarType.SCALAR_TYPE_UNSPECIFIED;
|
|
25
|
+
case 1:
|
|
26
|
+
case "SCALAR_TYPE_STRING":
|
|
27
|
+
return ScalarType.SCALAR_TYPE_STRING;
|
|
28
|
+
case 2:
|
|
29
|
+
case "SCALAR_TYPE_BYTES":
|
|
30
|
+
return ScalarType.SCALAR_TYPE_BYTES;
|
|
31
|
+
case -1:
|
|
32
|
+
case "UNRECOGNIZED":
|
|
33
|
+
default:
|
|
34
|
+
return ScalarType.UNRECOGNIZED;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function scalarTypeToJSON(object: ScalarType): string {
|
|
39
|
+
switch (object) {
|
|
40
|
+
case ScalarType.SCALAR_TYPE_UNSPECIFIED:
|
|
41
|
+
return "SCALAR_TYPE_UNSPECIFIED";
|
|
42
|
+
case ScalarType.SCALAR_TYPE_STRING:
|
|
43
|
+
return "SCALAR_TYPE_STRING";
|
|
44
|
+
case ScalarType.SCALAR_TYPE_BYTES:
|
|
45
|
+
return "SCALAR_TYPE_BYTES";
|
|
46
|
+
case ScalarType.UNRECOGNIZED:
|
|
47
|
+
default:
|
|
48
|
+
return "UNRECOGNIZED";
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* InterfaceDescriptor describes an interface type to be used with
|
|
54
|
+
* accepts_interface and implements_interface and declared by declare_interface.
|
|
55
|
+
*/
|
|
56
|
+
export interface InterfaceDescriptor {
|
|
57
|
+
$type: "cosmos_proto.InterfaceDescriptor";
|
|
58
|
+
/**
|
|
59
|
+
* name is the name of the interface. It should be a short-name (without
|
|
60
|
+
* a period) such that the fully qualified name of the interface will be
|
|
61
|
+
* package.name, ex. for the package a.b and interface named C, the
|
|
62
|
+
* fully-qualified name will be a.b.C.
|
|
63
|
+
*/
|
|
64
|
+
name: string;
|
|
65
|
+
/**
|
|
66
|
+
* description is a human-readable description of the interface and its
|
|
67
|
+
* purpose.
|
|
68
|
+
*/
|
|
69
|
+
description: string;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* ScalarDescriptor describes an scalar type to be used with
|
|
74
|
+
* the scalar field option and declared by declare_scalar.
|
|
75
|
+
* Scalars extend simple protobuf built-in types with additional
|
|
76
|
+
* syntax and semantics, for instance to represent big integers.
|
|
77
|
+
* Scalars should ideally define an encoding such that there is only one
|
|
78
|
+
* valid syntactical representation for a given semantic meaning,
|
|
79
|
+
* i.e. the encoding should be deterministic.
|
|
80
|
+
*/
|
|
81
|
+
export interface ScalarDescriptor {
|
|
82
|
+
$type: "cosmos_proto.ScalarDescriptor";
|
|
83
|
+
/**
|
|
84
|
+
* name is the name of the scalar. It should be a short-name (without
|
|
85
|
+
* a period) such that the fully qualified name of the scalar will be
|
|
86
|
+
* package.name, ex. for the package a.b and scalar named C, the
|
|
87
|
+
* fully-qualified name will be a.b.C.
|
|
88
|
+
*/
|
|
89
|
+
name: string;
|
|
90
|
+
/**
|
|
91
|
+
* description is a human-readable description of the scalar and its
|
|
92
|
+
* encoding format. For instance a big integer or decimal scalar should
|
|
93
|
+
* specify precisely the expected encoding format.
|
|
94
|
+
*/
|
|
95
|
+
description: string;
|
|
96
|
+
/**
|
|
97
|
+
* field_type is the type of field with which this scalar can be used.
|
|
98
|
+
* Scalars can be used with one and only one type of field so that
|
|
99
|
+
* encoding standards and simple and clear. Currently only string and
|
|
100
|
+
* bytes fields are supported for scalars.
|
|
101
|
+
*/
|
|
102
|
+
fieldType: ScalarType[];
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function createBaseInterfaceDescriptor(): InterfaceDescriptor {
|
|
106
|
+
return { $type: "cosmos_proto.InterfaceDescriptor", name: "", description: "" };
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export const InterfaceDescriptor: MessageFns<InterfaceDescriptor, "cosmos_proto.InterfaceDescriptor"> = {
|
|
110
|
+
$type: "cosmos_proto.InterfaceDescriptor" as const,
|
|
111
|
+
|
|
112
|
+
encode(message: InterfaceDescriptor, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
113
|
+
if (message.name !== "") {
|
|
114
|
+
writer.uint32(10).string(message.name);
|
|
115
|
+
}
|
|
116
|
+
if (message.description !== "") {
|
|
117
|
+
writer.uint32(18).string(message.description);
|
|
118
|
+
}
|
|
119
|
+
return writer;
|
|
120
|
+
},
|
|
121
|
+
|
|
122
|
+
decode(input: BinaryReader | Uint8Array, length?: number): InterfaceDescriptor {
|
|
123
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
124
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
125
|
+
const message = createBaseInterfaceDescriptor();
|
|
126
|
+
while (reader.pos < end) {
|
|
127
|
+
const tag = reader.uint32();
|
|
128
|
+
switch (tag >>> 3) {
|
|
129
|
+
case 1: {
|
|
130
|
+
if (tag !== 10) {
|
|
131
|
+
break;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
message.name = reader.string();
|
|
135
|
+
continue;
|
|
136
|
+
}
|
|
137
|
+
case 2: {
|
|
138
|
+
if (tag !== 18) {
|
|
139
|
+
break;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
message.description = reader.string();
|
|
143
|
+
continue;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
147
|
+
break;
|
|
148
|
+
}
|
|
149
|
+
reader.skip(tag & 7);
|
|
150
|
+
}
|
|
151
|
+
return message;
|
|
152
|
+
},
|
|
153
|
+
|
|
154
|
+
fromJSON(object: any): InterfaceDescriptor {
|
|
155
|
+
return {
|
|
156
|
+
$type: InterfaceDescriptor.$type,
|
|
157
|
+
name: isSet(object.name) ? globalThis.String(object.name) : "",
|
|
158
|
+
description: isSet(object.description) ? globalThis.String(object.description) : "",
|
|
159
|
+
};
|
|
160
|
+
},
|
|
161
|
+
|
|
162
|
+
toJSON(message: InterfaceDescriptor): unknown {
|
|
163
|
+
const obj: any = {};
|
|
164
|
+
if (message.name !== "") {
|
|
165
|
+
obj.name = message.name;
|
|
166
|
+
}
|
|
167
|
+
if (message.description !== "") {
|
|
168
|
+
obj.description = message.description;
|
|
169
|
+
}
|
|
170
|
+
return obj;
|
|
171
|
+
},
|
|
172
|
+
|
|
173
|
+
create<I extends Exact<DeepPartial<InterfaceDescriptor>, I>>(base?: I): InterfaceDescriptor {
|
|
174
|
+
return InterfaceDescriptor.fromPartial(base ?? ({} as any));
|
|
175
|
+
},
|
|
176
|
+
fromPartial<I extends Exact<DeepPartial<InterfaceDescriptor>, I>>(object: I): InterfaceDescriptor {
|
|
177
|
+
const message = createBaseInterfaceDescriptor();
|
|
178
|
+
message.name = object.name ?? "";
|
|
179
|
+
message.description = object.description ?? "";
|
|
180
|
+
return message;
|
|
181
|
+
},
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
messageTypeRegistry.set(InterfaceDescriptor.$type, InterfaceDescriptor);
|
|
185
|
+
|
|
186
|
+
function createBaseScalarDescriptor(): ScalarDescriptor {
|
|
187
|
+
return { $type: "cosmos_proto.ScalarDescriptor", name: "", description: "", fieldType: [] };
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export const ScalarDescriptor: MessageFns<ScalarDescriptor, "cosmos_proto.ScalarDescriptor"> = {
|
|
191
|
+
$type: "cosmos_proto.ScalarDescriptor" as const,
|
|
192
|
+
|
|
193
|
+
encode(message: ScalarDescriptor, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
194
|
+
if (message.name !== "") {
|
|
195
|
+
writer.uint32(10).string(message.name);
|
|
196
|
+
}
|
|
197
|
+
if (message.description !== "") {
|
|
198
|
+
writer.uint32(18).string(message.description);
|
|
199
|
+
}
|
|
200
|
+
writer.uint32(26).fork();
|
|
201
|
+
for (const v of message.fieldType) {
|
|
202
|
+
writer.int32(v);
|
|
203
|
+
}
|
|
204
|
+
writer.join();
|
|
205
|
+
return writer;
|
|
206
|
+
},
|
|
207
|
+
|
|
208
|
+
decode(input: BinaryReader | Uint8Array, length?: number): ScalarDescriptor {
|
|
209
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
210
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
211
|
+
const message = createBaseScalarDescriptor();
|
|
212
|
+
while (reader.pos < end) {
|
|
213
|
+
const tag = reader.uint32();
|
|
214
|
+
switch (tag >>> 3) {
|
|
215
|
+
case 1: {
|
|
216
|
+
if (tag !== 10) {
|
|
217
|
+
break;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
message.name = reader.string();
|
|
221
|
+
continue;
|
|
222
|
+
}
|
|
223
|
+
case 2: {
|
|
224
|
+
if (tag !== 18) {
|
|
225
|
+
break;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
message.description = reader.string();
|
|
229
|
+
continue;
|
|
230
|
+
}
|
|
231
|
+
case 3: {
|
|
232
|
+
if (tag === 24) {
|
|
233
|
+
message.fieldType.push(reader.int32() as any);
|
|
234
|
+
|
|
235
|
+
continue;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
if (tag === 26) {
|
|
239
|
+
const end2 = reader.uint32() + reader.pos;
|
|
240
|
+
while (reader.pos < end2) {
|
|
241
|
+
message.fieldType.push(reader.int32() as any);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
continue;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
break;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
251
|
+
break;
|
|
252
|
+
}
|
|
253
|
+
reader.skip(tag & 7);
|
|
254
|
+
}
|
|
255
|
+
return message;
|
|
256
|
+
},
|
|
257
|
+
|
|
258
|
+
fromJSON(object: any): ScalarDescriptor {
|
|
259
|
+
return {
|
|
260
|
+
$type: ScalarDescriptor.$type,
|
|
261
|
+
name: isSet(object.name) ? globalThis.String(object.name) : "",
|
|
262
|
+
description: isSet(object.description) ? globalThis.String(object.description) : "",
|
|
263
|
+
fieldType: globalThis.Array.isArray(object?.fieldType)
|
|
264
|
+
? object.fieldType.map((e: any) => scalarTypeFromJSON(e))
|
|
265
|
+
: globalThis.Array.isArray(object?.field_type)
|
|
266
|
+
? object.field_type.map((e: any) => scalarTypeFromJSON(e))
|
|
267
|
+
: [],
|
|
268
|
+
};
|
|
269
|
+
},
|
|
270
|
+
|
|
271
|
+
toJSON(message: ScalarDescriptor): unknown {
|
|
272
|
+
const obj: any = {};
|
|
273
|
+
if (message.name !== "") {
|
|
274
|
+
obj.name = message.name;
|
|
275
|
+
}
|
|
276
|
+
if (message.description !== "") {
|
|
277
|
+
obj.description = message.description;
|
|
278
|
+
}
|
|
279
|
+
if (message.fieldType?.length) {
|
|
280
|
+
obj.fieldType = message.fieldType.map((e) => scalarTypeToJSON(e));
|
|
281
|
+
}
|
|
282
|
+
return obj;
|
|
283
|
+
},
|
|
284
|
+
|
|
285
|
+
create<I extends Exact<DeepPartial<ScalarDescriptor>, I>>(base?: I): ScalarDescriptor {
|
|
286
|
+
return ScalarDescriptor.fromPartial(base ?? ({} as any));
|
|
287
|
+
},
|
|
288
|
+
fromPartial<I extends Exact<DeepPartial<ScalarDescriptor>, I>>(object: I): ScalarDescriptor {
|
|
289
|
+
const message = createBaseScalarDescriptor();
|
|
290
|
+
message.name = object.name ?? "";
|
|
291
|
+
message.description = object.description ?? "";
|
|
292
|
+
message.fieldType = object.fieldType?.map((e) => e) || [];
|
|
293
|
+
return message;
|
|
294
|
+
},
|
|
295
|
+
};
|
|
296
|
+
|
|
297
|
+
messageTypeRegistry.set(ScalarDescriptor.$type, ScalarDescriptor);
|
|
298
|
+
|
|
299
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
300
|
+
|
|
301
|
+
export type DeepPartial<T> = T extends Builtin ? T
|
|
302
|
+
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
|
|
303
|
+
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
|
304
|
+
: T extends {} ? { [K in Exclude<keyof T, "$type">]?: DeepPartial<T[K]> }
|
|
305
|
+
: Partial<T>;
|
|
306
|
+
|
|
307
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
308
|
+
export type Exact<P, I extends P> = P extends Builtin ? P
|
|
309
|
+
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P> | "$type">]: never };
|
|
310
|
+
|
|
311
|
+
function isSet(value: any): boolean {
|
|
312
|
+
return value !== null && value !== undefined;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
export interface MessageFns<T, V extends string> {
|
|
316
|
+
readonly $type: V;
|
|
317
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
318
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
319
|
+
fromJSON(object: any): T;
|
|
320
|
+
toJSON(message: T): unknown;
|
|
321
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
322
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
323
|
+
}
|