@flashbacktech/flashbackclient 0.1.47 → 0.1.49
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.
|
@@ -16,26 +16,34 @@ class BucketOps {
|
|
|
16
16
|
* @returns Promise resolving to the created bucket ID
|
|
17
17
|
*/
|
|
18
18
|
this.createBucket = (0, decorator_1.withSignature)(async (provider_id, params) => {
|
|
19
|
-
const response = await (0, transaction_1.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
19
|
+
const response = await (0, transaction_1.executeWalletTransaction)(this.context, provider_id, "create_bucket", [
|
|
20
|
+
{ value: params.name, type: 'string' },
|
|
21
|
+
{ value: params.region, type: 'string' },
|
|
22
|
+
{ value: params.fb_bucket_id, type: 'string' },
|
|
23
|
+
{ value: params.api_compatibility, type: 'string' },
|
|
24
|
+
{ value: params.price_per_gb_storage, type: 'u128' },
|
|
25
|
+
{ value: params.price_per_gb_egress, type: 'u128' },
|
|
26
|
+
{ value: params.sla_avg_latency_ms, type: 'u32' },
|
|
27
|
+
{ value: params.sla_avg_uptime_pct, type: 'u32' }
|
|
28
|
+
]);
|
|
29
|
+
console.log('Contract response:', JSON.stringify(response, null, 2));
|
|
30
|
+
console.log('Response isSuccess:', response.isSuccess);
|
|
31
|
+
console.log('Response result:', response.result);
|
|
32
|
+
console.log('Response result type:', typeof response.result);
|
|
33
|
+
console.log('Response result constructor:', response.result?.constructor?.name);
|
|
32
34
|
if (!response.isSuccess) {
|
|
35
|
+
console.error('Contract call failed - isSuccess is false');
|
|
33
36
|
throw new Error('Failed to create bucket');
|
|
34
37
|
}
|
|
35
38
|
const result = response.result;
|
|
39
|
+
console.log('Processing result:', result);
|
|
40
|
+
console.log('Result type:', typeof result);
|
|
41
|
+
console.log('Result constructor:', result?.constructor?.name);
|
|
36
42
|
if (typeof result === 'number') {
|
|
43
|
+
console.log('Result is a number, returning:', result);
|
|
37
44
|
return result;
|
|
38
45
|
}
|
|
46
|
+
console.error('Result is not a number, throwing error. Result:', result);
|
|
39
47
|
throw new Error('Failed to create bucket');
|
|
40
48
|
});
|
|
41
49
|
/**
|
|
@@ -15,7 +15,7 @@ interface ContractMethodCall {
|
|
|
15
15
|
type: "u32" | "i32" | "u64" | "i64" | "u128" | "i128" | "string" | "symbol" | "address" | "bool" | "vec";
|
|
16
16
|
}>;
|
|
17
17
|
}
|
|
18
|
-
interface ContractMethodResponse {
|
|
18
|
+
export interface ContractMethodResponse {
|
|
19
19
|
isSuccess: boolean;
|
|
20
20
|
isReadOnly: boolean;
|
|
21
21
|
result: string | unknown;
|
|
@@ -46,9 +46,7 @@ const getServer = (network) => {
|
|
|
46
46
|
let server;
|
|
47
47
|
// Approach 1: Try with allowHttp option
|
|
48
48
|
try {
|
|
49
|
-
console.log(`Attempting to create server with allowHttp: true`);
|
|
50
49
|
server = new stellar_sdk_2.rpc.Server(serverUrl, { allowHttp: true });
|
|
51
|
-
console.log(`Soroban RPC server created successfully with allowHttp: true`);
|
|
52
50
|
return server;
|
|
53
51
|
}
|
|
54
52
|
catch (error) {
|
|
@@ -172,7 +170,6 @@ const prepareTransaction = async (context, address, contractCalls, extraOperatio
|
|
|
172
170
|
.setTimeout(TIMEOUT_TRANSACTION)
|
|
173
171
|
.build();
|
|
174
172
|
console.log(`About to simulate transaction for method: ${calls[0]?.method || 'unknown'}`);
|
|
175
|
-
console.log(`Network: ${context.network.network}, Passphrase: ${context.network.networkPassphrase}`);
|
|
176
173
|
let sim;
|
|
177
174
|
try {
|
|
178
175
|
sim = await server.simulateTransaction(builtTransaction);
|