@triadxyz/triad-protocol 2.5.8-beta → 2.5.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, 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
- customer,
263
- pool: poolPDA
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;
@@ -2009,6 +2009,31 @@
2009
2009
  ],
2010
2010
  "args": []
2011
2011
  },
2012
+ {
2013
+ "name": "update_customer_fee",
2014
+ "discriminator": [218, 240, 1, 38, 34, 166, 40, 25],
2015
+ "accounts": [
2016
+ {
2017
+ "name": "signer",
2018
+ "writable": true,
2019
+ "signer": true
2020
+ },
2021
+ {
2022
+ "name": "customer",
2023
+ "writable": true
2024
+ },
2025
+ {
2026
+ "name": "system_program",
2027
+ "address": "11111111111111111111111111111111"
2028
+ }
2029
+ ],
2030
+ "args": [
2031
+ {
2032
+ "name": "fee_bps",
2033
+ "type": "u16"
2034
+ }
2035
+ ]
2036
+ },
2012
2037
  {
2013
2038
  "name": "update_market",
2014
2039
  "discriminator": [153, 39, 2, 197, 179, 50, 199, 217],
@@ -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
+ };
@@ -2788,6 +2788,31 @@ export type TriadProtocol = {
2788
2788
  ];
2789
2789
  args: [];
2790
2790
  },
2791
+ {
2792
+ name: 'updateCustomerFee';
2793
+ discriminator: [218, 240, 1, 38, 34, 166, 40, 25];
2794
+ accounts: [
2795
+ {
2796
+ name: 'signer';
2797
+ writable: true;
2798
+ signer: true;
2799
+ },
2800
+ {
2801
+ name: 'customer';
2802
+ writable: true;
2803
+ },
2804
+ {
2805
+ name: 'systemProgram';
2806
+ address: '11111111111111111111111111111111';
2807
+ }
2808
+ ];
2809
+ args: [
2810
+ {
2811
+ name: 'feeBps';
2812
+ type: 'u16';
2813
+ }
2814
+ ];
2815
+ },
2791
2816
  {
2792
2817
  name: 'updateMarket';
2793
2818
  discriminator: [153, 39, 2, 197, 179, 50, 199, 217];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@triadxyz/triad-protocol",
3
- "version": "2.5.8-beta",
3
+ "version": "2.5.9-beta",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",