@wireio/opp-solidity-models 1.0.0 → 1.0.7
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.
- package/README.md +17 -11
- package/contracts/sysio/opp/Opp.sol +182 -208
- package/contracts/sysio/opp/attestations/Attestations.sol +294 -329
- package/contracts/sysio/opp/types/Types.sol +66 -91
- package/index.d.ts +4 -0
- package/index.d.ts.map +1 -0
- package/index.js +4 -0
- package/index.ts +5 -0
- package/package.json +19 -11
- package/sysio/opp/attestations/attestations.d.ts +336 -0
- package/sysio/opp/attestations/attestations.d.ts.map +1 -0
- package/sysio/opp/attestations/attestations.js +670 -0
- package/sysio/opp/attestations/attestations.ts +895 -0
- package/sysio/opp/opp.d.ts +218 -0
- package/sysio/opp/opp.d.ts.map +1 -0
- package/sysio/opp/opp.js +451 -0
- package/sysio/opp/opp.ts +625 -0
- package/sysio/opp/types/types.d.ts +483 -0
- package/sysio/opp/types/types.d.ts.map +1 -0
- package/sysio/opp/types/types.js +666 -0
- package/sysio/opp/types/types.ts +747 -0
- package/index.mjs +0 -2
|
@@ -4,7 +4,7 @@ pragma solidity >=0.8.0 <0.9.0;
|
|
|
4
4
|
// Auto-generated by protoc-gen-solidity from sysio/opp/types/types.proto
|
|
5
5
|
// DO NOT EDIT
|
|
6
6
|
|
|
7
|
-
import {ProtobufRuntime} from "
|
|
7
|
+
import {ProtobufRuntime} from "../../../ProtobufRuntime.sol";
|
|
8
8
|
|
|
9
9
|
struct ChainId {
|
|
10
10
|
uint64 kind;
|
|
@@ -13,7 +13,7 @@ struct ChainId {
|
|
|
13
13
|
|
|
14
14
|
struct ChainAddress {
|
|
15
15
|
uint64 kind;
|
|
16
|
-
bytes
|
|
16
|
+
bytes address_;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
struct ChainSignature {
|
|
@@ -35,21 +35,21 @@ struct EncodingFlags {
|
|
|
35
35
|
|
|
36
36
|
library ChainIdCodec {
|
|
37
37
|
|
|
38
|
-
function encode(ChainId memory
|
|
38
|
+
function encode(ChainId memory chainId) internal pure returns (bytes memory) {
|
|
39
39
|
bytes memory buf = "";
|
|
40
40
|
|
|
41
41
|
// field 1: kind
|
|
42
42
|
buf = abi.encodePacked(buf, ProtobufRuntime._encode_key(0x8));
|
|
43
|
-
buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(
|
|
43
|
+
buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(chainId.kind));
|
|
44
44
|
|
|
45
45
|
// field 2: id
|
|
46
46
|
buf = abi.encodePacked(buf, ProtobufRuntime._encode_key(0x10));
|
|
47
|
-
buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(
|
|
47
|
+
buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(chainId.id));
|
|
48
48
|
|
|
49
49
|
return buf;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
function decode(bytes memory data) internal pure returns (ChainId memory
|
|
52
|
+
function decode(bytes memory data) internal pure returns (ChainId memory chainId) {
|
|
53
53
|
uint256 pos = 0;
|
|
54
54
|
uint256 end = data.length;
|
|
55
55
|
|
|
@@ -57,17 +57,14 @@ library ChainIdCodec {
|
|
|
57
57
|
uint64 tag;
|
|
58
58
|
(tag, pos) = ProtobufRuntime._decode_key(data, pos);
|
|
59
59
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
default:
|
|
69
|
-
pos = ProtobufRuntime._skip_field(data, pos, tag & 0x07);
|
|
70
|
-
break;
|
|
60
|
+
if (tag == 8) {
|
|
61
|
+
(chainId.kind, pos) = ProtobufRuntime._decode_varint(data, pos);
|
|
62
|
+
} else if (tag == 16) {
|
|
63
|
+
{ uint64 _v;
|
|
64
|
+
(_v, pos) = ProtobufRuntime._decode_varint(data, pos);
|
|
65
|
+
chainId.id = uint32(_v); }
|
|
66
|
+
} else {
|
|
67
|
+
pos = ProtobufRuntime._skip_field(data, pos, tag & 0x07);
|
|
71
68
|
}
|
|
72
69
|
}
|
|
73
70
|
}
|
|
@@ -75,21 +72,21 @@ library ChainIdCodec {
|
|
|
75
72
|
|
|
76
73
|
library ChainAddressCodec {
|
|
77
74
|
|
|
78
|
-
function encode(ChainAddress memory
|
|
75
|
+
function encode(ChainAddress memory chainAddress) internal pure returns (bytes memory) {
|
|
79
76
|
bytes memory buf = "";
|
|
80
77
|
|
|
81
78
|
// field 1: kind
|
|
82
79
|
buf = abi.encodePacked(buf, ProtobufRuntime._encode_key(0x8));
|
|
83
|
-
buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(
|
|
80
|
+
buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(chainAddress.kind));
|
|
84
81
|
|
|
85
82
|
// field 2: address
|
|
86
83
|
buf = abi.encodePacked(buf, ProtobufRuntime._encode_key(0x12));
|
|
87
|
-
buf = abi.encodePacked(buf, ProtobufRuntime._encode_bytes(
|
|
84
|
+
buf = abi.encodePacked(buf, ProtobufRuntime._encode_bytes(chainAddress.address_));
|
|
88
85
|
|
|
89
86
|
return buf;
|
|
90
87
|
}
|
|
91
88
|
|
|
92
|
-
function decode(bytes memory data) internal pure returns (ChainAddress memory
|
|
89
|
+
function decode(bytes memory data) internal pure returns (ChainAddress memory chainAddress) {
|
|
93
90
|
uint256 pos = 0;
|
|
94
91
|
uint256 end = data.length;
|
|
95
92
|
|
|
@@ -97,17 +94,12 @@ library ChainAddressCodec {
|
|
|
97
94
|
uint64 tag;
|
|
98
95
|
(tag, pos) = ProtobufRuntime._decode_key(data, pos);
|
|
99
96
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
(msg.address, pos) = ProtobufRuntime._decode_bytes(data, pos);
|
|
107
|
-
break;
|
|
108
|
-
default:
|
|
109
|
-
pos = ProtobufRuntime._skip_field(data, pos, tag & 0x07);
|
|
110
|
-
break;
|
|
97
|
+
if (tag == 8) {
|
|
98
|
+
(chainAddress.kind, pos) = ProtobufRuntime._decode_varint(data, pos);
|
|
99
|
+
} else if (tag == 18) {
|
|
100
|
+
(chainAddress.address_, pos) = ProtobufRuntime._decode_bytes(data, pos);
|
|
101
|
+
} else {
|
|
102
|
+
pos = ProtobufRuntime._skip_field(data, pos, tag & 0x07);
|
|
111
103
|
}
|
|
112
104
|
}
|
|
113
105
|
}
|
|
@@ -115,27 +107,27 @@ library ChainAddressCodec {
|
|
|
115
107
|
|
|
116
108
|
library ChainSignatureCodec {
|
|
117
109
|
|
|
118
|
-
function encode(ChainSignature memory
|
|
110
|
+
function encode(ChainSignature memory chainSignature) internal pure returns (bytes memory) {
|
|
119
111
|
bytes memory buf = "";
|
|
120
112
|
|
|
121
113
|
// field 1: actor
|
|
122
114
|
buf = abi.encodePacked(buf, ProtobufRuntime._encode_key(0xa));
|
|
123
|
-
bytes memory actor_encoded = ChainAddressCodec.encode(
|
|
115
|
+
bytes memory actor_encoded = ChainAddressCodec.encode(chainSignature.actor);
|
|
124
116
|
buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(uint64(actor_encoded.length)));
|
|
125
117
|
buf = abi.encodePacked(buf, actor_encoded);
|
|
126
118
|
|
|
127
119
|
// field 2: key_type
|
|
128
120
|
buf = abi.encodePacked(buf, ProtobufRuntime._encode_key(0x10));
|
|
129
|
-
buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(
|
|
121
|
+
buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(chainSignature.keyType));
|
|
130
122
|
|
|
131
123
|
// field 3: signature
|
|
132
124
|
buf = abi.encodePacked(buf, ProtobufRuntime._encode_key(0x1a));
|
|
133
|
-
buf = abi.encodePacked(buf, ProtobufRuntime._encode_bytes(
|
|
125
|
+
buf = abi.encodePacked(buf, ProtobufRuntime._encode_bytes(chainSignature.signature));
|
|
134
126
|
|
|
135
127
|
return buf;
|
|
136
128
|
}
|
|
137
129
|
|
|
138
|
-
function decode(bytes memory data) internal pure returns (ChainSignature memory
|
|
130
|
+
function decode(bytes memory data) internal pure returns (ChainSignature memory chainSignature) {
|
|
139
131
|
uint256 pos = 0;
|
|
140
132
|
uint256 end = data.length;
|
|
141
133
|
|
|
@@ -143,26 +135,18 @@ library ChainSignatureCodec {
|
|
|
143
135
|
uint64 tag;
|
|
144
136
|
(tag, pos) = ProtobufRuntime._decode_key(data, pos);
|
|
145
137
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
(msg.keyType, pos) = ProtobufRuntime._decode_varint(data, pos);
|
|
159
|
-
break;
|
|
160
|
-
case 26:
|
|
161
|
-
(msg.signature, pos) = ProtobufRuntime._decode_bytes(data, pos);
|
|
162
|
-
break;
|
|
163
|
-
default:
|
|
164
|
-
pos = ProtobufRuntime._skip_field(data, pos, tag & 0x07);
|
|
165
|
-
break;
|
|
138
|
+
if (tag == 10) {
|
|
139
|
+
uint64 _len;
|
|
140
|
+
(_len, pos) = ProtobufRuntime._decode_varint(data, pos);
|
|
141
|
+
bytes memory _sub = ProtobufRuntime._slice(data, pos, pos + uint256(_len));
|
|
142
|
+
chainSignature.actor = ChainAddressCodec.decode(_sub);
|
|
143
|
+
pos += uint256(_len);
|
|
144
|
+
} else if (tag == 16) {
|
|
145
|
+
(chainSignature.keyType, pos) = ProtobufRuntime._decode_varint(data, pos);
|
|
146
|
+
} else if (tag == 26) {
|
|
147
|
+
(chainSignature.signature, pos) = ProtobufRuntime._decode_bytes(data, pos);
|
|
148
|
+
} else {
|
|
149
|
+
pos = ProtobufRuntime._skip_field(data, pos, tag & 0x07);
|
|
166
150
|
}
|
|
167
151
|
}
|
|
168
152
|
}
|
|
@@ -170,21 +154,21 @@ library ChainSignatureCodec {
|
|
|
170
154
|
|
|
171
155
|
library TokenAmountCodec {
|
|
172
156
|
|
|
173
|
-
function encode(TokenAmount memory
|
|
157
|
+
function encode(TokenAmount memory tokenAmount) internal pure returns (bytes memory) {
|
|
174
158
|
bytes memory buf = "";
|
|
175
159
|
|
|
176
160
|
// field 1: kind
|
|
177
161
|
buf = abi.encodePacked(buf, ProtobufRuntime._encode_key(0x8));
|
|
178
|
-
buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(
|
|
162
|
+
buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(tokenAmount.kind));
|
|
179
163
|
|
|
180
164
|
// field 2: amount
|
|
181
165
|
buf = abi.encodePacked(buf, ProtobufRuntime._encode_key(0x10));
|
|
182
|
-
buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(
|
|
166
|
+
buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(uint64(tokenAmount.amount)));
|
|
183
167
|
|
|
184
168
|
return buf;
|
|
185
169
|
}
|
|
186
170
|
|
|
187
|
-
function decode(bytes memory data) internal pure returns (TokenAmount memory
|
|
171
|
+
function decode(bytes memory data) internal pure returns (TokenAmount memory tokenAmount) {
|
|
188
172
|
uint256 pos = 0;
|
|
189
173
|
uint256 end = data.length;
|
|
190
174
|
|
|
@@ -192,17 +176,14 @@ library TokenAmountCodec {
|
|
|
192
176
|
uint64 tag;
|
|
193
177
|
(tag, pos) = ProtobufRuntime._decode_key(data, pos);
|
|
194
178
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
default:
|
|
204
|
-
pos = ProtobufRuntime._skip_field(data, pos, tag & 0x07);
|
|
205
|
-
break;
|
|
179
|
+
if (tag == 8) {
|
|
180
|
+
(tokenAmount.kind, pos) = ProtobufRuntime._decode_varint(data, pos);
|
|
181
|
+
} else if (tag == 16) {
|
|
182
|
+
{ uint64 _v;
|
|
183
|
+
(_v, pos) = ProtobufRuntime._decode_varint(data, pos);
|
|
184
|
+
tokenAmount.amount = int64(_v); }
|
|
185
|
+
} else {
|
|
186
|
+
pos = ProtobufRuntime._skip_field(data, pos, tag & 0x07);
|
|
206
187
|
}
|
|
207
188
|
}
|
|
208
189
|
}
|
|
@@ -210,25 +191,25 @@ library TokenAmountCodec {
|
|
|
210
191
|
|
|
211
192
|
library EncodingFlagsCodec {
|
|
212
193
|
|
|
213
|
-
function encode(EncodingFlags memory
|
|
194
|
+
function encode(EncodingFlags memory encodingFlags) internal pure returns (bytes memory) {
|
|
214
195
|
bytes memory buf = "";
|
|
215
196
|
|
|
216
197
|
// field 1: endianness
|
|
217
198
|
buf = abi.encodePacked(buf, ProtobufRuntime._encode_key(0x8));
|
|
218
|
-
buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(
|
|
199
|
+
buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(encodingFlags.endianness));
|
|
219
200
|
|
|
220
201
|
// field 2: hash_algorithm
|
|
221
202
|
buf = abi.encodePacked(buf, ProtobufRuntime._encode_key(0x10));
|
|
222
|
-
buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(
|
|
203
|
+
buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(encodingFlags.hashAlgorithm));
|
|
223
204
|
|
|
224
205
|
// field 3: length_encoding
|
|
225
206
|
buf = abi.encodePacked(buf, ProtobufRuntime._encode_key(0x18));
|
|
226
|
-
buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(
|
|
207
|
+
buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(encodingFlags.lengthEncoding));
|
|
227
208
|
|
|
228
209
|
return buf;
|
|
229
210
|
}
|
|
230
211
|
|
|
231
|
-
function decode(bytes memory data) internal pure returns (EncodingFlags memory
|
|
212
|
+
function decode(bytes memory data) internal pure returns (EncodingFlags memory encodingFlags) {
|
|
232
213
|
uint256 pos = 0;
|
|
233
214
|
uint256 end = data.length;
|
|
234
215
|
|
|
@@ -236,20 +217,14 @@ library EncodingFlagsCodec {
|
|
|
236
217
|
uint64 tag;
|
|
237
218
|
(tag, pos) = ProtobufRuntime._decode_key(data, pos);
|
|
238
219
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
case 24:
|
|
248
|
-
(msg.lengthEncoding, pos) = ProtobufRuntime._decode_varint(data, pos);
|
|
249
|
-
break;
|
|
250
|
-
default:
|
|
251
|
-
pos = ProtobufRuntime._skip_field(data, pos, tag & 0x07);
|
|
252
|
-
break;
|
|
220
|
+
if (tag == 8) {
|
|
221
|
+
(encodingFlags.endianness, pos) = ProtobufRuntime._decode_varint(data, pos);
|
|
222
|
+
} else if (tag == 16) {
|
|
223
|
+
(encodingFlags.hashAlgorithm, pos) = ProtobufRuntime._decode_varint(data, pos);
|
|
224
|
+
} else if (tag == 24) {
|
|
225
|
+
(encodingFlags.lengthEncoding, pos) = ProtobufRuntime._decode_varint(data, pos);
|
|
226
|
+
} else {
|
|
227
|
+
pos = ProtobufRuntime._skip_field(data, pos, tag & 0x07);
|
|
253
228
|
}
|
|
254
229
|
}
|
|
255
230
|
}
|
package/index.d.ts
ADDED
package/index.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAEA,cAAc,0CAA0C,CAAC;AACzD,cAAc,oBAAoB,CAAC;AACnC,cAAc,4BAA4B,CAAC"}
|
package/index.js
ADDED
package/index.ts
ADDED
package/package.json
CHANGED
|
@@ -1,11 +1,19 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@wireio/opp-solidity-models",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "Auto-generated protobuf types for Solidity",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "index.
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@wireio/opp-solidity-models",
|
|
3
|
+
"version": "1.0.7",
|
|
4
|
+
"description": "Auto-generated protobuf types for Solidity",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "index.js",
|
|
7
|
+
"types": "index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"contracts",
|
|
10
|
+
"**/*.ts",
|
|
11
|
+
"**/*.js",
|
|
12
|
+
"**/*.d.ts",
|
|
13
|
+
"**/*.d.ts.map",
|
|
14
|
+
"*.js",
|
|
15
|
+
"README.md"
|
|
16
|
+
],
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"@protobuf-ts/runtime": "^2.9.4"
|
|
19
|
+
}}
|