@triadxyz/triad-protocol 2.4.2-beta → 2.4.3-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/index.d.ts +1 -1
- package/dist/index.js +17 -12
- package/dist/types/idl_triad_protocol.json +5 -0
- package/dist/types/triad_protocol.d.ts +5 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -188,7 +188,7 @@ export default class TriadProtocolClient {
|
|
|
188
188
|
*
|
|
189
189
|
* @param options - RPC options
|
|
190
190
|
*/
|
|
191
|
-
|
|
191
|
+
createOrEditPool({ poolId, question, markets, mint, customer, startTime, endTime, feeBps, payoutFee, isFast }: CreatePoolArgs, options?: RpcOptions): Promise<string>;
|
|
192
192
|
/**
|
|
193
193
|
* Open Order
|
|
194
194
|
* @param args.marketId - The ID of the Market
|
package/dist/index.js
CHANGED
|
@@ -209,29 +209,34 @@ class TriadProtocolClient {
|
|
|
209
209
|
*
|
|
210
210
|
* @param options - RPC options
|
|
211
211
|
*/
|
|
212
|
-
|
|
212
|
+
createOrEditPool({ poolId, question, markets, mint, customer, startTime, endTime, feeBps, payoutFee, isFast }, options) {
|
|
213
213
|
return __awaiter(this, void 0, void 0, function* () {
|
|
214
214
|
if (question.length > 80) {
|
|
215
215
|
throw new Error('Pool question must be less than 80 characters');
|
|
216
216
|
}
|
|
217
217
|
const ixs = [];
|
|
218
218
|
const poolPDA = (0, pda_1.getPoolPDA)(this.program.programId, poolId);
|
|
219
|
-
|
|
220
|
-
.
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
219
|
+
try {
|
|
220
|
+
yield this.getPoolById(poolId);
|
|
221
|
+
}
|
|
222
|
+
catch (_a) {
|
|
223
|
+
ixs.push(yield this.program.methods
|
|
224
|
+
.createPool({
|
|
225
|
+
poolId: new bn_js_1.default(poolId),
|
|
226
|
+
question: (0, helpers_1.encodeString)(question, 80),
|
|
227
|
+
isFast
|
|
228
|
+
})
|
|
229
|
+
.accounts({
|
|
230
|
+
signer: this.program.provider.publicKey
|
|
231
|
+
})
|
|
232
|
+
.instruction());
|
|
233
|
+
}
|
|
229
234
|
let userTrade = null;
|
|
230
235
|
try {
|
|
231
236
|
yield this.getUserTrade(this.program.provider.publicKey);
|
|
232
237
|
userTrade = (0, pda_1.getUserTradePDA)(this.program.programId, this.program.provider.publicKey);
|
|
233
238
|
}
|
|
234
|
-
catch (
|
|
239
|
+
catch (_b) { }
|
|
235
240
|
for (const market of markets) {
|
|
236
241
|
if (market.question.length > 80) {
|
|
237
242
|
throw new Error('Market question must be less than 80 characters');
|