@flashbacktech/flashbackclient 0.1.68 → 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
@@ -93,45 +93,32 @@ class DealOps {
93
93
  ]);
94
94
  });
95
95
  /**
96
- * Marks a deal as breached by the consumer
96
+ * Deletes a deal from the system (owner only)
97
97
  * @param consumer_id - Address of the consumer
98
98
  * @param provider_id - Address of the provider
99
- * @param deal_id - ID of the deal
100
- * @returns Promise resolving to the breach marking result
99
+ * @param deal_id - ID of the deal to delete
100
+ * @returns Promise resolving to the deletion result
101
101
  */
102
- this.setDealBreachedConsumer = (0, decorator_1.withSignature)(async (consumer_id, provider_id, deal_id) => {
103
- await (0, transaction_1.executeWalletTransaction)(this.context, provider_id, "set_deal_breached_consumer", [
102
+ this.deleteDeal = (0, decorator_1.withSignature)(async (consumer_id, provider_id, deal_id) => {
103
+ await (0, transaction_1.executeWalletTransaction)(this.context, '', "delete_deal", [
104
104
  { value: consumer_id, type: 'address' },
105
105
  { value: provider_id, type: 'address' },
106
106
  { value: deal_id, type: 'u32' }
107
107
  ]);
108
108
  });
109
109
  /**
110
- * Marks a deal as breached by the provider
111
- * @param consumer_id - Address of the consumer
112
- * @param provider_id - Address of the provider
113
- * @param deal_id - ID of the deal
114
- * @returns Promise resolving to the breach marking result
115
- */
116
- this.setDealBreachedProvider = (0, decorator_1.withSignature)(async (consumer_id, provider_id, deal_id) => {
117
- await (0, transaction_1.executeWalletTransaction)(this.context, consumer_id, "set_deal_breached_provider", [
118
- { value: provider_id, type: 'address' },
119
- { value: consumer_id, type: 'address' },
120
- { value: deal_id, type: 'u32' }
121
- ]);
122
- });
123
- /**
124
- * Deletes a deal from the system (owner only)
110
+ * Deposits funds to a deal
125
111
  * @param consumer_id - Address of the consumer
126
112
  * @param provider_id - Address of the provider
127
- * @param deal_id - ID of the deal to delete
128
- * @returns Promise resolving to the deletion result
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
129
116
  */
130
- this.deleteDeal = (0, decorator_1.withSignature)(async (consumer_id, provider_id, deal_id) => {
131
- await (0, transaction_1.executeWalletTransaction)(this.context, '', "delete_deal", [
132
- { 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", [
133
119
  { value: provider_id, type: 'address' },
134
- { value: deal_id, type: 'u32' }
120
+ { value: deal_id, type: 'u32' },
121
+ { value: amount_usd, type: 'u128' }
135
122
  ]);
136
123
  });
137
124
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flashbacktech/flashbackclient",
3
- "version": "0.1.68",
3
+ "version": "0.1.69",
4
4
  "type": "commonjs",
5
5
  "publishConfig": {
6
6
  "access": "public"