@meantjs/profile 0.3.0 → 0.4.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 CHANGED
@@ -2,6 +2,15 @@
2
2
 
3
3
  The five Candid Profile library packages (`@meantjs/profile`, `/format`, `/consent`, `/tools`, `/reconcile`) release together under one version and pin each other exactly; a version appears here even when this package did not change. Release steps: `docs/releasing.md` in the repository.
4
4
 
5
+ ## 0.4.0 — 2026-10-30
6
+
7
+ - What a call grants (spec §5.3, D-056): an `effect` of kind `transfer` or `approve` may carry `grant`, the positions of
8
+ who may take the tokens (`spender` or `to`), the `amount` and the `ends`. The validator checks them (new code
9
+ `E_GRANT`); a pack whose grant does not hold where it applies keeps its effect and loses the grant
10
+ (`I_PACK_ANNOTATION_SKIPPED`). The resolved form carries `grant` inside `effect`.
11
+ - The packs carry grants: `icrc1`, `icrc2`, `erc20` and `erc2612`, and the contract profiles `permit2` and
12
+ `dai-permit`. Their profile ids changed with them.
13
+
5
14
  ## 0.3.0 — 2026-10-29
6
15
 
7
16
  - EIP-712 typed messages, experimental (spec §15.9, D-055). A contract profile or EVM pack may carry
@@ -58,7 +58,11 @@
58
58
  "tag": "effect",
59
59
  "args": {
60
60
  "kind": "approve",
61
- "irreversible": false
61
+ "irreversible": false,
62
+ "grant": {
63
+ "spender": "spender",
64
+ "amount": "allowed"
65
+ }
62
66
  }
63
67
  },
64
68
  {
@@ -33,7 +33,11 @@
33
33
  "tag": "effect",
34
34
  "args": {
35
35
  "kind": "transfer",
36
- "irreversible": true
36
+ "irreversible": true,
37
+ "grant": {
38
+ "to": "to",
39
+ "amount": "value"
40
+ }
37
41
  }
38
42
  },
39
43
  {
@@ -75,7 +79,11 @@
75
79
  "tag": "effect",
76
80
  "args": {
77
81
  "kind": "approve",
78
- "irreversible": false
82
+ "irreversible": false,
83
+ "grant": {
84
+ "spender": "spender",
85
+ "amount": "value"
86
+ }
79
87
  }
80
88
  },
81
89
  {
@@ -57,7 +57,11 @@
57
57
  "tag": "effect",
58
58
  "args": {
59
59
  "kind": "approve",
60
- "irreversible": false
60
+ "irreversible": false,
61
+ "grant": {
62
+ "spender": "spender",
63
+ "amount": "value"
64
+ }
61
65
  }
62
66
  },
63
67
  {
@@ -131,7 +135,11 @@
131
135
  "tag": "effect",
132
136
  "args": {
133
137
  "kind": "approve",
134
- "irreversible": false
138
+ "irreversible": false,
139
+ "grant": {
140
+ "spender": "spender",
141
+ "amount": "value"
142
+ }
135
143
  }
136
144
  },
137
145
  {
@@ -25,7 +25,11 @@
25
25
  "tag": "effect",
26
26
  "args": {
27
27
  "kind": "transfer",
28
- "irreversible": true
28
+ "irreversible": true,
29
+ "grant": {
30
+ "to": "to",
31
+ "amount": "amount"
32
+ }
29
33
  }
30
34
  },
31
35
  {
@@ -25,7 +25,14 @@
25
25
  "tag": "effect",
26
26
  "args": {
27
27
  "kind": "approve",
28
- "irreversible": false
28
+ "irreversible": false,
29
+ "grant": {
30
+ "spender": "spender",
31
+ "amount": "amount",
32
+ "ends": [
33
+ "expires_at"
34
+ ]
35
+ }
29
36
  }
30
37
  },
31
38
  {
@@ -131,7 +131,15 @@
131
131
  "tag": "effect",
132
132
  "args": {
133
133
  "kind": "approve",
134
- "irreversible": false
134
+ "irreversible": false,
135
+ "grant": {
136
+ "spender": "spender",
137
+ "amount": "details.amount",
138
+ "ends": [
139
+ "details.expiration",
140
+ "sigDeadline"
141
+ ]
142
+ }
135
143
  }
136
144
  },
137
145
  {
@@ -309,7 +317,14 @@
309
317
  "tag": "effect",
310
318
  "args": {
311
319
  "kind": "transfer",
312
- "irreversible": true
320
+ "irreversible": true,
321
+ "grant": {
322
+ "spender": "spender",
323
+ "amount": "permitted.amount",
324
+ "ends": [
325
+ "deadline"
326
+ ]
327
+ }
313
328
  }
314
329
  },
315
330
  {
@@ -1140,9 +1140,62 @@
1140
1140
  },
1141
1141
  "replicated": {
1142
1142
  "type": "boolean"
1143
+ },
1144
+ "grant": {
1145
+ "$ref": "#/$defs/grant",
1146
+ "description": "What a transfer or approve lets someone take (spec section 5.3, D-056), for a check against terms the user confirmed."
1143
1147
  }
1144
1148
  }
1145
1149
  },
1150
+ "grant": {
1151
+ "type": "object",
1152
+ "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.",
1153
+ "required": [
1154
+ "amount"
1155
+ ],
1156
+ "additionalProperties": false,
1157
+ "properties": {
1158
+ "spender": {
1159
+ "$ref": "#/$defs/relpath",
1160
+ "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."
1161
+ },
1162
+ "to": {
1163
+ "$ref": "#/$defs/relpath",
1164
+ "description": "Who a transfer pays directly: an address, or a position with an account tag."
1165
+ },
1166
+ "amount": {
1167
+ "$ref": "#/$defs/relpath",
1168
+ "description": "A position with an amount tag, whose threshold means unlimited; or a bool, where true is unlimited and false grants nothing."
1169
+ },
1170
+ "ends": {
1171
+ "type": "array",
1172
+ "minItems": 1,
1173
+ "maxItems": 8,
1174
+ "items": {
1175
+ "$ref": "#/$defs/relpath"
1176
+ },
1177
+ "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."
1178
+ }
1179
+ },
1180
+ "oneOf": [
1181
+ {
1182
+ "required": [
1183
+ "spender"
1184
+ ],
1185
+ "properties": {
1186
+ "spender": true
1187
+ }
1188
+ },
1189
+ {
1190
+ "required": [
1191
+ "to"
1192
+ ],
1193
+ "properties": {
1194
+ "to": true
1195
+ }
1196
+ }
1197
+ ]
1198
+ },
1146
1199
  "args_idempotency": {
1147
1200
  "type": "object",
1148
1201
  "required": [