1
// Auto-generated from doc/scripting/native_reference.org.
2
// Do not edit manually — edit the org file + cargo build.
3
//
4
// See `feedback_single_path` + `feedback_docs_in_org` memories:
5
// the org source is the single point of truth for every typed
6
// host fn; this file is the tangled mirror.
7

            
8
use nomiscript::{EntityKind, HostFnSpec, PairElement, WasmType};
9

            
10
#[must_use]
11
75414
pub fn all_compiler_specs() -> Vec<HostFnSpec> {
12
75414
    vec![
13
75414
        HostFnSpec::new("rpc-protocol-version", "nomi", "rpc_protocol_version")
14
75414
            .returns(WasmType::I32),
15
75414
        HostFnSpec::new("rpc-session-user-id", "nomi", "rpc_session_user_id_capture")
16
75414
            .returns(WasmType::StringRef),
17
75414
        HostFnSpec::new("account-count", "nomi", "account_account_count").returns(WasmType::I32),
18
75414
        HostFnSpec::new("list-accounts", "nomi", "account_list_accounts")
19
75414
            .returns(WasmType::PairRef(PairElement::Entity(EntityKind::Account))),
20
75414
        HostFnSpec::new("get-account", "nomi", "account_get_account")
21
75414
            .with_params(vec![WasmType::StringRef])
22
75414
            .returns(WasmType::EntityRef(EntityKind::Account)),
23
75414
        HostFnSpec::new("get-balance", "nomi", "account_get_balance")
24
75414
            .with_params(vec![WasmType::StringRef])
25
75414
            .returns(WasmType::Ratio),
26
75414
        HostFnSpec::new("get-balances", "nomi", "account_get_balances")
27
75414
            .with_params(vec![WasmType::StringRef])
28
75414
            .returns(WasmType::PairRef(PairElement::StringRef)),
29
75414
        HostFnSpec::new(
30
75414
            "get-account-commodities",
31
75414
            "nomi",
32
75414
            "account_get_account_commodities",
33
75414
        )
34
75414
        .with_params(vec![WasmType::StringRef])
35
75414
        .returns(WasmType::PairRef(PairElement::Entity(
36
75414
            EntityKind::Commodity,
37
75414
        ))),
38
75414
        HostFnSpec::new("set-account-tag", "nomi", "account_set_account_tag")
39
75414
            .with_params(vec![
40
75414
                WasmType::StringRef,
41
75414
                WasmType::StringRef,
42
75414
                WasmType::StringRef,
43
75414
            ])
44
75414
            .returns(WasmType::Bool),
45
75414
        HostFnSpec::new("clear-account-tag", "nomi", "account_clear_account_tag")
46
75414
            .with_params(vec![WasmType::StringRef, WasmType::StringRef])
47
75414
            .returns(WasmType::Bool),
48
75414
        HostFnSpec::new("set-commodity-tag", "nomi", "commodity_set_commodity_tag")
49
75414
            .with_params(vec![
50
75414
                WasmType::StringRef,
51
75414
                WasmType::StringRef,
52
75414
                WasmType::StringRef,
53
75414
            ])
54
75414
            .returns(WasmType::Bool),
55
75414
        HostFnSpec::new(
56
75414
            "clear-commodity-tag",
57
75414
            "nomi",
58
75414
            "commodity_clear_commodity_tag",
59
75414
        )
60
75414
        .with_params(vec![WasmType::StringRef, WasmType::StringRef])
61
75414
        .returns(WasmType::Bool),
62
75414
        HostFnSpec::new("delete-tag", "nomi", "tag_delete_tag")
63
75414
            .with_params(vec![WasmType::StringRef])
64
75414
            .returns(WasmType::Bool),
65
75414
        HostFnSpec::new("delete-template", "nomi", "template_store_delete_template")
66
75414
            .with_params(vec![WasmType::StringRef])
67
75414
            .returns(WasmType::Bool),
68
75414
        HostFnSpec::new("delete-script", "nomi", "script_store_delete_script")
69
75414
            .with_params(vec![WasmType::StringRef])
70
75414
            .returns(WasmType::Bool),
71
75414
        HostFnSpec::new("run-script", "nomi", "script_store_run_script")
72
75414
            .with_params(vec![WasmType::StringRef, WasmType::StringRef])
73
75414
            .returns(WasmType::AnyRef),
74
75414
        HostFnSpec::new("list-scripts", "nomi", "script_store_list_scripts")
75
75414
            .returns(WasmType::PairRef(PairElement::AnyRef)),
76
75414
        HostFnSpec::new("list-tags", "nomi", "tag_list_tags")
77
75414
            .returns(WasmType::PairRef(PairElement::Entity(EntityKind::Tag))),
78
75414
        HostFnSpec::new("create-account", "nomi", "account_create_account")
79
75414
            .with_params(vec![WasmType::StringRef, WasmType::StringRef])
80
75414
            .returns(WasmType::StringRef),
81
75414
        HostFnSpec::new("merge-accounts", "nomi", "account_merge_accounts")
82
75414
            .with_params(vec![WasmType::StringRef, WasmType::StringRef])
83
75414
            .returns(WasmType::StringRef),
84
75414
        HostFnSpec::new(
85
75414
            "list-accounts-for-manage",
86
75414
            "nomi",
87
75414
            "account_list_accounts_for_manage",
88
75414
        )
89
75414
        .returns(WasmType::PairRef(PairElement::Entity(EntityKind::Account))),
90
75414
        HostFnSpec::new(
91
75414
            "get-account-for-manage",
92
75414
            "nomi",
93
75414
            "account_get_account_for_manage",
94
75414
        )
95
75414
        .with_params(vec![WasmType::StringRef])
96
75414
        .returns(WasmType::EntityRef(EntityKind::Account)),
97
75414
        HostFnSpec::new("account-balance", "nomi", "account_account_balance")
98
75414
            .with_params(vec![WasmType::StringRef])
99
75414
            .returns(WasmType::Commodity),
100
75414
        HostFnSpec::new("list-commodities", "nomi", "commodity_list_commodities").returns(
101
75414
            WasmType::PairRef(PairElement::Entity(EntityKind::Commodity)),
102
75414
        ),
103
75414
        HostFnSpec::new("get-commodity", "nomi", "commodity_get_commodity")
104
75414
            .with_params(vec![WasmType::StringRef])
105
75414
            .returns(WasmType::EntityRef(EntityKind::Commodity)),
106
75414
        HostFnSpec::new("create-commodity", "nomi", "commodity_create_commodity")
107
75414
            .with_params(vec![WasmType::StringRef, WasmType::StringRef])
108
75414
            .returns(WasmType::StringRef),
109
75414
        HostFnSpec::new("convert-commodity", "nomi", "commodity_convert_commodity")
110
75414
            .with_params(vec![WasmType::Commodity, WasmType::StringRef])
111
75414
            .returns(WasmType::Commodity),
112
75414
        HostFnSpec::new("convert-amount", "nomi", "commodity_convert_amount")
113
75414
            .with_params(vec![
114
75414
                WasmType::StringRef,
115
75414
                WasmType::StringRef,
116
75414
                WasmType::StringRef,
117
75414
            ])
118
75414
            .returns(WasmType::StringRef),
119
75414
        HostFnSpec::new("get-version", "nomi", "config_get_version").returns(WasmType::StringRef),
120
75414
        HostFnSpec::new("get-build-date", "nomi", "config_get_build_date")
121
75414
            .returns(WasmType::StringRef),
122
75414
        HostFnSpec::new("get-config", "nomi", "config_get_config")
123
75414
            .with_params(vec![WasmType::StringRef])
124
75414
            .returns(WasmType::StringRef),
125
75414
        HostFnSpec::new("set-config", "nomi", "config_set_config")
126
75414
            .with_params(vec![WasmType::StringRef, WasmType::StringRef])
127
75414
            .returns(WasmType::Bool),
128
75414
        HostFnSpec::new("list-config", "nomi", "config_list_config")
129
75414
            .returns(WasmType::PairRef(PairElement::AnyRef)),
130
75414
        HostFnSpec::new("format-date", "nomi", "date_format_date")
131
75414
            .with_params(vec![WasmType::StringRef])
132
75414
            .returns(WasmType::StringRef),
133
75414
        HostFnSpec::new("list-transactions", "nomi", "transaction_list_transactions")
134
75414
            .with_params(vec![WasmType::StringRef])
135
75414
            .returns(WasmType::PairRef(PairElement::Entity(
136
75414
                EntityKind::Transaction,
137
75414
            ))),
138
75414
        HostFnSpec::new("get-transaction", "nomi", "transaction_get_transaction")
139
75414
            .with_params(vec![WasmType::StringRef])
140
75414
            .returns(WasmType::EntityRef(EntityKind::Transaction)),
141
75414
        HostFnSpec::new(
142
75414
            "get-transaction-detail",
143
75414
            "nomi",
144
75414
            "transaction_get_transaction_detail",
145
75414
        )
146
75414
        .with_params(vec![WasmType::StringRef])
147
75414
        .returns(WasmType::StringRef),
148
75414
        HostFnSpec::new(
149
75414
            "get-transaction-logical",
150
75414
            "nomi",
151
75414
            "transaction_get_transaction_logical",
152
75414
        )
153
75414
        .with_params(vec![WasmType::StringRef])
154
75414
        .returns(WasmType::StringRef),
155
75414
        HostFnSpec::new(
156
75414
            "create-transaction",
157
75414
            "nomi",
158
75414
            "transaction_create_transaction",
159
75414
        )
160
75414
        .with_params(vec![WasmType::StringRef])
161
75414
        .returns(WasmType::StringRef),
162
75414
        HostFnSpec::new(
163
75414
            "create-transaction-logical",
164
75414
            "nomi",
165
75414
            "transaction_create_transaction_logical",
166
75414
        )
167
75414
        .with_params(vec![WasmType::StringRef])
168
75414
        .returns(WasmType::StringRef),
169
75414
        HostFnSpec::new(
170
75414
            "update-transaction",
171
75414
            "nomi",
172
75414
            "transaction_update_transaction",
173
75414
        )
174
75414
        .with_params(vec![WasmType::StringRef])
175
75414
        .returns(WasmType::StringRef),
176
75414
        HostFnSpec::new(
177
75414
            "update-transaction-logical",
178
75414
            "nomi",
179
75414
            "transaction_update_transaction_logical",
180
75414
        )
181
75414
        .with_params(vec![WasmType::StringRef])
182
75414
        .returns(WasmType::StringRef),
183
75414
        HostFnSpec::new(
184
75414
            "delete-transaction",
185
75414
            "nomi",
186
75414
            "transaction_delete_transaction",
187
75414
        )
188
75414
        .with_params(vec![WasmType::StringRef])
189
75414
        .returns(WasmType::Bool),
190
75414
        HostFnSpec::new(
191
75414
            "set-transaction-tag",
192
75414
            "nomi",
193
75414
            "transaction_set_transaction_tag",
194
75414
        )
195
75414
        .with_params(vec![
196
75414
            WasmType::StringRef,
197
75414
            WasmType::StringRef,
198
75414
            WasmType::StringRef,
199
75414
        ])
200
75414
        .returns(WasmType::Bool),
201
75414
        HostFnSpec::new(
202
75414
            "get-transaction-tag",
203
75414
            "nomi",
204
75414
            "transaction_get_transaction_tag",
205
75414
        )
206
75414
        .with_params(vec![WasmType::StringRef, WasmType::StringRef])
207
75414
        .returns(WasmType::StringRef),
208
75414
        HostFnSpec::new("form-descriptor", "nomi", "forms_form_descriptor")
209
75414
            .with_params(vec![WasmType::StringRef])
210
75414
            .returns(WasmType::StringRef),
211
75414
        HostFnSpec::new("form-options", "nomi", "forms_form_options")
212
75414
            .with_params(vec![WasmType::StringRef])
213
75414
            .returns(WasmType::StringRef),
214
75414
        HostFnSpec::new("load-form", "nomi", "forms_load_form")
215
75414
            .with_params(vec![WasmType::StringRef, WasmType::StringRef])
216
75414
            .returns(WasmType::StringRef),
217
75414
        HostFnSpec::new("submit-form", "nomi", "forms_submit_form")
218
75414
            .with_params(vec![WasmType::StringRef, WasmType::StringRef])
219
75414
            .returns(WasmType::AnyRef),
220
75414
        HostFnSpec::new("merge-preview", "nomi", "forms_merge_preview")
221
75414
            .with_params(vec![WasmType::StringRef])
222
75414
            .returns(WasmType::AnyRef),
223
75414
        HostFnSpec::new("filter-rows", "nomi", "forms_filter_rows")
224
75414
            .with_params(vec![WasmType::StringRef])
225
75414
            .returns(WasmType::AnyRef),
226
75414
        HostFnSpec::new("filter-text", "nomi", "forms_filter_text")
227
75414
            .with_params(vec![WasmType::StringRef])
228
75414
            .returns(WasmType::StringRef),
229
75414
        HostFnSpec::new("list-ssh-keys", "nomi", "ssh_key_list_ssh_keys")
230
75414
            .returns(WasmType::PairRef(PairElement::Entity(EntityKind::SshKey))),
231
75414
        HostFnSpec::new("remove-ssh-key", "nomi", "ssh_key_remove_ssh_key")
232
75414
            .with_params(vec![WasmType::StringRef])
233
75414
            .returns(WasmType::Bool),
234
75414
        HostFnSpec::new("user-has-ssh-key", "nomi", "ssh_key_user_has_ssh_key")
235
75414
            .returns(WasmType::Bool),
236
75414
        HostFnSpec::new("list-splits", "nomi", "split_list_splits")
237
75414
            .with_params(vec![WasmType::StringRef])
238
75414
            .returns(WasmType::PairRef(PairElement::Entity(EntityKind::Split))),
239
75414
        HostFnSpec::new(
240
75414
            "list-splits-by-transaction",
241
75414
            "nomi",
242
75414
            "split_list_splits_by_transaction",
243
75414
        )
244
75414
        .with_params(vec![WasmType::StringRef])
245
75414
        .returns(WasmType::PairRef(PairElement::Entity(EntityKind::Split))),
246
75414
        HostFnSpec::new("set-split-tag", "nomi", "split_set_split_tag")
247
75414
            .with_params(vec![
248
75414
                WasmType::StringRef,
249
75414
                WasmType::StringRef,
250
75414
                WasmType::StringRef,
251
75414
            ])
252
75414
            .returns(WasmType::Bool),
253
75414
        HostFnSpec::new("get-split-tag", "nomi", "split_get_split_tag")
254
75414
            .with_params(vec![WasmType::StringRef, WasmType::StringRef])
255
75414
            .returns(WasmType::StringRef),
256
75414
        HostFnSpec::new("get-split-tags", "nomi", "split_get_split_tags")
257
75414
            .with_params(vec![WasmType::StringRef, WasmType::StringRef])
258
75414
            .returns(WasmType::PairRef(PairElement::StringRef)),
259
75414
        HostFnSpec::new("balance-report", "nomi", "report_balance_report")
260
75414
            .returns(WasmType::StringRef),
261
75414
        HostFnSpec::new("activity-report", "nomi", "report_activity_report")
262
75414
            .with_params(vec![WasmType::StringRef, WasmType::StringRef])
263
75414
            .returns(WasmType::StringRef),
264
75414
        HostFnSpec::new("category-breakdown", "nomi", "report_category_breakdown")
265
75414
            .with_params(vec![WasmType::StringRef, WasmType::StringRef])
266
75414
            .returns(WasmType::StringRef),
267
75414
        HostFnSpec::new("report-csv", "nomi", "report_report_csv")
268
75414
            .with_params(vec![WasmType::StringRef])
269
75414
            .returns(WasmType::StringRef),
270
75414
        HostFnSpec::new("report-chart-render", "nomi", "chart_report_chart_render")
271
75414
            .with_params(vec![
272
75414
                WasmType::StringRef,
273
75414
                WasmType::StringRef,
274
75414
                WasmType::StringRef,
275
75414
                WasmType::StringRef,
276
75414
                WasmType::I32,
277
75414
                WasmType::I32,
278
75414
                WasmType::I32,
279
75414
                WasmType::I32,
280
75414
            ])
281
75414
            .returns(WasmType::AnyRef),
282
75414
        HostFnSpec::new("set-draft-note", "nomi", "template_set_draft_note")
283
75414
            .with_params(vec![WasmType::StringRef])
284
75414
            .returns(WasmType::Bool),
285
75414
        HostFnSpec::new("set-draft-date", "nomi", "template_set_draft_date")
286
75414
            .with_params(vec![WasmType::StringRef])
287
75414
            .returns(WasmType::Bool),
288
75414
        HostFnSpec::new("draft-split", "nomi", "template_draft_split")
289
75414
            .with_params(vec![
290
75414
                WasmType::EntityRef(EntityKind::Account),
291
75414
                WasmType::EntityRef(EntityKind::Commodity),
292
75414
                WasmType::Ratio,
293
75414
            ])
294
75414
            .returns(WasmType::I32),
295
75414
        HostFnSpec::new("draft-tag", "nomi", "template_draft_tag")
296
75414
            .with_params(vec![WasmType::StringRef, WasmType::StringRef])
297
75414
            .returns(WasmType::Bool),
298
75414
        HostFnSpec::new("draft-split-tag", "nomi", "template_draft_split_tag")
299
75414
            .with_params(vec![
300
75414
                WasmType::I32,
301
75414
                WasmType::StringRef,
302
75414
                WasmType::StringRef,
303
75414
            ])
304
75414
            .returns(WasmType::Bool),
305
    ]
306
75414
}