@5ive-tech/sdk 1.1.18 → 1.1.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,770 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+
4
+ /**
5
+ * Bytecode analyzer for WASM
6
+ */
7
+ export class BytecodeAnalyzer {
8
+ private constructor();
9
+ free(): void;
10
+ [Symbol.dispose](): void;
11
+ /**
12
+ * Analyze bytecode and return instruction breakdown (legacy method for compatibility)
13
+ */
14
+ static analyze(bytecode: Uint8Array): any;
15
+ /**
16
+ * Get detailed opcode flow analysis - shows execution paths through the bytecode
17
+ */
18
+ static analyze_execution_flow(bytecode: Uint8Array): any;
19
+ /**
20
+ * Get detailed information about a specific instruction at an offset
21
+ */
22
+ static analyze_instruction_at(bytecode: Uint8Array, offset: number): any;
23
+ /**
24
+ * Advanced semantic analysis with full opcode understanding and instruction flow
25
+ * Performs semantic analysis of bytecode to understand opcode behavior
26
+ * and instruction flow.
27
+ */
28
+ static analyze_semantic(bytecode: Uint8Array): any;
29
+ /**
30
+ * Get summary statistics about the bytecode
31
+ */
32
+ static get_bytecode_summary(bytecode: Uint8Array): any;
33
+ }
34
+
35
+ /**
36
+ * Bytecode Encoding utilities for JavaScript (Fixed Size)
37
+ */
38
+ export class BytecodeEncoder {
39
+ private constructor();
40
+ free(): void;
41
+ [Symbol.dispose](): void;
42
+ /**
43
+ * Decode a u16 value
44
+ * Returns [value, bytes_consumed] or null if invalid
45
+ */
46
+ static decode_u16(bytes: Uint8Array): Array<any> | undefined;
47
+ /**
48
+ * Decode a u32 value
49
+ * Returns [value, bytes_consumed] or null if invalid
50
+ */
51
+ static decode_u32(bytes: Uint8Array): Array<any> | undefined;
52
+ /**
53
+ * Encode a u16 value
54
+ * Returns [size, byte1, byte2]
55
+ */
56
+ static encode_u16(value: number): Array<any>;
57
+ /**
58
+ * Encode a u32 value
59
+ * Returns [size, byte1, byte2, byte3, byte4]
60
+ */
61
+ static encode_u32(value: number): Array<any>;
62
+ /**
63
+ * Calculate encoded size (Always 2 for u16)
64
+ */
65
+ static encoded_size_u16(_value: number): number;
66
+ /**
67
+ * Calculate encoded size (Always 4 for u32)
68
+ */
69
+ static encoded_size_u32(_value: number): number;
70
+ }
71
+
72
+ /**
73
+ * Execution result.
74
+ */
75
+ export enum ExecutionStatus {
76
+ /**
77
+ * All operations completed successfully.
78
+ */
79
+ Completed = 0,
80
+ /**
81
+ * Execution stopped because it hit a system program call that cannot be executed in WASM.
82
+ */
83
+ StoppedAtSystemCall = 1,
84
+ /**
85
+ * Execution stopped because it hit an INIT_PDA operation that requires real Solana context.
86
+ */
87
+ StoppedAtInitPDA = 2,
88
+ /**
89
+ * Execution stopped because it hit an INVOKE operation that requires real RPC.
90
+ */
91
+ StoppedAtInvoke = 3,
92
+ /**
93
+ * Execution stopped because it hit an INVOKE_SIGNED operation that requires real RPC.
94
+ */
95
+ StoppedAtInvokeSigned = 4,
96
+ /**
97
+ * Execution stopped because compute limit was reached.
98
+ */
99
+ ComputeLimitExceeded = 5,
100
+ /**
101
+ * Execution failed due to an error.
102
+ */
103
+ Failed = 6,
104
+ }
105
+
106
+ /**
107
+ * JavaScript-compatible VM state representation.
108
+ */
109
+ export class FiveVMState {
110
+ private constructor();
111
+ free(): void;
112
+ [Symbol.dispose](): void;
113
+ readonly compute_units: bigint;
114
+ readonly instruction_pointer: number;
115
+ readonly stack: Array<any>;
116
+ }
117
+
118
+ /**
119
+ * Main WASM VM wrapper.
120
+ */
121
+ export class FiveVMWasm {
122
+ free(): void;
123
+ [Symbol.dispose](): void;
124
+ /**
125
+ * Execute VM with input data and accounts (legacy method).
126
+ */
127
+ execute(input_data: Uint8Array, accounts: Array<any>): any;
128
+ /**
129
+ * Execute VM with partial execution support - stops at system calls.
130
+ */
131
+ execute_partial(input_data: Uint8Array, accounts: Array<any>): TestResult;
132
+ /**
133
+ * Get VM constants for JavaScript
134
+ */
135
+ static get_constants(): any;
136
+ /**
137
+ * Get current VM state
138
+ */
139
+ get_state(): any;
140
+ /**
141
+ * Create new VM instance with bytecode.
142
+ */
143
+ constructor(_bytecode: Uint8Array);
144
+ /**
145
+ * Validate bytecode without execution
146
+ */
147
+ static validate_bytecode(bytecode: Uint8Array): boolean;
148
+ }
149
+
150
+ /**
151
+ * Parameter encoding utilities using fixed-size encoding and protocol types
152
+ */
153
+ export class ParameterEncoder {
154
+ private constructor();
155
+ free(): void;
156
+ [Symbol.dispose](): void;
157
+ /**
158
+ * Encode function parameters using fixed size encoding
159
+ * Returns ONLY parameter data - SDK handles discriminator AND function index
160
+ */
161
+ static encode_execute(_function_index: number, params: Array<any>): Uint8Array;
162
+ }
163
+
164
+ /**
165
+ * Detailed execution result.
166
+ */
167
+ export class TestResult {
168
+ private constructor();
169
+ free(): void;
170
+ [Symbol.dispose](): void;
171
+ /**
172
+ * Compute units consumed.
173
+ */
174
+ compute_units_used: bigint;
175
+ /**
176
+ * Final instruction pointer.
177
+ */
178
+ instruction_pointer: number;
179
+ /**
180
+ * Which opcode caused the stop (if stopped at system call).
181
+ */
182
+ get stopped_at_opcode(): number | undefined;
183
+ /**
184
+ * Which opcode caused the stop (if stopped at system call).
185
+ */
186
+ set stopped_at_opcode(value: number | null | undefined);
187
+ readonly error_message: string | undefined;
188
+ readonly execution_context: string | undefined;
189
+ readonly final_accounts: Array<any>;
190
+ readonly final_memory: Uint8Array;
191
+ readonly final_stack: Array<any>;
192
+ readonly get_result_value: any;
193
+ readonly has_result_value: boolean;
194
+ readonly status: string;
195
+ readonly stopped_at_opcode_name: string | undefined;
196
+ }
197
+
198
+ /**
199
+ * JavaScript-compatible account representation.
200
+ */
201
+ export class WasmAccount {
202
+ free(): void;
203
+ [Symbol.dispose](): void;
204
+ constructor(key: Uint8Array, data: Uint8Array, lamports: bigint, is_writable: boolean, is_signer: boolean, owner: Uint8Array);
205
+ is_signer: boolean;
206
+ is_writable: boolean;
207
+ lamports: bigint;
208
+ data: Uint8Array;
209
+ readonly key: Uint8Array;
210
+ readonly owner: Uint8Array;
211
+ }
212
+
213
+ /**
214
+ * WASM source analysis result
215
+ */
216
+ export class WasmAnalysisResult {
217
+ private constructor();
218
+ free(): void;
219
+ [Symbol.dispose](): void;
220
+ /**
221
+ * Get parsed metrics as JavaScript object
222
+ */
223
+ get_metrics_object(): any;
224
+ /**
225
+ * Analysis time in milliseconds
226
+ */
227
+ analysis_time: number;
228
+ /**
229
+ * Whether analysis succeeded
230
+ */
231
+ success: boolean;
232
+ readonly errors: Array<any>;
233
+ readonly metrics: string;
234
+ readonly summary: string;
235
+ }
236
+
237
+ /**
238
+ * Compilation options for enhanced error reporting and formatting
239
+ */
240
+ export class WasmCompilationOptions {
241
+ free(): void;
242
+ [Symbol.dispose](): void;
243
+ /**
244
+ * Create development-debug configuration
245
+ */
246
+ static development_debug(): WasmCompilationOptions;
247
+ /**
248
+ * Create fast iteration configuration
249
+ */
250
+ static fast_iteration(): WasmCompilationOptions;
251
+ /**
252
+ * Create default compilation options
253
+ */
254
+ constructor();
255
+ /**
256
+ * Create production-optimized configuration
257
+ */
258
+ static production_optimized(): WasmCompilationOptions;
259
+ /**
260
+ * Set analysis depth level
261
+ */
262
+ with_analysis_depth(depth: string): WasmCompilationOptions;
263
+ /**
264
+ * Enable or disable complexity analysis
265
+ */
266
+ with_complexity_analysis(enabled: boolean): WasmCompilationOptions;
267
+ /**
268
+ * Enable or disable comprehensive metrics collection
269
+ */
270
+ with_comprehensive_metrics(enabled: boolean): WasmCompilationOptions;
271
+ /**
272
+ * Enable or disable bytecode compression
273
+ */
274
+ with_compression(enabled: boolean): WasmCompilationOptions;
275
+ /**
276
+ * Enable or disable constraint caching optimization
277
+ */
278
+ with_constraint_cache(enabled: boolean): WasmCompilationOptions;
279
+ /**
280
+ * Enable or disable debug information
281
+ */
282
+ with_debug_info(enabled: boolean): WasmCompilationOptions;
283
+ /**
284
+ * Enable or disable REQUIRE_BATCH lowering.
285
+ */
286
+ with_disable_require_batch(enabled: boolean): WasmCompilationOptions;
287
+ /**
288
+ * Enable or disable enhanced error reporting
289
+ */
290
+ with_enhanced_errors(enabled: boolean): WasmCompilationOptions;
291
+ /**
292
+ * Set error output format
293
+ */
294
+ with_error_format(format: string): WasmCompilationOptions;
295
+ /**
296
+ * Set export format
297
+ */
298
+ with_export_format(format: string): WasmCompilationOptions;
299
+ /**
300
+ * Enable or disable basic metrics collection
301
+ */
302
+ with_metrics(enabled: boolean): WasmCompilationOptions;
303
+ /**
304
+ * Set metrics export format
305
+ */
306
+ with_metrics_format(format: string): WasmCompilationOptions;
307
+ /**
308
+ * Set compilation mode
309
+ */
310
+ with_mode(mode: string): WasmCompilationOptions;
311
+ /**
312
+ * Enable or disable module namespace qualification
313
+ */
314
+ with_module_namespaces(enabled: boolean): WasmCompilationOptions;
315
+ /**
316
+ * Set optimization level (production)
317
+ */
318
+ with_optimization_level(level: string): WasmCompilationOptions;
319
+ /**
320
+ * Enable or disable performance analysis
321
+ */
322
+ with_performance_analysis(enabled: boolean): WasmCompilationOptions;
323
+ /**
324
+ * Enable or disable quiet mode
325
+ */
326
+ with_quiet(enabled: boolean): WasmCompilationOptions;
327
+ /**
328
+ * Set source file name for better error reporting
329
+ */
330
+ with_source_file(filename: string): WasmCompilationOptions;
331
+ /**
332
+ * Enable or disable compilation summary
333
+ */
334
+ with_summary(enabled: boolean): WasmCompilationOptions;
335
+ /**
336
+ * Enable or disable v2-preview features
337
+ */
338
+ with_v2_preview(enabled: boolean): WasmCompilationOptions;
339
+ /**
340
+ * Enable or disable verbose output
341
+ */
342
+ with_verbose(enabled: boolean): WasmCompilationOptions;
343
+ /**
344
+ * Include complexity analysis
345
+ */
346
+ complexity_analysis: boolean;
347
+ /**
348
+ * Include comprehensive metrics collection
349
+ */
350
+ comprehensive_metrics: boolean;
351
+ /**
352
+ * Enable bytecode compression
353
+ */
354
+ compress_output: boolean;
355
+ /**
356
+ * Disable REQUIRE_BATCH lowering in compiler pipeline.
357
+ */
358
+ disable_require_batch: boolean;
359
+ /**
360
+ * Enable constraint caching optimization
361
+ */
362
+ enable_constraint_cache: boolean;
363
+ /**
364
+ * Enable module namespace qualification (module::function)
365
+ */
366
+ enable_module_namespaces: boolean;
367
+ /**
368
+ * Enable enhanced error reporting with suggestions
369
+ */
370
+ enhanced_errors: boolean;
371
+ /**
372
+ * Include debug information
373
+ */
374
+ include_debug_info: boolean;
375
+ /**
376
+ * Include basic metrics
377
+ */
378
+ include_metrics: boolean;
379
+ /**
380
+ * Include performance analysis
381
+ */
382
+ performance_analysis: boolean;
383
+ /**
384
+ * Suppress non-essential output
385
+ */
386
+ quiet: boolean;
387
+ /**
388
+ * Show compilation summary
389
+ */
390
+ summary: boolean;
391
+ /**
392
+ * Enable v2-preview features (nibble immediates, BR_EQ_U8, etc.)
393
+ */
394
+ v2_preview: boolean;
395
+ /**
396
+ * Verbose output
397
+ */
398
+ verbose: boolean;
399
+ readonly analysis_depth: string;
400
+ readonly error_format: string;
401
+ readonly export_format: string;
402
+ readonly metrics_format: string;
403
+ readonly mode: string;
404
+ readonly optimization_level: string;
405
+ readonly source_file: string | undefined;
406
+ }
407
+
408
+ /**
409
+ * WASM compilation result - unified with enhanced error support
410
+ */
411
+ export class WasmCompilationResult {
412
+ private constructor();
413
+ free(): void;
414
+ [Symbol.dispose](): void;
415
+ /**
416
+ * Get all errors as JSON array
417
+ */
418
+ format_all_json(): string;
419
+ /**
420
+ * Get all errors formatted as terminal output
421
+ */
422
+ format_all_terminal(): string;
423
+ get_formatted_errors_json(): string;
424
+ get_formatted_errors_terminal(): string;
425
+ /**
426
+ * Get fully detailed metrics regardless of export format
427
+ */
428
+ get_metrics_detailed(): any;
429
+ /**
430
+ * Get parsed metrics as JavaScript object
431
+ */
432
+ get_metrics_object(): any;
433
+ /**
434
+ * Size of generated bytecode
435
+ */
436
+ bytecode_size: number;
437
+ /**
438
+ * Compilation time in milliseconds
439
+ */
440
+ compilation_time: number;
441
+ /**
442
+ * Total error count
443
+ */
444
+ error_count: number;
445
+ /**
446
+ * Whether compilation succeeded
447
+ */
448
+ success: boolean;
449
+ /**
450
+ * Total warning count
451
+ */
452
+ warning_count: number;
453
+ readonly abi: any;
454
+ readonly bytecode: Uint8Array | undefined;
455
+ readonly compiler_errors: WasmCompilerError[];
456
+ readonly disassembly: Array<any>;
457
+ readonly errors: Array<any>;
458
+ readonly metrics: string;
459
+ readonly metrics_format: string;
460
+ readonly warnings: Array<any>;
461
+ }
462
+
463
+ /**
464
+ * WASM compilation result with comprehensive metrics
465
+ */
466
+ export class WasmCompilationWithMetrics {
467
+ private constructor();
468
+ free(): void;
469
+ [Symbol.dispose](): void;
470
+ /**
471
+ * Get parsed metrics as JavaScript object
472
+ */
473
+ get_metrics_object(): any;
474
+ /**
475
+ * Size of generated bytecode
476
+ */
477
+ bytecode_size: number;
478
+ /**
479
+ * Compilation time in milliseconds
480
+ */
481
+ compilation_time: number;
482
+ /**
483
+ * Whether compilation succeeded
484
+ */
485
+ success: boolean;
486
+ readonly bytecode: Uint8Array | undefined;
487
+ readonly errors: Array<any>;
488
+ readonly metrics: string;
489
+ readonly warnings: Array<any>;
490
+ }
491
+
492
+ /**
493
+ * Enhanced compiler error for WASM
494
+ */
495
+ export class WasmCompilerError {
496
+ private constructor();
497
+ free(): void;
498
+ [Symbol.dispose](): void;
499
+ /**
500
+ * Get error as JSON string
501
+ */
502
+ format_json(): string;
503
+ /**
504
+ * Get formatted error message (terminal style)
505
+ * Get formatted error message (terminal style)
506
+ */
507
+ format_terminal(): string;
508
+ readonly category: string;
509
+ readonly code: string;
510
+ readonly column: any;
511
+ readonly description: string | undefined;
512
+ readonly line: any;
513
+ readonly location: WasmSourceLocation | undefined;
514
+ readonly message: string;
515
+ readonly severity: string;
516
+ readonly source_line: string | undefined;
517
+ readonly suggestions: WasmSuggestion[];
518
+ }
519
+
520
+ /**
521
+ * Enhanced compilation result with rich error information
522
+ */
523
+ export class WasmEnhancedCompilationResult {
524
+ private constructor();
525
+ free(): void;
526
+ [Symbol.dispose](): void;
527
+ /**
528
+ * Get all errors as JSON array
529
+ */
530
+ format_all_json(): string;
531
+ /**
532
+ * Get all errors formatted as terminal output
533
+ */
534
+ format_all_terminal(): string;
535
+ /**
536
+ * Size of generated bytecode
537
+ */
538
+ bytecode_size: number;
539
+ /**
540
+ * Compilation time in milliseconds
541
+ */
542
+ compilation_time: number;
543
+ /**
544
+ * Total error count
545
+ */
546
+ error_count: number;
547
+ /**
548
+ * Whether compilation succeeded
549
+ */
550
+ success: boolean;
551
+ /**
552
+ * Total warning count
553
+ */
554
+ warning_count: number;
555
+ readonly compiler_errors: WasmCompilerError[];
556
+ }
557
+
558
+ /**
559
+ * WASM DSL Compiler for client-side compilation
560
+ */
561
+ export class WasmFiveCompiler {
562
+ free(): void;
563
+ [Symbol.dispose](): void;
564
+ /**
565
+ * Get detailed analysis of source code
566
+ */
567
+ analyze_source(source: string): WasmAnalysisResult;
568
+ /**
569
+ * Get detailed analysis of source code with compilation mode selection
570
+ */
571
+ analyze_source_mode(source: string, mode: string): WasmAnalysisResult;
572
+ /**
573
+ * Unified compilation method with enhanced error reporting and metrics
574
+ */
575
+ compile(source: string, options: WasmCompilationOptions): WasmCompilationResult;
576
+ /**
577
+ * Compile multi-file project with explicit module list
578
+ */
579
+ compileModules(module_files: any, entry_point: string, options: WasmCompilationOptions): WasmCompilationResult;
580
+ /**
581
+ * Compile multi-file project with automatic discovery
582
+ */
583
+ compileMultiWithDiscovery(entry_point: string, options: WasmCompilationOptions): WasmCompilationResult;
584
+ /**
585
+ * Multi-file compilation using module merger (main source + modules)
586
+ */
587
+ compile_multi(main_source: string, modules: any, options: WasmCompilationOptions): WasmCompilationResult;
588
+ /**
589
+ * Compile DSL and generate both bytecode and ABI
590
+ */
591
+ compile_with_abi(source: string): any;
592
+ /**
593
+ * Discover modules starting from an entry point
594
+ */
595
+ discoverModules(entry_point: string): any;
596
+ /**
597
+ * Extract function name metadata from compiled bytecode
598
+ * Returns a list of discovered functions in the bytecode
599
+ */
600
+ extractFunctionMetadata(bytecode: Uint8Array): any;
601
+ /**
602
+ * Extract account definitions from DSL source code
603
+ */
604
+ extract_account_definitions(source: string): any;
605
+ /**
606
+ * Extract function signatures with account parameters
607
+ */
608
+ extract_function_signatures(source: string): any;
609
+ /**
610
+ * Format an error message using the native terminal formatter
611
+ * This provides rich Rust-style error output with source context and colors
612
+ */
613
+ format_error_terminal(message: string, code: string, severity: string, line: number, column: number, _source: string): string;
614
+ /**
615
+ * Generate ABI from DSL source code for function calls
616
+ */
617
+ generate_abi(source: string): any;
618
+ /**
619
+ * Get compiler statistics
620
+ */
621
+ get_compiler_stats(): any;
622
+ /**
623
+ * Get comprehensive compiler statistics including which opcodes are used vs unused
624
+ */
625
+ get_opcode_analysis(source: string): any;
626
+ /**
627
+ * Get opcode usage statistics from compilation
628
+ */
629
+ get_opcode_usage(source: string): any;
630
+ /**
631
+ * Create a new WASM compiler instance
632
+ */
633
+ constructor();
634
+ /**
635
+ * Optimize bytecode
636
+ */
637
+ optimize_bytecode(bytecode: Uint8Array): Uint8Array;
638
+ /**
639
+ * Parse DSL source code and return AST information
640
+ */
641
+ parse_dsl(source: string): any;
642
+ /**
643
+ * Type-check parsed AST
644
+ */
645
+ type_check(_ast_json: string): any;
646
+ /**
647
+ * Validate account constraints against function parameters
648
+ */
649
+ validate_account_constraints(source: string, function_name: string, accounts_json: string): any;
650
+ /**
651
+ * Validate DSL syntax without full compilation
652
+ */
653
+ validate_syntax(source: string): any;
654
+ }
655
+
656
+ /**
657
+ * WASM-exposed metrics collector wrapper
658
+ */
659
+ export class WasmMetricsCollector {
660
+ free(): void;
661
+ [Symbol.dispose](): void;
662
+ /**
663
+ * End the current compilation phase
664
+ */
665
+ end_phase(): void;
666
+ /**
667
+ * Export metrics in the requested format
668
+ */
669
+ export(format: string): string;
670
+ /**
671
+ * Finalize metrics collection
672
+ */
673
+ finalize(): void;
674
+ /**
675
+ * Get metrics as a JS object for programmatic use
676
+ */
677
+ get_metrics_object(): any;
678
+ constructor();
679
+ /**
680
+ * Reset the collector for a new compilation
681
+ */
682
+ reset(): void;
683
+ /**
684
+ * Start timing a compilation phase
685
+ */
686
+ start_phase(phase_name: string): void;
687
+ }
688
+
689
+ /**
690
+ * Enhanced source location for WASM
691
+ */
692
+ export class WasmSourceLocation {
693
+ private constructor();
694
+ free(): void;
695
+ [Symbol.dispose](): void;
696
+ /**
697
+ * Column number (1-based)
698
+ */
699
+ column: number;
700
+ /**
701
+ * Length of the relevant text
702
+ */
703
+ length: number;
704
+ /**
705
+ * Line number (1-based)
706
+ */
707
+ line: number;
708
+ /**
709
+ * Byte offset in source
710
+ */
711
+ offset: number;
712
+ readonly file: string | undefined;
713
+ }
714
+
715
+ /**
716
+ * Enhanced error suggestion for WASM
717
+ */
718
+ export class WasmSuggestion {
719
+ private constructor();
720
+ free(): void;
721
+ [Symbol.dispose](): void;
722
+ /**
723
+ * Confidence score (0.0 to 1.0)
724
+ */
725
+ confidence: number;
726
+ readonly code_suggestion: string | undefined;
727
+ readonly explanation: string | undefined;
728
+ readonly message: string;
729
+ }
730
+
731
+ /**
732
+ * Get function names from bytecode as a JS value (array of objects)
733
+ *
734
+ * This function avoids constructing `FunctionNameInfo` JS instances and instead
735
+ * marshals the parsed metadata directly into a serde-friendly structure and
736
+ * returns a `JsValue` via `JsValue::from_serde`.
737
+ */
738
+ export function get_function_names(bytecode: Uint8Array): any;
739
+
740
+ /**
741
+ * Get the count of public functions from bytecode header
742
+ */
743
+ export function get_public_function_count(bytecode: Uint8Array): number;
744
+
745
+ /**
746
+ * Get information about the WASM compiler capabilities
747
+ */
748
+ export function get_wasm_compiler_info(): any;
749
+
750
+ /**
751
+ * Helper function to convert JS value to VM Value
752
+ */
753
+ export function js_value_to_vm_value(js_val: any, value_type: number): any;
754
+
755
+ export function log_to_console(message: string): void;
756
+
757
+ /**
758
+ * Parse function names from bytecode metadata
759
+ *
760
+ * Returns a JS value which is a JSON string encoding an array of objects:
761
+ * [ { "name": "...", "function_index": N }, ... ]
762
+ * We serialize via serde_json and return the JSON string as a `JsValue` to
763
+ * avoid complex JS object construction in Rust/WASM glue.
764
+ */
765
+ export function parse_function_names(bytecode: Uint8Array): any;
766
+
767
+ /**
768
+ * Utility: Validate optimized headers and mirror bytecode back to JS callers
769
+ */
770
+ export function wrap_with_script_header(bytecode: Uint8Array): Uint8Array;