@flashbacktech/flashbackclient 0.1.47 → 0.1.48
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,19 +16,16 @@ 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
|
-
{ value: params.sla_avg_uptime_pct, type: 'u32' }
|
|
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
|
+
]);
|
|
32
29
|
if (!response.isSuccess) {
|
|
33
30
|
throw new Error('Failed to create bucket');
|
|
34
31
|
}
|
|
@@ -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);
|