@triadxyz/triad-protocol 1.1.5-beta → 1.1.6-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 +12 -0
- package/dist/trade.js +20 -0
- package/package.json +1 -1
package/dist/trade.d.ts
CHANGED
|
@@ -156,4 +156,16 @@ export default class Trade {
|
|
|
156
156
|
*
|
|
157
157
|
*/
|
|
158
158
|
resolveQuestion(marketId: number, options?: RpcOptions): Promise<string>;
|
|
159
|
+
/**
|
|
160
|
+
* Settle an order
|
|
161
|
+
* @param marketId - The ID of the market
|
|
162
|
+
* @param orderId - The ID of the order to settle
|
|
163
|
+
*
|
|
164
|
+
* @param options - RPC options
|
|
165
|
+
*
|
|
166
|
+
*/
|
|
167
|
+
settleOrder({ marketId, orderId }: {
|
|
168
|
+
marketId: number;
|
|
169
|
+
orderId: number;
|
|
170
|
+
}, options?: RpcOptions): Promise<string>;
|
|
159
171
|
}
|
package/dist/trade.js
CHANGED
|
@@ -200,5 +200,25 @@ class Trade {
|
|
|
200
200
|
return (0, sendTransactionWithOptions_1.default)(method, options);
|
|
201
201
|
});
|
|
202
202
|
}
|
|
203
|
+
/**
|
|
204
|
+
* Settle an order
|
|
205
|
+
* @param marketId - The ID of the market
|
|
206
|
+
* @param orderId - The ID of the order to settle
|
|
207
|
+
*
|
|
208
|
+
* @param options - RPC options
|
|
209
|
+
*
|
|
210
|
+
*/
|
|
211
|
+
settleOrder({ marketId, orderId }, options) {
|
|
212
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
213
|
+
const marketPDA = (0, trade_1.getMarketPDA)(this.program.programId, marketId);
|
|
214
|
+
const userTradePDA = (0, trade_1.getUserTradePDA)(this.program.programId, this.provider.publicKey);
|
|
215
|
+
return (0, sendTransactionWithOptions_1.default)(this.program.methods.settleOrder(new bn_js_1.default(orderId)).accounts({
|
|
216
|
+
signer: this.provider.publicKey,
|
|
217
|
+
userTrade: userTradePDA,
|
|
218
|
+
market: marketPDA,
|
|
219
|
+
mint: this.mint
|
|
220
|
+
}), options);
|
|
221
|
+
});
|
|
222
|
+
}
|
|
203
223
|
}
|
|
204
224
|
exports.default = Trade;
|