@triadxyz/triad-protocol 2.3.8-beta → 2.3.9-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
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 } from './types';
|
|
5
|
+
import { CreateMarketArgs, OpenOrderArgs, UserTrade, CreateCustomerArgs, MarketBidOrderArgs, CancelBidOrderArgs, CancelAskOrderArgs, PlaceBidOrderArgs, PlaceAskOrderArgs, CreatePoolArgs, BookOrder, MarketAskOrderArgs, RpcOptions, CollectMarketFeeArgs } from './types';
|
|
6
6
|
import Stake from './stake';
|
|
7
7
|
import Poseidon from './poseidon';
|
|
8
8
|
export default class TriadProtocolClient {
|
|
@@ -409,5 +409,5 @@ export default class TriadProtocolClient {
|
|
|
409
409
|
*
|
|
410
410
|
* @param options - RPC options
|
|
411
411
|
*/
|
|
412
|
-
collectMarketFee(marketId:
|
|
412
|
+
collectMarketFee({ marketId, feeRecipient }: CollectMarketFeeArgs, options?: RpcOptions): Promise<string>;
|
|
413
413
|
}
|
package/dist/index.js
CHANGED
|
@@ -871,6 +871,8 @@ class TriadProtocolClient {
|
|
|
871
871
|
data.spreadToReward = orderBook.spreadToReward.toString();
|
|
872
872
|
const processOrders = (orders, side) => {
|
|
873
873
|
for (const order of orders) {
|
|
874
|
+
if (order.price.eq(new bn_js_1.default(0)))
|
|
875
|
+
continue;
|
|
874
876
|
if ((0, helpers_1.getOrderSideFromNumber)(order.orderSide) === types_1.OrderSide.BID) {
|
|
875
877
|
data[side].bid.push((0, helpers_1.formatBookOrder)(order));
|
|
876
878
|
}
|
|
@@ -890,7 +892,7 @@ class TriadProtocolClient {
|
|
|
890
892
|
*
|
|
891
893
|
* @param options - RPC options
|
|
892
894
|
*/
|
|
893
|
-
collectMarketFee(marketId, options) {
|
|
895
|
+
collectMarketFee({ marketId, feeRecipient }, options) {
|
|
894
896
|
return __awaiter(this, void 0, void 0, function* () {
|
|
895
897
|
const ixs = [];
|
|
896
898
|
ixs.push(yield this.program.methods
|
|
@@ -898,6 +900,7 @@ class TriadProtocolClient {
|
|
|
898
900
|
.accounts({
|
|
899
901
|
signer: this.program.provider.publicKey,
|
|
900
902
|
market: (0, pda_1.getMarketPDA)(this.program.programId, marketId),
|
|
903
|
+
feeRecipient,
|
|
901
904
|
mint: constants_1.TRD_MINT
|
|
902
905
|
})
|
|
903
906
|
.instruction());
|
|
@@ -404,9 +404,8 @@
|
|
|
404
404
|
"signer": true
|
|
405
405
|
},
|
|
406
406
|
{
|
|
407
|
-
"name": "
|
|
408
|
-
"writable": true
|
|
409
|
-
"address": "6fcSf6qfwPNR9AUUNC1UWYZDy5cQ4TzTb2aaipN2zFdq"
|
|
407
|
+
"name": "fee_recipient",
|
|
408
|
+
"writable": true
|
|
410
409
|
},
|
|
411
410
|
{
|
|
412
411
|
"name": "market",
|
|
@@ -451,7 +450,7 @@
|
|
|
451
450
|
"seeds": [
|
|
452
451
|
{
|
|
453
452
|
"kind": "account",
|
|
454
|
-
"path": "
|
|
453
|
+
"path": "fee_recipient"
|
|
455
454
|
},
|
|
456
455
|
{
|
|
457
456
|
"kind": "account",
|
package/dist/types/index.d.ts
CHANGED
|
@@ -596,9 +596,8 @@ export type TriadProtocol = {
|
|
|
596
596
|
signer: true;
|
|
597
597
|
},
|
|
598
598
|
{
|
|
599
|
-
name: '
|
|
599
|
+
name: 'feeRecipient';
|
|
600
600
|
writable: true;
|
|
601
|
-
address: '6fcSf6qfwPNR9AUUNC1UWYZDy5cQ4TzTb2aaipN2zFdq';
|
|
602
601
|
},
|
|
603
602
|
{
|
|
604
603
|
name: 'market';
|
|
@@ -672,7 +671,7 @@ export type TriadProtocol = {
|
|
|
672
671
|
seeds: [
|
|
673
672
|
{
|
|
674
673
|
kind: 'account';
|
|
675
|
-
path: '
|
|
674
|
+
path: 'feeRecipient';
|
|
676
675
|
},
|
|
677
676
|
{
|
|
678
677
|
kind: 'account';
|