@flashbacktech/flashbackclient 0.1.68 → 0.1.70
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.
- package/dist/stellarv2/client/deal.d.ts +10 -16
- package/dist/stellarv2/client/deal.js +19 -26
- package/package.json +1 -1
|
@@ -24,6 +24,7 @@ export declare class DealOps {
|
|
|
24
24
|
* @returns Promise resolving to the acceptance result
|
|
25
25
|
*/
|
|
26
26
|
setDealAccepted: (provider_id: string, consumer_id: string, deal_id: number) => Promise<void>;
|
|
27
|
+
setDealRejected: (provider_id: string, consumer_id: string, deal_id: number) => Promise<void>;
|
|
27
28
|
/**
|
|
28
29
|
* Sets a deal as funded by the consumer
|
|
29
30
|
* @param consumer_id - Address of the consumer funding the deal
|
|
@@ -49,22 +50,6 @@ export declare class DealOps {
|
|
|
49
50
|
* @returns Promise resolving to the cancellation result
|
|
50
51
|
*/
|
|
51
52
|
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
53
|
/**
|
|
69
54
|
* Deletes a deal from the system (owner only)
|
|
70
55
|
* @param consumer_id - Address of the consumer
|
|
@@ -73,6 +58,15 @@ export declare class DealOps {
|
|
|
73
58
|
* @returns Promise resolving to the deletion result
|
|
74
59
|
*/
|
|
75
60
|
deleteDeal: (consumer_id: string, provider_id: string, deal_id: number) => Promise<void>;
|
|
61
|
+
/**
|
|
62
|
+
* Deposits funds to a deal
|
|
63
|
+
* @param consumer_id - Address of the consumer
|
|
64
|
+
* @param provider_id - Address of the provider
|
|
65
|
+
* @param deal_id - ID of the deal to deposit to
|
|
66
|
+
* @param amount_usd - Amount to deposit in USD (scaled by 10^7)
|
|
67
|
+
* @returns Promise resolving to the deposit result
|
|
68
|
+
*/
|
|
69
|
+
depositToDeal: (consumer_id: string, provider_id: string, deal_id: number, amount_usd: bigint) => Promise<void>;
|
|
76
70
|
/**
|
|
77
71
|
* Retrieves deal information
|
|
78
72
|
* @param consumer_id - Address of the consumer
|
|
@@ -50,6 +50,12 @@ class DealOps {
|
|
|
50
50
|
{ value: deal_id, type: 'u32' }
|
|
51
51
|
]);
|
|
52
52
|
});
|
|
53
|
+
this.setDealRejected = (0, decorator_1.withSignature)(async (provider_id, consumer_id, deal_id) => {
|
|
54
|
+
await (0, transaction_1.executeWalletTransaction)(this.context, provider_id, "set_deal_rejected", [
|
|
55
|
+
{ value: consumer_id, type: 'address' },
|
|
56
|
+
{ value: deal_id, type: 'u32' }
|
|
57
|
+
]);
|
|
58
|
+
});
|
|
53
59
|
/**
|
|
54
60
|
* Sets a deal as funded by the consumer
|
|
55
61
|
* @param consumer_id - Address of the consumer funding the deal
|
|
@@ -93,45 +99,32 @@ class DealOps {
|
|
|
93
99
|
]);
|
|
94
100
|
});
|
|
95
101
|
/**
|
|
96
|
-
*
|
|
102
|
+
* Deletes a deal from the system (owner only)
|
|
97
103
|
* @param consumer_id - Address of the consumer
|
|
98
104
|
* @param provider_id - Address of the provider
|
|
99
|
-
* @param deal_id - ID of the deal
|
|
100
|
-
* @returns Promise resolving to the
|
|
105
|
+
* @param deal_id - ID of the deal to delete
|
|
106
|
+
* @returns Promise resolving to the deletion result
|
|
101
107
|
*/
|
|
102
|
-
this.
|
|
103
|
-
await (0, transaction_1.executeWalletTransaction)(this.context,
|
|
108
|
+
this.deleteDeal = (0, decorator_1.withSignature)(async (consumer_id, provider_id, deal_id) => {
|
|
109
|
+
await (0, transaction_1.executeWalletTransaction)(this.context, '', "delete_deal", [
|
|
104
110
|
{ value: consumer_id, type: 'address' },
|
|
105
111
|
{ value: provider_id, type: 'address' },
|
|
106
112
|
{ value: deal_id, type: 'u32' }
|
|
107
113
|
]);
|
|
108
114
|
});
|
|
109
115
|
/**
|
|
110
|
-
*
|
|
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)
|
|
116
|
+
* Deposits funds to a deal
|
|
125
117
|
* @param consumer_id - Address of the consumer
|
|
126
118
|
* @param provider_id - Address of the provider
|
|
127
|
-
* @param deal_id - ID of the deal to
|
|
128
|
-
* @
|
|
119
|
+
* @param deal_id - ID of the deal to deposit to
|
|
120
|
+
* @param amount_usd - Amount to deposit in USD (scaled by 10^7)
|
|
121
|
+
* @returns Promise resolving to the deposit result
|
|
129
122
|
*/
|
|
130
|
-
this.
|
|
131
|
-
await (0, transaction_1.executeWalletTransaction)(this.context,
|
|
132
|
-
{ value: consumer_id, type: 'address' },
|
|
123
|
+
this.depositToDeal = (0, decorator_1.withSignature)(async (consumer_id, provider_id, deal_id, amount_usd) => {
|
|
124
|
+
await (0, transaction_1.executeWalletTransaction)(this.context, consumer_id, "deposit_to_deal", [
|
|
133
125
|
{ value: provider_id, type: 'address' },
|
|
134
|
-
{ value: deal_id, type: 'u32' }
|
|
126
|
+
{ value: deal_id, type: 'u32' },
|
|
127
|
+
{ value: amount_usd, type: 'u128' }
|
|
135
128
|
]);
|
|
136
129
|
});
|
|
137
130
|
/**
|