@flashbacktech/flashbackclient 0.1.67 → 0.1.69
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.
|
@@ -49,22 +49,6 @@ export declare class DealOps {
|
|
|
49
49
|
* @returns Promise resolving to the cancellation result
|
|
50
50
|
*/
|
|
51
51
|
setDealCancelled: (consumer_id: string, provider_id: string, deal_id: number) => Promise<void>;
|
|
52
|
-
/**
|
|
53
|
-
* Marks a deal as breached by the consumer
|
|
54
|
-
* @param consumer_id - Address of the consumer
|
|
55
|
-
* @param provider_id - Address of the provider
|
|
56
|
-
* @param deal_id - ID of the deal
|
|
57
|
-
* @returns Promise resolving to the breach marking result
|
|
58
|
-
*/
|
|
59
|
-
setDealBreachedConsumer: (consumer_id: string, provider_id: string, deal_id: number) => Promise<void>;
|
|
60
|
-
/**
|
|
61
|
-
* Marks a deal as breached by the provider
|
|
62
|
-
* @param consumer_id - Address of the consumer
|
|
63
|
-
* @param provider_id - Address of the provider
|
|
64
|
-
* @param deal_id - ID of the deal
|
|
65
|
-
* @returns Promise resolving to the breach marking result
|
|
66
|
-
*/
|
|
67
|
-
setDealBreachedProvider: (consumer_id: string, provider_id: string, deal_id: number) => Promise<void>;
|
|
68
52
|
/**
|
|
69
53
|
* Deletes a deal from the system (owner only)
|
|
70
54
|
* @param consumer_id - Address of the consumer
|
|
@@ -73,6 +57,15 @@ export declare class DealOps {
|
|
|
73
57
|
* @returns Promise resolving to the deletion result
|
|
74
58
|
*/
|
|
75
59
|
deleteDeal: (consumer_id: string, provider_id: string, deal_id: number) => Promise<void>;
|
|
60
|
+
/**
|
|
61
|
+
* Deposits funds to a deal
|
|
62
|
+
* @param consumer_id - Address of the consumer
|
|
63
|
+
* @param provider_id - Address of the provider
|
|
64
|
+
* @param deal_id - ID of the deal to deposit to
|
|
65
|
+
* @param amount_usd - Amount to deposit in USD (scaled by 10^7)
|
|
66
|
+
* @returns Promise resolving to the deposit result
|
|
67
|
+
*/
|
|
68
|
+
depositToDeal: (consumer_id: string, provider_id: string, deal_id: number, amount_usd: bigint) => Promise<void>;
|
|
76
69
|
/**
|
|
77
70
|
* Retrieves deal information
|
|
78
71
|
* @param consumer_id - Address of the consumer
|
|
@@ -76,7 +76,6 @@ class DealOps {
|
|
|
76
76
|
this.setDealCompleted = (0, decorator_1.withSignature)(async (consumer_id, provider_id, deal_id) => {
|
|
77
77
|
await (0, transaction_1.executeWalletTransaction)(this.context, consumer_id, "set_deal_completed", [
|
|
78
78
|
{ value: provider_id, type: 'address' },
|
|
79
|
-
{ value: consumer_id, type: 'address' },
|
|
80
79
|
{ value: deal_id, type: 'u32' }
|
|
81
80
|
]);
|
|
82
81
|
});
|
|
@@ -90,50 +89,36 @@ class DealOps {
|
|
|
90
89
|
this.setDealCancelled = (0, decorator_1.withSignature)(async (consumer_id, provider_id, deal_id) => {
|
|
91
90
|
await (0, transaction_1.executeWalletTransaction)(this.context, provider_id, "set_deal_cancelled", [
|
|
92
91
|
{ value: consumer_id, type: 'address' },
|
|
93
|
-
{ value: provider_id, type: 'address' },
|
|
94
92
|
{ value: deal_id, type: 'u32' }
|
|
95
93
|
]);
|
|
96
94
|
});
|
|
97
95
|
/**
|
|
98
|
-
*
|
|
96
|
+
* Deletes a deal from the system (owner only)
|
|
99
97
|
* @param consumer_id - Address of the consumer
|
|
100
98
|
* @param provider_id - Address of the provider
|
|
101
|
-
* @param deal_id - ID of the deal
|
|
102
|
-
* @returns Promise resolving to the
|
|
99
|
+
* @param deal_id - ID of the deal to delete
|
|
100
|
+
* @returns Promise resolving to the deletion result
|
|
103
101
|
*/
|
|
104
|
-
this.
|
|
105
|
-
await (0, transaction_1.executeWalletTransaction)(this.context,
|
|
102
|
+
this.deleteDeal = (0, decorator_1.withSignature)(async (consumer_id, provider_id, deal_id) => {
|
|
103
|
+
await (0, transaction_1.executeWalletTransaction)(this.context, '', "delete_deal", [
|
|
106
104
|
{ value: consumer_id, type: 'address' },
|
|
107
105
|
{ value: provider_id, type: 'address' },
|
|
108
106
|
{ value: deal_id, type: 'u32' }
|
|
109
107
|
]);
|
|
110
108
|
});
|
|
111
109
|
/**
|
|
112
|
-
*
|
|
113
|
-
* @param consumer_id - Address of the consumer
|
|
114
|
-
* @param provider_id - Address of the provider
|
|
115
|
-
* @param deal_id - ID of the deal
|
|
116
|
-
* @returns Promise resolving to the breach marking result
|
|
117
|
-
*/
|
|
118
|
-
this.setDealBreachedProvider = (0, decorator_1.withSignature)(async (consumer_id, provider_id, deal_id) => {
|
|
119
|
-
await (0, transaction_1.executeWalletTransaction)(this.context, consumer_id, "set_deal_breached_provider", [
|
|
120
|
-
{ value: provider_id, type: 'address' },
|
|
121
|
-
{ value: consumer_id, type: 'address' },
|
|
122
|
-
{ value: deal_id, type: 'u32' }
|
|
123
|
-
]);
|
|
124
|
-
});
|
|
125
|
-
/**
|
|
126
|
-
* Deletes a deal from the system (owner only)
|
|
110
|
+
* Deposits funds to a deal
|
|
127
111
|
* @param consumer_id - Address of the consumer
|
|
128
112
|
* @param provider_id - Address of the provider
|
|
129
|
-
* @param deal_id - ID of the deal to
|
|
130
|
-
* @
|
|
113
|
+
* @param deal_id - ID of the deal to deposit to
|
|
114
|
+
* @param amount_usd - Amount to deposit in USD (scaled by 10^7)
|
|
115
|
+
* @returns Promise resolving to the deposit result
|
|
131
116
|
*/
|
|
132
|
-
this.
|
|
133
|
-
await (0, transaction_1.executeWalletTransaction)(this.context,
|
|
134
|
-
{ value: consumer_id, type: 'address' },
|
|
117
|
+
this.depositToDeal = (0, decorator_1.withSignature)(async (consumer_id, provider_id, deal_id, amount_usd) => {
|
|
118
|
+
await (0, transaction_1.executeWalletTransaction)(this.context, consumer_id, "deposit_to_deal", [
|
|
135
119
|
{ value: provider_id, type: 'address' },
|
|
136
|
-
{ value: deal_id, type: 'u32' }
|
|
120
|
+
{ value: deal_id, type: 'u32' },
|
|
121
|
+
{ value: amount_usd, type: 'u128' }
|
|
137
122
|
]);
|
|
138
123
|
});
|
|
139
124
|
/**
|