@triadxyz/triad-protocol 4.1.3 → 4.1.5
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 +7 -1
- package/dist/index.js +21 -2
- package/dist/types/idl_triad_protocol.json +40 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/triad_protocol.d.ts +40 -0
- package/package.json +1 -1
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;
|
|
@@ -2430,6 +2430,10 @@
|
|
|
2430
2430
|
"name": "MarketFeeEvent",
|
|
2431
2431
|
"discriminator": [191, 148, 93, 112, 63, 139, 16, 186]
|
|
2432
2432
|
},
|
|
2433
|
+
{
|
|
2434
|
+
"name": "MarketOrderEvent",
|
|
2435
|
+
"discriminator": [223, 150, 100, 181, 180, 170, 93, 91]
|
|
2436
|
+
},
|
|
2433
2437
|
{
|
|
2434
2438
|
"name": "PoolEvent",
|
|
2435
2439
|
"discriminator": [76, 227, 205, 183, 1, 218, 164, 244]
|
|
@@ -3408,6 +3412,42 @@
|
|
|
3408
3412
|
]
|
|
3409
3413
|
}
|
|
3410
3414
|
},
|
|
3415
|
+
{
|
|
3416
|
+
"name": "MarketOrderEvent",
|
|
3417
|
+
"type": {
|
|
3418
|
+
"kind": "struct",
|
|
3419
|
+
"fields": [
|
|
3420
|
+
{
|
|
3421
|
+
"name": "hype_price",
|
|
3422
|
+
"type": "u64"
|
|
3423
|
+
},
|
|
3424
|
+
{
|
|
3425
|
+
"name": "flop_price",
|
|
3426
|
+
"type": "u64"
|
|
3427
|
+
},
|
|
3428
|
+
{
|
|
3429
|
+
"name": "hype_liquidity",
|
|
3430
|
+
"type": "u64"
|
|
3431
|
+
},
|
|
3432
|
+
{
|
|
3433
|
+
"name": "flop_liquidity",
|
|
3434
|
+
"type": "u64"
|
|
3435
|
+
},
|
|
3436
|
+
{
|
|
3437
|
+
"name": "hype_shares",
|
|
3438
|
+
"type": "u64"
|
|
3439
|
+
},
|
|
3440
|
+
{
|
|
3441
|
+
"name": "flop_shares",
|
|
3442
|
+
"type": "u64"
|
|
3443
|
+
},
|
|
3444
|
+
{
|
|
3445
|
+
"name": "volume",
|
|
3446
|
+
"type": "u64"
|
|
3447
|
+
}
|
|
3448
|
+
]
|
|
3449
|
+
}
|
|
3450
|
+
},
|
|
3411
3451
|
{
|
|
3412
3452
|
"name": "MarketV2",
|
|
3413
3453
|
"type": {
|
package/dist/types/index.d.ts
CHANGED
|
@@ -3376,6 +3376,10 @@ export type TriadProtocol = {
|
|
|
3376
3376
|
name: 'marketFeeEvent';
|
|
3377
3377
|
discriminator: [191, 148, 93, 112, 63, 139, 16, 186];
|
|
3378
3378
|
},
|
|
3379
|
+
{
|
|
3380
|
+
name: 'marketOrderEvent';
|
|
3381
|
+
discriminator: [223, 150, 100, 181, 180, 170, 93, 91];
|
|
3382
|
+
},
|
|
3379
3383
|
{
|
|
3380
3384
|
name: 'poolEvent';
|
|
3381
3385
|
discriminator: [76, 227, 205, 183, 1, 218, 164, 244];
|
|
@@ -4354,6 +4358,42 @@ export type TriadProtocol = {
|
|
|
4354
4358
|
];
|
|
4355
4359
|
};
|
|
4356
4360
|
},
|
|
4361
|
+
{
|
|
4362
|
+
name: 'marketOrderEvent';
|
|
4363
|
+
type: {
|
|
4364
|
+
kind: 'struct';
|
|
4365
|
+
fields: [
|
|
4366
|
+
{
|
|
4367
|
+
name: 'hypePrice';
|
|
4368
|
+
type: 'u64';
|
|
4369
|
+
},
|
|
4370
|
+
{
|
|
4371
|
+
name: 'flopPrice';
|
|
4372
|
+
type: 'u64';
|
|
4373
|
+
},
|
|
4374
|
+
{
|
|
4375
|
+
name: 'hypeLiquidity';
|
|
4376
|
+
type: 'u64';
|
|
4377
|
+
},
|
|
4378
|
+
{
|
|
4379
|
+
name: 'flopLiquidity';
|
|
4380
|
+
type: 'u64';
|
|
4381
|
+
},
|
|
4382
|
+
{
|
|
4383
|
+
name: 'hypeShares';
|
|
4384
|
+
type: 'u64';
|
|
4385
|
+
},
|
|
4386
|
+
{
|
|
4387
|
+
name: 'flopShares';
|
|
4388
|
+
type: 'u64';
|
|
4389
|
+
},
|
|
4390
|
+
{
|
|
4391
|
+
name: 'volume';
|
|
4392
|
+
type: 'u64';
|
|
4393
|
+
}
|
|
4394
|
+
];
|
|
4395
|
+
};
|
|
4396
|
+
},
|
|
4357
4397
|
{
|
|
4358
4398
|
name: 'marketV2';
|
|
4359
4399
|
type: {
|