@inco/shield-js 0.1.0 → 0.2.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 (74) hide show
  1. package/README.md +52 -308
  2. package/dist/contracts/abi.d.ts +2000 -4513
  3. package/dist/contracts/abi.js +2400 -5651
  4. package/dist/contracts/index.d.ts +2 -2
  5. package/dist/contracts/index.js +2 -2
  6. package/dist/contracts/utils.d.ts +5 -24
  7. package/dist/contracts/utils.js +13 -24
  8. package/dist/errors.d.ts +16 -47
  9. package/dist/errors.js +6 -53
  10. package/dist/generated/inco/shield/v2/conductor_pb.d.ts +77 -0
  11. package/dist/generated/inco/shield/v2/conductor_pb.js +6 -0
  12. package/dist/generated/inco/shield/v2/deposit_pb.d.ts +12 -103
  13. package/dist/generated/inco/shield/v2/deposit_pb.js +4 -141
  14. package/dist/generated/inco/shield/v2/drafting_pb.d.ts +45 -269
  15. package/dist/generated/inco/shield/v2/drafting_pb.js +8 -361
  16. package/dist/generated/inco/shield/v2/types_pb.d.ts +47 -166
  17. package/dist/generated/inco/shield/v2/types_pb.js +12 -261
  18. package/dist/index.d.ts +1 -7
  19. package/dist/index.js +1 -14
  20. package/dist/shield/abi.d.ts +5 -0
  21. package/dist/shield/abi.js +28 -0
  22. package/dist/shield/client.d.ts +27 -51
  23. package/dist/shield/client.js +73 -65
  24. package/dist/shield/convert.d.ts +2 -14
  25. package/dist/shield/convert.js +39 -115
  26. package/dist/shield/encryption.d.ts +0 -67
  27. package/dist/shield/encryption.js +0 -67
  28. package/dist/shield/envelope.d.ts +10 -11
  29. package/dist/shield/envelope.js +15 -14
  30. package/dist/shield/fee.d.ts +24 -0
  31. package/dist/shield/fee.js +151 -0
  32. package/dist/shield/index.d.ts +9 -3
  33. package/dist/shield/index.js +7 -2
  34. package/dist/shield/intent.d.ts +20 -933
  35. package/dist/shield/intent.js +92 -112
  36. package/dist/shield/permission-status.d.ts +9 -0
  37. package/dist/shield/permission-status.js +8 -0
  38. package/dist/shield/rpc.d.ts +50 -49
  39. package/dist/shield/rpc.js +207 -354
  40. package/dist/shield/shield.eip712.gen.d.ts +1096 -43
  41. package/dist/shield/shield.eip712.gen.js +572 -62
  42. package/dist/shield/types.d.ts +7 -102
  43. package/dist/shield/types.js +1 -4
  44. package/dist/shield/userop/gas-estimation.d.ts +7 -22
  45. package/dist/shield/userop/gas-estimation.js +100 -137
  46. package/dist/shield/userop/paymaster.d.ts +15 -0
  47. package/dist/shield/userop/paymaster.js +17 -0
  48. package/dist/shield/userop/token-exchange.d.ts +5 -52
  49. package/dist/shield/userop/token-exchange.js +41 -149
  50. package/dist/shield/userop/types.d.ts +2 -27
  51. package/dist/shield/userop/types.js +0 -3
  52. package/dist/shield/userop/userOp.d.ts +0 -19
  53. package/dist/shield/userop/userOp.js +4 -22
  54. package/dist/shield/utils/chain.d.ts +1 -0
  55. package/dist/shield/utils/chain.js +3 -0
  56. package/dist/shield/validate-withdrawal-split.d.ts +13 -0
  57. package/dist/shield/validate-withdrawal-split.js +93 -0
  58. package/package.json +18 -27
  59. package/dist/generated/inco/shield/v2/conductor_connect.d.ts +0 -137
  60. package/dist/generated/inco/shield/v2/conductor_connect.js +0 -141
  61. package/dist/generated/inco/shield/v2/permission_pb.d.ts +0 -443
  62. package/dist/generated/inco/shield/v2/permission_pb.js +0 -639
  63. package/dist/generated/inco/shield/v2/query_pb.d.ts +0 -103
  64. package/dist/generated/inco/shield/v2/query_pb.js +0 -141
  65. package/dist/shield/userop/index.d.ts +0 -1
  66. package/dist/shield/userop/index.js +0 -1
  67. package/dist/uniswap-adapter/config.d.ts +0 -34
  68. package/dist/uniswap-adapter/config.js +0 -45
  69. package/dist/uniswap-adapter/find-pools.d.ts +0 -91
  70. package/dist/uniswap-adapter/find-pools.js +0 -108
  71. package/dist/uniswap-adapter/index.d.ts +0 -10
  72. package/dist/uniswap-adapter/index.js +0 -13
  73. package/dist/uniswap-adapter/swap.d.ts +0 -344
  74. package/dist/uniswap-adapter/swap.js +0 -309
@@ -1,639 +0,0 @@
1
- // @generated by protoc-gen-es v1.10.1 with parameter "target=ts,import_extension=.js"
2
- // @generated from file inco/shield/v2/permission.proto (package inco.shield.v2, syntax proto3)
3
- /* eslint-disable */
4
- // @ts-nocheck
5
- import { Message, proto3, protoInt64 } from "@bufbuild/protobuf";
6
- import { Address, AssetId, Bytes32, Uint256 } from "./types_pb.js";
7
- /**
8
- * PermissionStatus represents the lifecycle state of a permission.
9
- *
10
- * @generated from enum inco.shield.v2.PermissionStatus
11
- */
12
- export var PermissionStatus;
13
- (function (PermissionStatus) {
14
- /**
15
- * @generated from enum value: PERMISSION_STATUS_UNSPECIFIED = 0;
16
- */
17
- PermissionStatus[PermissionStatus["UNSPECIFIED"] = 0] = "UNSPECIFIED";
18
- /**
19
- * @generated from enum value: PERMISSION_STATUS_ACTIVE = 1;
20
- */
21
- PermissionStatus[PermissionStatus["ACTIVE"] = 1] = "ACTIVE";
22
- /**
23
- * @generated from enum value: PERMISSION_STATUS_NOT_YET_ACTIVE = 2;
24
- */
25
- PermissionStatus[PermissionStatus["NOT_YET_ACTIVE"] = 2] = "NOT_YET_ACTIVE";
26
- /**
27
- * @generated from enum value: PERMISSION_STATUS_EXPIRED = 3;
28
- */
29
- PermissionStatus[PermissionStatus["EXPIRED"] = 3] = "EXPIRED";
30
- /**
31
- * @generated from enum value: PERMISSION_STATUS_REVOKED = 4;
32
- */
33
- PermissionStatus[PermissionStatus["REVOKED"] = 4] = "REVOKED";
34
- /**
35
- * @generated from enum value: PERMISSION_STATUS_GENERATION_REVOKED = 5;
36
- */
37
- PermissionStatus[PermissionStatus["GENERATION_REVOKED"] = 5] = "GENERATION_REVOKED";
38
- })(PermissionStatus || (PermissionStatus = {}));
39
- // Retrieve enum metadata with: proto3.getEnumType(PermissionStatus)
40
- proto3.util.setEnumType(PermissionStatus, "inco.shield.v2.PermissionStatus", [
41
- { no: 0, name: "PERMISSION_STATUS_UNSPECIFIED" },
42
- { no: 1, name: "PERMISSION_STATUS_ACTIVE" },
43
- { no: 2, name: "PERMISSION_STATUS_NOT_YET_ACTIVE" },
44
- { no: 3, name: "PERMISSION_STATUS_EXPIRED" },
45
- { no: 4, name: "PERMISSION_STATUS_REVOKED" },
46
- { no: 5, name: "PERMISSION_STATUS_GENERATION_REVOKED" },
47
- ]);
48
- /**
49
- * PermissionInfo contains detailed information about a permission.
50
- *
51
- * @generated from message inco.shield.v2.PermissionInfo
52
- */
53
- export class PermissionInfo extends Message {
54
- /**
55
- * @generated from field: inco.shield.v2.Bytes32 permission_id = 1;
56
- */
57
- permissionId;
58
- /**
59
- * @generated from field: inco.shield.v2.Address owner = 2;
60
- */
61
- owner;
62
- /**
63
- * @generated from field: inco.shield.v2.Address spender = 3;
64
- */
65
- spender;
66
- /**
67
- * @generated from field: inco.shield.v2.AssetId asset_id = 4;
68
- */
69
- assetId;
70
- /**
71
- * @generated from field: inco.shield.v2.Uint256 allowance = 5;
72
- */
73
- allowance;
74
- /**
75
- * Unix timestamp (seconds) at which the permission becomes active.
76
- *
77
- * @generated from field: uint64 start = 6;
78
- */
79
- start = protoInt64.zero;
80
- /**
81
- * Unix timestamp (seconds) at which the permission expires (exclusive).
82
- *
83
- * @generated from field: uint64 end = 7;
84
- */
85
- end = protoInt64.zero;
86
- /**
87
- * Replenishment window in seconds (0 = one-time).
88
- *
89
- * @generated from field: uint64 period = 8;
90
- */
91
- period = protoInt64.zero;
92
- /**
93
- * @generated from field: inco.shield.v2.Bytes32 agreement_hash = 9;
94
- */
95
- agreementHash;
96
- /**
97
- * Amount spent in current period.
98
- *
99
- * @generated from field: inco.shield.v2.Uint256 spent_in_current_period = 10;
100
- */
101
- spentInCurrentPeriod;
102
- /**
103
- * Calculated available allowance.
104
- *
105
- * @generated from field: inco.shield.v2.Uint256 available_allowance = 11;
106
- */
107
- availableAllowance;
108
- /**
109
- * The current lifecycle status of the permission.
110
- *
111
- * @generated from field: inco.shield.v2.PermissionStatus status = 12;
112
- */
113
- status = PermissionStatus.UNSPECIFIED;
114
- /**
115
- * Per-issuance salt used in the permission id preimage.
116
- *
117
- * @generated from field: inco.shield.v2.Bytes32 salt = 13;
118
- */
119
- salt;
120
- /**
121
- * Unix timestamp (seconds) at which the current replenishment period starts.
122
- *
123
- * @generated from field: uint64 current_period_start = 14;
124
- */
125
- currentPeriodStart = protoInt64.zero;
126
- constructor(data) {
127
- super();
128
- proto3.util.initPartial(data, this);
129
- }
130
- static runtime = proto3;
131
- static typeName = "inco.shield.v2.PermissionInfo";
132
- static fields = proto3.util.newFieldList(() => [
133
- { no: 1, name: "permission_id", kind: "message", T: Bytes32 },
134
- { no: 2, name: "owner", kind: "message", T: Address },
135
- { no: 3, name: "spender", kind: "message", T: Address },
136
- { no: 4, name: "asset_id", kind: "message", T: AssetId },
137
- { no: 5, name: "allowance", kind: "message", T: Uint256 },
138
- { no: 6, name: "start", kind: "scalar", T: 4 /* ScalarType.UINT64 */ },
139
- { no: 7, name: "end", kind: "scalar", T: 4 /* ScalarType.UINT64 */ },
140
- { no: 8, name: "period", kind: "scalar", T: 4 /* ScalarType.UINT64 */ },
141
- { no: 9, name: "agreement_hash", kind: "message", T: Bytes32 },
142
- { no: 10, name: "spent_in_current_period", kind: "message", T: Uint256 },
143
- { no: 11, name: "available_allowance", kind: "message", T: Uint256 },
144
- { no: 12, name: "status", kind: "enum", T: proto3.getEnumType(PermissionStatus) },
145
- { no: 13, name: "salt", kind: "message", T: Bytes32 },
146
- { no: 14, name: "current_period_start", kind: "scalar", T: 4 /* ScalarType.UINT64 */ },
147
- ]);
148
- static fromBinary(bytes, options) {
149
- return new PermissionInfo().fromBinary(bytes, options);
150
- }
151
- static fromJson(jsonValue, options) {
152
- return new PermissionInfo().fromJson(jsonValue, options);
153
- }
154
- static fromJsonString(jsonString, options) {
155
- return new PermissionInfo().fromJsonString(jsonString, options);
156
- }
157
- static equals(a, b) {
158
- return proto3.util.equals(PermissionInfo, a, b);
159
- }
160
- }
161
- /**
162
- * RequestPermissionAttestationRequest is the envelope payload for
163
- * RequestPermissionAttestation. The TEE redeems the owner-signed intent
164
- * once and returns a long-lived attestation in exchange.
165
- *
166
- * @generated from message inco.shield.v2.RequestPermissionAttestationRequest
167
- */
168
- export class RequestPermissionAttestationRequest extends Message {
169
- /**
170
- * The ABI-encoded PermissionAttestationRequest struct from Solidity.
171
- *
172
- * @generated from field: bytes permission_attestation_request_bytes = 1;
173
- */
174
- permissionAttestationRequestBytes = new Uint8Array(0);
175
- /**
176
- * EIP-712 signature from the owner over the permission.
177
- *
178
- * @generated from field: bytes eip712_signature = 2;
179
- */
180
- eip712Signature = new Uint8Array(0);
181
- /**
182
- * Symmetric key for AEAD-encrypting the response.
183
- *
184
- * @generated from field: bytes response_key = 3;
185
- */
186
- responseKey = new Uint8Array(0);
187
- constructor(data) {
188
- super();
189
- proto3.util.initPartial(data, this);
190
- }
191
- static runtime = proto3;
192
- static typeName = "inco.shield.v2.RequestPermissionAttestationRequest";
193
- static fields = proto3.util.newFieldList(() => [
194
- { no: 1, name: "permission_attestation_request_bytes", kind: "scalar", T: 12 /* ScalarType.BYTES */ },
195
- { no: 2, name: "eip712_signature", kind: "scalar", T: 12 /* ScalarType.BYTES */ },
196
- { no: 3, name: "response_key", kind: "scalar", T: 12 /* ScalarType.BYTES */ },
197
- ]);
198
- static fromBinary(bytes, options) {
199
- return new RequestPermissionAttestationRequest().fromBinary(bytes, options);
200
- }
201
- static fromJson(jsonValue, options) {
202
- return new RequestPermissionAttestationRequest().fromJson(jsonValue, options);
203
- }
204
- static fromJsonString(jsonString, options) {
205
- return new RequestPermissionAttestationRequest().fromJsonString(jsonString, options);
206
- }
207
- static equals(a, b) {
208
- return proto3.util.equals(RequestPermissionAttestationRequest, a, b);
209
- }
210
- }
211
- /**
212
- * GetPermissionsByOwnerRequest is the envelope payload for GetPermissionsByOwner.
213
- * ABI-encoded Solidity GetPermissionsByOwner(requester, includeExpired, timestamp), signed by the requester.
214
- *
215
- * @generated from message inco.shield.v2.GetPermissionsByOwnerRequest
216
- */
217
- export class GetPermissionsByOwnerRequest extends Message {
218
- /**
219
- * @generated from field: bytes get_permissions_by_owner_bytes = 1;
220
- */
221
- getPermissionsByOwnerBytes = new Uint8Array(0);
222
- /**
223
- * EIP-712 signature from the owner over the GetPermissionsByOwner.
224
- *
225
- * @generated from field: bytes eip712_signature = 2;
226
- */
227
- eip712Signature = new Uint8Array(0);
228
- /**
229
- * Symmetric key for AEAD-encrypting the response.
230
- *
231
- * @generated from field: bytes response_key = 3;
232
- */
233
- responseKey = new Uint8Array(0);
234
- constructor(data) {
235
- super();
236
- proto3.util.initPartial(data, this);
237
- }
238
- static runtime = proto3;
239
- static typeName = "inco.shield.v2.GetPermissionsByOwnerRequest";
240
- static fields = proto3.util.newFieldList(() => [
241
- { no: 1, name: "get_permissions_by_owner_bytes", kind: "scalar", T: 12 /* ScalarType.BYTES */ },
242
- { no: 2, name: "eip712_signature", kind: "scalar", T: 12 /* ScalarType.BYTES */ },
243
- { no: 3, name: "response_key", kind: "scalar", T: 12 /* ScalarType.BYTES */ },
244
- ]);
245
- static fromBinary(bytes, options) {
246
- return new GetPermissionsByOwnerRequest().fromBinary(bytes, options);
247
- }
248
- static fromJson(jsonValue, options) {
249
- return new GetPermissionsByOwnerRequest().fromJson(jsonValue, options);
250
- }
251
- static fromJsonString(jsonString, options) {
252
- return new GetPermissionsByOwnerRequest().fromJsonString(jsonString, options);
253
- }
254
- static equals(a, b) {
255
- return proto3.util.equals(GetPermissionsByOwnerRequest, a, b);
256
- }
257
- }
258
- /**
259
- * GetPermissionsBySpenderRequest is the envelope payload for GetPermissionsBySpender.
260
- * ABI-encoded Solidity GetPermissionsBySpender(requester, includeExpired, timestamp), signed by the requester.
261
- *
262
- * @generated from message inco.shield.v2.GetPermissionsBySpenderRequest
263
- */
264
- export class GetPermissionsBySpenderRequest extends Message {
265
- /**
266
- * @generated from field: bytes get_permissions_by_spender_bytes = 1;
267
- */
268
- getPermissionsBySpenderBytes = new Uint8Array(0);
269
- /**
270
- * EIP-712 signature from the spender over the GetPermissionsBySpender.
271
- *
272
- * @generated from field: bytes eip712_signature = 2;
273
- */
274
- eip712Signature = new Uint8Array(0);
275
- /**
276
- * Symmetric key for AEAD-encrypting the response.
277
- *
278
- * @generated from field: bytes response_key = 3;
279
- */
280
- responseKey = new Uint8Array(0);
281
- constructor(data) {
282
- super();
283
- proto3.util.initPartial(data, this);
284
- }
285
- static runtime = proto3;
286
- static typeName = "inco.shield.v2.GetPermissionsBySpenderRequest";
287
- static fields = proto3.util.newFieldList(() => [
288
- { no: 1, name: "get_permissions_by_spender_bytes", kind: "scalar", T: 12 /* ScalarType.BYTES */ },
289
- { no: 2, name: "eip712_signature", kind: "scalar", T: 12 /* ScalarType.BYTES */ },
290
- { no: 3, name: "response_key", kind: "scalar", T: 12 /* ScalarType.BYTES */ },
291
- ]);
292
- static fromBinary(bytes, options) {
293
- return new GetPermissionsBySpenderRequest().fromBinary(bytes, options);
294
- }
295
- static fromJson(jsonValue, options) {
296
- return new GetPermissionsBySpenderRequest().fromJson(jsonValue, options);
297
- }
298
- static fromJsonString(jsonString, options) {
299
- return new GetPermissionsBySpenderRequest().fromJsonString(jsonString, options);
300
- }
301
- static equals(a, b) {
302
- return proto3.util.equals(GetPermissionsBySpenderRequest, a, b);
303
- }
304
- }
305
- /**
306
- * GetPermissionDetailsRequest is the envelope payload for GetPermissionDetails.
307
- * ABI-encoded Solidity GetPermissionDetails(requester, permissionId, timestamp), signed by the caller.
308
- *
309
- * @generated from message inco.shield.v2.GetPermissionDetailsRequest
310
- */
311
- export class GetPermissionDetailsRequest extends Message {
312
- /**
313
- * @generated from field: bytes get_permission_details_bytes = 1;
314
- */
315
- getPermissionDetailsBytes = new Uint8Array(0);
316
- /**
317
- * EIP-712 signature from the owner or spender over the GetPermissionDetails.
318
- *
319
- * @generated from field: bytes eip712_signature = 2;
320
- */
321
- eip712Signature = new Uint8Array(0);
322
- /**
323
- * Symmetric key for AEAD-encrypting the response.
324
- *
325
- * @generated from field: bytes response_key = 3;
326
- */
327
- responseKey = new Uint8Array(0);
328
- constructor(data) {
329
- super();
330
- proto3.util.initPartial(data, this);
331
- }
332
- static runtime = proto3;
333
- static typeName = "inco.shield.v2.GetPermissionDetailsRequest";
334
- static fields = proto3.util.newFieldList(() => [
335
- { no: 1, name: "get_permission_details_bytes", kind: "scalar", T: 12 /* ScalarType.BYTES */ },
336
- { no: 2, name: "eip712_signature", kind: "scalar", T: 12 /* ScalarType.BYTES */ },
337
- { no: 3, name: "response_key", kind: "scalar", T: 12 /* ScalarType.BYTES */ },
338
- ]);
339
- static fromBinary(bytes, options) {
340
- return new GetPermissionDetailsRequest().fromBinary(bytes, options);
341
- }
342
- static fromJson(jsonValue, options) {
343
- return new GetPermissionDetailsRequest().fromJson(jsonValue, options);
344
- }
345
- static fromJsonString(jsonString, options) {
346
- return new GetPermissionDetailsRequest().fromJsonString(jsonString, options);
347
- }
348
- static equals(a, b) {
349
- return proto3.util.equals(GetPermissionDetailsRequest, a, b);
350
- }
351
- }
352
- /**
353
- * GetSpendableRequest is the envelope payload for GetSpendable.
354
- * ABI-encoded Solidity GetSpendable(requester, permissionId, timestamp), signed by the spender.
355
- *
356
- * @generated from message inco.shield.v2.GetSpendableRequest
357
- */
358
- export class GetSpendableRequest extends Message {
359
- /**
360
- * @generated from field: bytes get_spendable_bytes = 1;
361
- */
362
- getSpendableBytes = new Uint8Array(0);
363
- /**
364
- * EIP-712 signature from the spender over the GetSpendable.
365
- *
366
- * @generated from field: bytes eip712_signature = 2;
367
- */
368
- eip712Signature = new Uint8Array(0);
369
- /**
370
- * Symmetric key for AEAD-encrypting the response.
371
- *
372
- * @generated from field: bytes response_key = 3;
373
- */
374
- responseKey = new Uint8Array(0);
375
- constructor(data) {
376
- super();
377
- proto3.util.initPartial(data, this);
378
- }
379
- static runtime = proto3;
380
- static typeName = "inco.shield.v2.GetSpendableRequest";
381
- static fields = proto3.util.newFieldList(() => [
382
- { no: 1, name: "get_spendable_bytes", kind: "scalar", T: 12 /* ScalarType.BYTES */ },
383
- { no: 2, name: "eip712_signature", kind: "scalar", T: 12 /* ScalarType.BYTES */ },
384
- { no: 3, name: "response_key", kind: "scalar", T: 12 /* ScalarType.BYTES */ },
385
- ]);
386
- static fromBinary(bytes, options) {
387
- return new GetSpendableRequest().fromBinary(bytes, options);
388
- }
389
- static fromJson(jsonValue, options) {
390
- return new GetSpendableRequest().fromJson(jsonValue, options);
391
- }
392
- static fromJsonString(jsonString, options) {
393
- return new GetSpendableRequest().fromJsonString(jsonString, options);
394
- }
395
- static equals(a, b) {
396
- return proto3.util.equals(GetSpendableRequest, a, b);
397
- }
398
- }
399
- /**
400
- * GetOwnerGenerationRequest is the envelope payload for GetOwnerGeneration.
401
- * ABI-encoded Solidity GetOwnerGeneration(requester, timestamp), signed by the owner.
402
- *
403
- * @generated from message inco.shield.v2.GetOwnerGenerationRequest
404
- */
405
- export class GetOwnerGenerationRequest extends Message {
406
- /**
407
- * @generated from field: bytes get_owner_generation_bytes = 1;
408
- */
409
- getOwnerGenerationBytes = new Uint8Array(0);
410
- /**
411
- * EIP-712 signature from the owner over the GetOwnerGeneration.
412
- *
413
- * @generated from field: bytes eip712_signature = 2;
414
- */
415
- eip712Signature = new Uint8Array(0);
416
- /**
417
- * Symmetric key for AEAD-encrypting the response.
418
- *
419
- * @generated from field: bytes response_key = 3;
420
- */
421
- responseKey = new Uint8Array(0);
422
- constructor(data) {
423
- super();
424
- proto3.util.initPartial(data, this);
425
- }
426
- static runtime = proto3;
427
- static typeName = "inco.shield.v2.GetOwnerGenerationRequest";
428
- static fields = proto3.util.newFieldList(() => [
429
- { no: 1, name: "get_owner_generation_bytes", kind: "scalar", T: 12 /* ScalarType.BYTES */ },
430
- { no: 2, name: "eip712_signature", kind: "scalar", T: 12 /* ScalarType.BYTES */ },
431
- { no: 3, name: "response_key", kind: "scalar", T: 12 /* ScalarType.BYTES */ },
432
- ]);
433
- static fromBinary(bytes, options) {
434
- return new GetOwnerGenerationRequest().fromBinary(bytes, options);
435
- }
436
- static fromJson(jsonValue, options) {
437
- return new GetOwnerGenerationRequest().fromJson(jsonValue, options);
438
- }
439
- static fromJsonString(jsonString, options) {
440
- return new GetOwnerGenerationRequest().fromJsonString(jsonString, options);
441
- }
442
- static equals(a, b) {
443
- return proto3.util.equals(GetOwnerGenerationRequest, a, b);
444
- }
445
- }
446
- /**
447
- * RequestPermissionAttestationResponse returns the TEE-issued attestation.
448
- * Serialized into an EncryptedResponse (AEAD-encrypted with the caller's response_key).
449
- *
450
- * @generated from message inco.shield.v2.RequestPermissionAttestationResponse
451
- */
452
- export class RequestPermissionAttestationResponse extends Message {
453
- /**
454
- * ABI-encoded Solidity PermissionAttestation(PermissionAttestationPayload payload, bytes signature).
455
- * The TEE committee signature lives inside the bytes as the struct's `signature` field.
456
- *
457
- * @generated from field: bytes permission_attestation_bytes = 1;
458
- */
459
- permissionAttestationBytes = new Uint8Array(0);
460
- constructor(data) {
461
- super();
462
- proto3.util.initPartial(data, this);
463
- }
464
- static runtime = proto3;
465
- static typeName = "inco.shield.v2.RequestPermissionAttestationResponse";
466
- static fields = proto3.util.newFieldList(() => [
467
- { no: 1, name: "permission_attestation_bytes", kind: "scalar", T: 12 /* ScalarType.BYTES */ },
468
- ]);
469
- static fromBinary(bytes, options) {
470
- return new RequestPermissionAttestationResponse().fromBinary(bytes, options);
471
- }
472
- static fromJson(jsonValue, options) {
473
- return new RequestPermissionAttestationResponse().fromJson(jsonValue, options);
474
- }
475
- static fromJsonString(jsonString, options) {
476
- return new RequestPermissionAttestationResponse().fromJsonString(jsonString, options);
477
- }
478
- static equals(a, b) {
479
- return proto3.util.equals(RequestPermissionAttestationResponse, a, b);
480
- }
481
- }
482
- /**
483
- * GetPermissionsResponse returns a list of permissions.
484
- * Serialized into an EncryptedResponse (AEAD-encrypted with the caller's response_key).
485
- *
486
- * @generated from message inco.shield.v2.GetPermissionsResponse
487
- */
488
- export class GetPermissionsResponse extends Message {
489
- /**
490
- * @generated from field: repeated inco.shield.v2.PermissionInfo permissions = 1;
491
- */
492
- permissions = [];
493
- constructor(data) {
494
- super();
495
- proto3.util.initPartial(data, this);
496
- }
497
- static runtime = proto3;
498
- static typeName = "inco.shield.v2.GetPermissionsResponse";
499
- static fields = proto3.util.newFieldList(() => [
500
- { no: 1, name: "permissions", kind: "message", T: PermissionInfo, repeated: true },
501
- ]);
502
- static fromBinary(bytes, options) {
503
- return new GetPermissionsResponse().fromBinary(bytes, options);
504
- }
505
- static fromJson(jsonValue, options) {
506
- return new GetPermissionsResponse().fromJson(jsonValue, options);
507
- }
508
- static fromJsonString(jsonString, options) {
509
- return new GetPermissionsResponse().fromJsonString(jsonString, options);
510
- }
511
- static equals(a, b) {
512
- return proto3.util.equals(GetPermissionsResponse, a, b);
513
- }
514
- }
515
- /**
516
- * GetPermissionDetailsResponse returns permission details.
517
- * Serialized into an EncryptedResponse (AEAD-encrypted with the caller's response_key).
518
- *
519
- * @generated from message inco.shield.v2.GetPermissionDetailsResponse
520
- */
521
- export class GetPermissionDetailsResponse extends Message {
522
- /**
523
- * The permission details.
524
- *
525
- * @generated from field: inco.shield.v2.PermissionInfo permission = 1;
526
- */
527
- permission;
528
- /**
529
- * Whether the permission was found.
530
- *
531
- * @generated from field: bool found = 2;
532
- */
533
- found = false;
534
- constructor(data) {
535
- super();
536
- proto3.util.initPartial(data, this);
537
- }
538
- static runtime = proto3;
539
- static typeName = "inco.shield.v2.GetPermissionDetailsResponse";
540
- static fields = proto3.util.newFieldList(() => [
541
- { no: 1, name: "permission", kind: "message", T: PermissionInfo },
542
- { no: 2, name: "found", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
543
- ]);
544
- static fromBinary(bytes, options) {
545
- return new GetPermissionDetailsResponse().fromBinary(bytes, options);
546
- }
547
- static fromJson(jsonValue, options) {
548
- return new GetPermissionDetailsResponse().fromJson(jsonValue, options);
549
- }
550
- static fromJsonString(jsonString, options) {
551
- return new GetPermissionDetailsResponse().fromJsonString(jsonString, options);
552
- }
553
- static equals(a, b) {
554
- return proto3.util.equals(GetPermissionDetailsResponse, a, b);
555
- }
556
- }
557
- /**
558
- * GetSpendableResponse returns a single clamped spend ceiling.
559
- *
560
- * `spendable = min(allowance - usage_in_current_period, ownerBalance)`. The
561
- * scalar deliberately hides which side of the `min()` is the binding
562
- * constraint, so the spender cannot infer whether the owner's balance is
563
- * below or above the remaining allowance.
564
- *
565
- * Serialized into an EncryptedResponse (AEAD-encrypted with the caller's response_key).
566
- *
567
- * @generated from message inco.shield.v2.GetSpendableResponse
568
- */
569
- export class GetSpendableResponse extends Message {
570
- /**
571
- * Spend ceiling.
572
- *
573
- * @generated from field: inco.shield.v2.Uint256 spendable = 1;
574
- */
575
- spendable;
576
- /**
577
- * Whether the permission was found.
578
- *
579
- * @generated from field: bool found = 2;
580
- */
581
- found = false;
582
- constructor(data) {
583
- super();
584
- proto3.util.initPartial(data, this);
585
- }
586
- static runtime = proto3;
587
- static typeName = "inco.shield.v2.GetSpendableResponse";
588
- static fields = proto3.util.newFieldList(() => [
589
- { no: 1, name: "spendable", kind: "message", T: Uint256 },
590
- { no: 2, name: "found", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
591
- ]);
592
- static fromBinary(bytes, options) {
593
- return new GetSpendableResponse().fromBinary(bytes, options);
594
- }
595
- static fromJson(jsonValue, options) {
596
- return new GetSpendableResponse().fromJson(jsonValue, options);
597
- }
598
- static fromJsonString(jsonString, options) {
599
- return new GetSpendableResponse().fromJsonString(jsonString, options);
600
- }
601
- static equals(a, b) {
602
- return proto3.util.equals(GetSpendableResponse, a, b);
603
- }
604
- }
605
- /**
606
- * GetOwnerGenerationResponse returns the owner's current generation.
607
- * Serialized into an EncryptedResponse (AEAD-encrypted with the caller's response_key).
608
- *
609
- * @generated from message inco.shield.v2.GetOwnerGenerationResponse
610
- */
611
- export class GetOwnerGenerationResponse extends Message {
612
- /**
613
- * Current generation (observed from chain events).
614
- *
615
- * @generated from field: uint64 generation = 1;
616
- */
617
- generation = protoInt64.zero;
618
- constructor(data) {
619
- super();
620
- proto3.util.initPartial(data, this);
621
- }
622
- static runtime = proto3;
623
- static typeName = "inco.shield.v2.GetOwnerGenerationResponse";
624
- static fields = proto3.util.newFieldList(() => [
625
- { no: 1, name: "generation", kind: "scalar", T: 4 /* ScalarType.UINT64 */ },
626
- ]);
627
- static fromBinary(bytes, options) {
628
- return new GetOwnerGenerationResponse().fromBinary(bytes, options);
629
- }
630
- static fromJson(jsonValue, options) {
631
- return new GetOwnerGenerationResponse().fromJson(jsonValue, options);
632
- }
633
- static fromJsonString(jsonString, options) {
634
- return new GetOwnerGenerationResponse().fromJsonString(jsonString, options);
635
- }
636
- static equals(a, b) {
637
- return proto3.util.equals(GetOwnerGenerationResponse, a, b);
638
- }
639
- }