@theliem/xmarket-sdk 4.2.0 → 4.2.2

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, feeRecipient, opts) {
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,7 +2172,8 @@ ${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) {
2175
+ const hasFee = yesSigned.order.fee.gtn(0) || noMakers.some((m) => m.order.fee.gtn(0));
2176
+ if (hasFee && this.programIds.feeManagement && this.feeConfigOwner) {
2176
2177
  const companyAddr = await this.companyAddress();
2177
2178
  const refVault = await this.referralVault();
2178
2179
  if (companyAddr && refVault) {
@@ -2191,7 +2192,6 @@ ${logs.join("\n")}`);
2191
2192
  }
2192
2193
  }
2193
2194
  }
2194
- const resolvedFeeRecipient = feeRecipient ?? clobUsdcAta;
2195
2195
  return this.program.methods.matchMintOrders(takerNonce, fillAmount, true).accounts({
2196
2196
  operator,
2197
2197
  payer,
@@ -2203,7 +2203,6 @@ ${logs.join("\n")}`);
2203
2203
  takerYesToken,
2204
2204
  takerYesPosition,
2205
2205
  takerOrderStatus,
2206
- feeRecipient: resolvedFeeRecipient,
2207
2206
  clobUsdcAta,
2208
2207
  clobYesAta,
2209
2208
  clobNoAta,
@@ -2233,7 +2232,7 @@ ${logs.join("\n")}`);
2233
2232
  const [noMint] = PDA.noMint(condition, this.programIds);
2234
2233
  const clobYesAta = splToken.getAssociatedTokenAddressSync(yesMint, clobConfig, true, splToken.TOKEN_PROGRAM_ID);
2235
2234
  const clobNoAta = splToken.getAssociatedTokenAddressSync(noMint, clobConfig, true, splToken.TOKEN_PROGRAM_ID);
2236
- const matchIx = await this._buildMintIx(yesSigned, noMakers, collateralMint, operatorWallet.publicKey, this.walletPubkey, _feeRecipient);
2235
+ const matchIx = await this._buildMintIx(yesSigned, noMakers, collateralMint, operatorWallet.publicKey, this.walletPubkey);
2237
2236
  await this._ensureClobOutcomeAtas(yesMint, noMint, clobConfig, clobYesAta, clobNoAta);
2238
2237
  const sig = await this.sendMatchTx([matchIx], lookupTable, operatorWallet);
2239
2238
  return { signature: sig };