@meantjs/profile 0.4.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.
- package/CHANGELOG.md +20 -0
- package/README.md +8 -4
- package/data/packs/permit2.profile.json +9 -1
- package/data/packs/usdc-base-sepolia.profile.json +301 -0
- package/data/packs/usdc.profile.json +309 -0
- package/data/packs/x402-exact-permit2.profile.json +187 -0
- package/data/profile-v0.schema.json +35 -2
- package/data/profile-v0.validate.mjs +3 -3
- package/package.json +1 -1
- package/src/analyze.mjs +55 -13
- package/src/browser.mjs +2 -1
- package/src/checks.mjs +22 -0
- package/src/resolve.mjs +3 -1
- package/src/served.mjs +6 -6
|
@@ -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
|
},
|
|
@@ -1308,6 +1326,21 @@
|
|
|
1308
1326
|
]
|
|
1309
1327
|
}
|
|
1310
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
|
+
}
|
|
1311
1344
|
}
|
|
1312
1345
|
}
|
|
1313
1346
|
}
|