@flashbacktech/flashbackclient 0.1.45 → 0.1.47
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ClientContext } from '.';
|
|
2
|
-
import { Bucket, BucketCreateParams, BucketUpdateBasicParams,
|
|
2
|
+
import { Bucket, BucketCreateParams, BucketUpdateBasicParams, BucketUpdateConditionsParams } from '../models';
|
|
3
3
|
/**
|
|
4
4
|
* Bucket operations client for FlashOnStellar V2
|
|
5
5
|
* Implements all bucket-related contract methods
|
|
@@ -34,15 +34,7 @@ export declare class BucketOps {
|
|
|
34
34
|
* @param params - Pricing update parameters
|
|
35
35
|
* @returns Promise resolving to the update result
|
|
36
36
|
*/
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Updates bucket SLA information
|
|
40
|
-
* @param provider_id - Address of the provider owning the bucket
|
|
41
|
-
* @param bucket_id - ID of the bucket to update
|
|
42
|
-
* @param params - SLA update parameters
|
|
43
|
-
* @returns Promise resolving to the update result
|
|
44
|
-
*/
|
|
45
|
-
updateBucketSLA: (provider_id: string, bucket_id: number, params: BucketUpdateSLAParams) => Promise<void>;
|
|
37
|
+
updateBucketConditions: (provider_id: string, bucket_id: number, params: BucketUpdateConditionsParams) => Promise<void>;
|
|
46
38
|
/**
|
|
47
39
|
* Locks a bucket to prevent modifications during active deals
|
|
48
40
|
* @param provider_id - Address of the provider owning the bucket
|
|
@@ -21,12 +21,12 @@ class BucketOps {
|
|
|
21
21
|
args: [
|
|
22
22
|
{ value: params.name, type: 'string' },
|
|
23
23
|
{ value: params.region, type: 'string' },
|
|
24
|
-
{ value: params.country, type: 'string' },
|
|
25
|
-
{ value: params.versioning_enabled, type: 'bool' },
|
|
26
24
|
{ value: params.fb_bucket_id, type: 'string' },
|
|
27
25
|
{ value: params.api_compatibility, type: 'string' },
|
|
28
26
|
{ value: params.price_per_gb_storage, type: 'u128' },
|
|
29
|
-
{ value: params.price_per_gb_egress, type: 'u128' }
|
|
27
|
+
{ value: params.price_per_gb_egress, type: 'u128' },
|
|
28
|
+
{ value: params.sla_avg_latency_ms, type: 'u32' },
|
|
29
|
+
{ value: params.sla_avg_uptime_pct, type: 'u32' }
|
|
30
30
|
]
|
|
31
31
|
});
|
|
32
32
|
if (!response.isSuccess) {
|
|
@@ -87,25 +87,11 @@ class BucketOps {
|
|
|
87
87
|
* @param params - Pricing update parameters
|
|
88
88
|
* @returns Promise resolving to the update result
|
|
89
89
|
*/
|
|
90
|
-
this.
|
|
91
|
-
await (0, transaction_1.executeWalletTransaction)(this.context, provider_id, "
|
|
90
|
+
this.updateBucketConditions = (0, decorator_1.withSignature)(async (provider_id, bucket_id, params) => {
|
|
91
|
+
await (0, transaction_1.executeWalletTransaction)(this.context, provider_id, "update_bucket_conditions", [
|
|
92
92
|
{ value: bucket_id, type: 'u32' },
|
|
93
93
|
{ value: params.price_per_gb_storage || null, type: 'u128' },
|
|
94
94
|
{ value: params.price_per_gb_egress || null, type: 'u128' },
|
|
95
|
-
{ value: params.max_storage_gb || null, type: 'u32' },
|
|
96
|
-
{ value: params.max_egress_gb || null, type: 'u32' }
|
|
97
|
-
]);
|
|
98
|
-
});
|
|
99
|
-
/**
|
|
100
|
-
* Updates bucket SLA information
|
|
101
|
-
* @param provider_id - Address of the provider owning the bucket
|
|
102
|
-
* @param bucket_id - ID of the bucket to update
|
|
103
|
-
* @param params - SLA update parameters
|
|
104
|
-
* @returns Promise resolving to the update result
|
|
105
|
-
*/
|
|
106
|
-
this.updateBucketSLA = (0, decorator_1.withSignature)(async (provider_id, bucket_id, params) => {
|
|
107
|
-
await (0, transaction_1.executeWalletTransaction)(this.context, provider_id, "update_bucket_sla", [
|
|
108
|
-
{ value: bucket_id, type: 'u32' },
|
|
109
95
|
{ value: params.sla_avg_latency_ms || null, type: 'u32' },
|
|
110
96
|
{ value: params.sla_avg_uptime_pct || null, type: 'u32' }
|
|
111
97
|
]);
|
|
@@ -110,12 +110,12 @@ export declare enum ErrorCode {
|
|
|
110
110
|
export interface BucketCreateParams {
|
|
111
111
|
name: string;
|
|
112
112
|
region: string;
|
|
113
|
-
country: string;
|
|
114
|
-
versioning_enabled: boolean;
|
|
115
113
|
fb_bucket_id: string;
|
|
116
114
|
api_compatibility: string;
|
|
117
115
|
price_per_gb_storage: bigint;
|
|
118
116
|
price_per_gb_egress: bigint;
|
|
117
|
+
sla_avg_latency_ms: number;
|
|
118
|
+
sla_avg_uptime_pct: number;
|
|
119
119
|
}
|
|
120
120
|
export interface DealCreateParams {
|
|
121
121
|
duration_secs: bigint;
|
|
@@ -129,13 +129,9 @@ export interface BucketUpdateBasicParams {
|
|
|
129
129
|
region?: string;
|
|
130
130
|
country?: string;
|
|
131
131
|
}
|
|
132
|
-
export interface
|
|
132
|
+
export interface BucketUpdateConditionsParams {
|
|
133
133
|
price_per_gb_storage?: bigint;
|
|
134
134
|
price_per_gb_egress?: bigint;
|
|
135
|
-
max_storage_gb?: number;
|
|
136
|
-
max_egress_gb?: number;
|
|
137
|
-
}
|
|
138
|
-
export interface BucketUpdateSLAParams {
|
|
139
135
|
sla_avg_latency_ms?: number;
|
|
140
136
|
sla_avg_uptime_pct?: number;
|
|
141
137
|
}
|