@triadxyz/triad-protocol 4.3.8 → 4.3.9

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/market.js CHANGED
@@ -12,7 +12,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- const spl_token_1 = require("@solana/spl-token");
16
15
  const bn_js_1 = __importDefault(require("bn.js"));
17
16
  const bs58_1 = __importDefault(require("bs58"));
18
17
  const helpers_1 = require("./utils/helpers");
@@ -415,7 +414,6 @@ class Market {
415
414
  })
416
415
  .accounts({
417
416
  signer: this.program.provider.publicKey,
418
- tokenProgram: spl_token_1.TOKEN_PROGRAM_ID,
419
417
  pool: poolPDA,
420
418
  customer: market.customer,
421
419
  priceUpdate: feedPDA
@@ -480,7 +478,6 @@ class Market {
480
478
  })
481
479
  .accounts({
482
480
  signer: this.program.provider.publicKey,
483
- tokenProgram: spl_token_1.TOKEN_PROGRAM_ID,
484
481
  pool: market.poolId
485
482
  ? (0, pda_1.getPoolPDA)(this.program.programId, market.poolId)
486
483
  : null,
@@ -381,6 +381,117 @@
381
381
  ],
382
382
  "args": []
383
383
  },
384
+ {
385
+ "name": "collect_customer_fee",
386
+ "discriminator": [187, 253, 215, 126, 168, 246, 253, 21],
387
+ "accounts": [
388
+ {
389
+ "name": "signer",
390
+ "writable": true,
391
+ "signer": true
392
+ },
393
+ {
394
+ "name": "central",
395
+ "writable": true,
396
+ "pda": {
397
+ "seeds": [
398
+ {
399
+ "kind": "const",
400
+ "value": [99, 101, 110, 116, 114, 97, 108]
401
+ },
402
+ {
403
+ "kind": "const",
404
+ "value": [
405
+ 116, 114, 105, 97, 100, 109, 97, 114, 107, 101, 116, 115
406
+ ]
407
+ }
408
+ ]
409
+ }
410
+ },
411
+ {
412
+ "name": "customer",
413
+ "writable": true
414
+ },
415
+ {
416
+ "name": "fee_recipient",
417
+ "writable": true
418
+ },
419
+ {
420
+ "name": "mint",
421
+ "writable": true,
422
+ "address": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
423
+ },
424
+ {
425
+ "name": "central_ata",
426
+ "writable": true,
427
+ "pda": {
428
+ "seeds": [
429
+ {
430
+ "kind": "account",
431
+ "path": "central"
432
+ },
433
+ {
434
+ "kind": "account",
435
+ "path": "token_program"
436
+ },
437
+ {
438
+ "kind": "account",
439
+ "path": "mint"
440
+ }
441
+ ],
442
+ "program": {
443
+ "kind": "const",
444
+ "value": [
445
+ 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142,
446
+ 13, 131, 11, 90, 19, 153, 218, 255, 16, 132, 4, 142, 123, 216,
447
+ 219, 233, 248, 89
448
+ ]
449
+ }
450
+ }
451
+ },
452
+ {
453
+ "name": "fee_recipient_ata",
454
+ "writable": true,
455
+ "pda": {
456
+ "seeds": [
457
+ {
458
+ "kind": "account",
459
+ "path": "fee_recipient"
460
+ },
461
+ {
462
+ "kind": "account",
463
+ "path": "token_program"
464
+ },
465
+ {
466
+ "kind": "account",
467
+ "path": "mint"
468
+ }
469
+ ],
470
+ "program": {
471
+ "kind": "const",
472
+ "value": [
473
+ 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142,
474
+ 13, 131, 11, 90, 19, 153, 218, 255, 16, 132, 4, 142, 123, 216,
475
+ 219, 233, 248, 89
476
+ ]
477
+ }
478
+ }
479
+ },
480
+ {
481
+ "name": "token_program",
482
+ "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
483
+ },
484
+ {
485
+ "name": "associated_token_program",
486
+ "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
487
+ },
488
+ {
489
+ "name": "system_program",
490
+ "address": "11111111111111111111111111111111"
491
+ }
492
+ ],
493
+ "args": []
494
+ },
384
495
  {
385
496
  "name": "collect_rewards",
386
497
  "discriminator": [63, 130, 90, 197, 39, 16, 143, 176],
@@ -642,50 +753,10 @@
642
753
  ]
643
754
  }
644
755
  },
645
- {
646
- "name": "mint",
647
- "writable": true,
648
- "address": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
649
- },
650
- {
651
- "name": "market_to_ata",
652
- "writable": true,
653
- "pda": {
654
- "seeds": [
655
- {
656
- "kind": "account",
657
- "path": "market"
658
- },
659
- {
660
- "kind": "account",
661
- "path": "token_program"
662
- },
663
- {
664
- "kind": "account",
665
- "path": "mint"
666
- }
667
- ],
668
- "program": {
669
- "kind": "const",
670
- "value": [
671
- 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142,
672
- 13, 131, 11, 90, 19, 153, 218, 255, 16, 132, 4, 142, 123, 216,
673
- 219, 233, 248, 89
674
- ]
675
- }
676
- }
677
- },
678
756
  {
679
757
  "name": "price_update",
680
758
  "writable": true
681
759
  },
682
- {
683
- "name": "token_program"
684
- },
685
- {
686
- "name": "associated_token_program",
687
- "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
688
- },
689
760
  {
690
761
  "name": "system_program",
691
762
  "address": "11111111111111111111111111111111"
@@ -1085,59 +1156,11 @@
1085
1156
  },
1086
1157
  {
1087
1158
  "name": "predictor_order",
1088
- "writable": true,
1089
- "pda": {
1090
- "seeds": [
1091
- {
1092
- "kind": "const",
1093
- "value": [
1094
- 112, 114, 101, 100, 105, 99, 116, 111, 114, 95, 111, 114, 100,
1095
- 101, 114
1096
- ]
1097
- },
1098
- {
1099
- "kind": "account",
1100
- "path": "predictor"
1101
- },
1102
- {
1103
- "kind": "account",
1104
- "path": "market.market_id",
1105
- "account": "MarketV2"
1106
- },
1107
- {
1108
- "kind": "arg",
1109
- "path": "args.order_direction"
1110
- }
1111
- ]
1112
- }
1159
+ "writable": true
1113
1160
  },
1114
1161
  {
1115
1162
  "name": "opposite_predictor_order",
1116
- "writable": true,
1117
- "pda": {
1118
- "seeds": [
1119
- {
1120
- "kind": "const",
1121
- "value": [
1122
- 112, 114, 101, 100, 105, 99, 116, 111, 114, 95, 111, 114, 100,
1123
- 101, 114
1124
- ]
1125
- },
1126
- {
1127
- "kind": "account",
1128
- "path": "opposite_predictor"
1129
- },
1130
- {
1131
- "kind": "account",
1132
- "path": "market.market_id",
1133
- "account": "MarketV2"
1134
- },
1135
- {
1136
- "kind": "arg",
1137
- "path": "args.opposite_order_direction"
1138
- }
1139
- ]
1140
- }
1163
+ "writable": true
1141
1164
  },
1142
1165
  {
1143
1166
  "name": "system_program",
@@ -1432,30 +1455,7 @@
1432
1455
  },
1433
1456
  {
1434
1457
  "name": "predictor_order",
1435
- "writable": true,
1436
- "pda": {
1437
- "seeds": [
1438
- {
1439
- "kind": "const",
1440
- "value": [
1441
- 112, 114, 101, 100, 105, 99, 116, 111, 114, 95, 111, 114, 100,
1442
- 101, 114
1443
- ]
1444
- },
1445
- {
1446
- "kind": "account",
1447
- "path": "predictor"
1448
- },
1449
- {
1450
- "kind": "arg",
1451
- "path": "args.market_id"
1452
- },
1453
- {
1454
- "kind": "arg",
1455
- "path": "args.order_direction"
1456
- }
1457
- ]
1458
- }
1458
+ "writable": true
1459
1459
  },
1460
1460
  {
1461
1461
  "name": "system_program",
@@ -2048,8 +2048,8 @@
2048
2048
  "discriminator": [2, 86, 74, 29, 119, 7, 53, 82]
2049
2049
  },
2050
2050
  {
2051
- "name": "CollectMarketFeeEvent",
2052
- "discriminator": [210, 147, 203, 216, 158, 111, 59, 143]
2051
+ "name": "CollectCustomerFeeEvent",
2052
+ "discriminator": [0, 238, 156, 209, 108, 54, 154, 187]
2053
2053
  },
2054
2054
  {
2055
2055
  "name": "CollectRewardsEvent",
@@ -2567,24 +2567,16 @@
2567
2567
  }
2568
2568
  },
2569
2569
  {
2570
- "name": "CollectMarketFeeEvent",
2570
+ "name": "CollectCustomerFeeEvent",
2571
2571
  "type": {
2572
2572
  "kind": "struct",
2573
2573
  "fields": [
2574
- {
2575
- "name": "market_id",
2576
- "type": "u64"
2577
- },
2578
- {
2579
- "name": "triad_fee",
2580
- "type": "u64"
2581
- },
2582
2574
  {
2583
2575
  "name": "customer_id",
2584
2576
  "type": "u16"
2585
2577
  },
2586
2578
  {
2587
- "name": "customer_fee",
2579
+ "name": "fee",
2588
2580
  "type": "u64"
2589
2581
  },
2590
2582
  {
@@ -486,6 +486,186 @@ export type TriadProtocol = {
486
486
  ];
487
487
  args: [];
488
488
  },
489
+ {
490
+ name: 'collectCustomerFee';
491
+ discriminator: [187, 253, 215, 126, 168, 246, 253, 21];
492
+ accounts: [
493
+ {
494
+ name: 'signer';
495
+ writable: true;
496
+ signer: true;
497
+ },
498
+ {
499
+ name: 'central';
500
+ writable: true;
501
+ pda: {
502
+ seeds: [
503
+ {
504
+ kind: 'const';
505
+ value: [99, 101, 110, 116, 114, 97, 108];
506
+ },
507
+ {
508
+ kind: 'const';
509
+ value: [
510
+ 116,
511
+ 114,
512
+ 105,
513
+ 97,
514
+ 100,
515
+ 109,
516
+ 97,
517
+ 114,
518
+ 107,
519
+ 101,
520
+ 116,
521
+ 115
522
+ ];
523
+ }
524
+ ];
525
+ };
526
+ },
527
+ {
528
+ name: 'customer';
529
+ writable: true;
530
+ },
531
+ {
532
+ name: 'feeRecipient';
533
+ writable: true;
534
+ },
535
+ {
536
+ name: 'mint';
537
+ writable: true;
538
+ address: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v';
539
+ },
540
+ {
541
+ name: 'centralAta';
542
+ writable: true;
543
+ pda: {
544
+ seeds: [
545
+ {
546
+ kind: 'account';
547
+ path: 'central';
548
+ },
549
+ {
550
+ kind: 'account';
551
+ path: 'tokenProgram';
552
+ },
553
+ {
554
+ kind: 'account';
555
+ path: 'mint';
556
+ }
557
+ ];
558
+ program: {
559
+ kind: 'const';
560
+ value: [
561
+ 140,
562
+ 151,
563
+ 37,
564
+ 143,
565
+ 78,
566
+ 36,
567
+ 137,
568
+ 241,
569
+ 187,
570
+ 61,
571
+ 16,
572
+ 41,
573
+ 20,
574
+ 142,
575
+ 13,
576
+ 131,
577
+ 11,
578
+ 90,
579
+ 19,
580
+ 153,
581
+ 218,
582
+ 255,
583
+ 16,
584
+ 132,
585
+ 4,
586
+ 142,
587
+ 123,
588
+ 216,
589
+ 219,
590
+ 233,
591
+ 248,
592
+ 89
593
+ ];
594
+ };
595
+ };
596
+ },
597
+ {
598
+ name: 'feeRecipientAta';
599
+ writable: true;
600
+ pda: {
601
+ seeds: [
602
+ {
603
+ kind: 'account';
604
+ path: 'feeRecipient';
605
+ },
606
+ {
607
+ kind: 'account';
608
+ path: 'tokenProgram';
609
+ },
610
+ {
611
+ kind: 'account';
612
+ path: 'mint';
613
+ }
614
+ ];
615
+ program: {
616
+ kind: 'const';
617
+ value: [
618
+ 140,
619
+ 151,
620
+ 37,
621
+ 143,
622
+ 78,
623
+ 36,
624
+ 137,
625
+ 241,
626
+ 187,
627
+ 61,
628
+ 16,
629
+ 41,
630
+ 20,
631
+ 142,
632
+ 13,
633
+ 131,
634
+ 11,
635
+ 90,
636
+ 19,
637
+ 153,
638
+ 218,
639
+ 255,
640
+ 16,
641
+ 132,
642
+ 4,
643
+ 142,
644
+ 123,
645
+ 216,
646
+ 219,
647
+ 233,
648
+ 248,
649
+ 89
650
+ ];
651
+ };
652
+ };
653
+ },
654
+ {
655
+ name: 'tokenProgram';
656
+ address: 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA';
657
+ },
658
+ {
659
+ name: 'associatedTokenProgram';
660
+ address: 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL';
661
+ },
662
+ {
663
+ name: 'systemProgram';
664
+ address: '11111111111111111111111111111111';
665
+ }
666
+ ];
667
+ args: [];
668
+ },
489
669
  {
490
670
  name: 'collectRewards';
491
671
  discriminator: [63, 130, 90, 197, 39, 16, 143, 176];
@@ -816,79 +996,10 @@ export type TriadProtocol = {
816
996
  ];
817
997
  };
818
998
  },
819
- {
820
- name: 'mint';
821
- writable: true;
822
- address: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v';
823
- },
824
- {
825
- name: 'marketToAta';
826
- writable: true;
827
- pda: {
828
- seeds: [
829
- {
830
- kind: 'account';
831
- path: 'market';
832
- },
833
- {
834
- kind: 'account';
835
- path: 'tokenProgram';
836
- },
837
- {
838
- kind: 'account';
839
- path: 'mint';
840
- }
841
- ];
842
- program: {
843
- kind: 'const';
844
- value: [
845
- 140,
846
- 151,
847
- 37,
848
- 143,
849
- 78,
850
- 36,
851
- 137,
852
- 241,
853
- 187,
854
- 61,
855
- 16,
856
- 41,
857
- 20,
858
- 142,
859
- 13,
860
- 131,
861
- 11,
862
- 90,
863
- 19,
864
- 153,
865
- 218,
866
- 255,
867
- 16,
868
- 132,
869
- 4,
870
- 142,
871
- 123,
872
- 216,
873
- 219,
874
- 233,
875
- 248,
876
- 89
877
- ];
878
- };
879
- };
880
- },
881
999
  {
882
1000
  name: 'priceUpdate';
883
1001
  writable: true;
884
1002
  },
885
- {
886
- name: 'tokenProgram';
887
- },
888
- {
889
- name: 'associatedTokenProgram';
890
- address: 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL';
891
- },
892
1003
  {
893
1004
  name: 'systemProgram';
894
1005
  address: '11111111111111111111111111111111';
@@ -2474,8 +2585,8 @@ export type TriadProtocol = {
2474
2585
  discriminator: [2, 86, 74, 29, 119, 7, 53, 82];
2475
2586
  },
2476
2587
  {
2477
- name: 'collectMarketFeeEvent';
2478
- discriminator: [210, 147, 203, 216, 158, 111, 59, 143];
2588
+ name: 'collectCustomerFeeEvent';
2589
+ discriminator: [0, 238, 156, 209, 108, 54, 154, 187];
2479
2590
  },
2480
2591
  {
2481
2592
  name: 'collectRewardsEvent';
@@ -2993,24 +3104,16 @@ export type TriadProtocol = {
2993
3104
  };
2994
3105
  },
2995
3106
  {
2996
- name: 'collectMarketFeeEvent';
3107
+ name: 'collectCustomerFeeEvent';
2997
3108
  type: {
2998
3109
  kind: 'struct';
2999
3110
  fields: [
3000
- {
3001
- name: 'marketId';
3002
- type: 'u64';
3003
- },
3004
- {
3005
- name: 'triadFee';
3006
- type: 'u64';
3007
- },
3008
3111
  {
3009
3112
  name: 'customerId';
3010
3113
  type: 'u16';
3011
3114
  },
3012
3115
  {
3013
- name: 'customerFee';
3116
+ name: 'fee';
3014
3117
  type: 'u64';
3015
3118
  },
3016
3119
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@triadxyz/triad-protocol",
3
- "version": "4.3.8",
3
+ "version": "4.3.9",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",