@triadxyz/triad-protocol 3.3.9-beta → 3.4.0-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 -2
- package/dist/index.js +1 -17
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -398,9 +398,8 @@ export default class TriadProtocol {
|
|
|
398
398
|
* @param args.orders.bidOrderId - The ID of the Bid Order
|
|
399
399
|
* @param args.orders.userNonce - The nonce of the user
|
|
400
400
|
* @param args.orderDirection - The direction of the Order
|
|
401
|
-
* @param args.isTrdPayout - Whether to payout in TRD or not
|
|
402
401
|
*/
|
|
403
|
-
marketAskOrder({ marketId, orders, orderDirection
|
|
402
|
+
marketAskOrder({ marketId, orders, orderDirection }: MarketAskOrderArgs): Promise<string | import("@solana/web3.js").VersionedTransaction>;
|
|
404
403
|
/**
|
|
405
404
|
* Get Orders By Market ID
|
|
406
405
|
* @param marketId - Market ID
|
package/dist/index.js
CHANGED
|
@@ -1025,9 +1025,8 @@ class TriadProtocol {
|
|
|
1025
1025
|
* @param args.orders.bidOrderId - The ID of the Bid Order
|
|
1026
1026
|
* @param args.orders.userNonce - The nonce of the user
|
|
1027
1027
|
* @param args.orderDirection - The direction of the Order
|
|
1028
|
-
* @param args.isTrdPayout - Whether to payout in TRD or not
|
|
1029
1028
|
*/
|
|
1030
|
-
marketAskOrder({ marketId, orders, orderDirection
|
|
1029
|
+
marketAskOrder({ marketId, orders, orderDirection }) {
|
|
1031
1030
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1032
1031
|
const marketPDA = (0, pda_1.getMarketPDA)(this.program.programId, marketId);
|
|
1033
1032
|
const ixs = [];
|
|
@@ -1076,21 +1075,6 @@ class TriadProtocol {
|
|
|
1076
1075
|
.instruction());
|
|
1077
1076
|
}
|
|
1078
1077
|
}
|
|
1079
|
-
if (isTrdPayout) {
|
|
1080
|
-
const { setupInstructions, swapIxs, addressLookupTableAccounts: swapAddressLookupTableAccounts } = yield (0, swap_1.swap)({
|
|
1081
|
-
connection: this.program.provider.connection,
|
|
1082
|
-
wallet: this.program.provider.publicKey.toBase58(),
|
|
1083
|
-
inToken: constants_1.USDC_MINT.toBase58(),
|
|
1084
|
-
outToken: constants_1.TRD_MINT.toString(),
|
|
1085
|
-
amount: amountOfUSDC.toNumber() / Math.pow(10, 6),
|
|
1086
|
-
payer: this.rpcOptions.payer.toBase58()
|
|
1087
|
-
});
|
|
1088
|
-
if (swapIxs.length > 0) {
|
|
1089
|
-
ixs.push(...setupInstructions);
|
|
1090
|
-
ixs.push(...swapIxs);
|
|
1091
|
-
addressLookupTableAccounts.push(...swapAddressLookupTableAccounts);
|
|
1092
|
-
}
|
|
1093
|
-
}
|
|
1094
1078
|
if (ixs.length === 0) {
|
|
1095
1079
|
throw new Error('No matching orders found to fill the requested amount');
|
|
1096
1080
|
}
|