@triadxyz/triad-protocol 2.6.7-beta → 2.6.8-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, UpdateCustomerFeeArgs } from './types';
5
+ import { CreateMarketArgs, OpenOrderArgs, UserTrade, CreateCustomerArgs, MarketBidOrderArgs, CancelBidOrderArgs, CancelAskOrderArgs, PlaceBidOrderArgs, PlaceAskOrderArgs, CreatePoolArgs, BookOrder, MarketAskOrderArgs, RpcOptions, UpdateCustomerFeeArgs } from './types';
6
6
  import Stake from './stake';
7
7
  import Poseidon from './poseidon';
8
8
  export * from './types';
@@ -436,18 +436,21 @@ export default class TriadProtocolClient {
436
436
  }>;
437
437
  /**
438
438
  * Collect Market Fee
439
- * @param marketId - The ID of the market
439
+ * @param args.markets - The markets to collect the fee from
440
440
  *
441
441
  * @param options - RPC options
442
442
  */
443
- collectMarketFee({ marketId, feeRecipient }: CollectMarketFeeArgs, options?: RpcOptions): Promise<string>;
443
+ collectMarketFee(markets: {
444
+ mint: PublicKey;
445
+ marketAddress: PublicKey;
446
+ }[], options?: RpcOptions): Promise<string>;
444
447
  /**
445
448
  * Close Order Book
446
449
  * @param marketId - The ID of the market
447
450
  *
448
451
  * @param options - RPC options
449
452
  */
450
- closeOrderBook(marketId: number, options?: RpcOptions): Promise<string>;
453
+ closeOrderBook(marketIds: number[], options?: RpcOptions): Promise<string>;
451
454
  /**
452
455
  * Create Refer
453
456
  * @param id - The ID of the refer
package/dist/index.js CHANGED
@@ -296,7 +296,8 @@ class TriadProtocolClient {
296
296
  isFast
297
297
  })
298
298
  .accounts({
299
- signer: this.program.provider.publicKey
299
+ signer: this.program.provider.publicKey,
300
+ customer
300
301
  })
301
302
  .instruction());
302
303
  for (const market of markets) {
@@ -967,21 +968,24 @@ class TriadProtocolClient {
967
968
  }
968
969
  /**
969
970
  * Collect Market Fee
970
- * @param marketId - The ID of the market
971
+ * @param args.markets - The markets to collect the fee from
971
972
  *
972
973
  * @param options - RPC options
973
974
  */
974
- collectMarketFee({ marketId, feeRecipient }, options) {
975
+ collectMarketFee(markets, options) {
975
976
  return __awaiter(this, void 0, void 0, function* () {
976
977
  const ixs = [];
977
- ixs.push(yield this.program.methods
978
- .collectMarketFee()
979
- .accounts({
980
- signer: this.program.provider.publicKey,
981
- market: (0, pda_1.getMarketPDA)(this.program.programId, marketId),
982
- mint: constants_1.TRD_MINT
983
- })
984
- .instruction());
978
+ for (const market of markets) {
979
+ ixs.push(yield this.program.methods
980
+ .collectMarketFee()
981
+ .accounts({
982
+ signer: this.program.provider.publicKey,
983
+ market: market.marketAddress,
984
+ mint: market.mint,
985
+ tokenProgram: (0, helpers_1.getTokenProgram)(market.mint)
986
+ })
987
+ .instruction());
988
+ }
985
989
  return (0, sendVersionedTransaction_1.default)(this.program, ixs, options);
986
990
  });
987
991
  }
@@ -991,17 +995,19 @@ class TriadProtocolClient {
991
995
  *
992
996
  * @param options - RPC options
993
997
  */
994
- closeOrderBook(marketId, options) {
998
+ closeOrderBook(marketIds, options) {
995
999
  return __awaiter(this, void 0, void 0, function* () {
996
1000
  const ixs = [];
997
- ixs.push(yield this.program.methods
998
- .closeOrderBook()
999
- .accounts({
1000
- signer: this.program.provider.publicKey,
1001
- market: (0, pda_1.getMarketPDA)(this.program.programId, marketId),
1002
- orderBook: (0, pda_1.getOrderBookPDA)(this.program.programId, marketId)
1003
- })
1004
- .instruction());
1001
+ for (const marketId of marketIds) {
1002
+ ixs.push(yield this.program.methods
1003
+ .closeOrderBook()
1004
+ .accounts({
1005
+ signer: this.program.provider.publicKey,
1006
+ market: (0, pda_1.getMarketPDA)(this.program.programId, marketId),
1007
+ orderBook: (0, pda_1.getOrderBookPDA)(this.program.programId, marketId)
1008
+ })
1009
+ .instruction());
1010
+ }
1005
1011
  return (0, sendVersionedTransaction_1.default)(this.program, ixs, options);
1006
1012
  });
1007
1013
  }
@@ -678,34 +678,6 @@
678
678
  }
679
679
  ]
680
680
  },
681
- {
682
- "name": "create_global",
683
- "discriminator": [84, 131, 250, 135, 241, 203, 79, 0],
684
- "accounts": [
685
- {
686
- "name": "signer",
687
- "writable": true,
688
- "signer": true
689
- },
690
- {
691
- "name": "global",
692
- "writable": true,
693
- "pda": {
694
- "seeds": [
695
- {
696
- "kind": "const",
697
- "value": [103, 108, 111, 98, 97, 108]
698
- }
699
- ]
700
- }
701
- },
702
- {
703
- "name": "system_program",
704
- "address": "11111111111111111111111111111111"
705
- }
706
- ],
707
- "args": []
708
- },
709
681
  {
710
682
  "name": "create_market",
711
683
  "discriminator": [103, 226, 97, 235, 200, 188, 251, 254],
@@ -227,10 +227,6 @@ export type MarketAskOrderArgs = {
227
227
  };
228
228
  mint: PublicKey;
229
229
  };
230
- export type CollectMarketFeeArgs = {
231
- marketId: number;
232
- feeRecipient: PublicKey;
233
- };
234
230
  export type Refer = {
235
231
  id: number;
236
232
  authority: string;
@@ -986,34 +986,6 @@ export type TriadProtocol = {
986
986
  }
987
987
  ];
988
988
  },
989
- {
990
- name: 'createGlobal';
991
- discriminator: [84, 131, 250, 135, 241, 203, 79, 0];
992
- accounts: [
993
- {
994
- name: 'signer';
995
- writable: true;
996
- signer: true;
997
- },
998
- {
999
- name: 'global';
1000
- writable: true;
1001
- pda: {
1002
- seeds: [
1003
- {
1004
- kind: 'const';
1005
- value: [103, 108, 111, 98, 97, 108];
1006
- }
1007
- ];
1008
- };
1009
- },
1010
- {
1011
- name: 'systemProgram';
1012
- address: '11111111111111111111111111111111';
1013
- }
1014
- ];
1015
- args: [];
1016
- },
1017
989
  {
1018
990
  name: 'createMarket';
1019
991
  discriminator: [103, 226, 97, 235, 200, 188, 251, 254];
@@ -1,5 +1,6 @@
1
1
  import { PublicKey } from '@solana/web3.js';
2
2
  export declare const TRD_DECIMALS = 6;
3
+ export declare const USDC_MINT: PublicKey;
3
4
  export declare const TRD_MINT: PublicKey;
4
5
  export declare const TRIAD_ADMIN: PublicKey;
5
6
  export declare const SOL_MINT: PublicKey;
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TICKET_COLLECTION_SYMBOL = exports.POSEIDON_CORE_COLLECTION = exports.POSEIDON_COLLECTION_SYMBOL = exports.TICKET_CORE_COLLECTION = exports.SOL_MINT = exports.TRIAD_ADMIN = exports.TRD_MINT = exports.TRD_DECIMALS = void 0;
3
+ exports.TICKET_COLLECTION_SYMBOL = exports.POSEIDON_CORE_COLLECTION = exports.POSEIDON_COLLECTION_SYMBOL = exports.TICKET_CORE_COLLECTION = exports.SOL_MINT = exports.TRIAD_ADMIN = exports.TRD_MINT = exports.USDC_MINT = exports.TRD_DECIMALS = void 0;
4
4
  const web3_js_1 = require("@solana/web3.js");
5
5
  exports.TRD_DECIMALS = 6;
6
+ exports.USDC_MINT = new web3_js_1.PublicKey('EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v');
6
7
  exports.TRD_MINT = new web3_js_1.PublicKey('t3DohmswhKk94PPbPYwA6ZKACyY3y5kbcqeQerAJjmV');
7
8
  exports.TRIAD_ADMIN = new web3_js_1.PublicKey('82ppCojm3yrEKgdpH8B5AmBJTU1r1uAWXFWhxvPs9UCR');
8
9
  exports.SOL_MINT = new web3_js_1.PublicKey('So11111111111111111111111111111111111111112');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@triadxyz/triad-protocol",
3
- "version": "2.6.7-beta",
3
+ "version": "2.6.8-beta",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",