@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 +4 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
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,7 +2146,8 @@ ${logs.join("\n")}`);
|
|
|
2146
2146
|
{ pubkey: noStatus, isSigner: false, isWritable: true }
|
|
2147
2147
|
);
|
|
2148
2148
|
}
|
|
2149
|
-
|
|
2149
|
+
const hasFee = yesSigned.order.fee.gtn(0) || noMakers.some((m) => m.order.fee.gtn(0));
|
|
2150
|
+
if (hasFee && this.programIds.feeManagement && this.feeConfigOwner) {
|
|
2150
2151
|
const companyAddr = await this.companyAddress();
|
|
2151
2152
|
const refVault = await this.referralVault();
|
|
2152
2153
|
if (companyAddr && refVault) {
|
|
@@ -2165,7 +2166,6 @@ ${logs.join("\n")}`);
|
|
|
2165
2166
|
}
|
|
2166
2167
|
}
|
|
2167
2168
|
}
|
|
2168
|
-
const resolvedFeeRecipient = feeRecipient ?? clobUsdcAta;
|
|
2169
2169
|
return this.program.methods.matchMintOrders(takerNonce, fillAmount, true).accounts({
|
|
2170
2170
|
operator,
|
|
2171
2171
|
payer,
|
|
@@ -2177,7 +2177,6 @@ ${logs.join("\n")}`);
|
|
|
2177
2177
|
takerYesToken,
|
|
2178
2178
|
takerYesPosition,
|
|
2179
2179
|
takerOrderStatus,
|
|
2180
|
-
feeRecipient: resolvedFeeRecipient,
|
|
2181
2180
|
clobUsdcAta,
|
|
2182
2181
|
clobYesAta,
|
|
2183
2182
|
clobNoAta,
|
|
@@ -2207,7 +2206,7 @@ ${logs.join("\n")}`);
|
|
|
2207
2206
|
const [noMint] = PDA.noMint(condition, this.programIds);
|
|
2208
2207
|
const clobYesAta = getAssociatedTokenAddressSync(yesMint, clobConfig, true, TOKEN_PROGRAM_ID);
|
|
2209
2208
|
const clobNoAta = getAssociatedTokenAddressSync(noMint, clobConfig, true, TOKEN_PROGRAM_ID);
|
|
2210
|
-
const matchIx = await this._buildMintIx(yesSigned, noMakers, collateralMint, operatorWallet.publicKey, this.walletPubkey
|
|
2209
|
+
const matchIx = await this._buildMintIx(yesSigned, noMakers, collateralMint, operatorWallet.publicKey, this.walletPubkey);
|
|
2211
2210
|
await this._ensureClobOutcomeAtas(yesMint, noMint, clobConfig, clobYesAta, clobNoAta);
|
|
2212
2211
|
const sig = await this.sendMatchTx([matchIx], lookupTable, operatorWallet);
|
|
2213
2212
|
return { signature: sig };
|