@triadxyz/triad-protocol 4.3.7 → 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,
package/dist/predictor.js CHANGED
@@ -160,7 +160,10 @@ class Predictor {
160
160
  .accounts({
161
161
  signer: this.program.provider.publicKey,
162
162
  predictor: predictorPDA,
163
- customer: (0, pda_1.getCustomerPDA)(this.program.programId, customerId)
163
+ customer: (0, pda_1.getCustomerPDA)(this.program.programId, customerId),
164
+ predictorDeposit: depositId
165
+ ? (0, pda_1.getPredictorDepositPDA)(this.program.programId, depositId)
166
+ : null
164
167
  })
165
168
  .instruction());
166
169
  return (0, sendVersionedTransaction_1.default)(this.program, ixs, this.rpcOptions);
@@ -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"
@@ -901,22 +972,7 @@
901
972
  {
902
973
  "name": "predictor_deposit",
903
974
  "writable": true,
904
- "optional": true,
905
- "pda": {
906
- "seeds": [
907
- {
908
- "kind": "const",
909
- "value": [
910
- 112, 114, 101, 100, 105, 99, 116, 111, 114, 95, 100, 101, 112,
911
- 111, 115, 105, 116
912
- ]
913
- },
914
- {
915
- "kind": "arg",
916
- "path": "args.deposit_id"
917
- }
918
- ]
919
- }
975
+ "optional": true
920
976
  },
921
977
  {
922
978
  "name": "mint",
@@ -1100,59 +1156,11 @@
1100
1156
  },
1101
1157
  {
1102
1158
  "name": "predictor_order",
1103
- "writable": true,
1104
- "pda": {
1105
- "seeds": [
1106
- {
1107
- "kind": "const",
1108
- "value": [
1109
- 112, 114, 101, 100, 105, 99, 116, 111, 114, 95, 111, 114, 100,
1110
- 101, 114
1111
- ]
1112
- },
1113
- {
1114
- "kind": "account",
1115
- "path": "predictor"
1116
- },
1117
- {
1118
- "kind": "account",
1119
- "path": "market.market_id",
1120
- "account": "MarketV2"
1121
- },
1122
- {
1123
- "kind": "arg",
1124
- "path": "args.order_direction"
1125
- }
1126
- ]
1127
- }
1159
+ "writable": true
1128
1160
  },
1129
1161
  {
1130
1162
  "name": "opposite_predictor_order",
1131
- "writable": true,
1132
- "pda": {
1133
- "seeds": [
1134
- {
1135
- "kind": "const",
1136
- "value": [
1137
- 112, 114, 101, 100, 105, 99, 116, 111, 114, 95, 111, 114, 100,
1138
- 101, 114
1139
- ]
1140
- },
1141
- {
1142
- "kind": "account",
1143
- "path": "opposite_predictor"
1144
- },
1145
- {
1146
- "kind": "account",
1147
- "path": "market.market_id",
1148
- "account": "MarketV2"
1149
- },
1150
- {
1151
- "kind": "arg",
1152
- "path": "args.opposite_order_direction"
1153
- }
1154
- ]
1155
- }
1163
+ "writable": true
1156
1164
  },
1157
1165
  {
1158
1166
  "name": "system_program",
@@ -1447,30 +1455,7 @@
1447
1455
  },
1448
1456
  {
1449
1457
  "name": "predictor_order",
1450
- "writable": true,
1451
- "pda": {
1452
- "seeds": [
1453
- {
1454
- "kind": "const",
1455
- "value": [
1456
- 112, 114, 101, 100, 105, 99, 116, 111, 114, 95, 111, 114, 100,
1457
- 101, 114
1458
- ]
1459
- },
1460
- {
1461
- "kind": "account",
1462
- "path": "predictor"
1463
- },
1464
- {
1465
- "kind": "arg",
1466
- "path": "args.market_id"
1467
- },
1468
- {
1469
- "kind": "arg",
1470
- "path": "args.order_direction"
1471
- }
1472
- ]
1473
- }
1458
+ "writable": true
1474
1459
  },
1475
1460
  {
1476
1461
  "name": "system_program",
@@ -2063,8 +2048,8 @@
2063
2048
  "discriminator": [2, 86, 74, 29, 119, 7, 53, 82]
2064
2049
  },
2065
2050
  {
2066
- "name": "CollectMarketFeeEvent",
2067
- "discriminator": [210, 147, 203, 216, 158, 111, 59, 143]
2051
+ "name": "CollectCustomerFeeEvent",
2052
+ "discriminator": [0, 238, 156, 209, 108, 54, 154, 187]
2068
2053
  },
2069
2054
  {
2070
2055
  "name": "CollectRewardsEvent",
@@ -2582,24 +2567,16 @@
2582
2567
  }
2583
2568
  },
2584
2569
  {
2585
- "name": "CollectMarketFeeEvent",
2570
+ "name": "CollectCustomerFeeEvent",
2586
2571
  "type": {
2587
2572
  "kind": "struct",
2588
2573
  "fields": [
2589
- {
2590
- "name": "market_id",
2591
- "type": "u64"
2592
- },
2593
- {
2594
- "name": "triad_fee",
2595
- "type": "u64"
2596
- },
2597
2574
  {
2598
2575
  "name": "customer_id",
2599
2576
  "type": "u16"
2600
2577
  },
2601
2578
  {
2602
- "name": "customer_fee",
2579
+ "name": "fee",
2603
2580
  "type": "u64"
2604
2581
  },
2605
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';
@@ -1116,36 +1227,6 @@ export type TriadProtocol = {
1116
1227
  name: 'predictorDeposit';
1117
1228
  writable: true;
1118
1229
  optional: true;
1119
- pda: {
1120
- seeds: [
1121
- {
1122
- kind: 'const';
1123
- value: [
1124
- 112,
1125
- 114,
1126
- 101,
1127
- 100,
1128
- 105,
1129
- 99,
1130
- 116,
1131
- 111,
1132
- 114,
1133
- 95,
1134
- 100,
1135
- 101,
1136
- 112,
1137
- 111,
1138
- 115,
1139
- 105,
1140
- 116
1141
- ];
1142
- },
1143
- {
1144
- kind: 'arg';
1145
- path: 'args.deposit_id';
1146
- }
1147
- ];
1148
- };
1149
1230
  },
1150
1231
  {
1151
1232
  name: 'mint';
@@ -2504,8 +2585,8 @@ export type TriadProtocol = {
2504
2585
  discriminator: [2, 86, 74, 29, 119, 7, 53, 82];
2505
2586
  },
2506
2587
  {
2507
- name: 'collectMarketFeeEvent';
2508
- discriminator: [210, 147, 203, 216, 158, 111, 59, 143];
2588
+ name: 'collectCustomerFeeEvent';
2589
+ discriminator: [0, 238, 156, 209, 108, 54, 154, 187];
2509
2590
  },
2510
2591
  {
2511
2592
  name: 'collectRewardsEvent';
@@ -3023,24 +3104,16 @@ export type TriadProtocol = {
3023
3104
  };
3024
3105
  },
3025
3106
  {
3026
- name: 'collectMarketFeeEvent';
3107
+ name: 'collectCustomerFeeEvent';
3027
3108
  type: {
3028
3109
  kind: 'struct';
3029
3110
  fields: [
3030
- {
3031
- name: 'marketId';
3032
- type: 'u64';
3033
- },
3034
- {
3035
- name: 'triadFee';
3036
- type: 'u64';
3037
- },
3038
3111
  {
3039
3112
  name: 'customerId';
3040
3113
  type: 'u16';
3041
3114
  },
3042
3115
  {
3043
- name: 'customerFee';
3116
+ name: 'fee';
3044
3117
  type: 'u64';
3045
3118
  },
3046
3119
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@triadxyz/triad-protocol",
3
- "version": "4.3.7",
3
+ "version": "4.3.9",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",