@kaspacom/kcc20-tx-builder 0.8.0-fee.5 → 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.
- package/CHANGELOG.md +11 -0
- package/RELEASING.md +15 -0
- package/dist/cjs/engine.js +14 -4
- package/dist/cjs/engine.js.map +1 -1
- package/dist/cjs/operations.d.ts +1 -1
- package/dist/cjs/operations.js +2 -0
- package/dist/cjs/operations.js.map +1 -1
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +14 -4
- package/dist/engine.js.map +1 -1
- package/dist/operations.d.ts +1 -1
- package/dist/operations.d.ts.map +1 -1
- package/dist/operations.js +2 -0
- package/dist/operations.js.map +1 -1
- package/docs/COMPATIBILITY.json +1 -1
- package/package.json +1 -1
- package/src/engine.ts +15 -4
- package/src/operations.ts +2 -0
package/dist/operations.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const KCC20_BUILDER_KEYS: readonly ["kcc20.deploy-token", "kcc20.mint", "kcc20.set-public-mint-active", "kcc20.transfer", "kcc20.consolidate-holders", "kcc20.reveal-token", "kcc20wrapper.deploy-market", "kcc20wrapper.wrap", "kcc20wrapper.unwrap", "kcc20orderbook.create-bid", "kcc20orderbook.create-ask", "kcc20orderbook.fill-ask", "kcc20orderbook.fill-bid", "kcc20orderbook.sweep-asks", "kcc20orderbook.sweep-bids", "kcc20orderbook.consolidate-holders", "kcc20orderbook.cancel-ask", "kcc20orderbook.cancel-bid", "fee-ticket.deploy-root", "fee-ticket.update-denomination", "fee-ticket.create-from-utility-burn", "fee-ticket.burn", "fee-ticket.transfer", "kcc20fee.create-account", "kcc20fee.bind-account", "kcc20fee.deploy-market-genesis", "kcc20fee.bind-market", "kcc20fee.wrap", "kcc20fee.unwrap", "kcc20fee.create-ask", "kcc20fee.cancel-ask", "kcc20fee.create-bid", "kcc20fee.cancel-bid", "kcc20fee.buy-ask", "kcc20fee.buy-two-asks", "kcc20fee.claim", "kcc20fee.rotate-account", "kcc20-snapshot.deploy-bootstrap", "kcc20-snapshot.deploy-controller", "kcc20-snapshot.start", "kcc20-snapshot.claim"];
|
|
1
|
+
export declare const KCC20_BUILDER_KEYS: readonly ["kcc20.deploy-token", "kcc20.mint", "kcc20.set-public-mint-active", "kcc20.transfer", "kcc20.consolidate-holders", "kcc20.reveal-token", "kcc20wrapper.deploy-market", "kcc20wrapper.wrap", "kcc20wrapper.unwrap", "kcc20orderbook.create-bid", "kcc20orderbook.create-ask", "kcc20orderbook.fill-ask", "kcc20orderbook.fill-bid", "kcc20orderbook.sweep-asks", "kcc20orderbook.sweep-bids", "kcc20orderbook.consolidate-holders", "kcc20orderbook.cancel-ask", "kcc20orderbook.cancel-bid", "fee-ticket.deploy-root", "fee-ticket.update-denomination", "fee-ticket.create-from-utility-burn", "fee-ticket.burn", "fee-ticket.transfer", "kcc20fee.create-account", "kcc20fee.bind-account", "kcc20fee.deploy-market-genesis", "kcc20fee.bind-market", "kcc20fee.wrap", "kcc20fee.unwrap", "kcc20fee.merge-holders", "kcc20fee.create-ask", "kcc20fee.cancel-ask", "kcc20fee.create-bid", "kcc20fee.cancel-bid", "kcc20fee.buy-ask", "kcc20fee.buy-two-asks", "kcc20fee.sell-into-bids", "kcc20fee.claim", "kcc20fee.rotate-account", "kcc20-snapshot.deploy-bootstrap", "kcc20-snapshot.deploy-controller", "kcc20-snapshot.start", "kcc20-snapshot.claim"];
|
|
2
2
|
export type Kcc20BuilderKey = (typeof KCC20_BUILDER_KEYS)[number];
|
|
3
3
|
export declare function isKcc20BuilderKey(value: string): value is Kcc20BuilderKey;
|
|
4
4
|
export declare const BACKEND_ONLY_BUILDER_KEYS: readonly ["kcc20orderbook.matcher-settle-crossed"];
|
package/dist/operations.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../src/operations.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,
|
|
1
|
+
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../src/operations.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,ymCA4CrB,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAElE,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,eAAe,CAEzE;AAED,eAAO,MAAM,yBAAyB,oDAE5B,CAAC;AAEX,MAAM,MAAM,qBAAqB,GAAG,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE/E,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,qBAAqB,CAKhC"}
|
package/dist/operations.js
CHANGED
|
@@ -28,12 +28,14 @@ export const KCC20_BUILDER_KEYS = [
|
|
|
28
28
|
"kcc20fee.bind-market",
|
|
29
29
|
"kcc20fee.wrap",
|
|
30
30
|
"kcc20fee.unwrap",
|
|
31
|
+
"kcc20fee.merge-holders",
|
|
31
32
|
"kcc20fee.create-ask",
|
|
32
33
|
"kcc20fee.cancel-ask",
|
|
33
34
|
"kcc20fee.create-bid",
|
|
34
35
|
"kcc20fee.cancel-bid",
|
|
35
36
|
"kcc20fee.buy-ask",
|
|
36
37
|
"kcc20fee.buy-two-asks",
|
|
38
|
+
"kcc20fee.sell-into-bids",
|
|
37
39
|
"kcc20fee.claim",
|
|
38
40
|
"kcc20fee.rotate-account",
|
|
39
41
|
"kcc20-snapshot.deploy-bootstrap",
|
package/dist/operations.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operations.js","sourceRoot":"","sources":["../src/operations.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,oBAAoB;IACpB,YAAY;IACZ,8BAA8B;IAC9B,gBAAgB;IAChB,2BAA2B;IAC3B,oBAAoB;IACpB,4B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;IACxB,gCAAgC;IAChC,qCAAqC;IACrC,iBAAiB;IACjB,qBAAqB;IACrB,yBAAyB;IACzB,uBAAuB;IACvB,gCAAgC;IAChC,sBAAsB;IACtB,eAAe;IACf,iBAAiB;IACjB,wBAAwB;IACxB,qBAAqB;IACrB,qBAAqB;IACrB,qBAAqB;IACrB,qBAAqB;IACrB,kBAAkB;IAClB,uBAAuB;IACvB,yBAAyB;IACzB,gBAAgB;IAChB,yBAAyB;IACzB,iCAAiC;IACjC,kCAAkC;IAClC,sBAAsB;IACtB,sBAAsB;CACd,CAAC;AAIX,MAAM,UAAU,iBAAiB,CAAC,KAAa;IAC7C,OAAQ,kBAAwC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACnE,CAAC;AAED,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,uCAAuC;CAC/B,CAAC;AAIX,MAAM,UAAU,uBAAuB,CACrC,KAAc;IAEd,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACxB,yBAA+C,CAAC,QAAQ,CAAC,KAAK,CAAC,CACjE,CAAC;AACJ,CAAC"}
|
package/docs/COMPATIBILITY.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema": "kcc20-example-compatibility/v1",
|
|
3
|
-
"packageVersion": "0.8.0-fee.
|
|
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
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
|
-
//
|
|
5181
|
-
|
|
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:
|
|
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: { ...
|
|
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) });
|
package/src/operations.ts
CHANGED
|
@@ -28,12 +28,14 @@ export const KCC20_BUILDER_KEYS = [
|
|
|
28
28
|
"kcc20fee.bind-market",
|
|
29
29
|
"kcc20fee.wrap",
|
|
30
30
|
"kcc20fee.unwrap",
|
|
31
|
+
"kcc20fee.merge-holders",
|
|
31
32
|
"kcc20fee.create-ask",
|
|
32
33
|
"kcc20fee.cancel-ask",
|
|
33
34
|
"kcc20fee.create-bid",
|
|
34
35
|
"kcc20fee.cancel-bid",
|
|
35
36
|
"kcc20fee.buy-ask",
|
|
36
37
|
"kcc20fee.buy-two-asks",
|
|
38
|
+
"kcc20fee.sell-into-bids",
|
|
37
39
|
"kcc20fee.claim",
|
|
38
40
|
"kcc20fee.rotate-account",
|
|
39
41
|
"kcc20-snapshot.deploy-bootstrap",
|