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
3565
pub fn all_compiler_specs() -> Vec<HostFnSpec> {
12
3565
    vec![
13
3565
        HostFnSpec::new("rpc-protocol-version", "nomi", "rpc_protocol_version")
14
3565
            .returns(WasmType::I32),
15
3565
        HostFnSpec::new("rpc-session-user-id", "nomi", "rpc_session_user_id_capture")
16
3565
            .returns(WasmType::StringRef),
17
3565
        HostFnSpec::new("account-count", "nomi", "account_account_count").returns(WasmType::I32),
18
3565
        HostFnSpec::new("list-accounts", "nomi", "account_list_accounts")
19
3565
            .returns(WasmType::PairRef(PairElement::Entity(EntityKind::Account))),
20
3565
        HostFnSpec::new("get-account", "nomi", "account_get_account")
21
3565
            .with_params(vec![WasmType::StringRef])
22
3565
            .returns(WasmType::EntityRef(EntityKind::Account)),
23
3565
        HostFnSpec::new("get-balance", "nomi", "account_get_balance")
24
3565
            .with_params(vec![WasmType::StringRef])
25
3565
            .returns(WasmType::Ratio),
26
3565
        HostFnSpec::new("get-balances", "nomi", "account_get_balances")
27
3565
            .with_params(vec![WasmType::StringRef])
28
3565
            .returns(WasmType::PairRef(PairElement::StringRef)),
29
3565
        HostFnSpec::new(
30
            "get-account-commodities",
31
            "nomi",
32
            "account_get_account_commodities",
33
        )
34
3565
        .with_params(vec![WasmType::StringRef])
35
3565
        .returns(WasmType::PairRef(PairElement::Entity(
36
3565
            EntityKind::Commodity,
37
3565
        ))),
38
3565
        HostFnSpec::new("set-account-tag", "nomi", "account_set_account_tag")
39
3565
            .with_params(vec![
40
3565
                WasmType::StringRef,
41
3565
                WasmType::StringRef,
42
3565
                WasmType::StringRef,
43
            ])
44
3565
            .returns(WasmType::I32),
45
3565
        HostFnSpec::new("create-account", "nomi", "account_create_account")
46
3565
            .with_params(vec![WasmType::StringRef, WasmType::StringRef])
47
3565
            .returns(WasmType::StringRef),
48
3565
        HostFnSpec::new(
49
            "list-accounts-for-manage",
50
            "nomi",
51
            "account_list_accounts_for_manage",
52
        )
53
3565
        .returns(WasmType::PairRef(PairElement::Entity(EntityKind::Account))),
54
3565
        HostFnSpec::new(
55
            "get-account-for-manage",
56
            "nomi",
57
            "account_get_account_for_manage",
58
        )
59
3565
        .with_params(vec![WasmType::StringRef])
60
3565
        .returns(WasmType::EntityRef(EntityKind::Account)),
61
3565
        HostFnSpec::new("account-balance", "nomi", "account_account_balance")
62
3565
            .with_params(vec![WasmType::StringRef])
63
3565
            .returns(WasmType::Commodity),
64
3565
        HostFnSpec::new("list-commodities", "nomi", "commodity_list_commodities").returns(
65
3565
            WasmType::PairRef(PairElement::Entity(EntityKind::Commodity)),
66
        ),
67
3565
        HostFnSpec::new("get-commodity", "nomi", "commodity_get_commodity")
68
3565
            .with_params(vec![WasmType::StringRef])
69
3565
            .returns(WasmType::EntityRef(EntityKind::Commodity)),
70
3565
        HostFnSpec::new("create-commodity", "nomi", "commodity_create_commodity")
71
3565
            .with_params(vec![WasmType::StringRef, WasmType::StringRef])
72
3565
            .returns(WasmType::StringRef),
73
3565
        HostFnSpec::new("convert-commodity", "nomi", "commodity_convert_commodity")
74
3565
            .with_params(vec![WasmType::Commodity, WasmType::StringRef])
75
3565
            .returns(WasmType::Commodity),
76
3565
        HostFnSpec::new("convert-amount", "nomi", "commodity_convert_amount")
77
3565
            .with_params(vec![
78
3565
                WasmType::StringRef,
79
3565
                WasmType::StringRef,
80
3565
                WasmType::StringRef,
81
            ])
82
3565
            .returns(WasmType::StringRef),
83
3565
        HostFnSpec::new("get-version", "nomi", "config_get_version").returns(WasmType::StringRef),
84
3565
        HostFnSpec::new("get-build-date", "nomi", "config_get_build_date")
85
3565
            .returns(WasmType::StringRef),
86
3565
        HostFnSpec::new("get-config", "nomi", "config_get_config")
87
3565
            .with_params(vec![WasmType::StringRef])
88
3565
            .returns(WasmType::StringRef),
89
3565
        HostFnSpec::new("set-config", "nomi", "config_set_config")
90
3565
            .with_params(vec![WasmType::StringRef, WasmType::StringRef])
91
3565
            .returns(WasmType::I32),
92
3565
        HostFnSpec::new("list-transactions", "nomi", "transaction_list_transactions")
93
3565
            .with_params(vec![WasmType::StringRef])
94
3565
            .returns(WasmType::PairRef(PairElement::Entity(
95
3565
                EntityKind::Transaction,
96
3565
            ))),
97
3565
        HostFnSpec::new("get-transaction", "nomi", "transaction_get_transaction")
98
3565
            .with_params(vec![WasmType::StringRef])
99
3565
            .returns(WasmType::EntityRef(EntityKind::Transaction)),
100
3565
        HostFnSpec::new(
101
            "get-transaction-detail",
102
            "nomi",
103
            "transaction_get_transaction_detail",
104
        )
105
3565
        .with_params(vec![WasmType::StringRef])
106
3565
        .returns(WasmType::StringRef),
107
3565
        HostFnSpec::new(
108
            "create-transaction",
109
            "nomi",
110
            "transaction_create_transaction",
111
        )
112
3565
        .with_params(vec![WasmType::StringRef])
113
3565
        .returns(WasmType::StringRef),
114
3565
        HostFnSpec::new(
115
            "create-transaction-logical",
116
            "nomi",
117
            "transaction_create_transaction_logical",
118
        )
119
3565
        .with_params(vec![WasmType::StringRef])
120
3565
        .returns(WasmType::StringRef),
121
3565
        HostFnSpec::new(
122
            "update-transaction",
123
            "nomi",
124
            "transaction_update_transaction",
125
        )
126
3565
        .with_params(vec![WasmType::StringRef])
127
3565
        .returns(WasmType::StringRef),
128
3565
        HostFnSpec::new(
129
            "update-transaction-logical",
130
            "nomi",
131
            "transaction_update_transaction_logical",
132
        )
133
3565
        .with_params(vec![WasmType::StringRef])
134
3565
        .returns(WasmType::StringRef),
135
3565
        HostFnSpec::new(
136
            "delete-transaction",
137
            "nomi",
138
            "transaction_delete_transaction",
139
        )
140
3565
        .with_params(vec![WasmType::StringRef])
141
3565
        .returns(WasmType::I32),
142
3565
        HostFnSpec::new(
143
            "set-transaction-tag",
144
            "nomi",
145
            "transaction_set_transaction_tag",
146
        )
147
3565
        .with_params(vec![
148
3565
            WasmType::StringRef,
149
3565
            WasmType::StringRef,
150
3565
            WasmType::StringRef,
151
        ])
152
3565
        .returns(WasmType::I32),
153
3565
        HostFnSpec::new(
154
            "get-transaction-tag",
155
            "nomi",
156
            "transaction_get_transaction_tag",
157
        )
158
3565
        .with_params(vec![WasmType::StringRef, WasmType::StringRef])
159
3565
        .returns(WasmType::StringRef),
160
3565
        HostFnSpec::new("list-ssh-keys", "nomi", "ssh_key_list_ssh_keys")
161
3565
            .returns(WasmType::PairRef(PairElement::Entity(EntityKind::SshKey))),
162
3565
        HostFnSpec::new(
163
            "lookup-user-by-ssh-key",
164
            "nomi",
165
            "ssh_key_lookup_user_by_ssh_key",
166
        )
167
3565
        .with_params(vec![WasmType::StringRef])
168
3565
        .returns(WasmType::StringRef),
169
3565
        HostFnSpec::new("remove-ssh-key", "nomi", "ssh_key_remove_ssh_key")
170
3565
            .with_params(vec![WasmType::StringRef])
171
3565
            .returns(WasmType::I32),
172
3565
        HostFnSpec::new("user-has-ssh-key", "nomi", "ssh_key_user_has_ssh_key")
173
3565
            .returns(WasmType::I32),
174
3565
        HostFnSpec::new("list-splits", "nomi", "split_list_splits")
175
3565
            .with_params(vec![WasmType::StringRef])
176
3565
            .returns(WasmType::PairRef(PairElement::Entity(EntityKind::Split))),
177
3565
        HostFnSpec::new(
178
            "list-splits-by-transaction",
179
            "nomi",
180
            "split_list_splits_by_transaction",
181
        )
182
3565
        .with_params(vec![WasmType::StringRef])
183
3565
        .returns(WasmType::PairRef(PairElement::Entity(EntityKind::Split))),
184
3565
        HostFnSpec::new("set-split-tag", "nomi", "split_set_split_tag")
185
3565
            .with_params(vec![
186
3565
                WasmType::StringRef,
187
3565
                WasmType::StringRef,
188
3565
                WasmType::StringRef,
189
            ])
190
3565
            .returns(WasmType::I32),
191
3565
        HostFnSpec::new("get-split-tag", "nomi", "split_get_split_tag")
192
3565
            .with_params(vec![WasmType::StringRef, WasmType::StringRef])
193
3565
            .returns(WasmType::StringRef),
194
3565
        HostFnSpec::new("verify-user-password", "nomi", "user_verify_user_password")
195
3565
            .with_params(vec![WasmType::StringRef, WasmType::StringRef])
196
3565
            .returns(WasmType::StringRef),
197
3565
        HostFnSpec::new("balance-report", "nomi", "report_balance_report")
198
3565
            .returns(WasmType::StringRef),
199
3565
        HostFnSpec::new("activity-report", "nomi", "report_activity_report")
200
3565
            .with_params(vec![WasmType::StringRef, WasmType::StringRef])
201
3565
            .returns(WasmType::StringRef),
202
3565
        HostFnSpec::new("category-breakdown", "nomi", "report_category_breakdown")
203
3565
            .with_params(vec![WasmType::StringRef, WasmType::StringRef])
204
3565
            .returns(WasmType::StringRef),
205
3565
        HostFnSpec::new("set-draft-note", "nomi", "template_set_draft_note")
206
3565
            .with_params(vec![WasmType::StringRef])
207
3565
            .returns(WasmType::I32),
208
3565
        HostFnSpec::new("set-draft-date", "nomi", "template_set_draft_date")
209
3565
            .with_params(vec![WasmType::StringRef])
210
3565
            .returns(WasmType::I32),
211
3565
        HostFnSpec::new("draft-split", "nomi", "template_draft_split")
212
3565
            .with_params(vec![
213
3565
                WasmType::EntityRef(EntityKind::Account),
214
3565
                WasmType::EntityRef(EntityKind::Commodity),
215
3565
                WasmType::Ratio,
216
            ])
217
3565
            .returns(WasmType::I32),
218
3565
        HostFnSpec::new("draft-tag", "nomi", "template_draft_tag")
219
3565
            .with_params(vec![WasmType::StringRef, WasmType::StringRef])
220
3565
            .returns(WasmType::I32),
221
3565
        HostFnSpec::new("draft-split-tag", "nomi", "template_draft_split_tag")
222
3565
            .with_params(vec![
223
3565
                WasmType::I32,
224
3565
                WasmType::StringRef,
225
3565
                WasmType::StringRef,
226
            ])
227
3565
            .returns(WasmType::I32),
228
    ]
229
3565
}