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
1989
pub fn all_compiler_specs() -> Vec<HostFnSpec> {
12
1989
    vec![
13
1989
    HostFnSpec::new("rpc-protocol-version", "nomi", "rpc_protocol_version")
14
1989
        .returns(WasmType::I32),
15
1989
    HostFnSpec::new("rpc-session-user-id", "nomi", "rpc_session_user_id_capture")
16
1989
        .returns(WasmType::StringRef),
17
1989
    HostFnSpec::new("account-count", "nomi", "account_account_count")
18
1989
        .returns(WasmType::I32),
19
1989
    HostFnSpec::new("list-accounts", "nomi", "account_list_accounts")
20
1989
        .returns(WasmType::PairRef(PairElement::Entity(EntityKind::Account))),
21
1989
    HostFnSpec::new("get-account", "nomi", "account_get_account")
22
1989
        .with_params(vec![WasmType::StringRef])
23
1989
        .returns(WasmType::EntityRef(EntityKind::Account)),
24
1989
    HostFnSpec::new("get-balance", "nomi", "account_get_balance")
25
1989
        .with_params(vec![WasmType::StringRef])
26
1989
        .returns(WasmType::Ratio),
27
    HostFnSpec::new("get-account-commodities", "nomi", "account_get_account_commodities")
28
        .with_params(vec![WasmType::StringRef])
29
        .returns(WasmType::PairRef(PairElement::Entity(EntityKind::Commodity))),
30
    HostFnSpec::new("set-account-tag", "nomi", "account_set_account_tag")
31
1989
        .with_params(vec![WasmType::StringRef, WasmType::StringRef, WasmType::StringRef])
32
1989
        .returns(WasmType::I32),
33
1989
    HostFnSpec::new("create-account", "nomi", "account_create_account")
34
1989
        .with_params(vec![WasmType::StringRef])
35
1989
        .returns(WasmType::StringRef),
36
1989
    HostFnSpec::new("list-accounts-for-manage", "nomi", "account_list_accounts_for_manage")
37
1989
        .returns(WasmType::PairRef(PairElement::Entity(EntityKind::Account))),
38
1989
    HostFnSpec::new("get-account-for-manage", "nomi", "account_get_account_for_manage")
39
1989
        .with_params(vec![WasmType::StringRef])
40
        .returns(WasmType::EntityRef(EntityKind::Account)),
41
1989
    HostFnSpec::new("account-balance", "nomi", "account_account_balance")
42
1989
        .with_params(vec![WasmType::StringRef])
43
1989
        .returns(WasmType::Commodity),
44
1989
    HostFnSpec::new("list-commodities", "nomi", "commodity_list_commodities")
45
1989
        .returns(WasmType::PairRef(PairElement::Entity(EntityKind::Commodity))),
46
    HostFnSpec::new("get-commodity", "nomi", "commodity_get_commodity")
47
        .with_params(vec![WasmType::StringRef])
48
        .returns(WasmType::EntityRef(EntityKind::Commodity)),
49
    HostFnSpec::new("create-commodity", "nomi", "commodity_create_commodity")
50
1989
        .with_params(vec![WasmType::StringRef, WasmType::StringRef])
51
1989
        .returns(WasmType::StringRef),
52
    HostFnSpec::new("convert-commodity", "nomi", "commodity_convert_commodity")
53
        .with_params(vec![WasmType::Commodity, WasmType::StringRef])
54
        .returns(WasmType::Commodity),
55
    HostFnSpec::new("get-version", "nomi", "config_get_version")
56
1989
        .returns(WasmType::StringRef),
57
1989
    HostFnSpec::new("get-build-date", "nomi", "config_get_build_date")
58
1989
        .returns(WasmType::StringRef),
59
1989
    HostFnSpec::new("get-config", "nomi", "config_get_config")
60
1989
        .with_params(vec![WasmType::StringRef])
61
1989
        .returns(WasmType::StringRef),
62
1989
    HostFnSpec::new("set-config", "nomi", "config_set_config")
63
        .with_params(vec![WasmType::StringRef, WasmType::StringRef])
64
1989
        .returns(WasmType::I32),
65
1989
    HostFnSpec::new("list-transactions", "nomi", "transaction_list_transactions")
66
1989
        .returns(WasmType::PairRef(PairElement::Entity(EntityKind::Transaction))),
67
1989
    HostFnSpec::new("get-transaction", "nomi", "transaction_get_transaction")
68
1989
        .with_params(vec![WasmType::StringRef])
69
1989
        .returns(WasmType::EntityRef(EntityKind::Transaction)),
70
1989
    HostFnSpec::new("create-transaction", "nomi", "transaction_create_transaction")
71
1989
        .with_params(vec![WasmType::StringRef])
72
1989
        .returns(WasmType::StringRef),
73
1989
    HostFnSpec::new("update-transaction", "nomi", "transaction_update_transaction")
74
1989
        .with_params(vec![WasmType::StringRef])
75
1989
        .returns(WasmType::StringRef),
76
1989
    HostFnSpec::new("delete-transaction", "nomi", "transaction_delete_transaction")
77
1989
        .with_params(vec![WasmType::StringRef])
78
1989
        .returns(WasmType::I32),
79
1989
    HostFnSpec::new("set-transaction-tag", "nomi", "transaction_set_transaction_tag")
80
1989
        .with_params(vec![WasmType::StringRef, WasmType::StringRef, WasmType::StringRef])
81
1989
        .returns(WasmType::I32),
82
1989
    HostFnSpec::new("get-transaction-tag", "nomi", "transaction_get_transaction_tag")
83
1989
        .with_params(vec![WasmType::StringRef, WasmType::StringRef])
84
        .returns(WasmType::StringRef),
85
1989
    HostFnSpec::new("list-ssh-keys", "nomi", "ssh_key_list_ssh_keys")
86
1989
        .returns(WasmType::PairRef(PairElement::Entity(EntityKind::SshKey))),
87
1989
    HostFnSpec::new("lookup-user-by-ssh-key", "nomi", "ssh_key_lookup_user_by_ssh_key")
88
1989
        .with_params(vec![WasmType::StringRef])
89
        .returns(WasmType::StringRef),
90
    HostFnSpec::new("remove-ssh-key", "nomi", "ssh_key_remove_ssh_key")
91
        .with_params(vec![WasmType::StringRef])
92
        .returns(WasmType::I32),
93
1989
    HostFnSpec::new("user-has-ssh-key", "nomi", "ssh_key_user_has_ssh_key")
94
1989
        .returns(WasmType::I32),
95
1989
    HostFnSpec::new("list-splits", "nomi", "split_list_splits")
96
        .with_params(vec![WasmType::StringRef])
97
        .returns(WasmType::PairRef(PairElement::Entity(EntityKind::Split))),
98
    HostFnSpec::new("list-splits-by-transaction", "nomi", "split_list_splits_by_transaction")
99
        .with_params(vec![WasmType::StringRef])
100
1989
        .returns(WasmType::PairRef(PairElement::Entity(EntityKind::Split))),
101
1989
    HostFnSpec::new("set-split-tag", "nomi", "split_set_split_tag")
102
1989
        .with_params(vec![WasmType::StringRef, WasmType::StringRef, WasmType::StringRef])
103
        .returns(WasmType::I32),
104
    HostFnSpec::new("get-split-tag", "nomi", "split_get_split_tag")
105
        .with_params(vec![WasmType::StringRef, WasmType::StringRef])
106
        .returns(WasmType::StringRef),
107
1989
    HostFnSpec::new("verify-user-password", "nomi", "user_verify_user_password")
108
1989
        .with_params(vec![WasmType::StringRef, WasmType::StringRef])
109
1989
        .returns(WasmType::StringRef),
110
    HostFnSpec::new("balance-report", "nomi", "report_balance_report")
111
        .returns(WasmType::EntityRef(EntityKind::ReportNode)),
112
    HostFnSpec::new("activity-report", "nomi", "report_activity_report")
113
        .with_params(vec![WasmType::StringRef, WasmType::StringRef])
114
1989
        .returns(WasmType::StringRef),
115
1989
    HostFnSpec::new("category-breakdown", "nomi", "report_category_breakdown")
116
1989
        .with_params(vec![WasmType::StringRef, WasmType::StringRef])
117
1989
        .returns(WasmType::StringRef),
118
    HostFnSpec::new("set-draft-note", "nomi", "template_set_draft_note")
119
1989
        .with_params(vec![WasmType::StringRef])
120
1989
        .returns(WasmType::I32),
121
    HostFnSpec::new("set-draft-date", "nomi", "template_set_draft_date")
122
        .with_params(vec![WasmType::StringRef])
123
        .returns(WasmType::I32),
124
    HostFnSpec::new("draft-split", "nomi", "template_draft_split")
125
1989
        .with_params(vec![WasmType::EntityRef(EntityKind::Account), WasmType::EntityRef(EntityKind::Commodity), WasmType::Ratio])
126
1989
        .returns(WasmType::I32),
127
1989
    HostFnSpec::new("draft-tag", "nomi", "template_draft_tag")
128
1989
        .with_params(vec![WasmType::StringRef, WasmType::StringRef])
129
1989
        .returns(WasmType::I32),
130
    HostFnSpec::new("draft-split-tag", "nomi", "template_draft_split_tag")
131
        .with_params(vec![WasmType::I32, WasmType::StringRef, WasmType::StringRef])
132
        .returns(WasmType::I32),
133
    ]
134
1989
}