@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 +1 -1
- package/dist/trade.js +2 -6
- package/dist/types/trade.d.ts +1 -1
- package/dist/utils/pda/trade.d.ts +1 -1
- package/dist/utils/pda/trade.js +2 -2
- package/package.json +1 -1
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,
|
|
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,
|
|
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
|
|
140
|
+
customer
|
|
145
141
|
}), options);
|
|
146
142
|
});
|
|
147
143
|
}
|
package/dist/types/trade.d.ts
CHANGED
|
@@ -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,
|
|
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;
|
package/dist/utils/pda/trade.js
CHANGED
|
@@ -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,
|
|
14
|
-
return web3_js_1.PublicKey.findProgramAddressSync([Buffer.from('customer'), new bn_js_1.default(
|
|
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) => {
|