@meantjs/profile 0.0.0-stage → 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.
@@ -0,0 +1,221 @@
1
+ {
2
+ "format": "candid-profile",
3
+ "format_version": 0,
4
+ "kind": "pack",
5
+ "name": "erc20",
6
+ "origin": "pack",
7
+ "language": "en",
8
+ "description": "Standard pack for EIP-20 tokens on EVM chains (spec section 15, experimental). Applies to any contract that has every function of `binds.abi` with the same selector, outputs and kind of call; parameter names may differ (they are matched by position). `name()` is left out: no annotation reads it and EIP-20 makes it optional. A token without `decimals()` or `symbol()` matches no pack and needs a contract profile with literal values.",
9
+ "binds": {
10
+ "standard": "ERC-20",
11
+ "spec_url": "https://eips.ethereum.org/EIPS/eip-20",
12
+ "abi": [
13
+ "function symbol() view returns (string)",
14
+ "function decimals() view returns (uint8)",
15
+ "function balanceOf(address owner) view returns (uint256)",
16
+ "function allowance(address owner, address spender) view returns (uint256)",
17
+ "function transfer(address to, uint256 value) returns (bool)",
18
+ "function approve(address spender, uint256 value) returns (bool)",
19
+ "function transferFrom(address from, address to, uint256 value) returns (bool)"
20
+ ]
21
+ },
22
+ "annotations": [
23
+ {
24
+ "at": "transfer",
25
+ "tag": "intent",
26
+ "args": {
27
+ "title": "Send tokens",
28
+ "template": "Send {value} to {to}"
29
+ }
30
+ },
31
+ {
32
+ "at": "transfer",
33
+ "tag": "effect",
34
+ "args": {
35
+ "kind": "transfer",
36
+ "irreversible": true
37
+ }
38
+ },
39
+ {
40
+ "at": "transfer(0).value",
41
+ "tag": "amount",
42
+ "args": {
43
+ "decimals": {
44
+ "from": "query:decimals"
45
+ },
46
+ "symbol": {
47
+ "from": "query:symbol"
48
+ }
49
+ }
50
+ },
51
+ {
52
+ "at": "transfer(0).value",
53
+ "tag": "describe",
54
+ "args": {
55
+ "label": "Amount"
56
+ }
57
+ },
58
+ {
59
+ "at": "transfer(0).to",
60
+ "tag": "describe",
61
+ "args": {
62
+ "label": "Recipient"
63
+ }
64
+ },
65
+ {
66
+ "at": "approve",
67
+ "tag": "intent",
68
+ "args": {
69
+ "title": "Approve spending",
70
+ "template": "Set {spender}'s allowance to {value}, replacing any existing allowance"
71
+ }
72
+ },
73
+ {
74
+ "at": "approve",
75
+ "tag": "effect",
76
+ "args": {
77
+ "kind": "approve",
78
+ "irreversible": false
79
+ }
80
+ },
81
+ {
82
+ "at": "approve(0).spender",
83
+ "tag": "describe",
84
+ "args": {
85
+ "label": "Spender"
86
+ }
87
+ },
88
+ {
89
+ "at": "approve(0).value",
90
+ "tag": "amount",
91
+ "args": {
92
+ "decimals": {
93
+ "from": "query:decimals"
94
+ },
95
+ "symbol": {
96
+ "from": "query:symbol"
97
+ },
98
+ "threshold": "115792089237316195423570985008687907853269984665640564039457584007913129639935",
99
+ "message": "Unlimited"
100
+ }
101
+ },
102
+ {
103
+ "at": "approve(0).value",
104
+ "tag": "describe",
105
+ "args": {
106
+ "label": "Allowance",
107
+ "help": "Maximum the spender may transfer. An approval replaces the previous allowance; it does not add to it."
108
+ }
109
+ },
110
+ {
111
+ "at": "transferFrom",
112
+ "tag": "intent",
113
+ "args": {
114
+ "title": "Transfer using allowance",
115
+ "template": "Move {value} from {from} to {to} using an allowance"
116
+ }
117
+ },
118
+ {
119
+ "at": "transferFrom",
120
+ "tag": "effect",
121
+ "args": {
122
+ "kind": "transfer",
123
+ "irreversible": true
124
+ }
125
+ },
126
+ {
127
+ "at": "transferFrom(0).from",
128
+ "tag": "describe",
129
+ "args": {
130
+ "label": "From"
131
+ }
132
+ },
133
+ {
134
+ "at": "transferFrom(0).to",
135
+ "tag": "describe",
136
+ "args": {
137
+ "label": "Recipient"
138
+ }
139
+ },
140
+ {
141
+ "at": "transferFrom(0).value",
142
+ "tag": "amount",
143
+ "args": {
144
+ "decimals": {
145
+ "from": "query:decimals"
146
+ },
147
+ "symbol": {
148
+ "from": "query:symbol"
149
+ }
150
+ }
151
+ },
152
+ {
153
+ "at": "transferFrom(0).value",
154
+ "tag": "describe",
155
+ "args": {
156
+ "label": "Amount"
157
+ }
158
+ },
159
+ {
160
+ "at": "balanceOf",
161
+ "tag": "describe",
162
+ "args": {
163
+ "label": "Balance of an address"
164
+ }
165
+ },
166
+ {
167
+ "at": "balanceOf(0).owner",
168
+ "tag": "describe",
169
+ "args": {
170
+ "label": "Owner"
171
+ }
172
+ },
173
+ {
174
+ "at": "balanceOf->(0)",
175
+ "tag": "amount",
176
+ "args": {
177
+ "decimals": {
178
+ "from": "query:decimals"
179
+ },
180
+ "symbol": {
181
+ "from": "query:symbol"
182
+ }
183
+ }
184
+ },
185
+ {
186
+ "at": "allowance",
187
+ "tag": "describe",
188
+ "args": {
189
+ "label": "Allowance of a spender"
190
+ }
191
+ },
192
+ {
193
+ "at": "allowance(0).owner",
194
+ "tag": "describe",
195
+ "args": {
196
+ "label": "Owner"
197
+ }
198
+ },
199
+ {
200
+ "at": "allowance(0).spender",
201
+ "tag": "describe",
202
+ "args": {
203
+ "label": "Spender"
204
+ }
205
+ },
206
+ {
207
+ "at": "allowance->(0)",
208
+ "tag": "amount",
209
+ "args": {
210
+ "decimals": {
211
+ "from": "query:decimals"
212
+ },
213
+ "symbol": {
214
+ "from": "query:symbol"
215
+ },
216
+ "threshold": "115792089237316195423570985008687907853269984665640564039457584007913129639935",
217
+ "message": "Unlimited"
218
+ }
219
+ }
220
+ ]
221
+ }
@@ -0,0 +1,275 @@
1
+ {
2
+ "format": "candid-profile",
3
+ "format_version": 0,
4
+ "kind": "pack",
5
+ "name": "icrc1",
6
+ "origin": "pack",
7
+ "language": "en",
8
+ "description": "Standard pack for ICRC-1 fungible token ledgers. Applies to any canister whose service is a subtype of `binds.requires`.",
9
+ "binds": {
10
+ "standard": "ICRC-1",
11
+ "spec_url": "https://github.com/dfinity/ICRC-1/blob/main/standards/ICRC-1/README.md",
12
+ "requires": "type Account = record { owner : principal; subaccount : opt blob };\ntype TransferArgs = record {\n from_subaccount : opt blob;\n to : Account;\n amount : nat;\n fee : opt nat;\n memo : opt blob;\n created_at_time : opt nat64;\n};\ntype TransferError = variant {\n BadFee : record { expected_fee : nat };\n BadBurn : record { min_burn_amount : nat };\n InsufficientFunds : record { balance : nat };\n TooOld;\n CreatedInFuture : record { ledger_time : nat64 };\n Duplicate : record { duplicate_of : nat };\n TemporarilyUnavailable;\n GenericError : record { error_code : nat; message : text };\n};\nservice : {\n icrc1_symbol : () -> (text) query;\n icrc1_decimals : () -> (nat8) query;\n icrc1_fee : () -> (nat) query;\n icrc1_balance_of : (Account) -> (nat) query;\n icrc1_transfer : (TransferArgs) -> (variant { Ok : nat; Err : TransferError });\n}\n"
13
+ },
14
+ "annotations": [
15
+ {
16
+ "at": "icrc1_transfer",
17
+ "tag": "intent",
18
+ "args": {
19
+ "title": "Send tokens",
20
+ "template": "Send {amount} to {to}[ from subaccount {from_subaccount}][ with memo {memo}][ paying fee {fee}]"
21
+ }
22
+ },
23
+ {
24
+ "at": "icrc1_transfer",
25
+ "tag": "effect",
26
+ "args": {
27
+ "kind": "transfer",
28
+ "irreversible": true
29
+ }
30
+ },
31
+ {
32
+ "at": "icrc1_transfer",
33
+ "tag": "idempotency",
34
+ "args": {
35
+ "mode": "replay_same_payload",
36
+ "stamp": "created_at_time"
37
+ }
38
+ },
39
+ {
40
+ "at": "icrc1_transfer",
41
+ "tag": "outcome",
42
+ "args": {
43
+ "classes": {
44
+ "Ok": "success",
45
+ "Err.Duplicate": "already_done",
46
+ "Err.TemporarilyUnavailable": "retry_same",
47
+ "Err.TooOld": "retry_new",
48
+ "Err.CreatedInFuture": "retry_new",
49
+ "Err.BadFee": "fix_input",
50
+ "Err.BadBurn": "fix_input",
51
+ "Err.InsufficientFunds": "fail",
52
+ "Err.GenericError": "fail"
53
+ },
54
+ "default": "fail"
55
+ }
56
+ },
57
+ {
58
+ "at": "icrc1_transfer(0).amount",
59
+ "tag": "amount",
60
+ "args": {
61
+ "decimals": {
62
+ "from": "query:icrc1_decimals"
63
+ },
64
+ "symbol": {
65
+ "from": "query:icrc1_symbol"
66
+ }
67
+ }
68
+ },
69
+ {
70
+ "at": "icrc1_transfer(0).amount",
71
+ "tag": "describe",
72
+ "args": {
73
+ "label": "Amount"
74
+ }
75
+ },
76
+ {
77
+ "at": "icrc1_transfer(0).to",
78
+ "tag": "account",
79
+ "args": {
80
+ "encoding": "icrc1"
81
+ }
82
+ },
83
+ {
84
+ "at": "icrc1_transfer(0).to",
85
+ "tag": "describe",
86
+ "args": {
87
+ "label": "Recipient"
88
+ }
89
+ },
90
+ {
91
+ "at": "icrc1_transfer(0).from_subaccount",
92
+ "tag": "subaccount",
93
+ "args": {}
94
+ },
95
+ {
96
+ "at": "icrc1_transfer(0).from_subaccount",
97
+ "tag": "describe",
98
+ "args": {
99
+ "label": "From subaccount",
100
+ "help": "Omit to send from the default subaccount."
101
+ }
102
+ },
103
+ {
104
+ "at": "icrc1_transfer(0).fee",
105
+ "tag": "amount",
106
+ "args": {
107
+ "decimals": {
108
+ "from": "query:icrc1_decimals"
109
+ },
110
+ "symbol": {
111
+ "from": "query:icrc1_symbol"
112
+ }
113
+ }
114
+ },
115
+ {
116
+ "at": "icrc1_transfer(0).fee",
117
+ "tag": "default",
118
+ "args": {
119
+ "value": "null",
120
+ "mode": "auto"
121
+ }
122
+ },
123
+ {
124
+ "at": "icrc1_transfer(0).fee",
125
+ "tag": "describe",
126
+ "args": {
127
+ "label": "Fee",
128
+ "help": "Leave empty to pay the ledger's current default fee. A wrong explicit fee fails with BadFee."
129
+ }
130
+ },
131
+ {
132
+ "at": "icrc1_transfer(0).memo",
133
+ "tag": "bytes",
134
+ "args": {
135
+ "encoding": "utf8"
136
+ }
137
+ },
138
+ {
139
+ "at": "icrc1_transfer(0).memo",
140
+ "tag": "default",
141
+ "args": {
142
+ "value": "null",
143
+ "mode": "suggest"
144
+ }
145
+ },
146
+ {
147
+ "at": "icrc1_transfer(0).memo",
148
+ "tag": "describe",
149
+ "args": {
150
+ "label": "Memo",
151
+ "help": "Transfers with different memos are never deduplicated against each other. Ledgers accept at least 32 bytes; longer memos may be rejected."
152
+ }
153
+ },
154
+ {
155
+ "at": "icrc1_transfer(0).created_at_time",
156
+ "tag": "timestamp",
157
+ "args": {
158
+ "unit": "ns",
159
+ "epoch": "unix"
160
+ }
161
+ },
162
+ {
163
+ "at": "icrc1_transfer(0).created_at_time",
164
+ "tag": "describe",
165
+ "args": {
166
+ "label": "Created at",
167
+ "help": "Set once per intent by the tool layer; enables the ledger's duplicate protection."
168
+ }
169
+ },
170
+ {
171
+ "at": "icrc1_transfer(0).created_at_time",
172
+ "tag": "ui",
173
+ "args": {
174
+ "hidden": true
175
+ }
176
+ },
177
+ {
178
+ "at": "icrc1_transfer->(0).Ok",
179
+ "tag": "describe",
180
+ "args": {
181
+ "label": "Block index"
182
+ }
183
+ },
184
+ {
185
+ "at": "icrc1_transfer->(0).Err.BadFee.expected_fee",
186
+ "tag": "amount",
187
+ "args": {
188
+ "decimals": {
189
+ "from": "query:icrc1_decimals"
190
+ },
191
+ "symbol": {
192
+ "from": "query:icrc1_symbol"
193
+ }
194
+ }
195
+ },
196
+ {
197
+ "at": "icrc1_transfer->(0).Err.BadBurn.min_burn_amount",
198
+ "tag": "amount",
199
+ "args": {
200
+ "decimals": {
201
+ "from": "query:icrc1_decimals"
202
+ },
203
+ "symbol": {
204
+ "from": "query:icrc1_symbol"
205
+ }
206
+ }
207
+ },
208
+ {
209
+ "at": "icrc1_transfer->(0).Err.InsufficientFunds.balance",
210
+ "tag": "amount",
211
+ "args": {
212
+ "decimals": {
213
+ "from": "query:icrc1_decimals"
214
+ },
215
+ "symbol": {
216
+ "from": "query:icrc1_symbol"
217
+ }
218
+ }
219
+ },
220
+ {
221
+ "at": "icrc1_transfer->(0).Err.CreatedInFuture.ledger_time",
222
+ "tag": "timestamp",
223
+ "args": {
224
+ "unit": "ns",
225
+ "epoch": "unix"
226
+ }
227
+ },
228
+ {
229
+ "at": "icrc1_transfer->(0).Err.Duplicate.duplicate_of",
230
+ "tag": "describe",
231
+ "args": {
232
+ "label": "Existing block index",
233
+ "help": "The same transfer was already executed in this block."
234
+ }
235
+ },
236
+ {
237
+ "at": "icrc1_balance_of",
238
+ "tag": "describe",
239
+ "args": {
240
+ "label": "Balance of an account"
241
+ }
242
+ },
243
+ {
244
+ "at": "icrc1_balance_of(0)",
245
+ "tag": "account",
246
+ "args": {
247
+ "encoding": "icrc1"
248
+ }
249
+ },
250
+ {
251
+ "at": "icrc1_balance_of->(0)",
252
+ "tag": "amount",
253
+ "args": {
254
+ "decimals": {
255
+ "from": "query:icrc1_decimals"
256
+ },
257
+ "symbol": {
258
+ "from": "query:icrc1_symbol"
259
+ }
260
+ }
261
+ },
262
+ {
263
+ "at": "icrc1_fee->(0)",
264
+ "tag": "amount",
265
+ "args": {
266
+ "decimals": {
267
+ "from": "query:icrc1_decimals"
268
+ },
269
+ "symbol": {
270
+ "from": "query:icrc1_symbol"
271
+ }
272
+ }
273
+ }
274
+ ]
275
+ }