@triadxyz/triad-protocol 3.0.7-beta → 3.0.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 +1 -0
- package/dist/index.js +4 -4
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -496,8 +496,8 @@ class TriadProtocolClient {
|
|
|
496
496
|
payoutOrder(orders, options) {
|
|
497
497
|
return __awaiter(this, void 0, void 0, function* () {
|
|
498
498
|
const ixs = [];
|
|
499
|
-
if (orders.length >
|
|
500
|
-
throw new Error('Max
|
|
499
|
+
if (orders.length > 6) {
|
|
500
|
+
throw new Error('Max 6 orders per transaction');
|
|
501
501
|
}
|
|
502
502
|
for (const order of orders) {
|
|
503
503
|
ixs.push(yield this.program.methods
|
|
@@ -510,7 +510,7 @@ class TriadProtocolClient {
|
|
|
510
510
|
tokenProgram: (0, helpers_1.getTokenProgram)(order.mint)
|
|
511
511
|
})
|
|
512
512
|
.instruction());
|
|
513
|
-
if (order.isTrdPayout) {
|
|
513
|
+
if (order.isTrdPayout && order.isWinner) {
|
|
514
514
|
const { setupInstructions, swapIxs, addressLookupTableAccounts } = yield (0, swap_1.swap)({
|
|
515
515
|
connection: this.program.provider.connection,
|
|
516
516
|
wallet: this.program.provider.publicKey.toBase58(),
|
|
@@ -713,7 +713,7 @@ class TriadProtocolClient {
|
|
|
713
713
|
var _a;
|
|
714
714
|
return __awaiter(this, void 0, void 0, function* () {
|
|
715
715
|
const userOrders = yield this.getUserOrdersByMarketId(this.program.provider.publicKey, marketId);
|
|
716
|
-
const userNonce = (_a = userOrders.find((order) => order.orderDirection ===
|
|
716
|
+
const userNonce = (_a = userOrders.find((order) => order.orderDirection === direction &&
|
|
717
717
|
order.orderStatus === types_1.OrderStatus.OPEN)) === null || _a === void 0 ? void 0 : _a.userNonce;
|
|
718
718
|
let userTradePDA = null;
|
|
719
719
|
let userTradeIxs = [];
|