@meantjs/profile 0.3.0 → 0.5.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.
@@ -0,0 +1,309 @@
1
+ {
2
+ "format": "candid-profile",
3
+ "format_version": 0,
4
+ "kind": "contract",
5
+ "name": "usdc",
6
+ "origin": "third_party",
7
+ "language": "en",
8
+ "description": "USDC's EIP-3009 messages on Ethereum, Base and Arbitrum (spec section 15.9, experimental). TransferWithAuthorization and ReceiveWithAuthorization pay `to` once, by a signature that someone else submits (only the payee, for ReceiveWithAuthorization), and CancelAuthorization cancels one that is unused (EIP-3009; Circle stablecoin-evm, FiatTokenV2.sol). x402's `exact` scheme pays by TransferWithAuthorization by default (coinbase/x402, specs/schemes/exact/scheme_exact_evm.md). Only the messages are described: USDC's ABI names transferWithAuthorization, receiveWithAuthorization, cancelAuthorization and permit twice each, which the resolver refuses (O1). Bound to USDC's domain (`USD Coin`, version `2`) and to its contracts, each read on chain on 2026-10-30 (DOMAIN_SEPARATOR, decimals 6, the three type hashes), so a look-alike token gets none of these words.",
9
+ "binds": {
10
+ "eip712": {
11
+ "domain": {
12
+ "name": "USD Coin",
13
+ "version": "2"
14
+ },
15
+ "types": {
16
+ "CancelAuthorization": [
17
+ {
18
+ "name": "authorizer",
19
+ "type": "address"
20
+ },
21
+ {
22
+ "name": "nonce",
23
+ "type": "bytes32"
24
+ }
25
+ ],
26
+ "ReceiveWithAuthorization": [
27
+ {
28
+ "name": "from",
29
+ "type": "address"
30
+ },
31
+ {
32
+ "name": "to",
33
+ "type": "address"
34
+ },
35
+ {
36
+ "name": "value",
37
+ "type": "uint256"
38
+ },
39
+ {
40
+ "name": "validAfter",
41
+ "type": "uint256"
42
+ },
43
+ {
44
+ "name": "validBefore",
45
+ "type": "uint256"
46
+ },
47
+ {
48
+ "name": "nonce",
49
+ "type": "bytes32"
50
+ }
51
+ ],
52
+ "TransferWithAuthorization": [
53
+ {
54
+ "name": "from",
55
+ "type": "address"
56
+ },
57
+ {
58
+ "name": "to",
59
+ "type": "address"
60
+ },
61
+ {
62
+ "name": "value",
63
+ "type": "uint256"
64
+ },
65
+ {
66
+ "name": "validAfter",
67
+ "type": "uint256"
68
+ },
69
+ {
70
+ "name": "validBefore",
71
+ "type": "uint256"
72
+ },
73
+ {
74
+ "name": "nonce",
75
+ "type": "bytes32"
76
+ }
77
+ ]
78
+ }
79
+ },
80
+ "deployments": [
81
+ {
82
+ "chain_id": 1,
83
+ "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
84
+ },
85
+ {
86
+ "chain_id": 8453,
87
+ "address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
88
+ },
89
+ {
90
+ "chain_id": 42161,
91
+ "address": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
92
+ }
93
+ ]
94
+ },
95
+ "annotations": [
96
+ {
97
+ "at": "TransferWithAuthorization",
98
+ "tag": "intent",
99
+ "args": {
100
+ "title": "Pay USDC by signature",
101
+ "template": "Send {value} from {from} to {to}, once. Valid after {validAfter}. Expires: {validBefore}."
102
+ }
103
+ },
104
+ {
105
+ "at": "TransferWithAuthorization",
106
+ "tag": "effect",
107
+ "args": {
108
+ "kind": "transfer",
109
+ "irreversible": true,
110
+ "grant": {
111
+ "to": "to",
112
+ "amount": "value",
113
+ "ends": [
114
+ "validBefore"
115
+ ]
116
+ }
117
+ }
118
+ },
119
+ {
120
+ "at": "TransferWithAuthorization(0).from",
121
+ "tag": "describe",
122
+ "args": {
123
+ "label": "From"
124
+ }
125
+ },
126
+ {
127
+ "at": "TransferWithAuthorization(0).to",
128
+ "tag": "describe",
129
+ "args": {
130
+ "label": "To"
131
+ }
132
+ },
133
+ {
134
+ "at": "TransferWithAuthorization(0).value",
135
+ "tag": "amount",
136
+ "args": {
137
+ "decimals": 6,
138
+ "symbol": "USDC"
139
+ }
140
+ },
141
+ {
142
+ "at": "TransferWithAuthorization(0).value",
143
+ "tag": "describe",
144
+ "args": {
145
+ "label": "Amount"
146
+ }
147
+ },
148
+ {
149
+ "at": "TransferWithAuthorization(0).validAfter",
150
+ "tag": "timestamp",
151
+ "args": {
152
+ "unit": "s",
153
+ "epoch": "unix"
154
+ }
155
+ },
156
+ {
157
+ "at": "TransferWithAuthorization(0).validAfter",
158
+ "tag": "describe",
159
+ "args": {
160
+ "label": "Valid after"
161
+ }
162
+ },
163
+ {
164
+ "at": "TransferWithAuthorization(0).validBefore",
165
+ "tag": "timestamp",
166
+ "args": {
167
+ "unit": "s",
168
+ "epoch": "unix",
169
+ "threshold": "115792089237316195423570985008687907853269984665640564039457584007913129639935",
170
+ "message": "Never"
171
+ }
172
+ },
173
+ {
174
+ "at": "TransferWithAuthorization(0).validBefore",
175
+ "tag": "describe",
176
+ "args": {
177
+ "label": "Expires"
178
+ }
179
+ },
180
+ {
181
+ "at": "TransferWithAuthorization(0).nonce",
182
+ "tag": "describe",
183
+ "args": {
184
+ "label": "Nonce"
185
+ }
186
+ },
187
+ {
188
+ "at": "ReceiveWithAuthorization",
189
+ "tag": "intent",
190
+ "args": {
191
+ "title": "Pay USDC by signature, collected by the payee",
192
+ "template": "Send {value} from {from} to {to}, once; only {to} can submit it. Valid after {validAfter}. Expires: {validBefore}."
193
+ }
194
+ },
195
+ {
196
+ "at": "ReceiveWithAuthorization",
197
+ "tag": "effect",
198
+ "args": {
199
+ "kind": "transfer",
200
+ "irreversible": true,
201
+ "grant": {
202
+ "to": "to",
203
+ "amount": "value",
204
+ "ends": [
205
+ "validBefore"
206
+ ]
207
+ }
208
+ }
209
+ },
210
+ {
211
+ "at": "ReceiveWithAuthorization(0).from",
212
+ "tag": "describe",
213
+ "args": {
214
+ "label": "From"
215
+ }
216
+ },
217
+ {
218
+ "at": "ReceiveWithAuthorization(0).to",
219
+ "tag": "describe",
220
+ "args": {
221
+ "label": "To"
222
+ }
223
+ },
224
+ {
225
+ "at": "ReceiveWithAuthorization(0).value",
226
+ "tag": "amount",
227
+ "args": {
228
+ "decimals": 6,
229
+ "symbol": "USDC"
230
+ }
231
+ },
232
+ {
233
+ "at": "ReceiveWithAuthorization(0).value",
234
+ "tag": "describe",
235
+ "args": {
236
+ "label": "Amount"
237
+ }
238
+ },
239
+ {
240
+ "at": "ReceiveWithAuthorization(0).validAfter",
241
+ "tag": "timestamp",
242
+ "args": {
243
+ "unit": "s",
244
+ "epoch": "unix"
245
+ }
246
+ },
247
+ {
248
+ "at": "ReceiveWithAuthorization(0).validAfter",
249
+ "tag": "describe",
250
+ "args": {
251
+ "label": "Valid after"
252
+ }
253
+ },
254
+ {
255
+ "at": "ReceiveWithAuthorization(0).validBefore",
256
+ "tag": "timestamp",
257
+ "args": {
258
+ "unit": "s",
259
+ "epoch": "unix",
260
+ "threshold": "115792089237316195423570985008687907853269984665640564039457584007913129639935",
261
+ "message": "Never"
262
+ }
263
+ },
264
+ {
265
+ "at": "ReceiveWithAuthorization(0).validBefore",
266
+ "tag": "describe",
267
+ "args": {
268
+ "label": "Expires"
269
+ }
270
+ },
271
+ {
272
+ "at": "ReceiveWithAuthorization(0).nonce",
273
+ "tag": "describe",
274
+ "args": {
275
+ "label": "Nonce"
276
+ }
277
+ },
278
+ {
279
+ "at": "CancelAuthorization",
280
+ "tag": "intent",
281
+ "args": {
282
+ "title": "Cancel a USDC payment signature",
283
+ "template": "Cancel the unused USDC payment signature of {authorizer} with nonce {nonce}."
284
+ }
285
+ },
286
+ {
287
+ "at": "CancelAuthorization",
288
+ "tag": "effect",
289
+ "args": {
290
+ "kind": "write",
291
+ "irreversible": true
292
+ }
293
+ },
294
+ {
295
+ "at": "CancelAuthorization(0).authorizer",
296
+ "tag": "describe",
297
+ "args": {
298
+ "label": "Signer of the payment"
299
+ }
300
+ },
301
+ {
302
+ "at": "CancelAuthorization(0).nonce",
303
+ "tag": "describe",
304
+ "args": {
305
+ "label": "Nonce"
306
+ }
307
+ }
308
+ ]
309
+ }
@@ -0,0 +1,187 @@
1
+ {
2
+ "format": "candid-profile",
3
+ "format_version": 0,
4
+ "kind": "contract",
5
+ "name": "x402-exact-permit2",
6
+ "origin": "third_party",
7
+ "language": "en",
8
+ "description": "x402's `exact` payment through Permit2 (spec section 15.9, experimental): Permit2's PermitWitnessTransferFrom with x402's witness, Witness(address to,uint256 validAfter), which x402 uses for tokens without EIP-3009 (coinbase/x402, specs/schemes/exact/scheme_exact_evm.md). Permit2 lets the spender choose where the tokens go and never reads the witness, so the witness's `to` is the payee only when the spender is x402's proxy, 0x402085c248EeA27D92E8b30b2C58ed07f9E20001, whose `settle` sends exactly `permitted.amount` to `witness.to`, not before `validAfter` (contracts/evm/src/x402BasePermit2Proxy.sol). The spender is therefore fixed to the proxy, and a request with any other spender gets no text (E_FIXED). Bound to Permit2's domain and deployments; the proxy has the same code on each of these chains (read on chain on 2026-10-30). Amounts are in the token the message names: a consumer supplies that token's decimals() and symbol(), and shows its address beside the symbol.",
9
+ "binds": {
10
+ "eip712": {
11
+ "domain": {
12
+ "name": "Permit2"
13
+ },
14
+ "types": {
15
+ "PermitWitnessTransferFrom": [
16
+ {
17
+ "name": "permitted",
18
+ "type": "TokenPermissions"
19
+ },
20
+ {
21
+ "name": "spender",
22
+ "type": "address"
23
+ },
24
+ {
25
+ "name": "nonce",
26
+ "type": "uint256"
27
+ },
28
+ {
29
+ "name": "deadline",
30
+ "type": "uint256"
31
+ },
32
+ {
33
+ "name": "witness",
34
+ "type": "Witness"
35
+ }
36
+ ],
37
+ "TokenPermissions": [
38
+ {
39
+ "name": "token",
40
+ "type": "address"
41
+ },
42
+ {
43
+ "name": "amount",
44
+ "type": "uint256"
45
+ }
46
+ ],
47
+ "Witness": [
48
+ {
49
+ "name": "to",
50
+ "type": "address"
51
+ },
52
+ {
53
+ "name": "validAfter",
54
+ "type": "uint256"
55
+ }
56
+ ]
57
+ }
58
+ },
59
+ "deployments": [
60
+ {
61
+ "chain_id": 1,
62
+ "address": "0x000000000022D473030F116dDEE9F6B43aC78BA3"
63
+ },
64
+ {
65
+ "chain_id": 8453,
66
+ "address": "0x000000000022D473030F116dDEE9F6B43aC78BA3"
67
+ },
68
+ {
69
+ "chain_id": 42161,
70
+ "address": "0x000000000022D473030F116dDEE9F6B43aC78BA3"
71
+ },
72
+ {
73
+ "chain_id": 84532,
74
+ "address": "0x000000000022D473030F116dDEE9F6B43aC78BA3"
75
+ }
76
+ ]
77
+ },
78
+ "annotations": [
79
+ {
80
+ "at": "PermitWitnessTransferFrom",
81
+ "tag": "intent",
82
+ "args": {
83
+ "title": "Pay by x402 through Permit2",
84
+ "template": "Send {permitted.amount} to {witness.to}, once, through x402's payment contract. Usable from {witness.validAfter}. Signature expires: {deadline}."
85
+ }
86
+ },
87
+ {
88
+ "at": "PermitWitnessTransferFrom",
89
+ "tag": "effect",
90
+ "args": {
91
+ "kind": "transfer",
92
+ "irreversible": true,
93
+ "grant": {
94
+ "to": "witness.to",
95
+ "amount": "permitted.amount",
96
+ "ends": [
97
+ "deadline"
98
+ ]
99
+ }
100
+ }
101
+ },
102
+ {
103
+ "at": "PermitWitnessTransferFrom(0).permitted.token",
104
+ "tag": "describe",
105
+ "args": {
106
+ "label": "Token"
107
+ }
108
+ },
109
+ {
110
+ "at": "PermitWitnessTransferFrom(0).permitted.amount",
111
+ "tag": "amount",
112
+ "args": {
113
+ "token": "permitted.token"
114
+ }
115
+ },
116
+ {
117
+ "at": "PermitWitnessTransferFrom(0).permitted.amount",
118
+ "tag": "describe",
119
+ "args": {
120
+ "label": "Amount"
121
+ }
122
+ },
123
+ {
124
+ "at": "PermitWitnessTransferFrom(0).spender",
125
+ "tag": "fixed",
126
+ "args": {
127
+ "value": "0x402085c248EeA27D92E8b30b2C58ed07f9E20001"
128
+ }
129
+ },
130
+ {
131
+ "at": "PermitWitnessTransferFrom(0).spender",
132
+ "tag": "describe",
133
+ "args": {
134
+ "label": "x402's payment contract"
135
+ }
136
+ },
137
+ {
138
+ "at": "PermitWitnessTransferFrom(0).nonce",
139
+ "tag": "describe",
140
+ "args": {
141
+ "label": "Nonce"
142
+ }
143
+ },
144
+ {
145
+ "at": "PermitWitnessTransferFrom(0).deadline",
146
+ "tag": "timestamp",
147
+ "args": {
148
+ "unit": "s",
149
+ "epoch": "unix",
150
+ "threshold": "115792089237316195423570985008687907853269984665640564039457584007913129639935",
151
+ "message": "Never"
152
+ }
153
+ },
154
+ {
155
+ "at": "PermitWitnessTransferFrom(0).deadline",
156
+ "tag": "describe",
157
+ "args": {
158
+ "label": "Signature expires"
159
+ }
160
+ },
161
+ {
162
+ "at": "PermitWitnessTransferFrom(0).witness.to",
163
+ "tag": "describe",
164
+ "args": {
165
+ "label": "To"
166
+ }
167
+ },
168
+ {
169
+ "at": "PermitWitnessTransferFrom(0).witness.validAfter",
170
+ "tag": "timestamp",
171
+ "args": {
172
+ "unit": "s",
173
+ "epoch": "unix",
174
+ "labels": {
175
+ "0": "now"
176
+ }
177
+ }
178
+ },
179
+ {
180
+ "at": "PermitWitnessTransferFrom(0).witness.validAfter",
181
+ "tag": "describe",
182
+ "args": {
183
+ "label": "Usable from"
184
+ }
185
+ }
186
+ ]
187
+ }
@@ -422,7 +422,8 @@
422
422
  "outcome",
423
423
  "list",
424
424
  "names",
425
- "named"
425
+ "named",
426
+ "fixed"
426
427
  ]
427
428
  },
428
429
  "args": {
@@ -495,7 +496,8 @@
495
496
  "range",
496
497
  "default",
497
498
  "ui",
498
- "named"
499
+ "named",
500
+ "fixed"
499
501
  ]
500
502
  }
501
503
  }
@@ -818,6 +820,22 @@
818
820
  }
819
821
  }
820
822
  }
823
+ },
824
+ {
825
+ "if": {
826
+ "properties": {
827
+ "tag": {
828
+ "const": "fixed"
829
+ }
830
+ }
831
+ },
832
+ "then": {
833
+ "properties": {
834
+ "args": {
835
+ "$ref": "#/$defs/args_fixed"
836
+ }
837
+ }
838
+ }
821
839
  }
822
840
  ]
823
841
  },
@@ -1140,9 +1158,62 @@
1140
1158
  },
1141
1159
  "replicated": {
1142
1160
  "type": "boolean"
1161
+ },
1162
+ "grant": {
1163
+ "$ref": "#/$defs/grant",
1164
+ "description": "What a transfer or approve lets someone take (spec section 5.3, D-056), for a check against terms the user confirmed."
1143
1165
  }
1144
1166
  }
1145
1167
  },
1168
+ "grant": {
1169
+ "type": "object",
1170
+ "description": "Who may take the tokens, how many and until when, as relative paths into the method's arguments (spec section 5.3, D-056). Exactly one of spender and to.",
1171
+ "required": [
1172
+ "amount"
1173
+ ],
1174
+ "additionalProperties": false,
1175
+ "properties": {
1176
+ "spender": {
1177
+ "$ref": "#/$defs/relpath",
1178
+ "description": "Who may take the tokens through an allowance, or with a signature someone else submits: an address, or a position with an account tag."
1179
+ },
1180
+ "to": {
1181
+ "$ref": "#/$defs/relpath",
1182
+ "description": "Who a transfer pays directly: an address, or a position with an account tag."
1183
+ },
1184
+ "amount": {
1185
+ "$ref": "#/$defs/relpath",
1186
+ "description": "A position with an amount tag, whose threshold means unlimited; or a bool, where true is unlimited and false grants nothing."
1187
+ },
1188
+ "ends": {
1189
+ "type": "array",
1190
+ "minItems": 1,
1191
+ "maxItems": 8,
1192
+ "items": {
1193
+ "$ref": "#/$defs/relpath"
1194
+ },
1195
+ "description": "Positions with a timestamp tag; the grant ends at the latest of them, and one at its threshold or left out means never. Without ends, an approve never ends and a transfer ends when it is done."
1196
+ }
1197
+ },
1198
+ "oneOf": [
1199
+ {
1200
+ "required": [
1201
+ "spender"
1202
+ ],
1203
+ "properties": {
1204
+ "spender": true
1205
+ }
1206
+ },
1207
+ {
1208
+ "required": [
1209
+ "to"
1210
+ ],
1211
+ "properties": {
1212
+ "to": true
1213
+ }
1214
+ }
1215
+ ]
1216
+ },
1146
1217
  "args_idempotency": {
1147
1218
  "type": "object",
1148
1219
  "required": [
@@ -1255,6 +1326,21 @@
1255
1326
  ]
1256
1327
  }
1257
1328
  }
1329
+ },
1330
+ "args_fixed": {
1331
+ "type": "object",
1332
+ "required": [
1333
+ "value"
1334
+ ],
1335
+ "additionalProperties": false,
1336
+ "description": "An EVM address position the profile describes only with this value (spec section 15.4, D-058): a consumer refuses any other value before it shows text (E_FIXED). x402's Permit2 message pins its spender to x402's proxy this way.",
1337
+ "properties": {
1338
+ "value": {
1339
+ "type": "string",
1340
+ "pattern": "^0x[0-9a-fA-F]{40}$",
1341
+ "description": "The address, `0x` and 40 hex digits; in mixed case it must match its EIP-55 checksum (spec section 15.2)."
1342
+ }
1343
+ }
1258
1344
  }
1259
1345
  }
1260
1346
  }