Skip to content

WASM Imports#

Every function the SDK calls is a WASM import provided by the Xenon host at runtime. This is the complete list of imports a standard plugin can use.

All imports use the "core" import module unless otherwise noted.

Core Imports#

Import Name SDK Wrapper Signature
log Log(msg) (i32) → void
get_time GetTime() () → f32
is_key_down IsKeyDown(vk) (i32) → i32
is_key_pressed IsKeyPressed(vk) (i32) → i32
is_key_released IsKeyReleased(vk) (i32) → i32
get_screen_width ScreenSize().x () → i32
get_screen_height ScreenSize().y () → i32
world_to_screen WorldToScreen(...) (f32, f32, f32, i32) → i32
world_to_screen_unclamped WorldToScreenUnclamped(...) (f32, f32, f32, i32) → i32
get_camera_position GetCameraPosition() (i32) → i32
get_camera_forward GetCameraForward() / GetViewDirection() (i32) → i32
get_view_matrix GetViewMatrix(out16) (i32) → i32
get_sensitivity GetSensitivity() () → f32
set_sensitivity SetSensitivity(value) (f32) → void
get_mouse_delta GetMouseDelta(out) (i32) → i32

Tracked Input Imports#

Import Name SDK Wrapper Signature
get_game_command_tick GetGameCommandTick() () -> i32
press_game_button_tracked_v1 PressGameButtonTracked(bit) (i32) -> i64
pulse_game_button_tracked_v1 PulseGameButtonTracked(bit, holdMs) (i32, i32) -> i64
get_input_receipt_v1 GetInputReceipt(requestId, out) (i64, i32) -> i32

Tracked button imports accept one action bit. GameMemory receipts can report InputConsumed; KernelDriver receipts cannot observe that milestone. Superseded is terminal and means the request was coalesced or replaced, but it may have emitted or still affect a live held/timed action, so it is not a safe retry signal. A zero milestone tick can also mean the event could not be bracketed inside one stable command tick. Input consumption and milestone ticks do not confirm a shot or projectile spawn.

Entity Imports#

Import Name SDK Wrapper Signature
get_entity_count GetPlayerCount() () → i32
get_entity Entity(index) (i32, i32) → void
get_local_player LocalPlayer() (i32) → void
get_entity_ability_cooldown Entity::GetAbilityCooldown(input) (i32, i32, i32, i32) → i32
get_bone_pos Entity::GetBonePos(id) (i32, i32, i32) → i32
is_entity_visible Entity::IsVisible() (i32) → i32
get_distance_to_entity Entity::GetDistance() (i32) → f32
find_best_target FindBestTarget(flags) (i32) → i32
get_distance (internal) (f32, f32, f32, f32, f32, f32) → f32
get_skeleton_connections GetSkeletonConnections(heroId, out) (i64, i32) → i32

Ability State Imports#

Import Name SDK Wrapper Signature
get_ult_charge GetUltCharge() () → f32
get_ult_charge_status HasUltCharge() () → i32
get_local_ability_cooldown GetAbilityCooldown(input) (i32, i32) → i32
get_dva_self_destruct_state_v1 GetDvaSelfDestructState(out) (i32) → i32

Aim Imports#

Import Name SDK Wrapper Signature
aim_set_direction AimSetDirection(dir) (f32, f32, f32) → void
aim_get_direction AimGetDirection() (i32) → i32
aim_set_angles AimSetAngles(pitch, yaw) (f32, f32) → void
aim_get_angles AimGetAngles() (i32) → i32
aim_to AimAtPosition(target, stiffness) (f32, f32, f32, f32, f32) → void
aim_to_bone AimAtBone(idx, bone, stiffness) (i32, i32, f32, f32) → void
aim_reset_smoothing AimResetSmoothing() () → void
aim_hits_hitbox AimHitsHitbox(idx, scale) (i32, f32) → i32

Versioned Aim Imports#

Import Name SDK Wrapper Signature
aim_to_v1 AimAtPositionEx(target, stiffness, tolerance, out) (f32, f32, f32, f32, f32, i32) -> i32
aim_to_bone_v1 AimAtBoneEx(idx, bone, stiffness, tolerance, out) (i32, i32, f32, f32, i32) -> i32
aim_hit_test_v1 AimHitTest(idx, scale, margin, bulletPadding, predictionOffset, bodySlot, out) (i32, f32, f32, f32, f32, f32, f32, i32, i32) -> i32

Draw Imports#

Import Name SDK Wrapper Signature
draw_line Draw::Line(...) (f32, f32, f32, f32, f32, f32, f32, f32, f32) → void
draw_circle Draw::Circle(...) / CircleFilled(...) (f32, f32, f32, f32, f32, f32, f32, f32) → void
draw_rect Draw::Rect(...) / RectFilled(...) (f32, f32, f32, f32, f32, f32, f32, f32, f32) → void
draw_text Draw::Text(...) (f32, f32, i32, f32, f32, f32, f32, i32) → void

Draw Parameter Conventions#

  • Colors are passed as normalized floats (0.0-1.0 for R, G, B, A)
  • thickness = 0 means "filled" for circle and rect
  • Rect coordinates are min/max corners, not position/size (the SDK converts)
Import Name SDK Wrapper Signature
menu_checkbox ImGui::Checkbox(...) (i32, i32) → i32
menu_slider_int ImGui::SliderInt(...) (i32, i32, i32, i32) → i32
menu_slider_float ImGui::SliderFloat(...) (i32, i32, f32, f32) → i32
menu_combo ImGui::Combo(...) (i32, i32, i32) → i32
menu_text ImGui::Text(...) (i32) → void
menu_tooltip ImGui::Tooltip(...) (i32) → void
menu_separator ImGui::Separator() () → void
menu_collapsing_header ImGui::CollapsingHeader(...) (i32) → i32
menu_hotkey ImGui::Hotkey(...) (i32, i32) → i32

Config Imports#

Import Name SDK Wrapper Signature
config_set_int Config::SetInt(...) (i32, i32) → void
config_set_float Config::SetFloat(...) (i32, f32) → void
config_set_bool Config::SetBool(...) (i32, i32) → void
config_get_int Config::GetInt(...) (i32, i32) → i32
config_get_float Config::GetFloat(...) (i32, f32) → f32
config_get_bool Config::GetBool(...) (i32, i32) → i32
config_save Config::Save() () → void

Plugin Exports#

These are the functions your plugin exports to the host:

Export Name Entry Point Signature
on_get_info Plugin metadata (i32) → void
on_load Initialization () → void
on_unload Cleanup () → void
on_frame Game logic (f32) → void
on_render Drawing () → void
on_menu UI () → void
on_hero_changed Hero switch (i64) → void
on_perform_action Action callback (varies)

Library Imports#

Library dependencies use a dynamic import module: lib_<service_name>.

For example, a dependency on "math_helpers" generates imports like:

Module Import Name Signature
lib_math_helpers lerp (f32, f32, f32) → f32
lib_math_helpers clamp_f (f32, f32, f32) → f32
lib_math_helpers remap (f32, f32, f32, f32, f32) → f32

These are defined in the import header (include/xenon/libs/math_helpers.hpp).

WASM Types Reference#

Notation WASM Type C++ Type
i32 32-bit integer int32_t, uint32_t, pointers
i64 64-bit integer int64_t, uint64_t
f32 32-bit float float
f64 64-bit float double

In WASM, all pointers are i32 (32-bit address space).