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