@kaspacom/kcc20-tx-builder 0.8.0-fee.6 → 0.8.0-fee.7

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schema": "kcc20-example-compatibility/v1",
3
- "packageVersion": "0.8.0-fee.6",
3
+ "packageVersion": "0.8.0-fee.7",
4
4
  "contractsRepository": "https://github.com/KASPACOM/kaspa-covenants",
5
5
  "contractsCommit": "5deb1769e69142595576ef7c573af9f433a48a3c",
6
6
  "compiler": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kaspacom/kcc20-tx-builder",
3
- "version": "0.8.0-fee.6",
3
+ "version": "0.8.0-fee.7",
4
4
  "description": "Runtime-independent KCC20 covenant transaction and PSKT construction primitives.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "KaspaCom",
package/src/engine.ts CHANGED
@@ -5177,8 +5177,9 @@ export function createKcc20PsktBuilderEngine(
5177
5177
  return { schema: OUTPUT_SCHEMA,
5178
5178
  psktTransactionJson: feeResult.transaction.serializeToSafeJSON(),
5179
5179
  signInputs: [{ index: fundingInputIndex, sighashType: 1 }], scripts,
5180
- // Follower input 1 has a 600-unit budget without constrained consensus proof.
5181
- submitTransactionSupported: false,
5180
+ // The pinned two-ask follower and optional ticket budgets passed the
5181
+ // signed consensus proof in kaspa-covenants PR #718.
5182
+ submitTransactionSupported: true,
5182
5183
  metadata: { builderKey: "kcc20fee.buy-two-asks",
5183
5184
  operation: "fee-market-buy-two-asks", network, walletAddress,
5184
5185
  tokenId, marketId, policyId, fillCount: 2,
@@ -5305,14 +5306,24 @@ export function createKcc20PsktBuilderEngine(
5305
5306
  String(utxo.state.wrapper_spk_hash).toLowerCase() !== holderPlan.wrapper.scriptHash) {
5306
5307
  throw new Error(`bid ${slot} differs from fixed market policy`);
5307
5308
  }
5309
+ // The indexer adds policy summary fields for API consumers. They are not
5310
+ // part of the on-chain bid state and must not enter script reconstruction.
5311
+ const { creatorFeeBps: indexedCreatorFeeBps,
5312
+ feePolicyVersion: indexedFeePolicyVersion, ...bidState } = utxo.state;
5313
+ if ((indexedCreatorFeeBps !== undefined &&
5314
+ Number(indexedCreatorFeeBps) !== params.feePolicy.creatorFeeBps) ||
5315
+ (indexedFeePolicyVersion !== undefined &&
5316
+ Number(indexedFeePolicyVersion) !== params.feePolicy.version)) {
5317
+ throw new Error(`bid ${slot} indexed policy summary differs from fixed policy`);
5318
+ }
5308
5319
  const bidScript = buildKcc20FeeMarketRoleScript({ artifact: artifacts.bid,
5309
- role: "bid", state: utxo.state });
5320
+ role: "bid", state: bidState });
5310
5321
  const buyerPlan = prepareKcc20FeeMarketWrappedHolder({ ...base,
5311
5322
  recipientOwner: buyer, recipientOwnerScheme: scheme,
5312
5323
  recipientPayoutScriptHash: payoutHash, tokenAmount: fill });
5313
5324
  const continuation = remaining > 0n
5314
5325
  ? buildKcc20FeeMarketRoleScript({ artifact: artifacts.bid,
5315
- role: "bid", state: { ...utxo.state, amount: remaining.toString() } })
5326
+ role: "bid", state: { ...bidState, amount: remaining.toString() } })
5316
5327
  : null;
5317
5328
  const fee = calculateKcc20EscrowFees({ grossSompi: gross,
5318
5329
  creatorFeeBps: params.feePolicy.creatorFeeBps, protocolWaived: Boolean(ticket) });