@triadxyz/triad-protocol 2.2.5-beta → 2.2.7-beta
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/trade.js
CHANGED
|
@@ -127,6 +127,11 @@ class Trade {
|
|
|
127
127
|
if (poolId) {
|
|
128
128
|
poolPDA = (0, pda_1.getPoolPDA)(this.program.programId, poolId);
|
|
129
129
|
}
|
|
130
|
+
let userTrade = null;
|
|
131
|
+
try {
|
|
132
|
+
userTrade = yield this.getUserTrade(this.program.provider.publicKey);
|
|
133
|
+
}
|
|
134
|
+
catch (_a) { }
|
|
130
135
|
ixs.push(yield this.program.methods
|
|
131
136
|
.createMarket({
|
|
132
137
|
marketId: new bn_js_1.default(marketId),
|
|
@@ -141,7 +146,8 @@ class Trade {
|
|
|
141
146
|
mint,
|
|
142
147
|
tokenProgram: (0, helpers_1.getTokenProgram)(mint),
|
|
143
148
|
customer,
|
|
144
|
-
pool: poolPDA
|
|
149
|
+
pool: poolPDA,
|
|
150
|
+
userTrade
|
|
145
151
|
})
|
|
146
152
|
.instruction());
|
|
147
153
|
return (0, sendVersionedTransaction_1.default)(this.program, ixs, options);
|
|
@@ -906,12 +906,17 @@
|
|
|
906
906
|
}
|
|
907
907
|
},
|
|
908
908
|
{
|
|
909
|
-
"name": "
|
|
909
|
+
"name": "trd_mint",
|
|
910
910
|
"writable": true,
|
|
911
911
|
"address": "t3DohmswhKk94PPbPYwA6ZKACyY3y5kbcqeQerAJjmV"
|
|
912
912
|
},
|
|
913
913
|
{
|
|
914
|
-
"name": "
|
|
914
|
+
"name": "event_mint",
|
|
915
|
+
"writable": true,
|
|
916
|
+
"address": "tCMraBSGHeMcQS76hNnBhnfbMzrtnnT3nbt3vAnSCE2"
|
|
917
|
+
},
|
|
918
|
+
{
|
|
919
|
+
"name": "signer_trd_ata",
|
|
915
920
|
"writable": true,
|
|
916
921
|
"pda": {
|
|
917
922
|
"seeds": [
|
|
@@ -925,7 +930,7 @@
|
|
|
925
930
|
},
|
|
926
931
|
{
|
|
927
932
|
"kind": "account",
|
|
928
|
-
"path": "
|
|
933
|
+
"path": "trd_mint"
|
|
929
934
|
}
|
|
930
935
|
],
|
|
931
936
|
"program": {
|
|
@@ -939,7 +944,7 @@
|
|
|
939
944
|
}
|
|
940
945
|
},
|
|
941
946
|
{
|
|
942
|
-
"name": "
|
|
947
|
+
"name": "chest_trd_ata",
|
|
943
948
|
"writable": true,
|
|
944
949
|
"pda": {
|
|
945
950
|
"seeds": [
|
|
@@ -953,7 +958,35 @@
|
|
|
953
958
|
},
|
|
954
959
|
{
|
|
955
960
|
"kind": "account",
|
|
956
|
-
"path": "
|
|
961
|
+
"path": "trd_mint"
|
|
962
|
+
}
|
|
963
|
+
],
|
|
964
|
+
"program": {
|
|
965
|
+
"kind": "const",
|
|
966
|
+
"value": [
|
|
967
|
+
140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142,
|
|
968
|
+
13, 131, 11, 90, 19, 153, 218, 255, 16, 132, 4, 142, 123, 216,
|
|
969
|
+
219, 233, 248, 89
|
|
970
|
+
]
|
|
971
|
+
}
|
|
972
|
+
}
|
|
973
|
+
},
|
|
974
|
+
{
|
|
975
|
+
"name": "chest_event_ata",
|
|
976
|
+
"writable": true,
|
|
977
|
+
"pda": {
|
|
978
|
+
"seeds": [
|
|
979
|
+
{
|
|
980
|
+
"kind": "account",
|
|
981
|
+
"path": "chest"
|
|
982
|
+
},
|
|
983
|
+
{
|
|
984
|
+
"kind": "account",
|
|
985
|
+
"path": "token_program"
|
|
986
|
+
},
|
|
987
|
+
{
|
|
988
|
+
"kind": "account",
|
|
989
|
+
"path": "event_mint"
|
|
957
990
|
}
|
|
958
991
|
],
|
|
959
992
|
"program": {
|
|
@@ -1050,6 +1083,11 @@
|
|
|
1050
1083
|
"writable": true,
|
|
1051
1084
|
"optional": true
|
|
1052
1085
|
},
|
|
1086
|
+
{
|
|
1087
|
+
"name": "user_trade",
|
|
1088
|
+
"writable": true,
|
|
1089
|
+
"optional": true
|
|
1090
|
+
},
|
|
1053
1091
|
{
|
|
1054
1092
|
"name": "pool",
|
|
1055
1093
|
"writable": true,
|
|
@@ -1388,12 +1388,17 @@ export type TriadProtocol = {
|
|
|
1388
1388
|
};
|
|
1389
1389
|
},
|
|
1390
1390
|
{
|
|
1391
|
-
name: '
|
|
1391
|
+
name: 'trdMint';
|
|
1392
1392
|
writable: true;
|
|
1393
1393
|
address: 't3DohmswhKk94PPbPYwA6ZKACyY3y5kbcqeQerAJjmV';
|
|
1394
1394
|
},
|
|
1395
1395
|
{
|
|
1396
|
-
name: '
|
|
1396
|
+
name: 'eventMint';
|
|
1397
|
+
writable: true;
|
|
1398
|
+
address: 'tCMraBSGHeMcQS76hNnBhnfbMzrtnnT3nbt3vAnSCE2';
|
|
1399
|
+
},
|
|
1400
|
+
{
|
|
1401
|
+
name: 'signerTrdAta';
|
|
1397
1402
|
writable: true;
|
|
1398
1403
|
pda: {
|
|
1399
1404
|
seeds: [
|
|
@@ -1407,7 +1412,7 @@ export type TriadProtocol = {
|
|
|
1407
1412
|
},
|
|
1408
1413
|
{
|
|
1409
1414
|
kind: 'account';
|
|
1410
|
-
path: '
|
|
1415
|
+
path: 'trdMint';
|
|
1411
1416
|
}
|
|
1412
1417
|
];
|
|
1413
1418
|
program: {
|
|
@@ -1450,7 +1455,7 @@ export type TriadProtocol = {
|
|
|
1450
1455
|
};
|
|
1451
1456
|
},
|
|
1452
1457
|
{
|
|
1453
|
-
name: '
|
|
1458
|
+
name: 'chestTrdAta';
|
|
1454
1459
|
writable: true;
|
|
1455
1460
|
pda: {
|
|
1456
1461
|
seeds: [
|
|
@@ -1464,7 +1469,64 @@ export type TriadProtocol = {
|
|
|
1464
1469
|
},
|
|
1465
1470
|
{
|
|
1466
1471
|
kind: 'account';
|
|
1467
|
-
path: '
|
|
1472
|
+
path: 'trdMint';
|
|
1473
|
+
}
|
|
1474
|
+
];
|
|
1475
|
+
program: {
|
|
1476
|
+
kind: 'const';
|
|
1477
|
+
value: [
|
|
1478
|
+
140,
|
|
1479
|
+
151,
|
|
1480
|
+
37,
|
|
1481
|
+
143,
|
|
1482
|
+
78,
|
|
1483
|
+
36,
|
|
1484
|
+
137,
|
|
1485
|
+
241,
|
|
1486
|
+
187,
|
|
1487
|
+
61,
|
|
1488
|
+
16,
|
|
1489
|
+
41,
|
|
1490
|
+
20,
|
|
1491
|
+
142,
|
|
1492
|
+
13,
|
|
1493
|
+
131,
|
|
1494
|
+
11,
|
|
1495
|
+
90,
|
|
1496
|
+
19,
|
|
1497
|
+
153,
|
|
1498
|
+
218,
|
|
1499
|
+
255,
|
|
1500
|
+
16,
|
|
1501
|
+
132,
|
|
1502
|
+
4,
|
|
1503
|
+
142,
|
|
1504
|
+
123,
|
|
1505
|
+
216,
|
|
1506
|
+
219,
|
|
1507
|
+
233,
|
|
1508
|
+
248,
|
|
1509
|
+
89
|
|
1510
|
+
];
|
|
1511
|
+
};
|
|
1512
|
+
};
|
|
1513
|
+
},
|
|
1514
|
+
{
|
|
1515
|
+
name: 'chestEventAta';
|
|
1516
|
+
writable: true;
|
|
1517
|
+
pda: {
|
|
1518
|
+
seeds: [
|
|
1519
|
+
{
|
|
1520
|
+
kind: 'account';
|
|
1521
|
+
path: 'chest';
|
|
1522
|
+
},
|
|
1523
|
+
{
|
|
1524
|
+
kind: 'account';
|
|
1525
|
+
path: 'tokenProgram';
|
|
1526
|
+
},
|
|
1527
|
+
{
|
|
1528
|
+
kind: 'account';
|
|
1529
|
+
path: 'eventMint';
|
|
1468
1530
|
}
|
|
1469
1531
|
];
|
|
1470
1532
|
program: {
|
|
@@ -1590,6 +1652,11 @@ export type TriadProtocol = {
|
|
|
1590
1652
|
writable: true;
|
|
1591
1653
|
optional: true;
|
|
1592
1654
|
},
|
|
1655
|
+
{
|
|
1656
|
+
name: 'userTrade';
|
|
1657
|
+
writable: true;
|
|
1658
|
+
optional: true;
|
|
1659
|
+
},
|
|
1593
1660
|
{
|
|
1594
1661
|
name: 'pool';
|
|
1595
1662
|
writable: true;
|