@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
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
import { ScriptMetadataParser } from "../metadata/index.js";
|
|
2
|
+
import { normalizeAbiFunctions } from "../utils/abi.js";
|
|
3
|
+
import { loadWasmVM } from "../wasm/instance.js";
|
|
4
|
+
import { SolanaPublicKeyUtils } from "../crypto/index.js";
|
|
5
|
+
export async function fetchAccountAndDeserialize(accountAddress, connection, // Solana Connection object
|
|
6
|
+
options = {}) {
|
|
7
|
+
try {
|
|
8
|
+
if (options.debug) {
|
|
9
|
+
console.log(`[FiveSDK] Fetching account and deserializing data: ${accountAddress}`);
|
|
10
|
+
}
|
|
11
|
+
if (!SolanaPublicKeyUtils.isValid(accountAddress)) {
|
|
12
|
+
return {
|
|
13
|
+
success: false,
|
|
14
|
+
error: `Invalid account address format: ${accountAddress}`,
|
|
15
|
+
logs: [],
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
const { PublicKey } = await import("@solana/web3.js");
|
|
19
|
+
let accountPubkey;
|
|
20
|
+
try {
|
|
21
|
+
accountPubkey = new PublicKey(accountAddress);
|
|
22
|
+
}
|
|
23
|
+
catch (addressError) {
|
|
24
|
+
return {
|
|
25
|
+
success: false,
|
|
26
|
+
error: `Invalid account address format: ${accountAddress}`,
|
|
27
|
+
logs: [],
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
const accountInfo = await connection.getAccountInfo(accountPubkey, "confirmed");
|
|
31
|
+
if (!accountInfo) {
|
|
32
|
+
return {
|
|
33
|
+
success: false,
|
|
34
|
+
error: `Account not found: ${accountAddress}`,
|
|
35
|
+
logs: [],
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
if (!accountInfo.data || accountInfo.data.length === 0) {
|
|
39
|
+
return {
|
|
40
|
+
success: false,
|
|
41
|
+
error: `Account has no data: ${accountAddress}`,
|
|
42
|
+
logs: [],
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
const logs = [];
|
|
46
|
+
if (options.debug) {
|
|
47
|
+
console.log(`[FiveSDK] Account fetched successfully:`);
|
|
48
|
+
console.log(` - Address: ${accountAddress}`);
|
|
49
|
+
console.log(` - Owner: ${accountInfo.owner.toString()}`);
|
|
50
|
+
console.log(` - Lamports: ${accountInfo.lamports}`);
|
|
51
|
+
console.log(` - Data length: ${accountInfo.data.length} bytes`);
|
|
52
|
+
logs.push(`Account fetched: ${accountInfo.data.length} bytes`);
|
|
53
|
+
logs.push(`Owner: ${accountInfo.owner.toString()}`);
|
|
54
|
+
logs.push(`Balance: ${accountInfo.lamports / 1e9} SOL`);
|
|
55
|
+
}
|
|
56
|
+
const result = {
|
|
57
|
+
success: true,
|
|
58
|
+
accountInfo: {
|
|
59
|
+
address: accountAddress,
|
|
60
|
+
owner: accountInfo.owner.toString(),
|
|
61
|
+
lamports: accountInfo.lamports,
|
|
62
|
+
dataLength: accountInfo.data.length,
|
|
63
|
+
},
|
|
64
|
+
logs,
|
|
65
|
+
};
|
|
66
|
+
if (options.parseMetadata) {
|
|
67
|
+
try {
|
|
68
|
+
const scriptMetadata = ScriptMetadataParser.parseMetadata(accountInfo.data, accountAddress);
|
|
69
|
+
result.scriptMetadata = scriptMetadata;
|
|
70
|
+
result.rawBytecode = scriptMetadata.bytecode;
|
|
71
|
+
result.decodedData = {
|
|
72
|
+
header: {
|
|
73
|
+
version: scriptMetadata.version,
|
|
74
|
+
deployedAt: scriptMetadata.deployedAt,
|
|
75
|
+
authority: scriptMetadata.authority,
|
|
76
|
+
},
|
|
77
|
+
bytecode: scriptMetadata.bytecode,
|
|
78
|
+
abi: scriptMetadata.abi,
|
|
79
|
+
functions: normalizeAbiFunctions(scriptMetadata.abi?.functions ?? scriptMetadata.abi).map((func) => ({
|
|
80
|
+
name: func.name,
|
|
81
|
+
index: func.index,
|
|
82
|
+
parameters: func.parameters || [],
|
|
83
|
+
})),
|
|
84
|
+
};
|
|
85
|
+
const parsedFunctions = result.decodedData.functions;
|
|
86
|
+
if (options.debug) {
|
|
87
|
+
console.log(`[FiveSDK] Script metadata parsed successfully:`);
|
|
88
|
+
console.log(` - Script name: ${scriptMetadata.abi.name}`);
|
|
89
|
+
console.log(` - Functions: ${parsedFunctions.length}`);
|
|
90
|
+
console.log(` - Bytecode size: ${scriptMetadata.bytecode.length} bytes`);
|
|
91
|
+
console.log(` - Authority: ${scriptMetadata.authority}`);
|
|
92
|
+
logs.push(`Script metadata parsed: ${parsedFunctions.length} functions`);
|
|
93
|
+
logs.push(`Bytecode: ${scriptMetadata.bytecode.length} bytes`);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
catch (metadataError) {
|
|
97
|
+
if (options.debug) {
|
|
98
|
+
console.warn(`[FiveSDK] Failed to parse script metadata:`, metadataError);
|
|
99
|
+
}
|
|
100
|
+
result.rawBytecode = accountInfo.data;
|
|
101
|
+
logs.push("Warning: Failed to parse script metadata, treating as raw data");
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
result.rawBytecode = accountInfo.data;
|
|
106
|
+
logs.push("Raw account data returned (metadata parsing disabled)");
|
|
107
|
+
}
|
|
108
|
+
if (options.validateEncoding && result.rawBytecode) {
|
|
109
|
+
try {
|
|
110
|
+
const validation = await validateBytecodeEncoding(result.rawBytecode, options.debug);
|
|
111
|
+
if (validation.valid) {
|
|
112
|
+
logs.push("Encoding validation: PASSED");
|
|
113
|
+
if (options.debug) {
|
|
114
|
+
console.log(`[FiveSDK] Validation passed: ${validation.info}`);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
logs.push(`Encoding validation: FAILED - ${validation.error}`);
|
|
119
|
+
if (options.debug) {
|
|
120
|
+
console.warn(`[FiveSDK] Validation failed: ${validation.error}`);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
catch (validationError) {
|
|
125
|
+
logs.push(`Validation error: ${validationError instanceof Error ? validationError.message : "Unknown error"}`);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
return result;
|
|
129
|
+
}
|
|
130
|
+
catch (error) {
|
|
131
|
+
const errorMessage = error instanceof Error ? error.message : "Unknown account fetch error";
|
|
132
|
+
if (options.debug) {
|
|
133
|
+
console.error(`[FiveSDK] Account fetch and deserialization failed: ${errorMessage}`);
|
|
134
|
+
}
|
|
135
|
+
return {
|
|
136
|
+
success: false,
|
|
137
|
+
error: errorMessage,
|
|
138
|
+
logs: [],
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
export async function fetchMultipleAccountsAndDeserialize(accountAddresses, connection, options = {}) {
|
|
143
|
+
const batchSize = options.batchSize || 100;
|
|
144
|
+
const results = new Map();
|
|
145
|
+
if (options.debug) {
|
|
146
|
+
console.log(`[FiveSDK] Batch fetching ${accountAddresses.length} accounts (batch size: ${batchSize})`);
|
|
147
|
+
}
|
|
148
|
+
for (let i = 0; i < accountAddresses.length; i += batchSize) {
|
|
149
|
+
const batch = accountAddresses.slice(i, i + batchSize);
|
|
150
|
+
if (options.debug) {
|
|
151
|
+
console.log(`[FiveSDK] Processing batch ${Math.floor(i / batchSize) + 1}/${Math.ceil(accountAddresses.length / batchSize)}`);
|
|
152
|
+
}
|
|
153
|
+
const batchPromises = batch.map((address) => fetchAccountAndDeserialize(address, connection, {
|
|
154
|
+
debug: false,
|
|
155
|
+
parseMetadata: options.parseMetadata,
|
|
156
|
+
validateEncoding: options.validateEncoding,
|
|
157
|
+
}));
|
|
158
|
+
const batchResults = await Promise.allSettled(batchPromises);
|
|
159
|
+
batch.forEach((address, index) => {
|
|
160
|
+
const batchResult = batchResults[index];
|
|
161
|
+
if (batchResult.status === "fulfilled") {
|
|
162
|
+
results.set(address, batchResult.value);
|
|
163
|
+
}
|
|
164
|
+
else {
|
|
165
|
+
results.set(address, {
|
|
166
|
+
success: false,
|
|
167
|
+
error: `Batch processing failed: ${batchResult.reason}`,
|
|
168
|
+
logs: [],
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
if (options.debug) {
|
|
174
|
+
const successful = Array.from(results.values()).filter((r) => r.success).length;
|
|
175
|
+
console.log(`[FiveSDK] Batch processing completed: ${successful}/${accountAddresses.length} successful`);
|
|
176
|
+
}
|
|
177
|
+
return results;
|
|
178
|
+
}
|
|
179
|
+
export async function deserializeParameters(instructionData, expectedTypes = [], options = {}) {
|
|
180
|
+
try {
|
|
181
|
+
if (options.debug) {
|
|
182
|
+
console.log(`[FiveSDK] Deserializing parameters from ${instructionData.length} bytes:`);
|
|
183
|
+
console.log(`[FiveSDK] Instruction data (hex):`, Buffer.from(instructionData).toString("hex"));
|
|
184
|
+
console.log(`[FiveSDK] Expected parameter types:`, expectedTypes);
|
|
185
|
+
}
|
|
186
|
+
const wasmVM = await loadWasmVM();
|
|
187
|
+
try {
|
|
188
|
+
const wasmModule = await import("../assets/vm/five_vm_wasm.js");
|
|
189
|
+
if (options.debug) {
|
|
190
|
+
console.log(`[FiveSDK] Using WASM ParameterEncoder for decoding`);
|
|
191
|
+
}
|
|
192
|
+
const decodedResult = wasmModule.ParameterEncoder.decode_instruction_data(instructionData);
|
|
193
|
+
if (options.debug) {
|
|
194
|
+
console.log(`[FiveSDK] Decoding result:`, decodedResult);
|
|
195
|
+
}
|
|
196
|
+
const parameters = [];
|
|
197
|
+
if (decodedResult && decodedResult.parameters) {
|
|
198
|
+
decodedResult.parameters.forEach((param, index) => {
|
|
199
|
+
parameters.push({
|
|
200
|
+
type: expectedTypes[index] || "unknown",
|
|
201
|
+
value: param,
|
|
202
|
+
});
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
return {
|
|
206
|
+
success: true,
|
|
207
|
+
parameters,
|
|
208
|
+
functionIndex: decodedResult.function_index,
|
|
209
|
+
discriminator: decodedResult.discriminator,
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
catch (wasmError) {
|
|
213
|
+
if (options.debug) {
|
|
214
|
+
console.warn(`[FiveSDK] WASM decoding failed:`, wasmError);
|
|
215
|
+
}
|
|
216
|
+
throw wasmError;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
catch (error) {
|
|
220
|
+
const errorMessage = error instanceof Error
|
|
221
|
+
? error.message
|
|
222
|
+
: "Unknown deserialization error";
|
|
223
|
+
if (options.debug) {
|
|
224
|
+
console.error(`[FiveSDK] Parameter deserialization failed: ${errorMessage}`);
|
|
225
|
+
}
|
|
226
|
+
return {
|
|
227
|
+
success: false,
|
|
228
|
+
error: errorMessage,
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
export async function validateBytecodeEncoding(bytecode, debug = false) {
|
|
233
|
+
try {
|
|
234
|
+
if (bytecode.length < 10) {
|
|
235
|
+
return { valid: false, error: "Bytecode too short for Five VM format (min 10 bytes)" };
|
|
236
|
+
}
|
|
237
|
+
const magicBytes = bytecode.slice(0, 4);
|
|
238
|
+
const expectedMagic = new Uint8Array([0x35, 0x49, 0x56, 0x45]); // "5IVE"
|
|
239
|
+
let isValidHeader = true;
|
|
240
|
+
for (let i = 0; i < 4; i++) {
|
|
241
|
+
if (magicBytes[i] !== expectedMagic[i]) {
|
|
242
|
+
isValidHeader = false;
|
|
243
|
+
break;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
if (!isValidHeader) {
|
|
247
|
+
return {
|
|
248
|
+
valid: false,
|
|
249
|
+
error: 'Invalid Five VM magic bytes (expected "5IVE")',
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
// Optimized Header V3:
|
|
253
|
+
// 0-3: Magic
|
|
254
|
+
// 4-7: Features (u32 LE)
|
|
255
|
+
// 8: Public Function Count (u8)
|
|
256
|
+
// 9: Total Function Count (u8)
|
|
257
|
+
// Read features as u32 LE
|
|
258
|
+
const features = bytecode[4] | (bytecode[5] << 8) | (bytecode[6] << 16) | (bytecode[7] << 24);
|
|
259
|
+
const publicFunctionCount = bytecode[8];
|
|
260
|
+
const totalFunctionCount = bytecode[9];
|
|
261
|
+
if (debug) {
|
|
262
|
+
console.log(`[FiveSDK] Validation - Magic: "5IVE", Features: ${features}, PublicFuncs: ${publicFunctionCount}, TotalFuncs: ${totalFunctionCount}`);
|
|
263
|
+
}
|
|
264
|
+
return {
|
|
265
|
+
valid: true,
|
|
266
|
+
info: `Valid Five VM bytecode with ${publicFunctionCount}/${totalFunctionCount} functions (features: ${features})`,
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
catch (error) {
|
|
270
|
+
return {
|
|
271
|
+
valid: false,
|
|
272
|
+
error: error instanceof Error ? error.message : "Validation error",
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { FiveBytecode, DeploymentOptions, SerializedDeployment } from "../types.js";
|
|
2
|
+
interface ExportMetadataInterfaceInput {
|
|
3
|
+
name: string;
|
|
4
|
+
methodMap?: Record<string, string>;
|
|
5
|
+
}
|
|
6
|
+
interface ExportMetadataInput {
|
|
7
|
+
methods?: string[];
|
|
8
|
+
interfaces?: ExportMetadataInterfaceInput[];
|
|
9
|
+
}
|
|
10
|
+
export declare function generateDeployInstruction(bytecode: FiveBytecode, deployer: string, options?: DeploymentOptions & {
|
|
11
|
+
debug?: boolean;
|
|
12
|
+
}, connection?: any, fiveVMProgramId?: string): Promise<SerializedDeployment>;
|
|
13
|
+
export declare function createDeploymentTransaction(bytecode: FiveBytecode, connection: any, deployerPublicKey: any, // PublicKey
|
|
14
|
+
options?: {
|
|
15
|
+
debug?: boolean;
|
|
16
|
+
fiveVMProgramId?: string;
|
|
17
|
+
computeBudget?: number;
|
|
18
|
+
exportMetadata?: ExportMetadataInput;
|
|
19
|
+
}): Promise<{
|
|
20
|
+
transaction: any;
|
|
21
|
+
scriptKeypair: any;
|
|
22
|
+
vmStateKeypair: any;
|
|
23
|
+
programId: string;
|
|
24
|
+
rentLamports: number;
|
|
25
|
+
}>;
|
|
26
|
+
export declare function deployToSolana(bytecode: FiveBytecode, connection: any, // Solana Connection object
|
|
27
|
+
deployerKeypair: any, // Solana Keypair object
|
|
28
|
+
options?: {
|
|
29
|
+
debug?: boolean;
|
|
30
|
+
network?: string;
|
|
31
|
+
computeBudget?: number;
|
|
32
|
+
maxRetries?: number;
|
|
33
|
+
fiveVMProgramId?: string;
|
|
34
|
+
vmStateAccount?: string;
|
|
35
|
+
exportMetadata?: ExportMetadataInput;
|
|
36
|
+
}): Promise<{
|
|
37
|
+
success: boolean;
|
|
38
|
+
programId?: string;
|
|
39
|
+
transactionId?: string;
|
|
40
|
+
deploymentCost?: number;
|
|
41
|
+
error?: string;
|
|
42
|
+
logs?: string[];
|
|
43
|
+
vmStateAccount?: string;
|
|
44
|
+
}>;
|
|
45
|
+
export declare function deployLargeProgramToSolana(bytecode: FiveBytecode, connection: any, // Solana Connection object
|
|
46
|
+
deployerKeypair: any, // Solana Keypair object
|
|
47
|
+
options?: {
|
|
48
|
+
chunkSize?: number;
|
|
49
|
+
debug?: boolean;
|
|
50
|
+
network?: string;
|
|
51
|
+
maxRetries?: number;
|
|
52
|
+
fiveVMProgramId?: string;
|
|
53
|
+
progressCallback?: (chunk: number, total: number) => void;
|
|
54
|
+
vmStateAccount?: string;
|
|
55
|
+
}): Promise<{
|
|
56
|
+
success: boolean;
|
|
57
|
+
scriptAccount?: string;
|
|
58
|
+
transactionIds?: string[];
|
|
59
|
+
totalTransactions?: number;
|
|
60
|
+
deploymentCost?: number;
|
|
61
|
+
chunksUsed?: number;
|
|
62
|
+
vmStateAccount?: string;
|
|
63
|
+
error?: string;
|
|
64
|
+
logs?: string[];
|
|
65
|
+
}>;
|
|
66
|
+
export declare function deployLargeProgramOptimizedToSolana(bytecode: FiveBytecode, connection: any, // Solana Connection object
|
|
67
|
+
deployerKeypair: any, // Solana Keypair object
|
|
68
|
+
options?: {
|
|
69
|
+
chunkSize?: number;
|
|
70
|
+
debug?: boolean;
|
|
71
|
+
network?: string;
|
|
72
|
+
maxRetries?: number;
|
|
73
|
+
fiveVMProgramId?: string;
|
|
74
|
+
progressCallback?: (transaction: number, total: number) => void;
|
|
75
|
+
}): Promise<{
|
|
76
|
+
success: boolean;
|
|
77
|
+
scriptAccount?: string;
|
|
78
|
+
transactionIds?: string[];
|
|
79
|
+
totalTransactions?: number;
|
|
80
|
+
deploymentCost?: number;
|
|
81
|
+
chunksUsed?: number;
|
|
82
|
+
vmStateAccount?: string;
|
|
83
|
+
optimizationSavings?: {
|
|
84
|
+
transactionsSaved: number;
|
|
85
|
+
estimatedCostSaved: number;
|
|
86
|
+
};
|
|
87
|
+
error?: string;
|
|
88
|
+
logs?: string[];
|
|
89
|
+
}>;
|
|
90
|
+
export {};
|