@triadxyz/triad-protocol 2.5.8-beta → 2.6.0-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/index.d.ts +9 -1
- package/dist/index.js +23 -2
- package/dist/types/idl_triad_protocol.json +25 -56
- package/dist/types/index.d.ts +4 -1
- package/dist/types/triad_protocol.d.ts +25 -114
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Connection, PublicKey, TransactionInstruction } from '@solana/web3.js';
|
|
|
2
2
|
import { AnchorProvider, Program, Wallet } from '@coral-xyz/anchor';
|
|
3
3
|
import BN from 'bn.js';
|
|
4
4
|
import { TriadProtocol } from './types/triad_protocol';
|
|
5
|
-
import { CreateMarketArgs, OpenOrderArgs, UserTrade, CreateCustomerArgs, MarketBidOrderArgs, CancelBidOrderArgs, CancelAskOrderArgs, PlaceBidOrderArgs, PlaceAskOrderArgs, CreatePoolArgs, BookOrder, MarketAskOrderArgs, RpcOptions, CollectMarketFeeArgs } from './types';
|
|
5
|
+
import { CreateMarketArgs, OpenOrderArgs, UserTrade, CreateCustomerArgs, MarketBidOrderArgs, CancelBidOrderArgs, CancelAskOrderArgs, PlaceBidOrderArgs, PlaceAskOrderArgs, CreatePoolArgs, BookOrder, MarketAskOrderArgs, RpcOptions, CollectMarketFeeArgs, UpdateCustomerFeeArgs } from './types';
|
|
6
6
|
import Stake from './stake';
|
|
7
7
|
import Poseidon from './poseidon';
|
|
8
8
|
export * from './types';
|
|
@@ -455,4 +455,12 @@ export default class TriadProtocolClient {
|
|
|
455
455
|
* @param options - RPC options
|
|
456
456
|
*/
|
|
457
457
|
createRefer(options?: RpcOptions): Promise<string>;
|
|
458
|
+
/**
|
|
459
|
+
* Update Customer Fee
|
|
460
|
+
* @param feeBps - The fee in basis points
|
|
461
|
+
* @param wallet - The wallet of the customer to update the fee for
|
|
462
|
+
*
|
|
463
|
+
* @param options - RPC options
|
|
464
|
+
*/
|
|
465
|
+
updateCustomerFee({ feeBps, wallet }: UpdateCustomerFeeArgs, options?: RpcOptions): Promise<string>;
|
|
458
466
|
}
|
package/dist/index.js
CHANGED
|
@@ -259,8 +259,8 @@ class TriadProtocolClient {
|
|
|
259
259
|
.accounts({
|
|
260
260
|
signer: this.program.provider.publicKey,
|
|
261
261
|
tokenProgram: (0, helpers_1.getTokenProgram)(mint),
|
|
262
|
-
|
|
263
|
-
|
|
262
|
+
pool: poolPDA,
|
|
263
|
+
customer
|
|
264
264
|
})
|
|
265
265
|
.instruction());
|
|
266
266
|
ixs.push(yield this.program.methods
|
|
@@ -1021,5 +1021,26 @@ class TriadProtocolClient {
|
|
|
1021
1021
|
return (0, sendVersionedTransaction_1.default)(this.program, ixs, options);
|
|
1022
1022
|
});
|
|
1023
1023
|
}
|
|
1024
|
+
/**
|
|
1025
|
+
* Update Customer Fee
|
|
1026
|
+
* @param feeBps - The fee in basis points
|
|
1027
|
+
* @param wallet - The wallet of the customer to update the fee for
|
|
1028
|
+
*
|
|
1029
|
+
* @param options - RPC options
|
|
1030
|
+
*/
|
|
1031
|
+
updateCustomerFee({ feeBps, wallet }, options) {
|
|
1032
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1033
|
+
const ixs = [];
|
|
1034
|
+
const customer = yield this.getCustomerByWallet(wallet);
|
|
1035
|
+
ixs.push(yield this.program.methods
|
|
1036
|
+
.updateCustomerFee(feeBps)
|
|
1037
|
+
.accounts({
|
|
1038
|
+
signer: this.program.provider.publicKey,
|
|
1039
|
+
customer: customer.address
|
|
1040
|
+
})
|
|
1041
|
+
.instruction());
|
|
1042
|
+
return (0, sendVersionedTransaction_1.default)(this.program, ixs, options);
|
|
1043
|
+
});
|
|
1044
|
+
}
|
|
1024
1045
|
}
|
|
1025
1046
|
exports.default = TriadProtocolClient;
|
|
@@ -1091,34 +1091,6 @@
|
|
|
1091
1091
|
"name": "market_ata",
|
|
1092
1092
|
"writable": true
|
|
1093
1093
|
},
|
|
1094
|
-
{
|
|
1095
|
-
"name": "squads_ata",
|
|
1096
|
-
"writable": true,
|
|
1097
|
-
"pda": {
|
|
1098
|
-
"seeds": [
|
|
1099
|
-
{
|
|
1100
|
-
"kind": "account",
|
|
1101
|
-
"path": "squads"
|
|
1102
|
-
},
|
|
1103
|
-
{
|
|
1104
|
-
"kind": "account",
|
|
1105
|
-
"path": "token_program"
|
|
1106
|
-
},
|
|
1107
|
-
{
|
|
1108
|
-
"kind": "account",
|
|
1109
|
-
"path": "mint"
|
|
1110
|
-
}
|
|
1111
|
-
],
|
|
1112
|
-
"program": {
|
|
1113
|
-
"kind": "const",
|
|
1114
|
-
"value": [
|
|
1115
|
-
140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142,
|
|
1116
|
-
13, 131, 11, 90, 19, 153, 218, 255, 16, 132, 4, 142, 123, 216,
|
|
1117
|
-
219, 233, 248, 89
|
|
1118
|
-
]
|
|
1119
|
-
}
|
|
1120
|
-
}
|
|
1121
|
-
},
|
|
1122
1094
|
{
|
|
1123
1095
|
"name": "token_program"
|
|
1124
1096
|
},
|
|
@@ -1216,34 +1188,6 @@
|
|
|
1216
1188
|
"name": "market_ata",
|
|
1217
1189
|
"writable": true
|
|
1218
1190
|
},
|
|
1219
|
-
{
|
|
1220
|
-
"name": "squads_ata",
|
|
1221
|
-
"writable": true,
|
|
1222
|
-
"pda": {
|
|
1223
|
-
"seeds": [
|
|
1224
|
-
{
|
|
1225
|
-
"kind": "account",
|
|
1226
|
-
"path": "squads"
|
|
1227
|
-
},
|
|
1228
|
-
{
|
|
1229
|
-
"kind": "account",
|
|
1230
|
-
"path": "token_program"
|
|
1231
|
-
},
|
|
1232
|
-
{
|
|
1233
|
-
"kind": "account",
|
|
1234
|
-
"path": "mint"
|
|
1235
|
-
}
|
|
1236
|
-
],
|
|
1237
|
-
"program": {
|
|
1238
|
-
"kind": "const",
|
|
1239
|
-
"value": [
|
|
1240
|
-
140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142,
|
|
1241
|
-
13, 131, 11, 90, 19, 153, 218, 255, 16, 132, 4, 142, 123, 216,
|
|
1242
|
-
219, 233, 248, 89
|
|
1243
|
-
]
|
|
1244
|
-
}
|
|
1245
|
-
}
|
|
1246
|
-
},
|
|
1247
1191
|
{
|
|
1248
1192
|
"name": "token_program"
|
|
1249
1193
|
},
|
|
@@ -2009,6 +1953,31 @@
|
|
|
2009
1953
|
],
|
|
2010
1954
|
"args": []
|
|
2011
1955
|
},
|
|
1956
|
+
{
|
|
1957
|
+
"name": "update_customer_fee",
|
|
1958
|
+
"discriminator": [218, 240, 1, 38, 34, 166, 40, 25],
|
|
1959
|
+
"accounts": [
|
|
1960
|
+
{
|
|
1961
|
+
"name": "signer",
|
|
1962
|
+
"writable": true,
|
|
1963
|
+
"signer": true
|
|
1964
|
+
},
|
|
1965
|
+
{
|
|
1966
|
+
"name": "customer",
|
|
1967
|
+
"writable": true
|
|
1968
|
+
},
|
|
1969
|
+
{
|
|
1970
|
+
"name": "system_program",
|
|
1971
|
+
"address": "11111111111111111111111111111111"
|
|
1972
|
+
}
|
|
1973
|
+
],
|
|
1974
|
+
"args": [
|
|
1975
|
+
{
|
|
1976
|
+
"name": "fee_bps",
|
|
1977
|
+
"type": "u16"
|
|
1978
|
+
}
|
|
1979
|
+
]
|
|
1980
|
+
},
|
|
2012
1981
|
{
|
|
2013
1982
|
"name": "update_market",
|
|
2014
1983
|
"discriminator": [153, 39, 2, 197, 179, 50, 199, 217],
|
package/dist/types/index.d.ts
CHANGED
|
@@ -143,7 +143,6 @@ export type CreateCustomerArgs = {
|
|
|
143
143
|
name: string;
|
|
144
144
|
authority: PublicKey;
|
|
145
145
|
feeRecipient: PublicKey;
|
|
146
|
-
feeBps: number;
|
|
147
146
|
isStaked: boolean;
|
|
148
147
|
};
|
|
149
148
|
export type OpenOrderArgs = {
|
|
@@ -247,3 +246,7 @@ export type Customer = {
|
|
|
247
246
|
isVerified: boolean;
|
|
248
247
|
address: string;
|
|
249
248
|
};
|
|
249
|
+
export type UpdateCustomerFeeArgs = {
|
|
250
|
+
feeBps: number;
|
|
251
|
+
wallet: PublicKey;
|
|
252
|
+
};
|
|
@@ -1457,63 +1457,6 @@ export type TriadProtocol = {
|
|
|
1457
1457
|
name: 'marketAta';
|
|
1458
1458
|
writable: true;
|
|
1459
1459
|
},
|
|
1460
|
-
{
|
|
1461
|
-
name: 'squadsAta';
|
|
1462
|
-
writable: true;
|
|
1463
|
-
pda: {
|
|
1464
|
-
seeds: [
|
|
1465
|
-
{
|
|
1466
|
-
kind: 'account';
|
|
1467
|
-
path: 'squads';
|
|
1468
|
-
},
|
|
1469
|
-
{
|
|
1470
|
-
kind: 'account';
|
|
1471
|
-
path: 'tokenProgram';
|
|
1472
|
-
},
|
|
1473
|
-
{
|
|
1474
|
-
kind: 'account';
|
|
1475
|
-
path: 'mint';
|
|
1476
|
-
}
|
|
1477
|
-
];
|
|
1478
|
-
program: {
|
|
1479
|
-
kind: 'const';
|
|
1480
|
-
value: [
|
|
1481
|
-
140,
|
|
1482
|
-
151,
|
|
1483
|
-
37,
|
|
1484
|
-
143,
|
|
1485
|
-
78,
|
|
1486
|
-
36,
|
|
1487
|
-
137,
|
|
1488
|
-
241,
|
|
1489
|
-
187,
|
|
1490
|
-
61,
|
|
1491
|
-
16,
|
|
1492
|
-
41,
|
|
1493
|
-
20,
|
|
1494
|
-
142,
|
|
1495
|
-
13,
|
|
1496
|
-
131,
|
|
1497
|
-
11,
|
|
1498
|
-
90,
|
|
1499
|
-
19,
|
|
1500
|
-
153,
|
|
1501
|
-
218,
|
|
1502
|
-
255,
|
|
1503
|
-
16,
|
|
1504
|
-
132,
|
|
1505
|
-
4,
|
|
1506
|
-
142,
|
|
1507
|
-
123,
|
|
1508
|
-
216,
|
|
1509
|
-
219,
|
|
1510
|
-
233,
|
|
1511
|
-
248,
|
|
1512
|
-
89
|
|
1513
|
-
];
|
|
1514
|
-
};
|
|
1515
|
-
};
|
|
1516
|
-
},
|
|
1517
1460
|
{
|
|
1518
1461
|
name: 'tokenProgram';
|
|
1519
1462
|
},
|
|
@@ -1640,63 +1583,6 @@ export type TriadProtocol = {
|
|
|
1640
1583
|
name: 'marketAta';
|
|
1641
1584
|
writable: true;
|
|
1642
1585
|
},
|
|
1643
|
-
{
|
|
1644
|
-
name: 'squadsAta';
|
|
1645
|
-
writable: true;
|
|
1646
|
-
pda: {
|
|
1647
|
-
seeds: [
|
|
1648
|
-
{
|
|
1649
|
-
kind: 'account';
|
|
1650
|
-
path: 'squads';
|
|
1651
|
-
},
|
|
1652
|
-
{
|
|
1653
|
-
kind: 'account';
|
|
1654
|
-
path: 'tokenProgram';
|
|
1655
|
-
},
|
|
1656
|
-
{
|
|
1657
|
-
kind: 'account';
|
|
1658
|
-
path: 'mint';
|
|
1659
|
-
}
|
|
1660
|
-
];
|
|
1661
|
-
program: {
|
|
1662
|
-
kind: 'const';
|
|
1663
|
-
value: [
|
|
1664
|
-
140,
|
|
1665
|
-
151,
|
|
1666
|
-
37,
|
|
1667
|
-
143,
|
|
1668
|
-
78,
|
|
1669
|
-
36,
|
|
1670
|
-
137,
|
|
1671
|
-
241,
|
|
1672
|
-
187,
|
|
1673
|
-
61,
|
|
1674
|
-
16,
|
|
1675
|
-
41,
|
|
1676
|
-
20,
|
|
1677
|
-
142,
|
|
1678
|
-
13,
|
|
1679
|
-
131,
|
|
1680
|
-
11,
|
|
1681
|
-
90,
|
|
1682
|
-
19,
|
|
1683
|
-
153,
|
|
1684
|
-
218,
|
|
1685
|
-
255,
|
|
1686
|
-
16,
|
|
1687
|
-
132,
|
|
1688
|
-
4,
|
|
1689
|
-
142,
|
|
1690
|
-
123,
|
|
1691
|
-
216,
|
|
1692
|
-
219,
|
|
1693
|
-
233,
|
|
1694
|
-
248,
|
|
1695
|
-
89
|
|
1696
|
-
];
|
|
1697
|
-
};
|
|
1698
|
-
};
|
|
1699
|
-
},
|
|
1700
1586
|
{
|
|
1701
1587
|
name: 'tokenProgram';
|
|
1702
1588
|
},
|
|
@@ -2788,6 +2674,31 @@ export type TriadProtocol = {
|
|
|
2788
2674
|
];
|
|
2789
2675
|
args: [];
|
|
2790
2676
|
},
|
|
2677
|
+
{
|
|
2678
|
+
name: 'updateCustomerFee';
|
|
2679
|
+
discriminator: [218, 240, 1, 38, 34, 166, 40, 25];
|
|
2680
|
+
accounts: [
|
|
2681
|
+
{
|
|
2682
|
+
name: 'signer';
|
|
2683
|
+
writable: true;
|
|
2684
|
+
signer: true;
|
|
2685
|
+
},
|
|
2686
|
+
{
|
|
2687
|
+
name: 'customer';
|
|
2688
|
+
writable: true;
|
|
2689
|
+
},
|
|
2690
|
+
{
|
|
2691
|
+
name: 'systemProgram';
|
|
2692
|
+
address: '11111111111111111111111111111111';
|
|
2693
|
+
}
|
|
2694
|
+
];
|
|
2695
|
+
args: [
|
|
2696
|
+
{
|
|
2697
|
+
name: 'feeBps';
|
|
2698
|
+
type: 'u16';
|
|
2699
|
+
}
|
|
2700
|
+
];
|
|
2701
|
+
},
|
|
2791
2702
|
{
|
|
2792
2703
|
name: 'updateMarket';
|
|
2793
2704
|
discriminator: [153, 39, 2, 197, 179, 50, 199, 217];
|