@ark-us/wasmxjs 0.0.1 → 0.0.2

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 (81) hide show
  1. package/main/codegen/cosmos/bundle.js +4 -4
  2. package/main/codegen/wasmx/bundle.js +18 -8
  3. package/main/codegen/wasmx/client.js +4 -2
  4. package/main/codegen/wasmx/rpc.query.js +11 -4
  5. package/main/codegen/wasmx/rpc.tx.js +13 -4
  6. package/main/codegen/wasmx/wasmx/contract.js +66 -18
  7. package/main/codegen/wasmx/wasmx/genesis.js +44 -14
  8. package/main/codegen/wasmx/wasmx/tx.amino.js +106 -68
  9. package/main/codegen/wasmx/wasmx/tx.js +221 -12
  10. package/main/codegen/wasmx/wasmx/tx.registry.js +61 -1
  11. package/main/codegen/wasmx/wasmx/tx.rpc.msg.js +20 -0
  12. package/main/codegen/wasmx/websrv/genesis.js +59 -0
  13. package/main/codegen/wasmx/websrv/params.js +59 -0
  14. package/main/codegen/wasmx/websrv/proposal.js +167 -0
  15. package/main/codegen/wasmx/websrv/query.js +806 -0
  16. package/main/codegen/wasmx/websrv/query.rpc.Query.js +128 -0
  17. package/main/codegen/wasmx/websrv/tx.amino.js +71 -0
  18. package/main/codegen/wasmx/websrv/tx.js +312 -0
  19. package/main/codegen/wasmx/websrv/tx.registry.js +123 -0
  20. package/main/codegen/wasmx/websrv/tx.rpc.msg.js +55 -0
  21. package/module/codegen/cosmos/bundle.js +4 -4
  22. package/module/codegen/wasmx/bundle.js +18 -8
  23. package/module/codegen/wasmx/client.js +4 -2
  24. package/module/codegen/wasmx/rpc.query.js +2 -1
  25. package/module/codegen/wasmx/rpc.tx.js +2 -1
  26. package/module/codegen/wasmx/wasmx/contract.js +62 -16
  27. package/module/codegen/wasmx/wasmx/genesis.js +45 -15
  28. package/module/codegen/wasmx/wasmx/tx.amino.js +42 -0
  29. package/module/codegen/wasmx/wasmx/tx.js +211 -10
  30. package/module/codegen/wasmx/wasmx/tx.registry.js +62 -2
  31. package/module/codegen/wasmx/wasmx/tx.rpc.msg.js +13 -1
  32. package/module/codegen/wasmx/websrv/genesis.js +50 -0
  33. package/module/codegen/wasmx/websrv/params.js +50 -0
  34. package/module/codegen/wasmx/websrv/proposal.js +156 -0
  35. package/module/codegen/wasmx/websrv/query.js +739 -0
  36. package/module/codegen/wasmx/websrv/query.rpc.Query.js +83 -0
  37. package/module/codegen/wasmx/websrv/tx.amino.js +70 -0
  38. package/module/codegen/wasmx/websrv/tx.js +291 -0
  39. package/module/codegen/wasmx/websrv/tx.registry.js +109 -0
  40. package/module/codegen/wasmx/websrv/tx.rpc.msg.js +29 -0
  41. package/package.json +1 -1
  42. package/src/codegen/cosmos/bundle.ts +4 -4
  43. package/src/codegen/wasmx/bundle.ts +28 -9
  44. package/src/codegen/wasmx/client.ts +5 -2
  45. package/src/codegen/wasmx/rpc.query.ts +2 -1
  46. package/src/codegen/wasmx/rpc.tx.ts +2 -1
  47. package/src/codegen/wasmx/wasmx/contract.ts +90 -19
  48. package/src/codegen/wasmx/wasmx/genesis.ts +68 -18
  49. package/src/codegen/wasmx/wasmx/tx.amino.ts +57 -1
  50. package/src/codegen/wasmx/wasmx/tx.registry.ts +72 -2
  51. package/src/codegen/wasmx/wasmx/tx.rpc.msg.ts +21 -1
  52. package/src/codegen/wasmx/wasmx/tx.ts +302 -0
  53. package/src/codegen/wasmx/websrv/genesis.ts +70 -0
  54. package/src/codegen/wasmx/websrv/params.ts +69 -0
  55. package/src/codegen/wasmx/websrv/proposal.ts +254 -0
  56. package/src/codegen/wasmx/websrv/query.rpc.Query.ts +121 -0
  57. package/src/codegen/wasmx/websrv/query.ts +1151 -0
  58. package/src/codegen/wasmx/websrv/tx.amino.ts +94 -0
  59. package/src/codegen/wasmx/websrv/tx.registry.ts +125 -0
  60. package/src/codegen/wasmx/websrv/tx.rpc.msg.ts +44 -0
  61. package/src/codegen/wasmx/websrv/tx.ts +406 -0
  62. package/types/codegen/cosmos/bundle.d.ts +2 -2
  63. package/types/codegen/wasmx/bundle.d.ts +418 -5
  64. package/types/codegen/wasmx/client.d.ts +69 -12
  65. package/types/codegen/wasmx/rpc.query.d.ts +18 -9
  66. package/types/codegen/wasmx/rpc.tx.d.ts +1 -0
  67. package/types/codegen/wasmx/wasmx/contract.d.ts +19 -2
  68. package/types/codegen/wasmx/wasmx/genesis.d.ts +19 -5
  69. package/types/codegen/wasmx/wasmx/tx.amino.d.ts +25 -1
  70. package/types/codegen/wasmx/wasmx/tx.d.ts +72 -0
  71. package/types/codegen/wasmx/wasmx/tx.registry.d.ts +41 -1
  72. package/types/codegen/wasmx/wasmx/tx.rpc.msg.d.ts +7 -1
  73. package/types/codegen/wasmx/websrv/genesis.d.ts +17 -0
  74. package/types/codegen/wasmx/websrv/params.d.ts +16 -0
  75. package/types/codegen/wasmx/websrv/proposal.d.ts +65 -0
  76. package/types/codegen/wasmx/websrv/query.d.ts +315 -0
  77. package/types/codegen/wasmx/websrv/query.rpc.Query.d.ts +40 -0
  78. package/types/codegen/wasmx/websrv/tx.amino.d.ts +41 -0
  79. package/types/codegen/wasmx/websrv/tx.d.ts +90 -0
  80. package/types/codegen/wasmx/websrv/tx.registry.d.ts +76 -0
  81. package/types/codegen/wasmx/websrv/tx.rpc.msg.d.ts +18 -0
@@ -0,0 +1,254 @@
1
+ import * as _m0 from "protobufjs/minimal";
2
+ import { isSet } from "../../helpers";
3
+ /** RegisterRouteProposal is a gov Content type to register a web server route */
4
+
5
+ export interface RegisterRouteProposal {
6
+ /** title of the proposal */
7
+ title: string;
8
+ /** description of the proposal */
9
+
10
+ description: string;
11
+ /** Route path */
12
+
13
+ path: string;
14
+ /** Contract address in bech32 format */
15
+
16
+ contractAddress: string;
17
+ }
18
+ /** RegisterRouteProposal is a gov Content type to register a web server route */
19
+
20
+ export interface RegisterRouteProposalSDKType {
21
+ /** title of the proposal */
22
+ title: string;
23
+ /** description of the proposal */
24
+
25
+ description: string;
26
+ /** Route path */
27
+
28
+ path: string;
29
+ /** Contract address in bech32 format */
30
+
31
+ contract_address: string;
32
+ }
33
+ /**
34
+ * DisallowCosmosMessagesProposal is a gov Content type to remove a previously
35
+ * allowed Cosmos message or query to be called from the EVM
36
+ */
37
+
38
+ export interface DeregisterRouteProposal {
39
+ /** title of the proposal */
40
+ title: string;
41
+ /** description of the proposal */
42
+
43
+ description: string;
44
+ /** Route path */
45
+
46
+ path: string;
47
+ /** Contract address in bech32 format */
48
+
49
+ contractAddress: string;
50
+ }
51
+ /**
52
+ * DisallowCosmosMessagesProposal is a gov Content type to remove a previously
53
+ * allowed Cosmos message or query to be called from the EVM
54
+ */
55
+
56
+ export interface DeregisterRouteProposalSDKType {
57
+ /** title of the proposal */
58
+ title: string;
59
+ /** description of the proposal */
60
+
61
+ description: string;
62
+ /** Route path */
63
+
64
+ path: string;
65
+ /** Contract address in bech32 format */
66
+
67
+ contract_address: string;
68
+ }
69
+
70
+ function createBaseRegisterRouteProposal(): RegisterRouteProposal {
71
+ return {
72
+ title: "",
73
+ description: "",
74
+ path: "",
75
+ contractAddress: ""
76
+ };
77
+ }
78
+
79
+ export const RegisterRouteProposal = {
80
+ encode(message: RegisterRouteProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
81
+ if (message.title !== "") {
82
+ writer.uint32(10).string(message.title);
83
+ }
84
+
85
+ if (message.description !== "") {
86
+ writer.uint32(18).string(message.description);
87
+ }
88
+
89
+ if (message.path !== "") {
90
+ writer.uint32(26).string(message.path);
91
+ }
92
+
93
+ if (message.contractAddress !== "") {
94
+ writer.uint32(34).string(message.contractAddress);
95
+ }
96
+
97
+ return writer;
98
+ },
99
+
100
+ decode(input: _m0.Reader | Uint8Array, length?: number): RegisterRouteProposal {
101
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
102
+ let end = length === undefined ? reader.len : reader.pos + length;
103
+ const message = createBaseRegisterRouteProposal();
104
+
105
+ while (reader.pos < end) {
106
+ const tag = reader.uint32();
107
+
108
+ switch (tag >>> 3) {
109
+ case 1:
110
+ message.title = reader.string();
111
+ break;
112
+
113
+ case 2:
114
+ message.description = reader.string();
115
+ break;
116
+
117
+ case 3:
118
+ message.path = reader.string();
119
+ break;
120
+
121
+ case 4:
122
+ message.contractAddress = reader.string();
123
+ break;
124
+
125
+ default:
126
+ reader.skipType(tag & 7);
127
+ break;
128
+ }
129
+ }
130
+
131
+ return message;
132
+ },
133
+
134
+ fromJSON(object: any): RegisterRouteProposal {
135
+ return {
136
+ title: isSet(object.title) ? String(object.title) : "",
137
+ description: isSet(object.description) ? String(object.description) : "",
138
+ path: isSet(object.path) ? String(object.path) : "",
139
+ contractAddress: isSet(object.contractAddress) ? String(object.contractAddress) : ""
140
+ };
141
+ },
142
+
143
+ toJSON(message: RegisterRouteProposal): unknown {
144
+ const obj: any = {};
145
+ message.title !== undefined && (obj.title = message.title);
146
+ message.description !== undefined && (obj.description = message.description);
147
+ message.path !== undefined && (obj.path = message.path);
148
+ message.contractAddress !== undefined && (obj.contractAddress = message.contractAddress);
149
+ return obj;
150
+ },
151
+
152
+ fromPartial(object: Partial<RegisterRouteProposal>): RegisterRouteProposal {
153
+ const message = createBaseRegisterRouteProposal();
154
+ message.title = object.title ?? "";
155
+ message.description = object.description ?? "";
156
+ message.path = object.path ?? "";
157
+ message.contractAddress = object.contractAddress ?? "";
158
+ return message;
159
+ }
160
+
161
+ };
162
+
163
+ function createBaseDeregisterRouteProposal(): DeregisterRouteProposal {
164
+ return {
165
+ title: "",
166
+ description: "",
167
+ path: "",
168
+ contractAddress: ""
169
+ };
170
+ }
171
+
172
+ export const DeregisterRouteProposal = {
173
+ encode(message: DeregisterRouteProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
174
+ if (message.title !== "") {
175
+ writer.uint32(10).string(message.title);
176
+ }
177
+
178
+ if (message.description !== "") {
179
+ writer.uint32(18).string(message.description);
180
+ }
181
+
182
+ if (message.path !== "") {
183
+ writer.uint32(26).string(message.path);
184
+ }
185
+
186
+ if (message.contractAddress !== "") {
187
+ writer.uint32(34).string(message.contractAddress);
188
+ }
189
+
190
+ return writer;
191
+ },
192
+
193
+ decode(input: _m0.Reader | Uint8Array, length?: number): DeregisterRouteProposal {
194
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
195
+ let end = length === undefined ? reader.len : reader.pos + length;
196
+ const message = createBaseDeregisterRouteProposal();
197
+
198
+ while (reader.pos < end) {
199
+ const tag = reader.uint32();
200
+
201
+ switch (tag >>> 3) {
202
+ case 1:
203
+ message.title = reader.string();
204
+ break;
205
+
206
+ case 2:
207
+ message.description = reader.string();
208
+ break;
209
+
210
+ case 3:
211
+ message.path = reader.string();
212
+ break;
213
+
214
+ case 4:
215
+ message.contractAddress = reader.string();
216
+ break;
217
+
218
+ default:
219
+ reader.skipType(tag & 7);
220
+ break;
221
+ }
222
+ }
223
+
224
+ return message;
225
+ },
226
+
227
+ fromJSON(object: any): DeregisterRouteProposal {
228
+ return {
229
+ title: isSet(object.title) ? String(object.title) : "",
230
+ description: isSet(object.description) ? String(object.description) : "",
231
+ path: isSet(object.path) ? String(object.path) : "",
232
+ contractAddress: isSet(object.contractAddress) ? String(object.contractAddress) : ""
233
+ };
234
+ },
235
+
236
+ toJSON(message: DeregisterRouteProposal): unknown {
237
+ const obj: any = {};
238
+ message.title !== undefined && (obj.title = message.title);
239
+ message.description !== undefined && (obj.description = message.description);
240
+ message.path !== undefined && (obj.path = message.path);
241
+ message.contractAddress !== undefined && (obj.contractAddress = message.contractAddress);
242
+ return obj;
243
+ },
244
+
245
+ fromPartial(object: Partial<DeregisterRouteProposal>): DeregisterRouteProposal {
246
+ const message = createBaseDeregisterRouteProposal();
247
+ message.title = object.title ?? "";
248
+ message.description = object.description ?? "";
249
+ message.path = object.path ?? "";
250
+ message.contractAddress = object.contractAddress ?? "";
251
+ return message;
252
+ }
253
+
254
+ };
@@ -0,0 +1,121 @@
1
+ import { Rpc } from "../../helpers";
2
+ import * as _m0 from "protobufjs/minimal";
3
+ import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate";
4
+ import { QueryHttpRequestGet, QueryHttpResponseGet, QueryContractByRouteRequest, QueryContractByRouteResponse, QueryRouteByContractRequest, QueryRouteByContractResponse, QueryParamsRequest, QueryParamsResponse, QueryGetAllOauthClientsRequest, QueryGetAllOauthClientsResponse, QueryGetOauthClientRequest, QueryGetOauthClientResponse, QueryGetOauthClientsByOwnerRequest, QueryGetOauthClientsByOwnerResponse } from "./query";
5
+ /** Query defines the gRPC querier service. */
6
+
7
+ export interface Query {
8
+ /** HttpGet makes a get request to the webserver */
9
+ httpGet(request: QueryHttpRequestGet): Promise<QueryHttpResponseGet>;
10
+ /** ContractByRoute gets the contract controlling a given route */
11
+
12
+ contractByRoute(request: QueryContractByRouteRequest): Promise<QueryContractByRouteResponse>;
13
+ /** RouteByContract gets the route controlled by a given contract */
14
+
15
+ routeByContract(request: QueryRouteByContractRequest): Promise<QueryRouteByContractResponse>;
16
+ /** Parameters queries the parameters of the module. */
17
+
18
+ params(request?: QueryParamsRequest): Promise<QueryParamsResponse>;
19
+ /** GetAllClients gets all the registered client apps for the oauth service */
20
+
21
+ getAllOauthClients(request?: QueryGetAllOauthClientsRequest): Promise<QueryGetAllOauthClientsResponse>;
22
+ /** GetOauthClient gets the registered oauth client by client id */
23
+
24
+ getOauthClient(request: QueryGetOauthClientRequest): Promise<QueryGetOauthClientResponse>;
25
+ /** GetOauthClientsByOwner gets all the registered oauth client by an owner address */
26
+
27
+ getOauthClientsByOwner(request: QueryGetOauthClientsByOwnerRequest): Promise<QueryGetOauthClientsByOwnerResponse>;
28
+ }
29
+ export class QueryClientImpl implements Query {
30
+ private readonly rpc: Rpc;
31
+
32
+ constructor(rpc: Rpc) {
33
+ this.rpc = rpc;
34
+ this.httpGet = this.httpGet.bind(this);
35
+ this.contractByRoute = this.contractByRoute.bind(this);
36
+ this.routeByContract = this.routeByContract.bind(this);
37
+ this.params = this.params.bind(this);
38
+ this.getAllOauthClients = this.getAllOauthClients.bind(this);
39
+ this.getOauthClient = this.getOauthClient.bind(this);
40
+ this.getOauthClientsByOwner = this.getOauthClientsByOwner.bind(this);
41
+ }
42
+
43
+ httpGet(request: QueryHttpRequestGet): Promise<QueryHttpResponseGet> {
44
+ const data = QueryHttpRequestGet.encode(request).finish();
45
+ const promise = this.rpc.request("wasmx.websrv.Query", "HttpGet", data);
46
+ return promise.then(data => QueryHttpResponseGet.decode(new _m0.Reader(data)));
47
+ }
48
+
49
+ contractByRoute(request: QueryContractByRouteRequest): Promise<QueryContractByRouteResponse> {
50
+ const data = QueryContractByRouteRequest.encode(request).finish();
51
+ const promise = this.rpc.request("wasmx.websrv.Query", "ContractByRoute", data);
52
+ return promise.then(data => QueryContractByRouteResponse.decode(new _m0.Reader(data)));
53
+ }
54
+
55
+ routeByContract(request: QueryRouteByContractRequest): Promise<QueryRouteByContractResponse> {
56
+ const data = QueryRouteByContractRequest.encode(request).finish();
57
+ const promise = this.rpc.request("wasmx.websrv.Query", "RouteByContract", data);
58
+ return promise.then(data => QueryRouteByContractResponse.decode(new _m0.Reader(data)));
59
+ }
60
+
61
+ params(request: QueryParamsRequest = {}): Promise<QueryParamsResponse> {
62
+ const data = QueryParamsRequest.encode(request).finish();
63
+ const promise = this.rpc.request("wasmx.websrv.Query", "Params", data);
64
+ return promise.then(data => QueryParamsResponse.decode(new _m0.Reader(data)));
65
+ }
66
+
67
+ getAllOauthClients(request: QueryGetAllOauthClientsRequest = {
68
+ pagination: undefined
69
+ }): Promise<QueryGetAllOauthClientsResponse> {
70
+ const data = QueryGetAllOauthClientsRequest.encode(request).finish();
71
+ const promise = this.rpc.request("wasmx.websrv.Query", "GetAllOauthClients", data);
72
+ return promise.then(data => QueryGetAllOauthClientsResponse.decode(new _m0.Reader(data)));
73
+ }
74
+
75
+ getOauthClient(request: QueryGetOauthClientRequest): Promise<QueryGetOauthClientResponse> {
76
+ const data = QueryGetOauthClientRequest.encode(request).finish();
77
+ const promise = this.rpc.request("wasmx.websrv.Query", "GetOauthClient", data);
78
+ return promise.then(data => QueryGetOauthClientResponse.decode(new _m0.Reader(data)));
79
+ }
80
+
81
+ getOauthClientsByOwner(request: QueryGetOauthClientsByOwnerRequest): Promise<QueryGetOauthClientsByOwnerResponse> {
82
+ const data = QueryGetOauthClientsByOwnerRequest.encode(request).finish();
83
+ const promise = this.rpc.request("wasmx.websrv.Query", "GetOauthClientsByOwner", data);
84
+ return promise.then(data => QueryGetOauthClientsByOwnerResponse.decode(new _m0.Reader(data)));
85
+ }
86
+
87
+ }
88
+ export const createRpcQueryExtension = (base: QueryClient) => {
89
+ const rpc = createProtobufRpcClient(base);
90
+ const queryService = new QueryClientImpl(rpc);
91
+ return {
92
+ httpGet(request: QueryHttpRequestGet): Promise<QueryHttpResponseGet> {
93
+ return queryService.httpGet(request);
94
+ },
95
+
96
+ contractByRoute(request: QueryContractByRouteRequest): Promise<QueryContractByRouteResponse> {
97
+ return queryService.contractByRoute(request);
98
+ },
99
+
100
+ routeByContract(request: QueryRouteByContractRequest): Promise<QueryRouteByContractResponse> {
101
+ return queryService.routeByContract(request);
102
+ },
103
+
104
+ params(request?: QueryParamsRequest): Promise<QueryParamsResponse> {
105
+ return queryService.params(request);
106
+ },
107
+
108
+ getAllOauthClients(request?: QueryGetAllOauthClientsRequest): Promise<QueryGetAllOauthClientsResponse> {
109
+ return queryService.getAllOauthClients(request);
110
+ },
111
+
112
+ getOauthClient(request: QueryGetOauthClientRequest): Promise<QueryGetOauthClientResponse> {
113
+ return queryService.getOauthClient(request);
114
+ },
115
+
116
+ getOauthClientsByOwner(request: QueryGetOauthClientsByOwnerRequest): Promise<QueryGetOauthClientsByOwnerResponse> {
117
+ return queryService.getOauthClientsByOwner(request);
118
+ }
119
+
120
+ };
121
+ };