@theliem/xmarket-sdk 4.1.2 → 4.2.1

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.js CHANGED
@@ -2134,7 +2134,7 @@ ${logs.join("\n")}`);
2134
2134
  * remaining_accounts per NO maker (6):
2135
2135
  * [maker, order_record, buyer_no_token, buyer_no_collateral, buyer_no_position, no_order_status]
2136
2136
  */
2137
- async _buildMintIx(yesSigned, noMakers, collateralMint, operator, payer) {
2137
+ async _buildMintIx(yesSigned, noMakers, collateralMint, operator, payer, opts) {
2138
2138
  const condition = yesSigned.order.condition;
2139
2139
  const taker = yesSigned.order.maker;
2140
2140
  const takerNonce = yesSigned.order.nonce;
@@ -2172,6 +2172,25 @@ ${logs.join("\n")}`);
2172
2172
  { pubkey: noStatus, isSigner: false, isWritable: true }
2173
2173
  );
2174
2174
  }
2175
+ if (yesSigned.order.fee.gtn(0) && this.programIds.feeManagement && this.feeConfigOwner) {
2176
+ const companyAddr = await this.companyAddress();
2177
+ const refVault = await this.referralVault();
2178
+ if (companyAddr && refVault) {
2179
+ const feeOverridePda = PDA.marketFeeOverride(condition, this.programIds)[0];
2180
+ const feeOverrideExists = await this.provider.connection.getAccountInfo(feeOverridePda);
2181
+ if (feeOverrideExists) {
2182
+ const oracleVault = opts?.marketOracleVault ?? await this.getMarketOracleVault(condition, collateralMint) ?? payer;
2183
+ remainingAccounts.push(
2184
+ { pubkey: this.programIds.feeManagement, isSigner: false, isWritable: false },
2185
+ { pubkey: PDA.feeConfig(this.feeConfigOwner, this.programIds)[0], isSigner: false, isWritable: false },
2186
+ { pubkey: feeOverridePda, isSigner: false, isWritable: false },
2187
+ { pubkey: splToken.getAssociatedTokenAddressSync(collateralMint, companyAddr), isSigner: false, isWritable: true },
2188
+ { pubkey: oracleVault, isSigner: false, isWritable: true },
2189
+ { pubkey: refVault, isSigner: false, isWritable: true }
2190
+ );
2191
+ }
2192
+ }
2193
+ }
2175
2194
  return this.program.methods.matchMintOrders(takerNonce, fillAmount, true).accounts({
2176
2195
  operator,
2177
2196
  payer,