@5ive-tech/sdk 1.1.2
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.
- package/README.md +279 -0
- package/dist/FiveSDK.d.ts +336 -0
- package/dist/FiveSDK.js +395 -0
- package/dist/accounts/index.d.ts +254 -0
- package/dist/accounts/index.js +543 -0
- package/dist/assets/vm/dummy.file +0 -0
- package/dist/assets/vm/five_vm_wasm.d.ts +762 -0
- package/dist/assets/vm/five_vm_wasm.js +3754 -0
- package/dist/assets/vm/five_vm_wasm_bg.js +3307 -0
- package/dist/assets/vm/five_vm_wasm_bg.wasm +0 -0
- package/dist/assets/vm/five_vm_wasm_bg.wasm.d.ts +247 -0
- package/dist/assets/vm/package.json +11 -0
- package/dist/bin/gen-types.d.ts +2 -0
- package/dist/bin/gen-types.js +35 -0
- package/dist/compiler/BytecodeCompiler.d.ts +83 -0
- package/dist/compiler/BytecodeCompiler.js +379 -0
- package/dist/config/ConfigManager.d.ts +13 -0
- package/dist/config/ConfigManager.js +27 -0
- package/dist/config/ProgramIdResolver.d.ts +62 -0
- package/dist/config/ProgramIdResolver.js +104 -0
- package/dist/crypto/index.d.ts +211 -0
- package/dist/crypto/index.js +451 -0
- package/dist/encoding/ParameterEncoder.d.ts +31 -0
- package/dist/encoding/ParameterEncoder.js +278 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +28 -0
- package/dist/lib/bytecode-encoder.d.ts +62 -0
- package/dist/lib/bytecode-encoder.js +281 -0
- package/dist/logging/index.d.ts +9 -0
- package/dist/logging/index.js +10 -0
- package/dist/metadata/index.d.ts +213 -0
- package/dist/metadata/index.js +296 -0
- package/dist/modules/accounts.d.ts +60 -0
- package/dist/modules/accounts.js +275 -0
- package/dist/modules/deploy.d.ts +90 -0
- package/dist/modules/deploy.js +1118 -0
- package/dist/modules/execute.d.ts +90 -0
- package/dist/modules/execute.js +649 -0
- package/dist/modules/fees.d.ts +14 -0
- package/dist/modules/fees.js +112 -0
- package/dist/modules/namespaces.d.ts +39 -0
- package/dist/modules/namespaces.js +190 -0
- package/dist/modules/state-diff.d.ts +35 -0
- package/dist/modules/state-diff.js +342 -0
- package/dist/modules/vm-state.d.ts +7 -0
- package/dist/modules/vm-state.js +44 -0
- package/dist/program/AccountResolver.d.ts +67 -0
- package/dist/program/AccountResolver.js +134 -0
- package/dist/program/BorshSchemaGenerator.d.ts +8 -0
- package/dist/program/BorshSchemaGenerator.js +57 -0
- package/dist/program/FiveProgram.d.ts +144 -0
- package/dist/program/FiveProgram.js +282 -0
- package/dist/program/FunctionBuilder.d.ts +114 -0
- package/dist/program/FunctionBuilder.js +347 -0
- package/dist/program/ProgramAccount.d.ts +38 -0
- package/dist/program/ProgramAccount.js +170 -0
- package/dist/program/TypeGenerator.d.ts +90 -0
- package/dist/program/TypeGenerator.js +195 -0
- package/dist/program/index.d.ts +24 -0
- package/dist/program/index.js +21 -0
- package/dist/project/config.d.ts +5 -0
- package/dist/project/config.js +33 -0
- package/dist/project/toml.d.ts +6 -0
- package/dist/project/toml.js +43 -0
- package/dist/project/workspace.d.ts +160 -0
- package/dist/project/workspace.js +73 -0
- package/dist/testing/AccountMetaGenerator.d.ts +121 -0
- package/dist/testing/AccountMetaGenerator.js +261 -0
- package/dist/testing/AccountTestFixture.d.ts +211 -0
- package/dist/testing/AccountTestFixture.js +530 -0
- package/dist/testing/OnChainAccountManager.d.ts +81 -0
- package/dist/testing/OnChainAccountManager.js +260 -0
- package/dist/testing/StateSerializer.d.ts +65 -0
- package/dist/testing/StateSerializer.js +330 -0
- package/dist/testing/TestDiscovery.d.ts +79 -0
- package/dist/testing/TestDiscovery.js +274 -0
- package/dist/testing/TestRunner.d.ts +117 -0
- package/dist/testing/TestRunner.js +346 -0
- package/dist/testing/index.d.ts +14 -0
- package/dist/testing/index.js +13 -0
- package/dist/types.d.ts +356 -0
- package/dist/types.js +32 -0
- package/dist/utils/abi.d.ts +31 -0
- package/dist/utils/abi.js +92 -0
- package/dist/utils/transaction.d.ts +5 -0
- package/dist/utils/transaction.js +48 -0
- package/dist/validation/InputValidator.d.ts +142 -0
- package/dist/validation/InputValidator.js +332 -0
- package/dist/validation/index.d.ts +4 -0
- package/dist/validation/index.js +4 -0
- package/dist/wasm/compiler/AbiLogic.d.ts +4 -0
- package/dist/wasm/compiler/AbiLogic.js +37 -0
- package/dist/wasm/compiler/AnalysisLogic.d.ts +6 -0
- package/dist/wasm/compiler/AnalysisLogic.js +61 -0
- package/dist/wasm/compiler/CompilationLogic.d.ts +10 -0
- package/dist/wasm/compiler/CompilationLogic.js +431 -0
- package/dist/wasm/compiler/FiveCompiler.d.ts +48 -0
- package/dist/wasm/compiler/FiveCompiler.js +183 -0
- package/dist/wasm/compiler/InfoLogic.d.ts +6 -0
- package/dist/wasm/compiler/InfoLogic.js +24 -0
- package/dist/wasm/compiler/OptimizationLogic.d.ts +2 -0
- package/dist/wasm/compiler/OptimizationLogic.js +13 -0
- package/dist/wasm/compiler/ValidationLogic.d.ts +7 -0
- package/dist/wasm/compiler/ValidationLogic.js +26 -0
- package/dist/wasm/compiler/index.d.ts +2 -0
- package/dist/wasm/compiler/index.js +2 -0
- package/dist/wasm/compiler/types.d.ts +8 -0
- package/dist/wasm/compiler/types.js +1 -0
- package/dist/wasm/compiler/utils.d.ts +8 -0
- package/dist/wasm/compiler/utils.js +75 -0
- package/dist/wasm/index.d.ts +9 -0
- package/dist/wasm/index.js +12 -0
- package/dist/wasm/instance.d.ts +1 -0
- package/dist/wasm/instance.js +26 -0
- package/dist/wasm/loader.d.ts +7 -0
- package/dist/wasm/loader.js +112 -0
- package/dist/wasm/vm.d.ts +33 -0
- package/dist/wasm/vm.js +250 -0
- package/package.json +59 -0
|
Binary file
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
export const memory: WebAssembly.Memory;
|
|
4
|
+
export const log_to_console: (a: number, b: number) => void;
|
|
5
|
+
export const __wbg_testresult_free: (a: number, b: number) => void;
|
|
6
|
+
export const __wbg_get_testresult_compute_units_used: (a: number) => bigint;
|
|
7
|
+
export const __wbg_set_testresult_compute_units_used: (a: number, b: bigint) => void;
|
|
8
|
+
export const __wbg_get_testresult_instruction_pointer: (a: number) => number;
|
|
9
|
+
export const __wbg_set_testresult_instruction_pointer: (a: number, b: number) => void;
|
|
10
|
+
export const __wbg_get_testresult_stopped_at_opcode: (a: number) => number;
|
|
11
|
+
export const __wbg_set_testresult_stopped_at_opcode: (a: number, b: number) => void;
|
|
12
|
+
export const testresult_status: (a: number, b: number) => void;
|
|
13
|
+
export const testresult_has_result_value: (a: number) => number;
|
|
14
|
+
export const testresult_get_result_value: (a: number) => number;
|
|
15
|
+
export const testresult_final_stack: (a: number) => number;
|
|
16
|
+
export const testresult_final_memory: (a: number) => number;
|
|
17
|
+
export const testresult_final_accounts: (a: number) => number;
|
|
18
|
+
export const testresult_error_message: (a: number, b: number) => void;
|
|
19
|
+
export const testresult_execution_context: (a: number, b: number) => void;
|
|
20
|
+
export const testresult_stopped_at_opcode_name: (a: number, b: number) => void;
|
|
21
|
+
export const __wbg_fivevmstate_free: (a: number, b: number) => void;
|
|
22
|
+
export const fivevmstate_stack: (a: number) => number;
|
|
23
|
+
export const fivevmstate_instruction_pointer: (a: number) => number;
|
|
24
|
+
export const fivevmstate_compute_units: (a: number) => bigint;
|
|
25
|
+
export const __wbg_wasmaccount_free: (a: number, b: number) => void;
|
|
26
|
+
export const __wbg_get_wasmaccount_lamports: (a: number) => bigint;
|
|
27
|
+
export const __wbg_set_wasmaccount_lamports: (a: number, b: bigint) => void;
|
|
28
|
+
export const __wbg_get_wasmaccount_is_writable: (a: number) => number;
|
|
29
|
+
export const __wbg_set_wasmaccount_is_writable: (a: number, b: number) => void;
|
|
30
|
+
export const __wbg_get_wasmaccount_is_signer: (a: number) => number;
|
|
31
|
+
export const __wbg_set_wasmaccount_is_signer: (a: number, b: number) => void;
|
|
32
|
+
export const wasmaccount_new: (a: number, b: number, c: number, d: number, e: number, f: bigint, g: number, h: number, i: number, j: number) => void;
|
|
33
|
+
export const wasmaccount_key: (a: number) => number;
|
|
34
|
+
export const wasmaccount_data: (a: number) => number;
|
|
35
|
+
export const wasmaccount_set_data: (a: number, b: number, c: number) => void;
|
|
36
|
+
export const wasmaccount_owner: (a: number) => number;
|
|
37
|
+
export const __wbg_fivevmwasm_free: (a: number, b: number) => void;
|
|
38
|
+
export const fivevmwasm_new: (a: number, b: number, c: number) => void;
|
|
39
|
+
export const fivevmwasm_execute: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
40
|
+
export const fivevmwasm_execute_partial: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
41
|
+
export const fivevmwasm_get_state: (a: number, b: number) => void;
|
|
42
|
+
export const fivevmwasm_validate_bytecode: (a: number, b: number, c: number) => void;
|
|
43
|
+
export const fivevmwasm_get_constants: () => number;
|
|
44
|
+
export const wrap_with_script_header: (a: number, b: number, c: number) => void;
|
|
45
|
+
export const parse_function_names: (a: number, b: number, c: number) => void;
|
|
46
|
+
export const get_public_function_count: (a: number, b: number, c: number) => void;
|
|
47
|
+
export const get_function_names: (a: number, b: number, c: number) => void;
|
|
48
|
+
export const js_value_to_vm_value: (a: number, b: number, c: number) => void;
|
|
49
|
+
export const __wbg_bytecodeanalyzer_free: (a: number, b: number) => void;
|
|
50
|
+
export const bytecodeanalyzer_analyze: (a: number, b: number, c: number) => void;
|
|
51
|
+
export const bytecodeanalyzer_analyze_semantic: (a: number, b: number, c: number) => void;
|
|
52
|
+
export const bytecodeanalyzer_analyze_instruction_at: (a: number, b: number, c: number, d: number) => void;
|
|
53
|
+
export const bytecodeanalyzer_get_bytecode_summary: (a: number, b: number, c: number) => void;
|
|
54
|
+
export const bytecodeanalyzer_analyze_execution_flow: (a: number, b: number, c: number) => void;
|
|
55
|
+
export const __wbg_wasmsuggestion_free: (a: number, b: number) => void;
|
|
56
|
+
export const wasmsuggestion_message: (a: number, b: number) => void;
|
|
57
|
+
export const wasmsuggestion_explanation: (a: number, b: number) => void;
|
|
58
|
+
export const wasmsuggestion_code_suggestion: (a: number, b: number) => void;
|
|
59
|
+
export const __wbg_wasmsourcelocation_free: (a: number, b: number) => void;
|
|
60
|
+
export const __wbg_get_wasmsourcelocation_line: (a: number) => number;
|
|
61
|
+
export const __wbg_set_wasmsourcelocation_line: (a: number, b: number) => void;
|
|
62
|
+
export const __wbg_get_wasmsourcelocation_column: (a: number) => number;
|
|
63
|
+
export const __wbg_set_wasmsourcelocation_column: (a: number, b: number) => void;
|
|
64
|
+
export const __wbg_get_wasmsourcelocation_offset: (a: number) => number;
|
|
65
|
+
export const __wbg_set_wasmsourcelocation_offset: (a: number, b: number) => void;
|
|
66
|
+
export const __wbg_get_wasmsourcelocation_length: (a: number) => number;
|
|
67
|
+
export const __wbg_set_wasmsourcelocation_length: (a: number, b: number) => void;
|
|
68
|
+
export const wasmsourcelocation_file: (a: number, b: number) => void;
|
|
69
|
+
export const __wbg_wasmcompilererror_free: (a: number, b: number) => void;
|
|
70
|
+
export const wasmcompilererror_code: (a: number, b: number) => void;
|
|
71
|
+
export const wasmcompilererror_line: (a: number) => number;
|
|
72
|
+
export const wasmcompilererror_column: (a: number) => number;
|
|
73
|
+
export const wasmcompilererror_severity: (a: number, b: number) => void;
|
|
74
|
+
export const wasmcompilererror_category: (a: number, b: number) => void;
|
|
75
|
+
export const wasmcompilererror_message: (a: number, b: number) => void;
|
|
76
|
+
export const wasmcompilererror_description: (a: number, b: number) => void;
|
|
77
|
+
export const wasmcompilererror_location: (a: number) => number;
|
|
78
|
+
export const wasmcompilererror_suggestions: (a: number, b: number) => void;
|
|
79
|
+
export const wasmcompilererror_source_line: (a: number, b: number) => void;
|
|
80
|
+
export const wasmcompilererror_format_terminal: (a: number, b: number) => void;
|
|
81
|
+
export const wasmcompilererror_format_json: (a: number, b: number) => void;
|
|
82
|
+
export const __wbg_wasmenhancedcompilationresult_free: (a: number, b: number) => void;
|
|
83
|
+
export const __wbg_get_wasmenhancedcompilationresult_bytecode_size: (a: number) => number;
|
|
84
|
+
export const __wbg_set_wasmenhancedcompilationresult_bytecode_size: (a: number, b: number) => void;
|
|
85
|
+
export const __wbg_get_wasmenhancedcompilationresult_error_count: (a: number) => number;
|
|
86
|
+
export const __wbg_set_wasmenhancedcompilationresult_error_count: (a: number, b: number) => void;
|
|
87
|
+
export const __wbg_get_wasmenhancedcompilationresult_warning_count: (a: number) => number;
|
|
88
|
+
export const __wbg_set_wasmenhancedcompilationresult_warning_count: (a: number, b: number) => void;
|
|
89
|
+
export const wasmenhancedcompilationresult_compiler_errors: (a: number, b: number) => void;
|
|
90
|
+
export const wasmenhancedcompilationresult_format_all_terminal: (a: number, b: number) => void;
|
|
91
|
+
export const wasmenhancedcompilationresult_format_all_json: (a: number, b: number) => void;
|
|
92
|
+
export const __wbg_wasmcompilationoptions_free: (a: number, b: number) => void;
|
|
93
|
+
export const __wbg_get_wasmcompilationoptions_v2_preview: (a: number) => number;
|
|
94
|
+
export const __wbg_set_wasmcompilationoptions_v2_preview: (a: number, b: number) => void;
|
|
95
|
+
export const __wbg_get_wasmcompilationoptions_enable_constraint_cache: (a: number) => number;
|
|
96
|
+
export const __wbg_set_wasmcompilationoptions_enable_constraint_cache: (a: number, b: number) => void;
|
|
97
|
+
export const __wbg_get_wasmcompilationoptions_enhanced_errors: (a: number) => number;
|
|
98
|
+
export const __wbg_set_wasmcompilationoptions_enhanced_errors: (a: number, b: number) => void;
|
|
99
|
+
export const __wbg_get_wasmcompilationoptions_include_metrics: (a: number) => number;
|
|
100
|
+
export const __wbg_set_wasmcompilationoptions_include_metrics: (a: number, b: number) => void;
|
|
101
|
+
export const __wbg_get_wasmcompilationoptions_comprehensive_metrics: (a: number) => number;
|
|
102
|
+
export const __wbg_set_wasmcompilationoptions_comprehensive_metrics: (a: number, b: number) => void;
|
|
103
|
+
export const __wbg_get_wasmcompilationoptions_performance_analysis: (a: number) => number;
|
|
104
|
+
export const __wbg_set_wasmcompilationoptions_performance_analysis: (a: number, b: number) => void;
|
|
105
|
+
export const __wbg_get_wasmcompilationoptions_complexity_analysis: (a: number) => number;
|
|
106
|
+
export const __wbg_set_wasmcompilationoptions_complexity_analysis: (a: number, b: number) => void;
|
|
107
|
+
export const __wbg_get_wasmcompilationoptions_summary: (a: number) => number;
|
|
108
|
+
export const __wbg_set_wasmcompilationoptions_summary: (a: number, b: number) => void;
|
|
109
|
+
export const __wbg_get_wasmcompilationoptions_verbose: (a: number) => number;
|
|
110
|
+
export const __wbg_set_wasmcompilationoptions_verbose: (a: number, b: number) => void;
|
|
111
|
+
export const __wbg_get_wasmcompilationoptions_quiet: (a: number) => number;
|
|
112
|
+
export const __wbg_set_wasmcompilationoptions_quiet: (a: number, b: number) => void;
|
|
113
|
+
export const __wbg_get_wasmcompilationoptions_include_debug_info: (a: number) => number;
|
|
114
|
+
export const __wbg_set_wasmcompilationoptions_include_debug_info: (a: number, b: number) => void;
|
|
115
|
+
export const __wbg_get_wasmcompilationoptions_compress_output: (a: number) => number;
|
|
116
|
+
export const __wbg_set_wasmcompilationoptions_compress_output: (a: number, b: number) => void;
|
|
117
|
+
export const __wbg_get_wasmcompilationoptions_enable_module_namespaces: (a: number) => number;
|
|
118
|
+
export const __wbg_set_wasmcompilationoptions_enable_module_namespaces: (a: number, b: number) => void;
|
|
119
|
+
export const wasmcompilationoptions_new: () => number;
|
|
120
|
+
export const wasmcompilationoptions_with_mode: (a: number, b: number, c: number) => number;
|
|
121
|
+
export const wasmcompilationoptions_with_optimization_level: (a: number, b: number, c: number) => number;
|
|
122
|
+
export const wasmcompilationoptions_with_v2_preview: (a: number, b: number) => number;
|
|
123
|
+
export const wasmcompilationoptions_with_constraint_cache: (a: number, b: number) => number;
|
|
124
|
+
export const wasmcompilationoptions_with_enhanced_errors: (a: number, b: number) => number;
|
|
125
|
+
export const wasmcompilationoptions_with_error_format: (a: number, b: number, c: number) => number;
|
|
126
|
+
export const wasmcompilationoptions_with_source_file: (a: number, b: number, c: number) => number;
|
|
127
|
+
export const wasmcompilationoptions_with_metrics: (a: number, b: number) => number;
|
|
128
|
+
export const wasmcompilationoptions_with_comprehensive_metrics: (a: number, b: number) => number;
|
|
129
|
+
export const wasmcompilationoptions_with_metrics_format: (a: number, b: number, c: number) => number;
|
|
130
|
+
export const wasmcompilationoptions_with_performance_analysis: (a: number, b: number) => number;
|
|
131
|
+
export const wasmcompilationoptions_with_complexity_analysis: (a: number, b: number) => number;
|
|
132
|
+
export const wasmcompilationoptions_with_summary: (a: number, b: number) => number;
|
|
133
|
+
export const wasmcompilationoptions_with_verbose: (a: number, b: number) => number;
|
|
134
|
+
export const wasmcompilationoptions_with_quiet: (a: number, b: number) => number;
|
|
135
|
+
export const wasmcompilationoptions_with_analysis_depth: (a: number, b: number, c: number) => number;
|
|
136
|
+
export const wasmcompilationoptions_with_export_format: (a: number, b: number, c: number) => number;
|
|
137
|
+
export const wasmcompilationoptions_with_debug_info: (a: number, b: number) => number;
|
|
138
|
+
export const wasmcompilationoptions_with_compression: (a: number, b: number) => number;
|
|
139
|
+
export const wasmcompilationoptions_with_module_namespaces: (a: number, b: number) => number;
|
|
140
|
+
export const wasmcompilationoptions_production_optimized: () => number;
|
|
141
|
+
export const wasmcompilationoptions_development_debug: () => number;
|
|
142
|
+
export const wasmcompilationoptions_fast_iteration: () => number;
|
|
143
|
+
export const wasmcompilationoptions_mode: (a: number, b: number) => void;
|
|
144
|
+
export const wasmcompilationoptions_optimization_level: (a: number, b: number) => void;
|
|
145
|
+
export const wasmcompilationoptions_error_format: (a: number, b: number) => void;
|
|
146
|
+
export const wasmcompilationoptions_source_file: (a: number, b: number) => void;
|
|
147
|
+
export const wasmcompilationoptions_metrics_format: (a: number, b: number) => void;
|
|
148
|
+
export const wasmcompilationoptions_analysis_depth: (a: number, b: number) => void;
|
|
149
|
+
export const wasmcompilationoptions_export_format: (a: number, b: number) => void;
|
|
150
|
+
export const __wbg_wasmmetricscollector_free: (a: number, b: number) => void;
|
|
151
|
+
export const wasmmetricscollector_new: () => number;
|
|
152
|
+
export const wasmmetricscollector_start_phase: (a: number, b: number, c: number) => void;
|
|
153
|
+
export const wasmmetricscollector_end_phase: (a: number) => void;
|
|
154
|
+
export const wasmmetricscollector_finalize: (a: number) => void;
|
|
155
|
+
export const wasmmetricscollector_reset: (a: number) => void;
|
|
156
|
+
export const wasmmetricscollector_export: (a: number, b: number, c: number, d: number) => void;
|
|
157
|
+
export const wasmmetricscollector_get_metrics_object: (a: number, b: number) => void;
|
|
158
|
+
export const __wbg_wasmcompilationresult_free: (a: number, b: number) => void;
|
|
159
|
+
export const __wbg_get_wasmcompilationresult_success: (a: number) => number;
|
|
160
|
+
export const __wbg_set_wasmcompilationresult_success: (a: number, b: number) => void;
|
|
161
|
+
export const __wbg_get_wasmcompilationresult_bytecode_size: (a: number) => number;
|
|
162
|
+
export const __wbg_set_wasmcompilationresult_bytecode_size: (a: number, b: number) => void;
|
|
163
|
+
export const __wbg_get_wasmcompilationresult_error_count: (a: number) => number;
|
|
164
|
+
export const __wbg_set_wasmcompilationresult_error_count: (a: number, b: number) => void;
|
|
165
|
+
export const __wbg_get_wasmcompilationresult_warning_count: (a: number) => number;
|
|
166
|
+
export const __wbg_set_wasmcompilationresult_warning_count: (a: number, b: number) => void;
|
|
167
|
+
export const __wbg_wasmcompilationwithmetrics_free: (a: number, b: number) => void;
|
|
168
|
+
export const __wbg_get_wasmcompilationwithmetrics_success: (a: number) => number;
|
|
169
|
+
export const __wbg_set_wasmcompilationwithmetrics_success: (a: number, b: number) => void;
|
|
170
|
+
export const __wbg_get_wasmcompilationwithmetrics_bytecode_size: (a: number) => number;
|
|
171
|
+
export const __wbg_set_wasmcompilationwithmetrics_bytecode_size: (a: number, b: number) => void;
|
|
172
|
+
export const __wbg_wasmanalysisresult_free: (a: number, b: number) => void;
|
|
173
|
+
export const __wbg_get_wasmanalysisresult_success: (a: number) => number;
|
|
174
|
+
export const __wbg_set_wasmanalysisresult_success: (a: number, b: number) => void;
|
|
175
|
+
export const __wbg_get_wasmanalysisresult_analysis_time: (a: number) => number;
|
|
176
|
+
export const __wbg_set_wasmanalysisresult_analysis_time: (a: number, b: number) => void;
|
|
177
|
+
export const wasmcompilationresult_bytecode: (a: number) => number;
|
|
178
|
+
export const wasmcompilationresult_abi: (a: number) => number;
|
|
179
|
+
export const wasmcompilationresult_warnings: (a: number) => number;
|
|
180
|
+
export const wasmcompilationresult_errors: (a: number) => number;
|
|
181
|
+
export const wasmcompilationresult_compiler_errors: (a: number, b: number) => void;
|
|
182
|
+
export const wasmcompilationresult_disassembly: (a: number) => number;
|
|
183
|
+
export const wasmcompilationresult_get_formatted_errors_terminal: (a: number, b: number) => void;
|
|
184
|
+
export const wasmcompilationresult_get_formatted_errors_json: (a: number, b: number) => void;
|
|
185
|
+
export const wasmcompilationresult_format_all_terminal: (a: number, b: number) => void;
|
|
186
|
+
export const wasmcompilationresult_format_all_json: (a: number, b: number) => void;
|
|
187
|
+
export const wasmcompilationresult_get_metrics_object: (a: number) => number;
|
|
188
|
+
export const wasmcompilationresult_get_metrics_detailed: (a: number, b: number) => void;
|
|
189
|
+
export const wasmcompilationresult_metrics: (a: number, b: number) => void;
|
|
190
|
+
export const wasmcompilationresult_metrics_format: (a: number, b: number) => void;
|
|
191
|
+
export const wasmcompilationwithmetrics_bytecode: (a: number) => number;
|
|
192
|
+
export const wasmcompilationwithmetrics_warnings: (a: number) => number;
|
|
193
|
+
export const wasmcompilationwithmetrics_errors: (a: number) => number;
|
|
194
|
+
export const wasmcompilationwithmetrics_metrics: (a: number, b: number) => void;
|
|
195
|
+
export const wasmcompilationwithmetrics_get_metrics_object: (a: number, b: number) => void;
|
|
196
|
+
export const wasmanalysisresult_summary: (a: number, b: number) => void;
|
|
197
|
+
export const wasmanalysisresult_metrics: (a: number, b: number) => void;
|
|
198
|
+
export const wasmanalysisresult_errors: (a: number) => number;
|
|
199
|
+
export const wasmanalysisresult_get_metrics_object: (a: number, b: number) => void;
|
|
200
|
+
export const wasmfivecompiler_new: () => number;
|
|
201
|
+
export const wasmfivecompiler_format_error_terminal: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number) => void;
|
|
202
|
+
export const wasmfivecompiler_compile: (a: number, b: number, c: number, d: number) => number;
|
|
203
|
+
export const wasmfivecompiler_compileMultiWithDiscovery: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
204
|
+
export const wasmfivecompiler_discoverModules: (a: number, b: number, c: number, d: number) => void;
|
|
205
|
+
export const wasmfivecompiler_compileModules: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
206
|
+
export const wasmfivecompiler_extractFunctionMetadata: (a: number, b: number, c: number, d: number) => void;
|
|
207
|
+
export const wasmfivecompiler_compile_multi: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
208
|
+
export const wasmfivecompiler_analyze_source: (a: number, b: number, c: number) => number;
|
|
209
|
+
export const wasmfivecompiler_get_opcode_usage: (a: number, b: number, c: number, d: number) => void;
|
|
210
|
+
export const wasmfivecompiler_get_opcode_analysis: (a: number, b: number, c: number, d: number) => void;
|
|
211
|
+
export const wasmfivecompiler_analyze_source_mode: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
212
|
+
export const wasmfivecompiler_parse_dsl: (a: number, b: number, c: number, d: number) => void;
|
|
213
|
+
export const wasmfivecompiler_type_check: (a: number, b: number, c: number, d: number) => void;
|
|
214
|
+
export const wasmfivecompiler_optimize_bytecode: (a: number, b: number, c: number, d: number) => void;
|
|
215
|
+
export const wasmfivecompiler_extract_account_definitions: (a: number, b: number, c: number, d: number) => void;
|
|
216
|
+
export const wasmfivecompiler_extract_function_signatures: (a: number, b: number, c: number, d: number) => void;
|
|
217
|
+
export const wasmfivecompiler_validate_account_constraints: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
|
|
218
|
+
export const wasmfivecompiler_get_compiler_stats: (a: number) => number;
|
|
219
|
+
export const wasmfivecompiler_generate_abi: (a: number, b: number, c: number, d: number) => void;
|
|
220
|
+
export const wasmfivecompiler_compile_with_abi: (a: number, b: number, c: number, d: number) => void;
|
|
221
|
+
export const wasmfivecompiler_validate_syntax: (a: number, b: number, c: number) => number;
|
|
222
|
+
export const bytecodeencoder_encode_u32: (a: number) => number;
|
|
223
|
+
export const bytecodeencoder_encode_u16: (a: number) => number;
|
|
224
|
+
export const bytecodeencoder_decode_u32: (a: number, b: number) => number;
|
|
225
|
+
export const bytecodeencoder_decode_u16: (a: number, b: number) => number;
|
|
226
|
+
export const bytecodeencoder_encoded_size_u32: (a: number) => number;
|
|
227
|
+
export const bytecodeencoder_encoded_size_u16: (a: number) => number;
|
|
228
|
+
export const parameterencoder_encode_execute: (a: number, b: number, c: number) => void;
|
|
229
|
+
export const get_wasm_compiler_info: () => number;
|
|
230
|
+
export const __wbg_set_wasmsuggestion_confidence: (a: number, b: number) => void;
|
|
231
|
+
export const __wbg_set_wasmenhancedcompilationresult_compilation_time: (a: number, b: number) => void;
|
|
232
|
+
export const __wbg_set_wasmcompilationwithmetrics_compilation_time: (a: number, b: number) => void;
|
|
233
|
+
export const __wbg_set_wasmcompilationresult_compilation_time: (a: number, b: number) => void;
|
|
234
|
+
export const __wbg_get_wasmsuggestion_confidence: (a: number) => number;
|
|
235
|
+
export const __wbg_get_wasmenhancedcompilationresult_compilation_time: (a: number) => number;
|
|
236
|
+
export const __wbg_get_wasmcompilationwithmetrics_compilation_time: (a: number) => number;
|
|
237
|
+
export const __wbg_get_wasmcompilationresult_compilation_time: (a: number) => number;
|
|
238
|
+
export const __wbg_set_wasmenhancedcompilationresult_success: (a: number, b: number) => void;
|
|
239
|
+
export const __wbg_get_wasmenhancedcompilationresult_success: (a: number) => number;
|
|
240
|
+
export const __wbg_wasmfivecompiler_free: (a: number, b: number) => void;
|
|
241
|
+
export const __wbg_bytecodeencoder_free: (a: number, b: number) => void;
|
|
242
|
+
export const __wbg_parameterencoder_free: (a: number, b: number) => void;
|
|
243
|
+
export const __wbindgen_export: (a: number, b: number) => number;
|
|
244
|
+
export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
245
|
+
export const __wbindgen_export3: (a: number) => void;
|
|
246
|
+
export const __wbindgen_export4: (a: number, b: number, c: number) => void;
|
|
247
|
+
export const __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import fs from 'fs';
|
|
3
|
+
import { TypeGenerator } from '../program/TypeGenerator.js';
|
|
4
|
+
async function main() {
|
|
5
|
+
const args = process.argv.slice(2);
|
|
6
|
+
if (args.length < 1) {
|
|
7
|
+
console.error('Usage: five-gen-types <abi-file.json> [output-file.ts]');
|
|
8
|
+
process.exit(1);
|
|
9
|
+
}
|
|
10
|
+
const abiPath = args[0];
|
|
11
|
+
const outputPath = args[1] || abiPath.replace('.json', '.d.ts');
|
|
12
|
+
// Read ABI
|
|
13
|
+
const abiContent = fs.readFileSync(abiPath, 'utf8');
|
|
14
|
+
let abi;
|
|
15
|
+
try {
|
|
16
|
+
abi = JSON.parse(abiContent);
|
|
17
|
+
}
|
|
18
|
+
catch (e) {
|
|
19
|
+
console.error(`Error parsing ABI file ${abiPath}:`, e);
|
|
20
|
+
process.exit(1);
|
|
21
|
+
}
|
|
22
|
+
// Generate Types
|
|
23
|
+
const generator = new TypeGenerator(abi, {
|
|
24
|
+
scriptName: abi.name,
|
|
25
|
+
includeJSDoc: true
|
|
26
|
+
});
|
|
27
|
+
const code = generator.generate();
|
|
28
|
+
// Write output
|
|
29
|
+
fs.writeFileSync(outputPath, code);
|
|
30
|
+
console.log(`Generated types to: ${outputPath}`);
|
|
31
|
+
}
|
|
32
|
+
main().catch(err => {
|
|
33
|
+
console.error("Error:", err);
|
|
34
|
+
process.exit(1);
|
|
35
|
+
});
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Five Bytecode Compiler
|
|
3
|
+
*
|
|
4
|
+
* Handles compilation of Five script source (.v files) to bytecode (.bin files)
|
|
5
|
+
* using the existing WASM compilation infrastructure.
|
|
6
|
+
*
|
|
7
|
+
* This maintains the real compilation capabilities while providing a clean SDK interface.
|
|
8
|
+
*/
|
|
9
|
+
import { FiveScriptSource, FiveBytecode, CompilationOptions, CompilationResult, CompilationError } from "../types.js";
|
|
10
|
+
/**
|
|
11
|
+
* Compiler configuration
|
|
12
|
+
*/
|
|
13
|
+
interface CompilerConfig {
|
|
14
|
+
debug?: boolean;
|
|
15
|
+
wasmPath?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Bytecode compiler for Five scripts
|
|
19
|
+
*/
|
|
20
|
+
export declare class BytecodeCompiler {
|
|
21
|
+
private debug;
|
|
22
|
+
private wasmCompiler?;
|
|
23
|
+
private wasmModule?;
|
|
24
|
+
constructor(config?: CompilerConfig);
|
|
25
|
+
/**
|
|
26
|
+
* Compile Five script source to bytecode
|
|
27
|
+
*/
|
|
28
|
+
compile(source: FiveScriptSource | string, options?: CompilationOptions): Promise<CompilationResult>;
|
|
29
|
+
/**
|
|
30
|
+
* Compile multiple modules (entry + dependencies)
|
|
31
|
+
*/
|
|
32
|
+
compileModules(mainSource: FiveScriptSource, modules: Array<{
|
|
33
|
+
name: string;
|
|
34
|
+
source: string;
|
|
35
|
+
}>, options?: CompilationOptions): Promise<CompilationResult>;
|
|
36
|
+
/**
|
|
37
|
+
* Compile script from file path
|
|
38
|
+
*/
|
|
39
|
+
compileFile(filePath: string, options?: CompilationOptions): Promise<CompilationResult>;
|
|
40
|
+
/**
|
|
41
|
+
* Validate Five script source without compiling
|
|
42
|
+
*/
|
|
43
|
+
validateSource(source: FiveScriptSource | string): Promise<{
|
|
44
|
+
valid: boolean;
|
|
45
|
+
errors?: CompilationError[];
|
|
46
|
+
}>;
|
|
47
|
+
/**
|
|
48
|
+
* Get compiler version and information
|
|
49
|
+
*/
|
|
50
|
+
getCompilerInfo(): Promise<{
|
|
51
|
+
version: string;
|
|
52
|
+
wasmLoaded: boolean;
|
|
53
|
+
debug: boolean;
|
|
54
|
+
error?: undefined;
|
|
55
|
+
} | {
|
|
56
|
+
version: string;
|
|
57
|
+
wasmLoaded: boolean;
|
|
58
|
+
debug: boolean;
|
|
59
|
+
error: string;
|
|
60
|
+
}>;
|
|
61
|
+
/**
|
|
62
|
+
* Load WASM compiler (reuse existing infrastructure)
|
|
63
|
+
*/
|
|
64
|
+
private loadWasmCompiler;
|
|
65
|
+
private createWasmLogger;
|
|
66
|
+
/**
|
|
67
|
+
* Transform compiler errors to SDK format
|
|
68
|
+
*/
|
|
69
|
+
private transformErrors;
|
|
70
|
+
/**
|
|
71
|
+
* Extract function definitions from ABI
|
|
72
|
+
*/
|
|
73
|
+
private extractFunctions;
|
|
74
|
+
/**
|
|
75
|
+
* Generate ABI from Five script source code
|
|
76
|
+
*/
|
|
77
|
+
generateABI(source: FiveScriptSource | string): Promise<any>;
|
|
78
|
+
/**
|
|
79
|
+
* Extract function names from compiled bytecode
|
|
80
|
+
*/
|
|
81
|
+
getFunctionNames(bytecode: FiveBytecode): Promise<any>;
|
|
82
|
+
}
|
|
83
|
+
export {};
|