@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.
Files changed (119) hide show
  1. package/README.md +279 -0
  2. package/dist/FiveSDK.d.ts +336 -0
  3. package/dist/FiveSDK.js +395 -0
  4. package/dist/accounts/index.d.ts +254 -0
  5. package/dist/accounts/index.js +543 -0
  6. package/dist/assets/vm/dummy.file +0 -0
  7. package/dist/assets/vm/five_vm_wasm.d.ts +762 -0
  8. package/dist/assets/vm/five_vm_wasm.js +3754 -0
  9. package/dist/assets/vm/five_vm_wasm_bg.js +3307 -0
  10. package/dist/assets/vm/five_vm_wasm_bg.wasm +0 -0
  11. package/dist/assets/vm/five_vm_wasm_bg.wasm.d.ts +247 -0
  12. package/dist/assets/vm/package.json +11 -0
  13. package/dist/bin/gen-types.d.ts +2 -0
  14. package/dist/bin/gen-types.js +35 -0
  15. package/dist/compiler/BytecodeCompiler.d.ts +83 -0
  16. package/dist/compiler/BytecodeCompiler.js +379 -0
  17. package/dist/config/ConfigManager.d.ts +13 -0
  18. package/dist/config/ConfigManager.js +27 -0
  19. package/dist/config/ProgramIdResolver.d.ts +62 -0
  20. package/dist/config/ProgramIdResolver.js +104 -0
  21. package/dist/crypto/index.d.ts +211 -0
  22. package/dist/crypto/index.js +451 -0
  23. package/dist/encoding/ParameterEncoder.d.ts +31 -0
  24. package/dist/encoding/ParameterEncoder.js +278 -0
  25. package/dist/index.d.ts +21 -0
  26. package/dist/index.js +28 -0
  27. package/dist/lib/bytecode-encoder.d.ts +62 -0
  28. package/dist/lib/bytecode-encoder.js +281 -0
  29. package/dist/logging/index.d.ts +9 -0
  30. package/dist/logging/index.js +10 -0
  31. package/dist/metadata/index.d.ts +213 -0
  32. package/dist/metadata/index.js +296 -0
  33. package/dist/modules/accounts.d.ts +60 -0
  34. package/dist/modules/accounts.js +275 -0
  35. package/dist/modules/deploy.d.ts +90 -0
  36. package/dist/modules/deploy.js +1118 -0
  37. package/dist/modules/execute.d.ts +90 -0
  38. package/dist/modules/execute.js +649 -0
  39. package/dist/modules/fees.d.ts +14 -0
  40. package/dist/modules/fees.js +112 -0
  41. package/dist/modules/namespaces.d.ts +39 -0
  42. package/dist/modules/namespaces.js +190 -0
  43. package/dist/modules/state-diff.d.ts +35 -0
  44. package/dist/modules/state-diff.js +342 -0
  45. package/dist/modules/vm-state.d.ts +7 -0
  46. package/dist/modules/vm-state.js +44 -0
  47. package/dist/program/AccountResolver.d.ts +67 -0
  48. package/dist/program/AccountResolver.js +134 -0
  49. package/dist/program/BorshSchemaGenerator.d.ts +8 -0
  50. package/dist/program/BorshSchemaGenerator.js +57 -0
  51. package/dist/program/FiveProgram.d.ts +144 -0
  52. package/dist/program/FiveProgram.js +282 -0
  53. package/dist/program/FunctionBuilder.d.ts +114 -0
  54. package/dist/program/FunctionBuilder.js +347 -0
  55. package/dist/program/ProgramAccount.d.ts +38 -0
  56. package/dist/program/ProgramAccount.js +170 -0
  57. package/dist/program/TypeGenerator.d.ts +90 -0
  58. package/dist/program/TypeGenerator.js +195 -0
  59. package/dist/program/index.d.ts +24 -0
  60. package/dist/program/index.js +21 -0
  61. package/dist/project/config.d.ts +5 -0
  62. package/dist/project/config.js +33 -0
  63. package/dist/project/toml.d.ts +6 -0
  64. package/dist/project/toml.js +43 -0
  65. package/dist/project/workspace.d.ts +160 -0
  66. package/dist/project/workspace.js +73 -0
  67. package/dist/testing/AccountMetaGenerator.d.ts +121 -0
  68. package/dist/testing/AccountMetaGenerator.js +261 -0
  69. package/dist/testing/AccountTestFixture.d.ts +211 -0
  70. package/dist/testing/AccountTestFixture.js +530 -0
  71. package/dist/testing/OnChainAccountManager.d.ts +81 -0
  72. package/dist/testing/OnChainAccountManager.js +260 -0
  73. package/dist/testing/StateSerializer.d.ts +65 -0
  74. package/dist/testing/StateSerializer.js +330 -0
  75. package/dist/testing/TestDiscovery.d.ts +79 -0
  76. package/dist/testing/TestDiscovery.js +274 -0
  77. package/dist/testing/TestRunner.d.ts +117 -0
  78. package/dist/testing/TestRunner.js +346 -0
  79. package/dist/testing/index.d.ts +14 -0
  80. package/dist/testing/index.js +13 -0
  81. package/dist/types.d.ts +356 -0
  82. package/dist/types.js +32 -0
  83. package/dist/utils/abi.d.ts +31 -0
  84. package/dist/utils/abi.js +92 -0
  85. package/dist/utils/transaction.d.ts +5 -0
  86. package/dist/utils/transaction.js +48 -0
  87. package/dist/validation/InputValidator.d.ts +142 -0
  88. package/dist/validation/InputValidator.js +332 -0
  89. package/dist/validation/index.d.ts +4 -0
  90. package/dist/validation/index.js +4 -0
  91. package/dist/wasm/compiler/AbiLogic.d.ts +4 -0
  92. package/dist/wasm/compiler/AbiLogic.js +37 -0
  93. package/dist/wasm/compiler/AnalysisLogic.d.ts +6 -0
  94. package/dist/wasm/compiler/AnalysisLogic.js +61 -0
  95. package/dist/wasm/compiler/CompilationLogic.d.ts +10 -0
  96. package/dist/wasm/compiler/CompilationLogic.js +431 -0
  97. package/dist/wasm/compiler/FiveCompiler.d.ts +48 -0
  98. package/dist/wasm/compiler/FiveCompiler.js +183 -0
  99. package/dist/wasm/compiler/InfoLogic.d.ts +6 -0
  100. package/dist/wasm/compiler/InfoLogic.js +24 -0
  101. package/dist/wasm/compiler/OptimizationLogic.d.ts +2 -0
  102. package/dist/wasm/compiler/OptimizationLogic.js +13 -0
  103. package/dist/wasm/compiler/ValidationLogic.d.ts +7 -0
  104. package/dist/wasm/compiler/ValidationLogic.js +26 -0
  105. package/dist/wasm/compiler/index.d.ts +2 -0
  106. package/dist/wasm/compiler/index.js +2 -0
  107. package/dist/wasm/compiler/types.d.ts +8 -0
  108. package/dist/wasm/compiler/types.js +1 -0
  109. package/dist/wasm/compiler/utils.d.ts +8 -0
  110. package/dist/wasm/compiler/utils.js +75 -0
  111. package/dist/wasm/index.d.ts +9 -0
  112. package/dist/wasm/index.js +12 -0
  113. package/dist/wasm/instance.d.ts +1 -0
  114. package/dist/wasm/instance.js +26 -0
  115. package/dist/wasm/loader.d.ts +7 -0
  116. package/dist/wasm/loader.js +112 -0
  117. package/dist/wasm/vm.d.ts +33 -0
  118. package/dist/wasm/vm.js +250 -0
  119. package/package.json +59 -0
@@ -0,0 +1,90 @@
1
+ import { FiveScriptSource, FiveBytecode, SerializedExecution } from "../types.js";
2
+ import { BytecodeCompiler } from "../compiler/BytecodeCompiler.js";
3
+ export declare function execute(compiler: BytecodeCompiler, source: FiveScriptSource | string, functionName: string | number, parameters?: any[], options?: {
4
+ debug?: boolean;
5
+ trace?: boolean;
6
+ optimize?: boolean;
7
+ computeUnitLimit?: number;
8
+ vmStateAccount?: string;
9
+ accounts?: string[];
10
+ }): Promise<{
11
+ success: boolean;
12
+ compilationErrors: import("../types.js").CompilationError[];
13
+ error: string;
14
+ } | {
15
+ compilation: import("../types.js").CompilationResult;
16
+ bytecodeSize: number;
17
+ functions: any[];
18
+ success: boolean;
19
+ result?: any;
20
+ logs?: string[];
21
+ computeUnitsUsed?: number;
22
+ executionTime?: number;
23
+ error?: string;
24
+ trace?: any[];
25
+ compilationErrors?: undefined;
26
+ }>;
27
+ export declare function executeLocally(bytecode: FiveBytecode, functionName: string | number, parameters?: any[], options?: {
28
+ debug?: boolean;
29
+ trace?: boolean;
30
+ computeUnitLimit?: number;
31
+ abi?: any;
32
+ accounts?: string[];
33
+ }): Promise<{
34
+ success: boolean;
35
+ result?: any;
36
+ logs?: string[];
37
+ computeUnitsUsed?: number;
38
+ executionTime?: number;
39
+ error?: string;
40
+ trace?: any[];
41
+ }>;
42
+ export declare function generateExecuteInstruction(scriptAccount: string, functionName: string | number, parameters?: any[], accounts?: string[], connection?: any, options?: {
43
+ debug?: boolean;
44
+ computeUnitLimit?: number;
45
+ vmStateAccount?: string;
46
+ fiveVMProgramId?: string;
47
+ abi?: any;
48
+ adminAccount?: string;
49
+ estimateFees?: boolean;
50
+ accountMetadata?: Map<string, {
51
+ isSigner: boolean;
52
+ isWritable: boolean;
53
+ isSystemAccount?: boolean;
54
+ }>;
55
+ }): Promise<SerializedExecution>;
56
+ export declare function executeOnSolana(scriptAccount: string, connection: any, signerKeypair: any, functionName: string | number, parameters?: any[], accounts?: string[], options?: {
57
+ debug?: boolean;
58
+ network?: string;
59
+ computeUnitLimit?: number;
60
+ computeUnitPrice?: number;
61
+ maxRetries?: number;
62
+ skipPreflight?: boolean;
63
+ vmStateAccount?: string;
64
+ fiveVMProgramId?: string;
65
+ abi?: any;
66
+ }): Promise<{
67
+ success: boolean;
68
+ result?: any;
69
+ transactionId?: string;
70
+ computeUnitsUsed?: number;
71
+ cost?: number;
72
+ error?: string;
73
+ logs?: string[];
74
+ }>;
75
+ export declare function executeScriptAccount(scriptAccount: string, functionIndex: number, parameters: any[], connection: any, signerKeypair: any, options?: {
76
+ debug?: boolean;
77
+ network?: string;
78
+ computeBudget?: number;
79
+ maxRetries?: number;
80
+ vmStateAccount?: string;
81
+ fiveVMProgramId?: string;
82
+ }): Promise<{
83
+ success: boolean;
84
+ result?: any;
85
+ transactionId?: string;
86
+ computeUnitsUsed?: number;
87
+ cost?: number;
88
+ error?: string;
89
+ logs?: string[];
90
+ }>;