@triadxyz/triad-protocol 2.2.9-beta → 2.3.0-beta
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/trade.js +8 -1
- package/package.json +1 -1
package/dist/trade.js
CHANGED
|
@@ -202,6 +202,12 @@ class Trade {
|
|
|
202
202
|
signer: this.program.provider.publicKey
|
|
203
203
|
})
|
|
204
204
|
.instruction());
|
|
205
|
+
let userTrade = null;
|
|
206
|
+
try {
|
|
207
|
+
yield this.getUserTrade(this.program.provider.publicKey);
|
|
208
|
+
userTrade = (0, pda_1.getUserTradePDA)(this.program.programId, this.program.provider.publicKey);
|
|
209
|
+
}
|
|
210
|
+
catch (_a) { }
|
|
205
211
|
for (const market of markets) {
|
|
206
212
|
if (market.question.length > 80) {
|
|
207
213
|
throw new Error('Market question must be less than 80 characters');
|
|
@@ -220,7 +226,8 @@ class Trade {
|
|
|
220
226
|
mint,
|
|
221
227
|
tokenProgram: (0, helpers_1.getTokenProgram)(mint),
|
|
222
228
|
pool: poolPDA,
|
|
223
|
-
customer
|
|
229
|
+
customer,
|
|
230
|
+
userTrade
|
|
224
231
|
})
|
|
225
232
|
.instruction());
|
|
226
233
|
}
|