hooks-rs 0.2.0

Hooks in Rust for Xahau
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#![no_std]
#![no_main]

use hooks_rs::*;

#[no_mangle]
pub extern "C" fn cbak(_: u32) -> i64 {
    0
}

#[no_mangle]
pub extern "C" fn hook(_: u32) -> i64 {
    _g(1, 1);

    // Check https://docs.xahau.network/technical/hooks-c-functions/originating-transaction/otxn_type#known-transaction-types
    let otxn_type = otxn_type();
    accept(b"", otxn_type);
}