@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,372 +1,19 @@
1
- // @generated by protoc-gen-es v1.10.1 with parameter "target=ts,import_extension=.js"
2
- // @generated from file inco/shield/v2/drafting.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, Handle, Uint256 } from "./types_pb.js";
7
- /**
8
- * IntentKind is a union of all possible intent kinds.
9
- *
10
- * @generated from enum inco.shield.v2.IntentKind
11
- */
1
+ import { enumDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2";
2
+ import { file_inco_shield_v2_types } from "./types_pb.js";
3
+ export const file_inco_shield_v2_drafting = fileDesc("Ch1pbmNvL3NoaWVsZC92Mi9kcmFmdGluZy5wcm90bxIOaW5jby5zaGllbGQudjIiTwoMRHJhZnRSZXF1ZXN0Eg4KBmludGVudBgBIAEoDBIvCgtpbnRlbnRfa2luZBgCIAEoDjIaLmluY28uc2hpZWxkLnYyLkludGVudEtpbmQiYgoNRHJhZnRSZXNwb25zZRIpCgd1c2VyX29wGAEgASgLMhguaW5jby5zaGllbGQudjIuVXNlck9wMDcSJgoGY2hlcXVlGAIgASgLMhYuaW5jby5zaGllbGQudjIuQ2hlcXVlIrUGCghVc2VyT3AwNxInCgZzZW5kZXIYASABKAsyFy5pbmNvLnNoaWVsZC52Mi5BZGRyZXNzEiYKBW5vbmNlGAIgASgLMhcuaW5jby5zaGllbGQudjIuVWludDI1NhIRCgljYWxsX2RhdGEYAyABKAwSLwoOY2FsbF9nYXNfbGltaXQYBCABKAsyFy5pbmNvLnNoaWVsZC52Mi5VaW50MjU2EjcKFnZlcmlmaWNhdGlvbl9nYXNfbGltaXQYBSABKAsyFy5pbmNvLnNoaWVsZC52Mi5VaW50MjU2EjUKFHByZV92ZXJpZmljYXRpb25fZ2FzGAYgASgLMhcuaW5jby5zaGllbGQudjIuVWludDI1NhIwCg9tYXhfZmVlX3Blcl9nYXMYByABKAsyFy5pbmNvLnNoaWVsZC52Mi5VaW50MjU2EjkKGG1heF9wcmlvcml0eV9mZWVfcGVyX2dhcxgIIAEoCzIXLmluY28uc2hpZWxkLnYyLlVpbnQyNTYSEQoJc2lnbmF0dXJlGAkgASgMEi0KB2ZhY3RvcnkYCiABKAsyFy5pbmNvLnNoaWVsZC52Mi5BZGRyZXNzSACIAQESGQoMZmFjdG9yeV9kYXRhGAsgASgMSAGIAQESLwoJcGF5bWFzdGVyGAwgASgLMhcuaW5jby5zaGllbGQudjIuQWRkcmVzc0gCiAEBEhsKDnBheW1hc3Rlcl9kYXRhGA0gASgMSAOIAQESRgogcGF5bWFzdGVyX3ZlcmlmaWNhdGlvbl9nYXNfbGltaXQYDiABKAsyFy5pbmNvLnNoaWVsZC52Mi5VaW50MjU2SASIAQESQQobcGF5bWFzdGVyX3Bvc3Rfb3BfZ2FzX2xpbWl0GA8gASgLMhcuaW5jby5zaGllbGQudjIuVWludDI1NkgFiAEBQgoKCF9mYWN0b3J5Qg8KDV9mYWN0b3J5X2RhdGFCDAoKX3BheW1hc3RlckIRCg9fcGF5bWFzdGVyX2RhdGFCIwohX3BheW1hc3Rlcl92ZXJpZmljYXRpb25fZ2FzX2xpbWl0Qh4KHF9wYXltYXN0ZXJfcG9zdF9vcF9nYXNfbGltaXQi8AIKBkNoZXF1ZRIVCg1jaGVxdWVfbnVtYmVyGAEgASgEEi8KD2RyYWZ0aW5nX2hhbmRsZRgCIAEoCzIWLmluY28uc2hpZWxkLnYyLkhhbmRsZRIaChJkcmFmdGluZ190aW1lc3RhbXAYAyABKAQSKgoJbnVsbGlmaWVyGAQgASgLMhcuaW5jby5zaGllbGQudjIuQnl0ZXMzMhInCgZzZW5kZXIYBSABKAsyFy5pbmNvLnNoaWVsZC52Mi5BZGRyZXNzEikKCHJlY2VpdmVyGAYgASgLMhcuaW5jby5zaGllbGQudjIuQWRkcmVzcxIpCghhc3NldF9pZBgHIAEoCzIXLmluY28uc2hpZWxkLnYyLkFzc2V0SWQSJwoGYW1vdW50GAggASgLMhcuaW5jby5zaGllbGQudjIuVWludDI1NhIuCg1wZXJtaXNzaW9uX2lkGAkgASgLMhcuaW5jby5zaGllbGQudjIuQnl0ZXMzMiqjAgoKSW50ZW50S2luZBIYChRJTlRFTlRfS0lORF9UUkFOU0ZFUhAAEhgKFElOVEVOVF9LSU5EX1dJVEhEUkFXEAESIAocSU5URU5UX0tJTkRfREVGSV9JTlRFUkFDVElPThACEiUKIUlOVEVOVF9LSU5EX0lORElWSURVQUxfUkVWT0NBVElPThADEiQKIElOVEVOVF9LSU5EX1VTRVJfV0lERV9SRVZPQ0FUSU9OEAQSIgoeSU5URU5UX0tJTkRfREVMRUdBVEVEX1RSQU5TRkVSEAUSIgoeSU5URU5UX0tJTkRfREVMRUdBVEVEX1dJVEhEUkFXEAYSKgomSU5URU5UX0tJTkRfREVMRUdBVEVEX0RFRklfSU5URVJBQ1RJT04QB2IGcHJvdG8z", [file_inco_shield_v2_types]);
4
+ export const DraftRequestSchema = messageDesc(file_inco_shield_v2_drafting, 0);
5
+ export const DraftResponseSchema = messageDesc(file_inco_shield_v2_drafting, 1);
6
+ export const UserOp07Schema = messageDesc(file_inco_shield_v2_drafting, 2);
7
+ export const ChequeSchema = messageDesc(file_inco_shield_v2_drafting, 3);
12
8
  export var IntentKind;
13
9
  (function (IntentKind) {
14
- /**
15
- * @generated from enum value: INTENT_KIND_TRANSFER = 0;
16
- */
17
10
  IntentKind[IntentKind["TRANSFER"] = 0] = "TRANSFER";
18
- /**
19
- * @generated from enum value: INTENT_KIND_WITHDRAW = 1;
20
- */
21
11
  IntentKind[IntentKind["WITHDRAW"] = 1] = "WITHDRAW";
22
- /**
23
- * @generated from enum value: INTENT_KIND_DEFI_INTERACTION = 2;
24
- */
25
12
  IntentKind[IntentKind["DEFI_INTERACTION"] = 2] = "DEFI_INTERACTION";
26
- /**
27
- * @generated from enum value: INTENT_KIND_INDIVIDUAL_REVOCATION = 3;
28
- */
29
13
  IntentKind[IntentKind["INDIVIDUAL_REVOCATION"] = 3] = "INDIVIDUAL_REVOCATION";
30
- /**
31
- * @generated from enum value: INTENT_KIND_USER_WIDE_REVOCATION = 4;
32
- */
33
14
  IntentKind[IntentKind["USER_WIDE_REVOCATION"] = 4] = "USER_WIDE_REVOCATION";
34
- /**
35
- * @generated from enum value: INTENT_KIND_DELEGATED_TRANSFER = 5;
36
- */
37
15
  IntentKind[IntentKind["DELEGATED_TRANSFER"] = 5] = "DELEGATED_TRANSFER";
38
- /**
39
- * @generated from enum value: INTENT_KIND_DELEGATED_WITHDRAW = 6;
40
- */
41
16
  IntentKind[IntentKind["DELEGATED_WITHDRAW"] = 6] = "DELEGATED_WITHDRAW";
42
- /**
43
- * @generated from enum value: INTENT_KIND_DELEGATED_DEFI_INTERACTION = 7;
44
- */
45
17
  IntentKind[IntentKind["DELEGATED_DEFI_INTERACTION"] = 7] = "DELEGATED_DEFI_INTERACTION";
46
18
  })(IntentKind || (IntentKind = {}));
47
- // Retrieve enum metadata with: proto3.getEnumType(IntentKind)
48
- proto3.util.setEnumType(IntentKind, "inco.shield.v2.IntentKind", [
49
- { no: 0, name: "INTENT_KIND_TRANSFER" },
50
- { no: 1, name: "INTENT_KIND_WITHDRAW" },
51
- { no: 2, name: "INTENT_KIND_DEFI_INTERACTION" },
52
- { no: 3, name: "INTENT_KIND_INDIVIDUAL_REVOCATION" },
53
- { no: 4, name: "INTENT_KIND_USER_WIDE_REVOCATION" },
54
- { no: 5, name: "INTENT_KIND_DELEGATED_TRANSFER" },
55
- { no: 6, name: "INTENT_KIND_DELEGATED_WITHDRAW" },
56
- { no: 7, name: "INTENT_KIND_DELEGATED_DEFI_INTERACTION" },
57
- ]);
58
- /**
59
- * DraftRequest carries a user drafting intent.
60
- *
61
- * @generated from message inco.shield.v2.DraftRequest
62
- */
63
- export class DraftRequest extends Message {
64
- /**
65
- * ABI-encoded intent struct. Can be any of the {*}Intent structs mapped to
66
- * the `IntentKind` enum. See Shield.eip712.sol for the structs.
67
- *
68
- * @generated from field: bytes intent = 1;
69
- */
70
- intent = new Uint8Array(0);
71
- /**
72
- * Kind of the intent, used to know into which struct to decode the `intent` field.
73
- *
74
- * @generated from field: inco.shield.v2.IntentKind intent_kind = 2;
75
- */
76
- intentKind = IntentKind.TRANSFER;
77
- /**
78
- * Symmetric key for AEAD-encrypting the response.
79
- *
80
- * @generated from field: bytes response_key = 3;
81
- */
82
- responseKey = new Uint8Array(0);
83
- /**
84
- * EIP-712 signature proving ownership of the queried address.
85
- *
86
- * @generated from field: bytes eip712_signature = 4;
87
- */
88
- eip712Signature = new Uint8Array(0);
89
- constructor(data) {
90
- super();
91
- proto3.util.initPartial(data, this);
92
- }
93
- static runtime = proto3;
94
- static typeName = "inco.shield.v2.DraftRequest";
95
- static fields = proto3.util.newFieldList(() => [
96
- { no: 1, name: "intent", kind: "scalar", T: 12 /* ScalarType.BYTES */ },
97
- { no: 2, name: "intent_kind", kind: "enum", T: proto3.getEnumType(IntentKind) },
98
- { no: 3, name: "response_key", kind: "scalar", T: 12 /* ScalarType.BYTES */ },
99
- { no: 4, name: "eip712_signature", kind: "scalar", T: 12 /* ScalarType.BYTES */ },
100
- ]);
101
- static fromBinary(bytes, options) {
102
- return new DraftRequest().fromBinary(bytes, options);
103
- }
104
- static fromJson(jsonValue, options) {
105
- return new DraftRequest().fromJson(jsonValue, options);
106
- }
107
- static fromJsonString(jsonString, options) {
108
- return new DraftRequest().fromJsonString(jsonString, options);
109
- }
110
- static equals(a, b) {
111
- return proto3.util.equals(DraftRequest, a, b);
112
- }
113
- }
114
- /**
115
- * DraftResponse is the plaintext payload of the response to Draft.
116
- *
117
- * @generated from message inco.shield.v2.DraftResponse
118
- */
119
- export class DraftResponse extends Message {
120
- /**
121
- * The ABI-encoded UserOp, ready to be submitted on-chain.
122
- *
123
- * @generated from field: inco.shield.v2.UserOp07 user_op = 1;
124
- */
125
- userOp;
126
- /**
127
- * The cheque, not submitted on-chain, for information purposes. Populated only
128
- * for spend drafts (Transfer / Withdrawal and their delegated variants);
129
- * absent for revocations.
130
- *
131
- * @generated from field: inco.shield.v2.Cheque cheque = 2;
132
- */
133
- cheque;
134
- constructor(data) {
135
- super();
136
- proto3.util.initPartial(data, this);
137
- }
138
- static runtime = proto3;
139
- static typeName = "inco.shield.v2.DraftResponse";
140
- static fields = proto3.util.newFieldList(() => [
141
- { no: 1, name: "user_op", kind: "message", T: UserOp07 },
142
- { no: 2, name: "cheque", kind: "message", T: Cheque },
143
- ]);
144
- static fromBinary(bytes, options) {
145
- return new DraftResponse().fromBinary(bytes, options);
146
- }
147
- static fromJson(jsonValue, options) {
148
- return new DraftResponse().fromJson(jsonValue, options);
149
- }
150
- static fromJsonString(jsonString, options) {
151
- return new DraftResponse().fromJsonString(jsonString, options);
152
- }
153
- static equals(a, b) {
154
- return proto3.util.equals(DraftResponse, a, b);
155
- }
156
- }
157
- /**
158
- * UserOp07 is an ERC-4337 EntryPoint v0.7 UserOperation. It mirrors viem's
159
- * `UserOperation<'0.7'>` exactly: the eight always-present fields plus the
160
- * optional factory, paymaster.
161
- *
162
- * TODO: add EIP-7702 authorization fields if needed
163
- *
164
- * @generated from message inco.shield.v2.UserOp07
165
- */
166
- export class UserOp07 extends Message {
167
- /**
168
- * The account making the operation.
169
- *
170
- * @generated from field: inco.shield.v2.Address sender = 1;
171
- */
172
- sender;
173
- /**
174
- * Anti-replay parameter.
175
- *
176
- * @generated from field: inco.shield.v2.Uint256 nonce = 2;
177
- */
178
- nonce;
179
- /**
180
- * The data to pass to the `sender` during the main execution call.
181
- *
182
- * @generated from field: bytes call_data = 3;
183
- */
184
- callData = new Uint8Array(0);
185
- /**
186
- * The amount of gas to allocate the main execution call.
187
- *
188
- * @generated from field: inco.shield.v2.Uint256 call_gas_limit = 4;
189
- */
190
- callGasLimit;
191
- /**
192
- * The amount of gas to allocate for the verification step.
193
- *
194
- * @generated from field: inco.shield.v2.Uint256 verification_gas_limit = 5;
195
- */
196
- verificationGasLimit;
197
- /**
198
- * Extra gas to pay the Bundler.
199
- *
200
- * @generated from field: inco.shield.v2.Uint256 pre_verification_gas = 6;
201
- */
202
- preVerificationGas;
203
- /**
204
- * Maximum fee per gas.
205
- *
206
- * @generated from field: inco.shield.v2.Uint256 max_fee_per_gas = 7;
207
- */
208
- maxFeePerGas;
209
- /**
210
- * Maximum priority fee per gas.
211
- *
212
- * @generated from field: inco.shield.v2.Uint256 max_priority_fee_per_gas = 8;
213
- */
214
- maxPriorityFeePerGas;
215
- /**
216
- * Data passed into the account to verify authorization.
217
- *
218
- * @generated from field: bytes signature = 9;
219
- */
220
- signature = new Uint8Array(0);
221
- /**
222
- * Account factory. Only for new accounts. Optional.
223
- *
224
- * @generated from field: optional inco.shield.v2.Address factory = 10;
225
- */
226
- factory;
227
- /**
228
- * Data for account factory. Optional.
229
- *
230
- * @generated from field: optional bytes factory_data = 11;
231
- */
232
- factoryData;
233
- /**
234
- * Address of paymaster contract. Optional.
235
- *
236
- * @generated from field: optional inco.shield.v2.Address paymaster = 12;
237
- */
238
- paymaster;
239
- /**
240
- * Data for paymaster. Optional.
241
- *
242
- * @generated from field: optional bytes paymaster_data = 13;
243
- */
244
- paymasterData;
245
- /**
246
- * The amount of gas to allocate for the paymaster validation code. Optional.
247
- *
248
- * @generated from field: optional inco.shield.v2.Uint256 paymaster_verification_gas_limit = 14;
249
- */
250
- paymasterVerificationGasLimit;
251
- /**
252
- * The amount of gas to allocate for the paymaster post-operation code. Optional.
253
- *
254
- * EIP-7702 authorization data is skipped for now, as we don't use it in our
255
- * system.
256
- *
257
- * @generated from field: optional inco.shield.v2.Uint256 paymaster_post_op_gas_limit = 15;
258
- */
259
- paymasterPostOpGasLimit;
260
- constructor(data) {
261
- super();
262
- proto3.util.initPartial(data, this);
263
- }
264
- static runtime = proto3;
265
- static typeName = "inco.shield.v2.UserOp07";
266
- static fields = proto3.util.newFieldList(() => [
267
- { no: 1, name: "sender", kind: "message", T: Address },
268
- { no: 2, name: "nonce", kind: "message", T: Uint256 },
269
- { no: 3, name: "call_data", kind: "scalar", T: 12 /* ScalarType.BYTES */ },
270
- { no: 4, name: "call_gas_limit", kind: "message", T: Uint256 },
271
- { no: 5, name: "verification_gas_limit", kind: "message", T: Uint256 },
272
- { no: 6, name: "pre_verification_gas", kind: "message", T: Uint256 },
273
- { no: 7, name: "max_fee_per_gas", kind: "message", T: Uint256 },
274
- { no: 8, name: "max_priority_fee_per_gas", kind: "message", T: Uint256 },
275
- { no: 9, name: "signature", kind: "scalar", T: 12 /* ScalarType.BYTES */ },
276
- { no: 10, name: "factory", kind: "message", T: Address, opt: true },
277
- { no: 11, name: "factory_data", kind: "scalar", T: 12 /* ScalarType.BYTES */, opt: true },
278
- { no: 12, name: "paymaster", kind: "message", T: Address, opt: true },
279
- { no: 13, name: "paymaster_data", kind: "scalar", T: 12 /* ScalarType.BYTES */, opt: true },
280
- { no: 14, name: "paymaster_verification_gas_limit", kind: "message", T: Uint256, opt: true },
281
- { no: 15, name: "paymaster_post_op_gas_limit", kind: "message", T: Uint256, opt: true },
282
- ]);
283
- static fromBinary(bytes, options) {
284
- return new UserOp07().fromBinary(bytes, options);
285
- }
286
- static fromJson(jsonValue, options) {
287
- return new UserOp07().fromJson(jsonValue, options);
288
- }
289
- static fromJsonString(jsonString, options) {
290
- return new UserOp07().fromJsonString(jsonString, options);
291
- }
292
- static equals(a, b) {
293
- return proto3.util.equals(UserOp07, a, b);
294
- }
295
- }
296
- /**
297
- * Cheque is the output of the drafting process. It is not submitted on-chain,
298
- * and is only returned to the user after drafting for information purposes.
299
- *
300
- * @generated from message inco.shield.v2.Cheque
301
- */
302
- export class Cheque extends Message {
303
- /**
304
- * @generated from field: uint64 cheque_number = 1;
305
- */
306
- chequeNumber = protoInt64.zero;
307
- /**
308
- * @generated from field: inco.shield.v2.Handle drafting_handle = 2;
309
- */
310
- draftingHandle;
311
- /**
312
- * @generated from field: uint64 drafting_timestamp = 3;
313
- */
314
- draftingTimestamp = protoInt64.zero;
315
- /**
316
- * @generated from field: inco.shield.v2.Bytes32 nullifier = 4;
317
- */
318
- nullifier;
319
- /**
320
- * The (sender, receiver, amount, assetId) transfer tuple.
321
- *
322
- * @generated from field: inco.shield.v2.Address sender = 5;
323
- */
324
- sender;
325
- /**
326
- * @generated from field: inco.shield.v2.Address receiver = 6;
327
- */
328
- receiver;
329
- /**
330
- * @generated from field: inco.shield.v2.AssetId asset_id = 7;
331
- */
332
- assetId;
333
- /**
334
- * @generated from field: inco.shield.v2.Uint256 amount = 8;
335
- */
336
- amount;
337
- /**
338
- * Optional: set for delegated drafts, absent for plain drafts.
339
- *
340
- * @generated from field: inco.shield.v2.Bytes32 permission_id = 9;
341
- */
342
- permissionId;
343
- constructor(data) {
344
- super();
345
- proto3.util.initPartial(data, this);
346
- }
347
- static runtime = proto3;
348
- static typeName = "inco.shield.v2.Cheque";
349
- static fields = proto3.util.newFieldList(() => [
350
- { no: 1, name: "cheque_number", kind: "scalar", T: 4 /* ScalarType.UINT64 */ },
351
- { no: 2, name: "drafting_handle", kind: "message", T: Handle },
352
- { no: 3, name: "drafting_timestamp", kind: "scalar", T: 4 /* ScalarType.UINT64 */ },
353
- { no: 4, name: "nullifier", kind: "message", T: Bytes32 },
354
- { no: 5, name: "sender", kind: "message", T: Address },
355
- { no: 6, name: "receiver", kind: "message", T: Address },
356
- { no: 7, name: "asset_id", kind: "message", T: AssetId },
357
- { no: 8, name: "amount", kind: "message", T: Uint256 },
358
- { no: 9, name: "permission_id", kind: "message", T: Bytes32 },
359
- ]);
360
- static fromBinary(bytes, options) {
361
- return new Cheque().fromBinary(bytes, options);
362
- }
363
- static fromJson(jsonValue, options) {
364
- return new Cheque().fromJson(jsonValue, options);
365
- }
366
- static fromJsonString(jsonString, options) {
367
- return new Cheque().fromJsonString(jsonString, options);
368
- }
369
- static equals(a, b) {
370
- return proto3.util.equals(Cheque, a, b);
371
- }
372
- }
19
+ export const IntentKindSchema = enumDesc(file_inco_shield_v2_drafting, 0);
@@ -1,166 +1,47 @@
1
- import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf";
2
- import { Message, proto3 } from "@bufbuild/protobuf";
3
- /**
4
- * Address represents a 20-byte Ethereum address.
5
- * Stored as raw bytes to avoid encoding ambiguity (0x prefix, capitalization).
6
- *
7
- * @generated from message inco.shield.v2.Address
8
- */
9
- export declare class Address extends Message<Address> {
10
- /**
11
- * The raw 20-byte address value.
12
- *
13
- * @generated from field: bytes value = 1;
14
- */
15
- value: Uint8Array<ArrayBuffer>;
16
- constructor(data?: PartialMessage<Address>);
17
- static readonly runtime: typeof proto3;
18
- static readonly typeName = "inco.shield.v2.Address";
19
- static readonly fields: FieldList;
20
- static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): Address;
21
- static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): Address;
22
- static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): Address;
23
- static equals(a: Address | PlainMessage<Address> | undefined, b: Address | PlainMessage<Address> | undefined): boolean;
24
- }
25
- /**
26
- * Bytes32 represents a 32-byte value, used for hashes and other fixed-size data.
27
- *
28
- * @generated from message inco.shield.v2.Bytes32
29
- */
30
- export declare class Bytes32 extends Message<Bytes32> {
31
- /**
32
- * The raw 32-byte value.
33
- *
34
- * @generated from field: bytes value = 1;
35
- */
36
- value: Uint8Array<ArrayBuffer>;
37
- constructor(data?: PartialMessage<Bytes32>);
38
- static readonly runtime: typeof proto3;
39
- static readonly typeName = "inco.shield.v2.Bytes32";
40
- static readonly fields: FieldList;
41
- static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): Bytes32;
42
- static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): Bytes32;
43
- static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): Bytes32;
44
- static equals(a: Bytes32 | PlainMessage<Bytes32> | undefined, b: Bytes32 | PlainMessage<Bytes32> | undefined): boolean;
45
- }
46
- /**
47
- * Handle is a unique identifier for a position in the shield state.
48
- * Used to track the covalidator's view of the on-chain state.
49
- *
50
- * @generated from message inco.shield.v2.Handle
51
- */
52
- export declare class Handle extends Message<Handle> {
53
- /**
54
- * The 32-byte handle value.
55
- *
56
- * @generated from field: bytes value = 1;
57
- */
58
- value: Uint8Array<ArrayBuffer>;
59
- constructor(data?: PartialMessage<Handle>);
60
- static readonly runtime: typeof proto3;
61
- static readonly typeName = "inco.shield.v2.Handle";
62
- static readonly fields: FieldList;
63
- static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): Handle;
64
- static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): Handle;
65
- static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): Handle;
66
- static equals(a: Handle | PlainMessage<Handle> | undefined, b: Handle | PlainMessage<Handle> | undefined): boolean;
67
- }
68
- /**
69
- * AssetId identifies a specific asset type within the shield system.
70
- * Typically derived from the token contract address.
71
- *
72
- * @generated from message inco.shield.v2.AssetId
73
- */
74
- export declare class AssetId extends Message<AssetId> {
75
- /**
76
- * The 32-byte asset identifier.
77
- *
78
- * @generated from field: bytes value = 1;
79
- */
80
- value: Uint8Array<ArrayBuffer>;
81
- constructor(data?: PartialMessage<AssetId>);
82
- static readonly runtime: typeof proto3;
83
- static readonly typeName = "inco.shield.v2.AssetId";
84
- static readonly fields: FieldList;
85
- static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): AssetId;
86
- static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): AssetId;
87
- static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): AssetId;
88
- static equals(a: AssetId | PlainMessage<AssetId> | undefined, b: AssetId | PlainMessage<AssetId> | undefined): boolean;
89
- }
90
- /**
91
- * Uint256 is an unsigned 256-bit integer.
92
- *
93
- * Wire encoding: `value` is exactly 32 bytes, big-endian, unsigned. Same
94
- * byte layout as Solidity's `uint256` ABI encoding. Producers write the
95
- * integer to a 32-byte buffer big-endian (left-zero-padded); consumers
96
- * read the 32 bytes as a big-endian unsigned integer. The zero value is
97
- * 32 zero bytes (not an empty `value`). Length other than 32 is invalid.
98
- *
99
- * @generated from message inco.shield.v2.Uint256
100
- */
101
- export declare class Uint256 extends Message<Uint256> {
102
- /**
103
- * @generated from field: bytes value = 1;
104
- */
105
- value: Uint8Array<ArrayBuffer>;
106
- constructor(data?: PartialMessage<Uint256>);
107
- static readonly runtime: typeof proto3;
108
- static readonly typeName = "inco.shield.v2.Uint256";
109
- static readonly fields: FieldList;
110
- static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): Uint256;
111
- static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): Uint256;
112
- static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): Uint256;
113
- static equals(a: Uint256 | PlainMessage<Uint256> | undefined, b: Uint256 | PlainMessage<Uint256> | undefined): boolean;
114
- }
115
- /**
116
- * EncryptedEnvelope wraps an authenticated payload for the covalidator.
117
- * The covalidator determines the inner plaintext type from the RPC method being called.
118
- * The payload is serialized into a protobuf message and encrypted using the TEE's public key.
119
- *
120
- * @generated from message inco.shield.v2.EncryptedEnvelope
121
- */
122
- export declare class EncryptedEnvelope extends Message<EncryptedEnvelope> {
123
- /**
124
- * The payload bytes, encrypted using the TEE's public key.
125
- *
126
- * @generated from field: bytes payload = 1;
127
- */
128
- payload: Uint8Array<ArrayBuffer>;
129
- constructor(data?: PartialMessage<EncryptedEnvelope>);
130
- static readonly runtime: typeof proto3;
131
- static readonly typeName = "inco.shield.v2.EncryptedEnvelope";
132
- static readonly fields: FieldList;
133
- static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): EncryptedEnvelope;
134
- static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): EncryptedEnvelope;
135
- static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): EncryptedEnvelope;
136
- static equals(a: EncryptedEnvelope | PlainMessage<EncryptedEnvelope> | undefined, b: EncryptedEnvelope | PlainMessage<EncryptedEnvelope> | undefined): boolean;
137
- }
138
- /**
139
- * EncryptedResponse wraps a response payload from the covalidator.
140
- * The response is serialized into a protobuf message and AEAD-encrypted using the caller's response_key.
141
- * The nonce and ciphertext are always populated.
142
- *
143
- * @generated from message inco.shield.v2.EncryptedResponse
144
- */
145
- export declare class EncryptedResponse extends Message<EncryptedResponse> {
146
- /**
147
- * The AEAD nonce used to encrypt the response payload.
148
- *
149
- * @generated from field: bytes nonce = 1;
150
- */
151
- nonce: Uint8Array<ArrayBuffer>;
152
- /**
153
- * The AEAD-encrypted serialized response payload.
154
- *
155
- * @generated from field: bytes ciphertext = 2;
156
- */
157
- ciphertext: Uint8Array<ArrayBuffer>;
158
- constructor(data?: PartialMessage<EncryptedResponse>);
159
- static readonly runtime: typeof proto3;
160
- static readonly typeName = "inco.shield.v2.EncryptedResponse";
161
- static readonly fields: FieldList;
162
- static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): EncryptedResponse;
163
- static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): EncryptedResponse;
164
- static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): EncryptedResponse;
165
- static equals(a: EncryptedResponse | PlainMessage<EncryptedResponse> | undefined, b: EncryptedResponse | PlainMessage<EncryptedResponse> | undefined): boolean;
166
- }
1
+ import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2";
2
+ import type { Message } from "@bufbuild/protobuf";
3
+ export declare const file_inco_shield_v2_types: GenFile;
4
+ export type Address = Message<"inco.shield.v2.Address"> & {
5
+ value: Uint8Array;
6
+ };
7
+ export declare const AddressSchema: GenMessage<Address>;
8
+ export type Bytes32 = Message<"inco.shield.v2.Bytes32"> & {
9
+ value: Uint8Array;
10
+ };
11
+ export declare const Bytes32Schema: GenMessage<Bytes32>;
12
+ export type Handle = Message<"inco.shield.v2.Handle"> & {
13
+ value: Uint8Array;
14
+ };
15
+ export declare const HandleSchema: GenMessage<Handle>;
16
+ export type AssetId = Message<"inco.shield.v2.AssetId"> & {
17
+ value: Uint8Array;
18
+ };
19
+ export declare const AssetIdSchema: GenMessage<AssetId>;
20
+ export type Uint256 = Message<"inco.shield.v2.Uint256"> & {
21
+ value: Uint8Array;
22
+ };
23
+ export declare const Uint256Schema: GenMessage<Uint256>;
24
+ export type EncryptedEnvelope = Message<"inco.shield.v2.EncryptedEnvelope"> & {
25
+ payload: Uint8Array;
26
+ };
27
+ export declare const EncryptedEnvelopeSchema: GenMessage<EncryptedEnvelope>;
28
+ export type RequestAuth = Message<"inco.shield.v2.RequestAuth"> & {
29
+ eip712Signature?: Uint8Array | undefined;
30
+ responseKey: Uint8Array;
31
+ };
32
+ export declare const RequestAuthSchema: GenMessage<RequestAuth>;
33
+ export type SignedRequest = Message<"inco.shield.v2.SignedRequest"> & {
34
+ auth?: RequestAuth | undefined;
35
+ body: Uint8Array;
36
+ };
37
+ export declare const SignedRequestSchema: GenMessage<SignedRequest>;
38
+ export type EncryptedResponse = Message<"inco.shield.v2.EncryptedResponse"> & {
39
+ nonce: Uint8Array;
40
+ ciphertext: Uint8Array;
41
+ };
42
+ export declare const EncryptedResponseSchema: GenMessage<EncryptedResponse>;
43
+ export type SignedResponse = Message<"inco.shield.v2.SignedResponse"> & {
44
+ body: Uint8Array;
45
+ teeSignature: Uint8Array;
46
+ };
47
+ export declare const SignedResponseSchema: GenMessage<SignedResponse>;