@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.mjs CHANGED
@@ -2108,7 +2108,7 @@ ${logs.join("\n")}`);
2108
2108
  * remaining_accounts per NO maker (6):
2109
2109
  * [maker, order_record, buyer_no_token, buyer_no_collateral, buyer_no_position, no_order_status]
2110
2110
  */
2111
- async _buildMintIx(yesSigned, noMakers, collateralMint, operator, payer) {
2111
+ async _buildMintIx(yesSigned, noMakers, collateralMint, operator, payer, opts) {
2112
2112
  const condition = yesSigned.order.condition;
2113
2113
  const taker = yesSigned.order.maker;
2114
2114
  const takerNonce = yesSigned.order.nonce;
@@ -2146,6 +2146,25 @@ ${logs.join("\n")}`);
2146
2146
  { pubkey: noStatus, isSigner: false, isWritable: true }
2147
2147
  );
2148
2148
  }
2149
+ if (yesSigned.order.fee.gtn(0) && this.programIds.feeManagement && this.feeConfigOwner) {
2150
+ const companyAddr = await this.companyAddress();
2151
+ const refVault = await this.referralVault();
2152
+ if (companyAddr && refVault) {
2153
+ const feeOverridePda = PDA.marketFeeOverride(condition, this.programIds)[0];
2154
+ const feeOverrideExists = await this.provider.connection.getAccountInfo(feeOverridePda);
2155
+ if (feeOverrideExists) {
2156
+ const oracleVault = opts?.marketOracleVault ?? await this.getMarketOracleVault(condition, collateralMint) ?? payer;
2157
+ remainingAccounts.push(
2158
+ { pubkey: this.programIds.feeManagement, isSigner: false, isWritable: false },
2159
+ { pubkey: PDA.feeConfig(this.feeConfigOwner, this.programIds)[0], isSigner: false, isWritable: false },
2160
+ { pubkey: feeOverridePda, isSigner: false, isWritable: false },
2161
+ { pubkey: getAssociatedTokenAddressSync(collateralMint, companyAddr), isSigner: false, isWritable: true },
2162
+ { pubkey: oracleVault, isSigner: false, isWritable: true },
2163
+ { pubkey: refVault, isSigner: false, isWritable: true }
2164
+ );
2165
+ }
2166
+ }
2167
+ }
2149
2168
  return this.program.methods.matchMintOrders(takerNonce, fillAmount, true).accounts({
2150
2169
  operator,
2151
2170
  payer,