@triadxyz/triad-protocol 1.8.6-beta → 1.8.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.d.ts CHANGED
@@ -157,7 +157,7 @@ export default class Trade {
157
157
  * @param options - RPC options
158
158
  *
159
159
  */
160
- createMarket({ marketId, startTime, endTime, question, feeBps, customerId, payoutFee, mint }: CreateMarketArgs, options?: RpcOptions): Promise<string>;
160
+ createMarket({ marketId, startTime, endTime, question, feeBps, customer, payoutFee, mint }: CreateMarketArgs, options?: RpcOptions): Promise<string>;
161
161
  /**
162
162
  * Open Order
163
163
  * @param args.marketId - The ID of the Market
package/dist/trade.js CHANGED
@@ -119,15 +119,11 @@ class Trade {
119
119
  * @param options - RPC options
120
120
  *
121
121
  */
122
- createMarket({ marketId, startTime, endTime, question, feeBps, customerId, payoutFee, mint }, options) {
122
+ createMarket({ marketId, startTime, endTime, question, feeBps, customer, payoutFee, mint }, options) {
123
123
  return __awaiter(this, void 0, void 0, function* () {
124
124
  if (question.length > 80) {
125
125
  throw new Error('Question must be less than 80 characters');
126
126
  }
127
- let customerPDA = null;
128
- if (customerId) {
129
- customerPDA = (0, trade_2.getCustomerPDA)(this.program.programId, customerId);
130
- }
131
127
  return (0, sendTransactionWithOptions_1.default)(this.program.methods
132
128
  .createMarket({
133
129
  marketId: new bn_js_1.default(marketId),
@@ -141,7 +137,7 @@ class Trade {
141
137
  signer: this.provider.publicKey,
142
138
  mint,
143
139
  tokenProgram: (0, helpers_1.getTokenProgram)(mint),
144
- customer: customerPDA
140
+ customer
145
141
  }), options);
146
142
  });
147
143
  }
@@ -142,7 +142,7 @@ export type CreateMarketArgs = {
142
142
  endTime: number;
143
143
  question: string;
144
144
  feeBps: number;
145
- customerId: number | null;
145
+ customer: PublicKey | null;
146
146
  payoutFee: number;
147
147
  mint: PublicKey;
148
148
  };
@@ -1,5 +1,5 @@
1
1
  import { PublicKey } from '@solana/web3.js';
2
2
  export declare const getMarketPDA: (programId: PublicKey, marketId: number) => PublicKey;
3
- export declare const getCustomerPDA: (programId: PublicKey, marketId: number) => PublicKey;
3
+ export declare const getCustomerPDA: (programId: PublicKey, customerId: number) => PublicKey;
4
4
  export declare const getUserTradePDA: (programId: PublicKey, wallet: PublicKey) => PublicKey;
5
5
  export declare const getSubUserTradePDA: (programId: PublicKey, wallet: PublicKey, nonce: number) => PublicKey;
@@ -10,8 +10,8 @@ const getMarketPDA = (programId, marketId) => {
10
10
  return web3_js_1.PublicKey.findProgramAddressSync([Buffer.from('market'), new bn_js_1.default(marketId).toArrayLike(Buffer, 'le', 8)], programId)[0];
11
11
  };
12
12
  exports.getMarketPDA = getMarketPDA;
13
- const getCustomerPDA = (programId, marketId) => {
14
- return web3_js_1.PublicKey.findProgramAddressSync([Buffer.from('customer'), new bn_js_1.default(marketId).toArrayLike(Buffer, 'le', 8)], programId)[0];
13
+ const getCustomerPDA = (programId, customerId) => {
14
+ return web3_js_1.PublicKey.findProgramAddressSync([Buffer.from('customer'), new bn_js_1.default(customerId).toArrayLike(Buffer, 'le', 8)], programId)[0];
15
15
  };
16
16
  exports.getCustomerPDA = getCustomerPDA;
17
17
  const getUserTradePDA = (programId, wallet) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@triadxyz/triad-protocol",
3
- "version": "1.8.6-beta",
3
+ "version": "1.8.7-beta",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",