@triadxyz/triad-protocol 4.1.6 → 4.1.7

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 CHANGED
@@ -117,8 +117,9 @@ export default class TriadProtocol {
117
117
  * @param args.marketId - The ID of the Market
118
118
  * @param args.winningDirection - The Winning Direction of the Market
119
119
  * @param args.poolId - The ID of the Pool
120
+ * @param args.withPayout - Whether to allow the market to payout
120
121
  */
121
- updateMarketWinningDirection({ marketId, winningDirection, poolId }: UpdateMarketWinningDirectionArgs): Promise<string | import("@solana/web3.js").VersionedTransaction>;
122
+ updateMarketWinningDirection({ marketId, winningDirection, poolId, withPayout }: UpdateMarketWinningDirectionArgs): Promise<string | import("@solana/web3.js").VersionedTransaction>;
122
123
  /**
123
124
  * Update Market Payout
124
125
  * @param args.marketId - The ID of the market
package/dist/index.js CHANGED
@@ -340,8 +340,9 @@ class TriadProtocol {
340
340
  * @param args.marketId - The ID of the Market
341
341
  * @param args.winningDirection - The Winning Direction of the Market
342
342
  * @param args.poolId - The ID of the Pool
343
+ * @param args.withPayout - Whether to allow the market to payout
343
344
  */
344
- updateMarketWinningDirection({ marketId, winningDirection, poolId }) {
345
+ updateMarketWinningDirection({ marketId, winningDirection, poolId, withPayout = false }) {
345
346
  return __awaiter(this, void 0, void 0, function* () {
346
347
  const ixs = [
347
348
  yield this.program.methods
@@ -353,6 +354,15 @@ class TriadProtocol {
353
354
  })
354
355
  .instruction()
355
356
  ];
357
+ if (withPayout) {
358
+ ixs.push(yield this.program.methods
359
+ .updateMarketPayout(true)
360
+ .accounts({
361
+ signer: this.program.provider.publicKey,
362
+ market: (0, pda_1.getMarketPDA)(this.program.programId, marketId)
363
+ })
364
+ .instruction());
365
+ }
356
366
  return (0, sendVersionedTransaction_1.default)(this.program, ixs, this.rpcOptions);
357
367
  });
358
368
  }
@@ -183,6 +183,7 @@ export type UpdateMarketWinningDirectionArgs = {
183
183
  marketId: number;
184
184
  winningDirection: WinningDirectionEncoded;
185
185
  poolId?: number;
186
+ withPayout?: boolean;
186
187
  };
187
188
  export type UpdateMarketPayoutArgs = {
188
189
  marketId: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@triadxyz/triad-protocol",
3
- "version": "4.1.6",
3
+ "version": "4.1.7",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",