@ark-us/wasmxjs 0.0.1

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 (219) hide show
  1. package/LICENSE +3 -0
  2. package/README.md +280 -0
  3. package/main/codegen/cosmos/base/abci/v1beta1/abci.js +887 -0
  4. package/main/codegen/cosmos/base/kv/v1beta1/kv.js +139 -0
  5. package/main/codegen/cosmos/base/query/v1beta1/pagination.js +157 -0
  6. package/main/codegen/cosmos/base/reflection/v1beta1/reflection.js +231 -0
  7. package/main/codegen/cosmos/base/reflection/v2alpha1/reflection.js +1479 -0
  8. package/main/codegen/cosmos/base/snapshots/v1beta1/snapshot.js +478 -0
  9. package/main/codegen/cosmos/base/store/v1beta1/commit_info.js +207 -0
  10. package/main/codegen/cosmos/base/store/v1beta1/listening.js +89 -0
  11. package/main/codegen/cosmos/base/tendermint/v1beta1/query.js +951 -0
  12. package/main/codegen/cosmos/base/tendermint/v1beta1/query.rpc.Service.js +117 -0
  13. package/main/codegen/cosmos/base/v1beta1/coin.js +223 -0
  14. package/main/codegen/cosmos/bundle.js +63 -0
  15. package/main/codegen/cosmos/rpc.query.js +55 -0
  16. package/main/codegen/extern.js +66 -0
  17. package/main/codegen/gogoproto/bundle.js +16 -0
  18. package/main/codegen/gogoproto/gogo.js +5 -0
  19. package/main/codegen/google/api/annotations.js +5 -0
  20. package/main/codegen/google/api/http.js +306 -0
  21. package/main/codegen/google/api/httpbody.js +102 -0
  22. package/main/codegen/google/bundle.js +26 -0
  23. package/main/codegen/google/protobuf/any.js +69 -0
  24. package/main/codegen/google/protobuf/descriptor.js +3429 -0
  25. package/main/codegen/google/protobuf/duration.js +69 -0
  26. package/main/codegen/google/protobuf/timestamp.js +69 -0
  27. package/main/codegen/helpers.js +170 -0
  28. package/main/codegen/index.js +93 -0
  29. package/main/codegen/tendermint/abci/types.js +3616 -0
  30. package/main/codegen/tendermint/bundle.js +37 -0
  31. package/main/codegen/tendermint/crypto/keys.js +69 -0
  32. package/main/codegen/tendermint/crypto/proof.js +372 -0
  33. package/main/codegen/tendermint/libs/bits/types.js +100 -0
  34. package/main/codegen/tendermint/p2p/types.js +322 -0
  35. package/main/codegen/tendermint/types/block.js +90 -0
  36. package/main/codegen/tendermint/types/evidence.js +335 -0
  37. package/main/codegen/tendermint/types/params.js +397 -0
  38. package/main/codegen/tendermint/types/types.js +1223 -0
  39. package/main/codegen/tendermint/types/validator.js +237 -0
  40. package/main/codegen/tendermint/version/types.js +126 -0
  41. package/main/codegen/wasmx/bundle.js +30 -0
  42. package/main/codegen/wasmx/client.js +65 -0
  43. package/main/codegen/wasmx/index.js +126 -0
  44. package/main/codegen/wasmx/rpc.query.js +65 -0
  45. package/main/codegen/wasmx/rpc.tx.js +44 -0
  46. package/main/codegen/wasmx/wasmx/contract.js +324 -0
  47. package/main/codegen/wasmx/wasmx/genesis.js +481 -0
  48. package/main/codegen/wasmx/wasmx/params.js +45 -0
  49. package/main/codegen/wasmx/wasmx/query.js +1187 -0
  50. package/main/codegen/wasmx/wasmx/query.rpc.Query.js +154 -0
  51. package/main/codegen/wasmx/wasmx/tx.amino.js +251 -0
  52. package/main/codegen/wasmx/wasmx/tx.js +937 -0
  53. package/main/codegen/wasmx/wasmx/tx.registry.js +213 -0
  54. package/main/codegen/wasmx/wasmx/tx.rpc.msg.js +85 -0
  55. package/main/index.js +16 -0
  56. package/module/codegen/cosmos/base/abci/v1beta1/abci.js +755 -0
  57. package/module/codegen/cosmos/base/kv/v1beta1/kv.js +110 -0
  58. package/module/codegen/cosmos/base/query/v1beta1/pagination.js +154 -0
  59. package/module/codegen/cosmos/base/reflection/v1beta1/reflection.js +183 -0
  60. package/module/codegen/cosmos/base/reflection/v2alpha1/reflection.js +1297 -0
  61. package/module/codegen/cosmos/base/snapshots/v1beta1/snapshot.js +439 -0
  62. package/module/codegen/cosmos/base/store/v1beta1/commit_info.js +179 -0
  63. package/module/codegen/cosmos/base/store/v1beta1/listening.js +86 -0
  64. package/module/codegen/cosmos/base/tendermint/v1beta1/query.js +866 -0
  65. package/module/codegen/cosmos/base/tendermint/v1beta1/query.rpc.Service.js +74 -0
  66. package/module/codegen/cosmos/base/v1beta1/coin.js +213 -0
  67. package/module/codegen/cosmos/bundle.js +52 -0
  68. package/module/codegen/cosmos/rpc.query.js +17 -0
  69. package/module/codegen/extern.js +30 -0
  70. package/module/codegen/gogoproto/bundle.js +5 -0
  71. package/module/codegen/gogoproto/gogo.js +1 -0
  72. package/module/codegen/google/api/annotations.js +1 -0
  73. package/module/codegen/google/api/http.js +264 -0
  74. package/module/codegen/google/api/httpbody.js +115 -0
  75. package/module/codegen/google/bundle.js +15 -0
  76. package/module/codegen/google/protobuf/any.js +140 -0
  77. package/module/codegen/google/protobuf/descriptor.js +2801 -0
  78. package/module/codegen/google/protobuf/duration.js +119 -0
  79. package/module/codegen/google/protobuf/timestamp.js +143 -0
  80. package/module/codegen/helpers.js +140 -0
  81. package/module/codegen/index.js +14 -0
  82. package/module/codegen/tendermint/abci/types.js +3305 -0
  83. package/module/codegen/tendermint/bundle.js +26 -0
  84. package/module/codegen/tendermint/crypto/keys.js +60 -0
  85. package/module/codegen/tendermint/crypto/proof.js +320 -0
  86. package/module/codegen/tendermint/libs/bits/types.js +71 -0
  87. package/module/codegen/tendermint/p2p/types.js +305 -0
  88. package/module/codegen/tendermint/types/block.js +79 -0
  89. package/module/codegen/tendermint/types/evidence.js +285 -0
  90. package/module/codegen/tendermint/types/params.js +363 -0
  91. package/module/codegen/tendermint/types/types.js +1149 -0
  92. package/module/codegen/tendermint/types/validator.js +204 -0
  93. package/module/codegen/tendermint/version/types.js +119 -0
  94. package/module/codegen/wasmx/bundle.js +19 -0
  95. package/module/codegen/wasmx/client.js +36 -0
  96. package/module/codegen/wasmx/index.js +11 -0
  97. package/module/codegen/wasmx/rpc.query.js +20 -0
  98. package/module/codegen/wasmx/rpc.tx.js +7 -0
  99. package/module/codegen/wasmx/wasmx/contract.js +291 -0
  100. package/module/codegen/wasmx/wasmx/genesis.js +386 -0
  101. package/module/codegen/wasmx/wasmx/params.js +36 -0
  102. package/module/codegen/wasmx/wasmx/query.js +1052 -0
  103. package/module/codegen/wasmx/wasmx/query.rpc.Query.js +101 -0
  104. package/module/codegen/wasmx/wasmx/tx.amino.js +236 -0
  105. package/module/codegen/wasmx/wasmx/tx.js +815 -0
  106. package/module/codegen/wasmx/wasmx/tx.registry.js +199 -0
  107. package/module/codegen/wasmx/wasmx/tx.rpc.msg.js +47 -0
  108. package/module/index.js +1 -0
  109. package/package.json +88 -0
  110. package/src/codegen/cosmos/base/abci/v1beta1/abci.ts +1254 -0
  111. package/src/codegen/cosmos/base/kv/v1beta1/kv.ts +156 -0
  112. package/src/codegen/cosmos/base/query/v1beta1/pagination.ts +314 -0
  113. package/src/codegen/cosmos/base/reflection/v1beta1/reflection.ts +280 -0
  114. package/src/codegen/cosmos/base/reflection/v2alpha1/reflection.ts +2079 -0
  115. package/src/codegen/cosmos/base/snapshots/v1beta1/snapshot.ts +641 -0
  116. package/src/codegen/cosmos/base/store/v1beta1/commit_info.ts +269 -0
  117. package/src/codegen/cosmos/base/store/v1beta1/listening.ts +129 -0
  118. package/src/codegen/cosmos/base/tendermint/v1beta1/query.rpc.Service.ts +107 -0
  119. package/src/codegen/cosmos/base/tendermint/v1beta1/query.ts +1284 -0
  120. package/src/codegen/cosmos/base/v1beta1/coin.ts +318 -0
  121. package/src/codegen/cosmos/bundle.ts +52 -0
  122. package/src/codegen/cosmos/rpc.query.ts +19 -0
  123. package/src/codegen/extern.ts +33 -0
  124. package/src/codegen/gogoproto/bundle.ts +3 -0
  125. package/src/codegen/gogoproto/gogo.ts +1 -0
  126. package/src/codegen/google/api/annotations.ts +1 -0
  127. package/src/codegen/google/api/http.ts +945 -0
  128. package/src/codegen/google/api/httpbody.ts +200 -0
  129. package/src/codegen/google/bundle.ts +18 -0
  130. package/src/codegen/google/protobuf/any.ts +305 -0
  131. package/src/codegen/google/protobuf/descriptor.ts +5113 -0
  132. package/src/codegen/google/protobuf/duration.ts +229 -0
  133. package/src/codegen/google/protobuf/timestamp.ts +273 -0
  134. package/src/codegen/helpers.ts +240 -0
  135. package/src/codegen/index.ts +14 -0
  136. package/src/codegen/tendermint/abci/types.ts +4754 -0
  137. package/src/codegen/tendermint/bundle.ts +32 -0
  138. package/src/codegen/tendermint/crypto/keys.ts +83 -0
  139. package/src/codegen/tendermint/crypto/proof.ts +465 -0
  140. package/src/codegen/tendermint/libs/bits/types.ts +97 -0
  141. package/src/codegen/tendermint/p2p/types.ts +422 -0
  142. package/src/codegen/tendermint/types/block.ts +109 -0
  143. package/src/codegen/tendermint/types/evidence.ts +415 -0
  144. package/src/codegen/tendermint/types/params.ts +615 -0
  145. package/src/codegen/tendermint/types/types.ts +1663 -0
  146. package/src/codegen/tendermint/types/validator.ts +282 -0
  147. package/src/codegen/tendermint/version/types.ts +180 -0
  148. package/src/codegen/wasmx/bundle.ts +26 -0
  149. package/src/codegen/wasmx/client.ts +45 -0
  150. package/src/codegen/wasmx/index.ts +11 -0
  151. package/src/codegen/wasmx/rpc.query.ts +22 -0
  152. package/src/codegen/wasmx/rpc.tx.ts +10 -0
  153. package/src/codegen/wasmx/wasmx/contract.ts +470 -0
  154. package/src/codegen/wasmx/wasmx/genesis.ts +552 -0
  155. package/src/codegen/wasmx/wasmx/params.ts +50 -0
  156. package/src/codegen/wasmx/wasmx/query.rpc.Query.ts +149 -0
  157. package/src/codegen/wasmx/wasmx/query.ts +1668 -0
  158. package/src/codegen/wasmx/wasmx/tx.amino.ts +314 -0
  159. package/src/codegen/wasmx/wasmx/tx.registry.ts +230 -0
  160. package/src/codegen/wasmx/wasmx/tx.rpc.msg.ts +80 -0
  161. package/src/codegen/wasmx/wasmx/tx.ts +1331 -0
  162. package/src/index.ts +1 -0
  163. package/types/codegen/cosmos/base/abci/v1beta1/abci.d.ts +338 -0
  164. package/types/codegen/cosmos/base/kv/v1beta1/kv.d.ts +33 -0
  165. package/types/codegen/cosmos/base/query/v1beta1/pagination.d.ts +140 -0
  166. package/types/codegen/cosmos/base/reflection/v1beta1/reflection.d.ts +75 -0
  167. package/types/codegen/cosmos/base/reflection/v2alpha1/reflection.d.ts +565 -0
  168. package/types/codegen/cosmos/base/snapshots/v1beta1/snapshot.d.ts +135 -0
  169. package/types/codegen/cosmos/base/store/v1beta1/commit_info.d.ts +71 -0
  170. package/types/codegen/cosmos/base/store/v1beta1/listening.d.ts +38 -0
  171. package/types/codegen/cosmos/base/tendermint/v1beta1/query.d.ts +282 -0
  172. package/types/codegen/cosmos/base/tendermint/v1beta1/query.lcd.d.ts +14 -0
  173. package/types/codegen/cosmos/base/tendermint/v1beta1/query.rpc.Service.d.ts +36 -0
  174. package/types/codegen/cosmos/base/v1beta1/coin.d.ts +85 -0
  175. package/types/codegen/cosmos/bundle.d.ts +594 -0
  176. package/types/codegen/cosmos/lcd.d.ts +11 -0
  177. package/types/codegen/cosmos/rpc.query.d.ts +19 -0
  178. package/types/codegen/extern.d.ts +9 -0
  179. package/types/codegen/gogoproto/bundle.d.ts +1 -0
  180. package/types/codegen/gogoproto/gogo.d.ts +1 -0
  181. package/types/codegen/google/api/annotations.d.ts +1 -0
  182. package/types/codegen/google/api/http.d.ts +622 -0
  183. package/types/codegen/google/api/httpbody.d.ts +113 -0
  184. package/types/codegen/google/bundle.d.ts +274 -0
  185. package/types/codegen/google/protobuf/any.d.ts +238 -0
  186. package/types/codegen/google/protobuf/descriptor.d.ts +1835 -0
  187. package/types/codegen/google/protobuf/duration.d.ts +163 -0
  188. package/types/codegen/google/protobuf/timestamp.d.ts +207 -0
  189. package/types/codegen/helpers.d.ts +82 -0
  190. package/types/codegen/index.d.ts +13 -0
  191. package/types/codegen/tendermint/abci/types.d.ts +993 -0
  192. package/types/codegen/tendermint/bundle.d.ts +639 -0
  193. package/types/codegen/tendermint/crypto/keys.d.ts +18 -0
  194. package/types/codegen/tendermint/crypto/proof.d.ts +101 -0
  195. package/types/codegen/tendermint/libs/bits/types.d.ts +17 -0
  196. package/types/codegen/tendermint/p2p/types.d.ts +78 -0
  197. package/types/codegen/tendermint/types/block.d.ts +22 -0
  198. package/types/codegen/tendermint/types/evidence.d.ts +91 -0
  199. package/types/codegen/tendermint/types/params.d.ts +193 -0
  200. package/types/codegen/tendermint/types/types.d.ts +363 -0
  201. package/types/codegen/tendermint/types/validator.d.ts +54 -0
  202. package/types/codegen/tendermint/version/types.d.ts +52 -0
  203. package/types/codegen/wasmx/bundle.d.ts +614 -0
  204. package/types/codegen/wasmx/client.d.ts +151 -0
  205. package/types/codegen/wasmx/index.d.ts +11 -0
  206. package/types/codegen/wasmx/lcd.d.ts +14 -0
  207. package/types/codegen/wasmx/rpc.query.d.ts +32 -0
  208. package/types/codegen/wasmx/rpc.tx.d.ts +8 -0
  209. package/types/codegen/wasmx/wasmx/contract.d.ts +122 -0
  210. package/types/codegen/wasmx/wasmx/genesis.d.ts +107 -0
  211. package/types/codegen/wasmx/wasmx/params.d.ts +14 -0
  212. package/types/codegen/wasmx/wasmx/query.d.ts +451 -0
  213. package/types/codegen/wasmx/wasmx/query.lcd.d.ts +17 -0
  214. package/types/codegen/wasmx/wasmx/query.rpc.Query.d.ts +48 -0
  215. package/types/codegen/wasmx/wasmx/tx.amino.d.ts +110 -0
  216. package/types/codegen/wasmx/wasmx/tx.d.ts +332 -0
  217. package/types/codegen/wasmx/wasmx/tx.registry.d.ts +136 -0
  218. package/types/codegen/wasmx/wasmx/tx.rpc.msg.d.ts +33 -0
  219. package/types/index.d.ts +1 -0
@@ -0,0 +1,200 @@
1
+ import { Any, AnySDKType } from "../protobuf/any";
2
+ import * as _m0 from "protobufjs/minimal";
3
+ import { isSet, bytesFromBase64, base64FromBytes } from "../../helpers";
4
+ /**
5
+ * Message that represents an arbitrary HTTP body. It should only be used for
6
+ * payload formats that can't be represented as JSON, such as raw binary or
7
+ * an HTML page.
8
+ *
9
+ *
10
+ * This message can be used both in streaming and non-streaming API methods in
11
+ * the request as well as the response.
12
+ *
13
+ * It can be used as a top-level request field, which is convenient if one
14
+ * wants to extract parameters from either the URL or HTTP template into the
15
+ * request fields and also want access to the raw HTTP body.
16
+ *
17
+ * Example:
18
+ *
19
+ * message GetResourceRequest {
20
+ * // A unique request id.
21
+ * string request_id = 1;
22
+ *
23
+ * // The raw HTTP body is bound to this field.
24
+ * google.api.HttpBody http_body = 2;
25
+ * }
26
+ *
27
+ * service ResourceService {
28
+ * rpc GetResource(GetResourceRequest) returns (google.api.HttpBody);
29
+ * rpc UpdateResource(google.api.HttpBody) returns
30
+ * (google.protobuf.Empty);
31
+ * }
32
+ *
33
+ * Example with streaming methods:
34
+ *
35
+ * service CaldavService {
36
+ * rpc GetCalendar(stream google.api.HttpBody)
37
+ * returns (stream google.api.HttpBody);
38
+ * rpc UpdateCalendar(stream google.api.HttpBody)
39
+ * returns (stream google.api.HttpBody);
40
+ * }
41
+ *
42
+ * Use of this type only changes how the request and response bodies are
43
+ * handled, all other features will continue to work unchanged.
44
+ */
45
+
46
+ export interface HttpBody {
47
+ /** The HTTP Content-Type header value specifying the content type of the body. */
48
+ contentType: string;
49
+ /** The HTTP request/response body as raw binary. */
50
+
51
+ data: Uint8Array;
52
+ /**
53
+ * Application specific response metadata. Must be set in the first response
54
+ * for streaming APIs.
55
+ */
56
+
57
+ extensions: Any[];
58
+ }
59
+ /**
60
+ * Message that represents an arbitrary HTTP body. It should only be used for
61
+ * payload formats that can't be represented as JSON, such as raw binary or
62
+ * an HTML page.
63
+ *
64
+ *
65
+ * This message can be used both in streaming and non-streaming API methods in
66
+ * the request as well as the response.
67
+ *
68
+ * It can be used as a top-level request field, which is convenient if one
69
+ * wants to extract parameters from either the URL or HTTP template into the
70
+ * request fields and also want access to the raw HTTP body.
71
+ *
72
+ * Example:
73
+ *
74
+ * message GetResourceRequest {
75
+ * // A unique request id.
76
+ * string request_id = 1;
77
+ *
78
+ * // The raw HTTP body is bound to this field.
79
+ * google.api.HttpBody http_body = 2;
80
+ * }
81
+ *
82
+ * service ResourceService {
83
+ * rpc GetResource(GetResourceRequest) returns (google.api.HttpBody);
84
+ * rpc UpdateResource(google.api.HttpBody) returns
85
+ * (google.protobuf.Empty);
86
+ * }
87
+ *
88
+ * Example with streaming methods:
89
+ *
90
+ * service CaldavService {
91
+ * rpc GetCalendar(stream google.api.HttpBody)
92
+ * returns (stream google.api.HttpBody);
93
+ * rpc UpdateCalendar(stream google.api.HttpBody)
94
+ * returns (stream google.api.HttpBody);
95
+ * }
96
+ *
97
+ * Use of this type only changes how the request and response bodies are
98
+ * handled, all other features will continue to work unchanged.
99
+ */
100
+
101
+ export interface HttpBodySDKType {
102
+ /** The HTTP Content-Type header value specifying the content type of the body. */
103
+ content_type: string;
104
+ /** The HTTP request/response body as raw binary. */
105
+
106
+ data: Uint8Array;
107
+ /**
108
+ * Application specific response metadata. Must be set in the first response
109
+ * for streaming APIs.
110
+ */
111
+
112
+ extensions: AnySDKType[];
113
+ }
114
+
115
+ function createBaseHttpBody(): HttpBody {
116
+ return {
117
+ contentType: "",
118
+ data: new Uint8Array(),
119
+ extensions: []
120
+ };
121
+ }
122
+
123
+ export const HttpBody = {
124
+ encode(message: HttpBody, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
125
+ if (message.contentType !== "") {
126
+ writer.uint32(10).string(message.contentType);
127
+ }
128
+
129
+ if (message.data.length !== 0) {
130
+ writer.uint32(18).bytes(message.data);
131
+ }
132
+
133
+ for (const v of message.extensions) {
134
+ Any.encode(v!, writer.uint32(26).fork()).ldelim();
135
+ }
136
+
137
+ return writer;
138
+ },
139
+
140
+ decode(input: _m0.Reader | Uint8Array, length?: number): HttpBody {
141
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
142
+ let end = length === undefined ? reader.len : reader.pos + length;
143
+ const message = createBaseHttpBody();
144
+
145
+ while (reader.pos < end) {
146
+ const tag = reader.uint32();
147
+
148
+ switch (tag >>> 3) {
149
+ case 1:
150
+ message.contentType = reader.string();
151
+ break;
152
+
153
+ case 2:
154
+ message.data = reader.bytes();
155
+ break;
156
+
157
+ case 3:
158
+ message.extensions.push(Any.decode(reader, reader.uint32()));
159
+ break;
160
+
161
+ default:
162
+ reader.skipType(tag & 7);
163
+ break;
164
+ }
165
+ }
166
+
167
+ return message;
168
+ },
169
+
170
+ fromJSON(object: any): HttpBody {
171
+ return {
172
+ contentType: isSet(object.contentType) ? String(object.contentType) : "",
173
+ data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(),
174
+ extensions: Array.isArray(object?.extensions) ? object.extensions.map((e: any) => Any.fromJSON(e)) : []
175
+ };
176
+ },
177
+
178
+ toJSON(message: HttpBody): unknown {
179
+ const obj: any = {};
180
+ message.contentType !== undefined && (obj.contentType = message.contentType);
181
+ message.data !== undefined && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array()));
182
+
183
+ if (message.extensions) {
184
+ obj.extensions = message.extensions.map(e => e ? Any.toJSON(e) : undefined);
185
+ } else {
186
+ obj.extensions = [];
187
+ }
188
+
189
+ return obj;
190
+ },
191
+
192
+ fromPartial(object: Partial<HttpBody>): HttpBody {
193
+ const message = createBaseHttpBody();
194
+ message.contentType = object.contentType ?? "";
195
+ message.data = object.data ?? new Uint8Array();
196
+ message.extensions = object.extensions?.map(e => Any.fromPartial(e)) || [];
197
+ return message;
198
+ }
199
+
200
+ };
@@ -0,0 +1,18 @@
1
+ import * as _11 from "./api/annotations";
2
+ import * as _12 from "./api/http";
3
+ import * as _13 from "./api/httpbody";
4
+ import * as _14 from "./protobuf/any";
5
+ import * as _15 from "./protobuf/descriptor";
6
+ import * as _16 from "./protobuf/timestamp";
7
+ import * as _17 from "./protobuf/duration";
8
+ export namespace google {
9
+ export const api = { ..._11,
10
+ ..._12,
11
+ ..._13
12
+ };
13
+ export const protobuf = { ..._14,
14
+ ..._15,
15
+ ..._16,
16
+ ..._17
17
+ };
18
+ }
@@ -0,0 +1,305 @@
1
+ import * as _m0 from "protobufjs/minimal";
2
+ import { isSet, bytesFromBase64, base64FromBytes } from "../../helpers";
3
+ /**
4
+ * `Any` contains an arbitrary serialized protocol buffer message along with a
5
+ * URL that describes the type of the serialized message.
6
+ *
7
+ * Protobuf library provides support to pack/unpack Any values in the form
8
+ * of utility functions or additional generated methods of the Any type.
9
+ *
10
+ * Example 1: Pack and unpack a message in C++.
11
+ *
12
+ * Foo foo = ...;
13
+ * Any any;
14
+ * any.PackFrom(foo);
15
+ * ...
16
+ * if (any.UnpackTo(&foo)) {
17
+ * ...
18
+ * }
19
+ *
20
+ * Example 2: Pack and unpack a message in Java.
21
+ *
22
+ * Foo foo = ...;
23
+ * Any any = Any.pack(foo);
24
+ * ...
25
+ * if (any.is(Foo.class)) {
26
+ * foo = any.unpack(Foo.class);
27
+ * }
28
+ *
29
+ * Example 3: Pack and unpack a message in Python.
30
+ *
31
+ * foo = Foo(...)
32
+ * any = Any()
33
+ * any.Pack(foo)
34
+ * ...
35
+ * if any.Is(Foo.DESCRIPTOR):
36
+ * any.Unpack(foo)
37
+ * ...
38
+ *
39
+ * Example 4: Pack and unpack a message in Go
40
+ *
41
+ * foo := &pb.Foo{...}
42
+ * any, err := ptypes.MarshalAny(foo)
43
+ * ...
44
+ * foo := &pb.Foo{}
45
+ * if err := ptypes.UnmarshalAny(any, foo); err != nil {
46
+ * ...
47
+ * }
48
+ *
49
+ * The pack methods provided by protobuf library will by default use
50
+ * 'type.googleapis.com/full.type.name' as the type URL and the unpack
51
+ * methods only use the fully qualified type name after the last '/'
52
+ * in the type URL, for example "foo.bar.com/x/y.z" will yield type
53
+ * name "y.z".
54
+ *
55
+ *
56
+ * JSON
57
+ * ====
58
+ * The JSON representation of an `Any` value uses the regular
59
+ * representation of the deserialized, embedded message, with an
60
+ * additional field `@type` which contains the type URL. Example:
61
+ *
62
+ * package google.profile;
63
+ * message Person {
64
+ * string first_name = 1;
65
+ * string last_name = 2;
66
+ * }
67
+ *
68
+ * {
69
+ * "@type": "type.googleapis.com/google.profile.Person",
70
+ * "firstName": <string>,
71
+ * "lastName": <string>
72
+ * }
73
+ *
74
+ * If the embedded message type is well-known and has a custom JSON
75
+ * representation, that representation will be embedded adding a field
76
+ * `value` which holds the custom JSON in addition to the `@type`
77
+ * field. Example (for message [google.protobuf.Duration][]):
78
+ *
79
+ * {
80
+ * "@type": "type.googleapis.com/google.protobuf.Duration",
81
+ * "value": "1.212s"
82
+ * }
83
+ */
84
+
85
+ export interface Any {
86
+ /**
87
+ * A URL/resource name that uniquely identifies the type of the serialized
88
+ * protocol buffer message. This string must contain at least
89
+ * one "/" character. The last segment of the URL's path must represent
90
+ * the fully qualified name of the type (as in
91
+ * `path/google.protobuf.Duration`). The name should be in a canonical form
92
+ * (e.g., leading "." is not accepted).
93
+ *
94
+ * In practice, teams usually precompile into the binary all types that they
95
+ * expect it to use in the context of Any. However, for URLs which use the
96
+ * scheme `http`, `https`, or no scheme, one can optionally set up a type
97
+ * server that maps type URLs to message definitions as follows:
98
+ *
99
+ * * If no scheme is provided, `https` is assumed.
100
+ * * An HTTP GET on the URL must yield a [google.protobuf.Type][]
101
+ * value in binary format, or produce an error.
102
+ * * Applications are allowed to cache lookup results based on the
103
+ * URL, or have them precompiled into a binary to avoid any
104
+ * lookup. Therefore, binary compatibility needs to be preserved
105
+ * on changes to types. (Use versioned type names to manage
106
+ * breaking changes.)
107
+ *
108
+ * Note: this functionality is not currently available in the official
109
+ * protobuf release, and it is not used for type URLs beginning with
110
+ * type.googleapis.com.
111
+ *
112
+ * Schemes other than `http`, `https` (or the empty scheme) might be
113
+ * used with implementation specific semantics.
114
+ */
115
+ typeUrl: string;
116
+ /** Must be a valid serialized protocol buffer of the above specified type. */
117
+
118
+ value: Uint8Array;
119
+ }
120
+ /**
121
+ * `Any` contains an arbitrary serialized protocol buffer message along with a
122
+ * URL that describes the type of the serialized message.
123
+ *
124
+ * Protobuf library provides support to pack/unpack Any values in the form
125
+ * of utility functions or additional generated methods of the Any type.
126
+ *
127
+ * Example 1: Pack and unpack a message in C++.
128
+ *
129
+ * Foo foo = ...;
130
+ * Any any;
131
+ * any.PackFrom(foo);
132
+ * ...
133
+ * if (any.UnpackTo(&foo)) {
134
+ * ...
135
+ * }
136
+ *
137
+ * Example 2: Pack and unpack a message in Java.
138
+ *
139
+ * Foo foo = ...;
140
+ * Any any = Any.pack(foo);
141
+ * ...
142
+ * if (any.is(Foo.class)) {
143
+ * foo = any.unpack(Foo.class);
144
+ * }
145
+ *
146
+ * Example 3: Pack and unpack a message in Python.
147
+ *
148
+ * foo = Foo(...)
149
+ * any = Any()
150
+ * any.Pack(foo)
151
+ * ...
152
+ * if any.Is(Foo.DESCRIPTOR):
153
+ * any.Unpack(foo)
154
+ * ...
155
+ *
156
+ * Example 4: Pack and unpack a message in Go
157
+ *
158
+ * foo := &pb.Foo{...}
159
+ * any, err := ptypes.MarshalAny(foo)
160
+ * ...
161
+ * foo := &pb.Foo{}
162
+ * if err := ptypes.UnmarshalAny(any, foo); err != nil {
163
+ * ...
164
+ * }
165
+ *
166
+ * The pack methods provided by protobuf library will by default use
167
+ * 'type.googleapis.com/full.type.name' as the type URL and the unpack
168
+ * methods only use the fully qualified type name after the last '/'
169
+ * in the type URL, for example "foo.bar.com/x/y.z" will yield type
170
+ * name "y.z".
171
+ *
172
+ *
173
+ * JSON
174
+ * ====
175
+ * The JSON representation of an `Any` value uses the regular
176
+ * representation of the deserialized, embedded message, with an
177
+ * additional field `@type` which contains the type URL. Example:
178
+ *
179
+ * package google.profile;
180
+ * message Person {
181
+ * string first_name = 1;
182
+ * string last_name = 2;
183
+ * }
184
+ *
185
+ * {
186
+ * "@type": "type.googleapis.com/google.profile.Person",
187
+ * "firstName": <string>,
188
+ * "lastName": <string>
189
+ * }
190
+ *
191
+ * If the embedded message type is well-known and has a custom JSON
192
+ * representation, that representation will be embedded adding a field
193
+ * `value` which holds the custom JSON in addition to the `@type`
194
+ * field. Example (for message [google.protobuf.Duration][]):
195
+ *
196
+ * {
197
+ * "@type": "type.googleapis.com/google.protobuf.Duration",
198
+ * "value": "1.212s"
199
+ * }
200
+ */
201
+
202
+ export interface AnySDKType {
203
+ /**
204
+ * A URL/resource name that uniquely identifies the type of the serialized
205
+ * protocol buffer message. This string must contain at least
206
+ * one "/" character. The last segment of the URL's path must represent
207
+ * the fully qualified name of the type (as in
208
+ * `path/google.protobuf.Duration`). The name should be in a canonical form
209
+ * (e.g., leading "." is not accepted).
210
+ *
211
+ * In practice, teams usually precompile into the binary all types that they
212
+ * expect it to use in the context of Any. However, for URLs which use the
213
+ * scheme `http`, `https`, or no scheme, one can optionally set up a type
214
+ * server that maps type URLs to message definitions as follows:
215
+ *
216
+ * * If no scheme is provided, `https` is assumed.
217
+ * * An HTTP GET on the URL must yield a [google.protobuf.Type][]
218
+ * value in binary format, or produce an error.
219
+ * * Applications are allowed to cache lookup results based on the
220
+ * URL, or have them precompiled into a binary to avoid any
221
+ * lookup. Therefore, binary compatibility needs to be preserved
222
+ * on changes to types. (Use versioned type names to manage
223
+ * breaking changes.)
224
+ *
225
+ * Note: this functionality is not currently available in the official
226
+ * protobuf release, and it is not used for type URLs beginning with
227
+ * type.googleapis.com.
228
+ *
229
+ * Schemes other than `http`, `https` (or the empty scheme) might be
230
+ * used with implementation specific semantics.
231
+ */
232
+ type_url: string;
233
+ /** Must be a valid serialized protocol buffer of the above specified type. */
234
+
235
+ value: Uint8Array;
236
+ }
237
+
238
+ function createBaseAny(): Any {
239
+ return {
240
+ typeUrl: "",
241
+ value: new Uint8Array()
242
+ };
243
+ }
244
+
245
+ export const Any = {
246
+ encode(message: Any, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
247
+ if (message.typeUrl !== "") {
248
+ writer.uint32(10).string(message.typeUrl);
249
+ }
250
+
251
+ if (message.value.length !== 0) {
252
+ writer.uint32(18).bytes(message.value);
253
+ }
254
+
255
+ return writer;
256
+ },
257
+
258
+ decode(input: _m0.Reader | Uint8Array, length?: number): Any {
259
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
260
+ let end = length === undefined ? reader.len : reader.pos + length;
261
+ const message = createBaseAny();
262
+
263
+ while (reader.pos < end) {
264
+ const tag = reader.uint32();
265
+
266
+ switch (tag >>> 3) {
267
+ case 1:
268
+ message.typeUrl = reader.string();
269
+ break;
270
+
271
+ case 2:
272
+ message.value = reader.bytes();
273
+ break;
274
+
275
+ default:
276
+ reader.skipType(tag & 7);
277
+ break;
278
+ }
279
+ }
280
+
281
+ return message;
282
+ },
283
+
284
+ fromJSON(object: any): Any {
285
+ return {
286
+ typeUrl: isSet(object.typeUrl) ? String(object.typeUrl) : "",
287
+ value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array()
288
+ };
289
+ },
290
+
291
+ toJSON(message: Any): unknown {
292
+ const obj: any = {};
293
+ message.typeUrl !== undefined && (obj.typeUrl = message.typeUrl);
294
+ message.value !== undefined && (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array()));
295
+ return obj;
296
+ },
297
+
298
+ fromPartial(object: Partial<Any>): Any {
299
+ const message = createBaseAny();
300
+ message.typeUrl = object.typeUrl ?? "";
301
+ message.value = object.value ?? new Uint8Array();
302
+ return message;
303
+ }
304
+
305
+ };