@triadxyz/triad-protocol 4.1.3 → 4.1.4

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
@@ -116,8 +116,9 @@ export default class TriadProtocol {
116
116
  * Update Market Winning Direction
117
117
  * @param args.marketId - The ID of the Market
118
118
  * @param args.winningDirection - The Winning Direction of the Market
119
+ * @param args.poolId - The ID of the Pool
119
120
  */
120
- updateMarketWinningDirection({ marketId, winningDirection }: UpdateMarketWinningDirectionArgs): Promise<string | import("@solana/web3.js").VersionedTransaction>;
121
+ updateMarketWinningDirection({ marketId, winningDirection, poolId }: UpdateMarketWinningDirectionArgs): Promise<string | import("@solana/web3.js").VersionedTransaction>;
121
122
  /**
122
123
  * Update Market Payout
123
124
  * @param args.marketId - The ID of the market
@@ -172,4 +173,9 @@ export default class TriadProtocol {
172
173
  * @param args.poolId - The ID of the pool
173
174
  */
174
175
  createMarketPyth({ marketId, resolveIn, customer, poolId, feedId, direction }: CreateMarketPythArgs): Promise<string | import("@solana/web3.js").VersionedTransaction>;
176
+ /**
177
+ * Burn Triad
178
+ * @param amount - Amount to burn
179
+ */
180
+ burnTriad(amount: number): Promise<string | import("@solana/web3.js").VersionedTransaction>;
175
181
  }
package/dist/index.js CHANGED
@@ -339,15 +339,17 @@ class TriadProtocol {
339
339
  * Update Market Winning Direction
340
340
  * @param args.marketId - The ID of the Market
341
341
  * @param args.winningDirection - The Winning Direction of the Market
342
+ * @param args.poolId - The ID of the Pool
342
343
  */
343
- updateMarketWinningDirection({ marketId, winningDirection }) {
344
+ updateMarketWinningDirection({ marketId, winningDirection, poolId }) {
344
345
  return __awaiter(this, void 0, void 0, function* () {
345
346
  const ixs = [
346
347
  yield this.program.methods
347
348
  .updateMarketWinningDirection(winningDirection)
348
349
  .accounts({
349
350
  signer: this.program.provider.publicKey,
350
- market: (0, pda_1.getMarketPDA)(this.program.programId, marketId)
351
+ market: (0, pda_1.getMarketPDA)(this.program.programId, marketId),
352
+ pool: poolId ? (0, pda_1.getPoolPDA)(this.program.programId, poolId) : null
351
353
  })
352
354
  .instruction()
353
355
  ];
@@ -512,5 +514,22 @@ class TriadProtocol {
512
514
  return (0, sendVersionedTransaction_1.default)(this.program, ixs, this.rpcOptions);
513
515
  });
514
516
  }
517
+ /**
518
+ * Burn Triad
519
+ * @param amount - Amount to burn
520
+ */
521
+ burnTriad(amount) {
522
+ return __awaiter(this, void 0, void 0, function* () {
523
+ const ixs = [
524
+ yield this.program.methods
525
+ .burnTriad(new bn_js_1.default(amount * Math.pow(10, 6)))
526
+ .accounts({
527
+ signer: this.program.provider.publicKey
528
+ })
529
+ .instruction()
530
+ ];
531
+ return (0, sendVersionedTransaction_1.default)(this.program, ixs, this.rpcOptions);
532
+ });
533
+ }
515
534
  }
516
535
  exports.default = TriadProtocol;
@@ -182,6 +182,7 @@ export type CreatePoolArgs = {
182
182
  export type UpdateMarketWinningDirectionArgs = {
183
183
  marketId: number;
184
184
  winningDirection: WinningDirectionEncoded;
185
+ poolId: number;
185
186
  };
186
187
  export type UpdateMarketPayoutArgs = {
187
188
  marketId: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@triadxyz/triad-protocol",
3
- "version": "4.1.3",
3
+ "version": "4.1.4",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",