@gnolang/gnonative 4.0.0 → 4.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 (60) hide show
  1. package/Makefile +20 -3
  2. package/android/libs/gnocore-sources.jar +0 -0
  3. package/android/libs/gnocore.aar +0 -0
  4. package/android/src/main/java/land/gno/gnonative/GnonativeModule.kt +0 -13
  5. package/build/GoBridge.d.ts +0 -1
  6. package/build/GoBridge.d.ts.map +1 -1
  7. package/build/GoBridge.js +0 -3
  8. package/build/GoBridge.js.map +1 -1
  9. package/build/api/GnoNativeApi.d.ts +3 -3
  10. package/build/api/GnoNativeApi.d.ts.map +1 -1
  11. package/build/api/GnoNativeApi.js +15 -10
  12. package/build/api/GnoNativeApi.js.map +1 -1
  13. package/build/api/types.d.ts +2 -2
  14. package/build/api/types.d.ts.map +1 -1
  15. package/build/api/types.js.map +1 -1
  16. package/build/api/vendor/gnonativetypes_pb.d.ts +1513 -0
  17. package/build/api/vendor/gnonativetypes_pb.d.ts.map +1 -0
  18. package/build/api/vendor/gnonativetypes_pb.js +2506 -0
  19. package/build/api/vendor/gnonativetypes_pb.js.map +1 -0
  20. package/build/api/vendor/rpc_connect.d.ts +461 -0
  21. package/build/api/vendor/rpc_connect.d.ts.map +1 -0
  22. package/build/api/vendor/rpc_connect.js +465 -0
  23. package/build/api/vendor/rpc_connect.js.map +1 -0
  24. package/build/api/vendor/rpc_pb.d.ts +221 -0
  25. package/build/api/vendor/rpc_pb.d.ts.map +1 -0
  26. package/build/api/vendor/rpc_pb.js +277 -0
  27. package/build/api/vendor/rpc_pb.js.map +1 -0
  28. package/build/grpc/client.d.ts +1 -1
  29. package/build/grpc/client.d.ts.map +1 -1
  30. package/build/grpc/client.js +1 -1
  31. package/build/grpc/client.js.map +1 -1
  32. package/build/grpc/error.d.ts +1 -1
  33. package/build/grpc/error.d.ts.map +1 -1
  34. package/build/grpc/error.js +1 -1
  35. package/build/grpc/error.js.map +1 -1
  36. package/build/index.d.ts +2 -2
  37. package/build/index.d.ts.map +1 -1
  38. package/build/index.js +2 -2
  39. package/build/index.js.map +1 -1
  40. package/ios/Frameworks/GnoCore.xcframework/Info.plist +5 -5
  41. package/ios/Frameworks/GnoCore.xcframework/ios-arm64/GnoCore.framework/GnoCore +0 -0
  42. package/ios/Frameworks/GnoCore.xcframework/ios-arm64/GnoCore.framework/Headers/GnoGnonative.objc.h +0 -7
  43. package/ios/Frameworks/GnoCore.xcframework/ios-arm64/GnoCore.framework/Versions/A/GnoCore +0 -0
  44. package/ios/Frameworks/GnoCore.xcframework/ios-arm64/GnoCore.framework/Versions/A/Headers/GnoGnonative.objc.h +0 -7
  45. package/ios/Frameworks/GnoCore.xcframework/ios-arm64/GnoCore.framework/Versions/Current/GnoCore +0 -0
  46. package/ios/Frameworks/GnoCore.xcframework/ios-arm64/GnoCore.framework/Versions/Current/Headers/GnoGnonative.objc.h +0 -7
  47. package/ios/Frameworks/GnoCore.xcframework/ios-arm64_x86_64-simulator/GnoCore.framework/GnoCore +0 -0
  48. package/ios/Frameworks/GnoCore.xcframework/ios-arm64_x86_64-simulator/GnoCore.framework/Headers/GnoGnonative.objc.h +0 -7
  49. package/ios/GnonativeModule.swift +0 -12
  50. package/package.json +1 -3
  51. package/src/GoBridge.ts +0 -5
  52. package/src/api/GnoNativeApi.ts +31 -14
  53. package/src/api/types.ts +10 -3
  54. package/src/api/vendor/gnonativetypes_pb.ts +3074 -0
  55. package/src/api/vendor/rpc_connect.ts +467 -0
  56. package/src/api/vendor/rpc_pb.ts +321 -0
  57. package/src/grpc/client.ts +1 -1
  58. package/src/grpc/error.ts +2 -1
  59. package/src/index.ts +2 -2
  60. package/tsconfig.json +0 -1
@@ -0,0 +1,321 @@
1
+ // @generated by protoc-gen-es v1.7.2 with parameter "target=ts"
2
+ // @generated from file rpc.proto (package land.gno.gnonative.v1, syntax proto3)
3
+ /* eslint-disable */
4
+ // @ts-nocheck
5
+
6
+ import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf";
7
+ import { Message, proto3 } from "@bufbuild/protobuf";
8
+
9
+ /**
10
+ * The ErrCode enum defines errors for gRPC API functions. These are converted
11
+ * from the Go error types returned by gnoclient.
12
+ *
13
+ * ----------------
14
+ * Special errors
15
+ * ----------------
16
+ *
17
+ * @generated from enum land.gno.gnonative.v1.ErrCode
18
+ */
19
+ export enum ErrCode {
20
+ /**
21
+ * Undefined is the default value. It should never be set manually
22
+ *
23
+ * @generated from enum value: Undefined = 0;
24
+ */
25
+ Undefined = 0,
26
+
27
+ /**
28
+ * TODO indicates that you plan to create an error later
29
+ *
30
+ * @generated from enum value: TODO = 1;
31
+ */
32
+ TODO = 1,
33
+
34
+ /**
35
+ * ErrNotImplemented indicates that a method is not implemented yet
36
+ *
37
+ * @generated from enum value: ErrNotImplemented = 2;
38
+ */
39
+ ErrNotImplemented = 2,
40
+
41
+ /**
42
+ * ErrInternal indicates an unknown error (without Code), i.e. in gRPC
43
+ *
44
+ * @generated from enum value: ErrInternal = 3;
45
+ */
46
+ ErrInternal = 3,
47
+
48
+ /**
49
+ * @generated from enum value: ErrInvalidInput = 100;
50
+ */
51
+ ErrInvalidInput = 100,
52
+
53
+ /**
54
+ * @generated from enum value: ErrBridgeInterrupted = 101;
55
+ */
56
+ ErrBridgeInterrupted = 101,
57
+
58
+ /**
59
+ * @generated from enum value: ErrMissingInput = 102;
60
+ */
61
+ ErrMissingInput = 102,
62
+
63
+ /**
64
+ * @generated from enum value: ErrSerialization = 103;
65
+ */
66
+ ErrSerialization = 103,
67
+
68
+ /**
69
+ * @generated from enum value: ErrDeserialization = 104;
70
+ */
71
+ ErrDeserialization = 104,
72
+
73
+ /**
74
+ * @generated from enum value: ErrInitService = 105;
75
+ */
76
+ ErrInitService = 105,
77
+
78
+ /**
79
+ * @generated from enum value: ErrSetRemote = 106;
80
+ */
81
+ ErrSetRemote = 106,
82
+
83
+ /**
84
+ * @generated from enum value: ErrCryptoKeyTypeUnknown = 150;
85
+ */
86
+ ErrCryptoKeyTypeUnknown = 150,
87
+
88
+ /**
89
+ * ErrCryptoKeyNotFound indicates that the doesn't exist in the keybase
90
+ *
91
+ * @generated from enum value: ErrCryptoKeyNotFound = 151;
92
+ */
93
+ ErrCryptoKeyNotFound = 151,
94
+
95
+ /**
96
+ * ErrNoActiveAccount indicates that no account with the given address has been activated with ActivateAccount
97
+ *
98
+ * @generated from enum value: ErrNoActiveAccount = 152;
99
+ */
100
+ ErrNoActiveAccount = 152,
101
+
102
+ /**
103
+ * @generated from enum value: ErrRunGRPCServer = 153;
104
+ */
105
+ ErrRunGRPCServer = 153,
106
+
107
+ /**
108
+ * ErrDecryptionFailed indicates a decryption failure including a wrong password
109
+ *
110
+ * @generated from enum value: ErrDecryptionFailed = 154;
111
+ */
112
+ ErrDecryptionFailed = 154,
113
+
114
+ /**
115
+ * @generated from enum value: ErrTxDecode = 200;
116
+ */
117
+ ErrTxDecode = 200,
118
+
119
+ /**
120
+ * @generated from enum value: ErrInvalidSequence = 201;
121
+ */
122
+ ErrInvalidSequence = 201,
123
+
124
+ /**
125
+ * @generated from enum value: ErrUnauthorized = 202;
126
+ */
127
+ ErrUnauthorized = 202,
128
+
129
+ /**
130
+ * ErrInsufficientFunds indicates that there are insufficient funds to pay for fees
131
+ *
132
+ * @generated from enum value: ErrInsufficientFunds = 203;
133
+ */
134
+ ErrInsufficientFunds = 203,
135
+
136
+ /**
137
+ * ErrUnknownRequest indicates that the path of a realm function call is unrecognized
138
+ *
139
+ * @generated from enum value: ErrUnknownRequest = 204;
140
+ */
141
+ ErrUnknownRequest = 204,
142
+
143
+ /**
144
+ * ErrInvalidAddress indicates that an account address is blank or the bech32 can't be decoded
145
+ *
146
+ * @generated from enum value: ErrInvalidAddress = 205;
147
+ */
148
+ ErrInvalidAddress = 205,
149
+
150
+ /**
151
+ * ErrUnknownAddress indicates that the address is unknown on the blockchain
152
+ *
153
+ * @generated from enum value: ErrUnknownAddress = 206;
154
+ */
155
+ ErrUnknownAddress = 206,
156
+
157
+ /**
158
+ * ErrInvalidPubKey indicates that the public key was not found or has an invalid algorithm or format
159
+ *
160
+ * @generated from enum value: ErrInvalidPubKey = 207;
161
+ */
162
+ ErrInvalidPubKey = 207,
163
+
164
+ /**
165
+ * ErrInsufficientCoins indicates that the transaction has insufficient account funds to send
166
+ *
167
+ * @generated from enum value: ErrInsufficientCoins = 208;
168
+ */
169
+ ErrInsufficientCoins = 208,
170
+
171
+ /**
172
+ * ErrInvalidCoins indicates that the transaction Coins are not sorted, or don't have a
173
+ * positive amount, or the coin Denom contains upper case characters
174
+ *
175
+ * @generated from enum value: ErrInvalidCoins = 209;
176
+ */
177
+ ErrInvalidCoins = 209,
178
+
179
+ /**
180
+ * ErrInvalidGasWanted indicates that the transaction gas wanted is too large or otherwise invalid
181
+ *
182
+ * @generated from enum value: ErrInvalidGasWanted = 210;
183
+ */
184
+ ErrInvalidGasWanted = 210,
185
+
186
+ /**
187
+ * ErrOutOfGas indicates that the transaction doesn't have enough gas
188
+ *
189
+ * @generated from enum value: ErrOutOfGas = 211;
190
+ */
191
+ ErrOutOfGas = 211,
192
+
193
+ /**
194
+ * ErrMemoTooLarge indicates that the transaction memo is too large
195
+ *
196
+ * @generated from enum value: ErrMemoTooLarge = 212;
197
+ */
198
+ ErrMemoTooLarge = 212,
199
+
200
+ /**
201
+ * ErrInsufficientFee indicates that the gas fee is insufficient
202
+ *
203
+ * @generated from enum value: ErrInsufficientFee = 213;
204
+ */
205
+ ErrInsufficientFee = 213,
206
+
207
+ /**
208
+ * ErrTooManySignatures indicates that the transaction has too many signatures
209
+ *
210
+ * @generated from enum value: ErrTooManySignatures = 214;
211
+ */
212
+ ErrTooManySignatures = 214,
213
+
214
+ /**
215
+ * ErrNoSignatures indicates that the transaction has no signatures
216
+ *
217
+ * @generated from enum value: ErrNoSignatures = 215;
218
+ */
219
+ ErrNoSignatures = 215,
220
+
221
+ /**
222
+ * ErrGasOverflow indicates that an action results in a gas consumption unsigned integer overflow
223
+ *
224
+ * @generated from enum value: ErrGasOverflow = 216;
225
+ */
226
+ ErrGasOverflow = 216,
227
+
228
+ /**
229
+ * ErrInvalidPkgPath indicates that the package path is not recognized.
230
+ *
231
+ * @generated from enum value: ErrInvalidPkgPath = 217;
232
+ */
233
+ ErrInvalidPkgPath = 217,
234
+
235
+ /**
236
+ * @generated from enum value: ErrInvalidStmt = 218;
237
+ */
238
+ ErrInvalidStmt = 218,
239
+
240
+ /**
241
+ * @generated from enum value: ErrInvalidExpr = 219;
242
+ */
243
+ ErrInvalidExpr = 219,
244
+ }
245
+ // Retrieve enum metadata with: proto3.getEnumType(ErrCode)
246
+ proto3.util.setEnumType(ErrCode, "land.gno.gnonative.v1.ErrCode", [
247
+ { no: 0, name: "Undefined" },
248
+ { no: 1, name: "TODO" },
249
+ { no: 2, name: "ErrNotImplemented" },
250
+ { no: 3, name: "ErrInternal" },
251
+ { no: 100, name: "ErrInvalidInput" },
252
+ { no: 101, name: "ErrBridgeInterrupted" },
253
+ { no: 102, name: "ErrMissingInput" },
254
+ { no: 103, name: "ErrSerialization" },
255
+ { no: 104, name: "ErrDeserialization" },
256
+ { no: 105, name: "ErrInitService" },
257
+ { no: 106, name: "ErrSetRemote" },
258
+ { no: 150, name: "ErrCryptoKeyTypeUnknown" },
259
+ { no: 151, name: "ErrCryptoKeyNotFound" },
260
+ { no: 152, name: "ErrNoActiveAccount" },
261
+ { no: 153, name: "ErrRunGRPCServer" },
262
+ { no: 154, name: "ErrDecryptionFailed" },
263
+ { no: 200, name: "ErrTxDecode" },
264
+ { no: 201, name: "ErrInvalidSequence" },
265
+ { no: 202, name: "ErrUnauthorized" },
266
+ { no: 203, name: "ErrInsufficientFunds" },
267
+ { no: 204, name: "ErrUnknownRequest" },
268
+ { no: 205, name: "ErrInvalidAddress" },
269
+ { no: 206, name: "ErrUnknownAddress" },
270
+ { no: 207, name: "ErrInvalidPubKey" },
271
+ { no: 208, name: "ErrInsufficientCoins" },
272
+ { no: 209, name: "ErrInvalidCoins" },
273
+ { no: 210, name: "ErrInvalidGasWanted" },
274
+ { no: 211, name: "ErrOutOfGas" },
275
+ { no: 212, name: "ErrMemoTooLarge" },
276
+ { no: 213, name: "ErrInsufficientFee" },
277
+ { no: 214, name: "ErrTooManySignatures" },
278
+ { no: 215, name: "ErrNoSignatures" },
279
+ { no: 216, name: "ErrGasOverflow" },
280
+ { no: 217, name: "ErrInvalidPkgPath" },
281
+ { no: 218, name: "ErrInvalidStmt" },
282
+ { no: 219, name: "ErrInvalidExpr" },
283
+ ]);
284
+
285
+ /**
286
+ * @generated from message land.gno.gnonative.v1.ErrDetails
287
+ */
288
+ export class ErrDetails extends Message<ErrDetails> {
289
+ /**
290
+ * @generated from field: repeated land.gno.gnonative.v1.ErrCode codes = 1;
291
+ */
292
+ codes: ErrCode[] = [];
293
+
294
+ constructor(data?: PartialMessage<ErrDetails>) {
295
+ super();
296
+ proto3.util.initPartial(data, this);
297
+ }
298
+
299
+ static readonly runtime: typeof proto3 = proto3;
300
+ static readonly typeName = "land.gno.gnonative.v1.ErrDetails";
301
+ static readonly fields: FieldList = proto3.util.newFieldList(() => [
302
+ { no: 1, name: "codes", kind: "enum", T: proto3.getEnumType(ErrCode), repeated: true },
303
+ ]);
304
+
305
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): ErrDetails {
306
+ return new ErrDetails().fromBinary(bytes, options);
307
+ }
308
+
309
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): ErrDetails {
310
+ return new ErrDetails().fromJson(jsonValue, options);
311
+ }
312
+
313
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): ErrDetails {
314
+ return new ErrDetails().fromJsonString(jsonString, options);
315
+ }
316
+
317
+ static equals(a: ErrDetails | PlainMessage<ErrDetails> | undefined, b: ErrDetails | PlainMessage<ErrDetails> | undefined): boolean {
318
+ return proto3.util.equals(ErrDetails, a, b);
319
+ }
320
+ }
321
+
@@ -1,7 +1,7 @@
1
- import { GnoNativeService } from '@buf/gnolang_gnonative.connectrpc_es/rpc_connect';
2
1
  import { createPromiseClient, PromiseClient } from '@connectrpc/connect';
3
2
 
4
3
  import { createNativeGrpcTransport } from './transport_native';
4
+ import { GnoNativeService } from '../api/vendor/rpc_connect';
5
5
 
6
6
  // Create a GnoNativeService client
7
7
  export function createClient(_port: number): PromiseClient<typeof GnoNativeService> {
package/src/grpc/error.ts CHANGED
@@ -1,6 +1,7 @@
1
- import { ErrCode } from '@buf/gnolang_gnonative.bufbuild_es/rpc_pb';
2
1
  import { Code, ConnectError } from '@connectrpc/connect';
3
2
 
3
+ import { ErrCode } from '../api/vendor/rpc_pb';
4
+
4
5
  class GRPCError extends Error {
5
6
  public GrpcCode: Code;
6
7
 
package/src/index.ts CHANGED
@@ -17,8 +17,8 @@ export function addChangeListener(listener: (event: ChangeEventPayload) => void)
17
17
 
18
18
  export { ChangeEventPayload, GnonativeView, GnonativeViewProps };
19
19
  export * from './provider/gnonative-provider';
20
- export * from '@buf/gnolang_gnonative.bufbuild_es/gnonativetypes_pb';
21
- export * from '@buf/gnolang_gnonative.bufbuild_es/rpc_pb';
20
+ export * from './api/vendor/gnonativetypes_pb';
21
+ export * from './api/vendor/rpc_pb';
22
22
  export { GRPCError } from './grpc/error';
23
23
 
24
24
  export * from './api/GnoNativeApi';
package/tsconfig.json CHANGED
@@ -1,4 +1,3 @@
1
- // @generated by expo-module-scripts
2
1
  {
3
2
  "extends": "expo-module-scripts/tsconfig.base",
4
3
  "compilerOptions": {