@odatano/core 1.8.0 → 1.9.0
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/@cds-models/CardanoODataService/index.d.ts +66 -42
- package/@cds-models/CardanoODataService/index.d.ts.map +1 -1
- package/@cds-models/CardanoODataService/index.js.map +1 -1
- package/@cds-models/CardanoODataService/index.ts +11 -7
- package/@cds-models/odatano/cardano/index.d.ts +70 -46
- package/@cds-models/odatano/cardano/index.d.ts.map +1 -1
- package/@cds-models/odatano/cardano/index.js +2 -2
- package/@cds-models/odatano/cardano/index.js.map +1 -1
- package/@cds-models/odatano/cardano/index.ts +13 -13
- package/db/schema.cds +18 -18
- package/db/types.cds +3 -3
- package/package.json +17 -2
- package/src/index.d.ts +29 -0
- package/src/index.js +1 -0
- package/src/plugin.d.ts +2 -0
- package/src/plugin.js +6 -0
- package/srv/blockchain/backends/blockfrost-backend.d.ts +155 -0
- package/srv/blockchain/backends/blockfrost-backend.js +19 -8
- package/srv/blockchain/backends/cardano-backend.d.ts +182 -0
- package/srv/blockchain/backends/koios-backend.d.ts +171 -0
- package/srv/blockchain/backends/koios-backend.js +69 -27
- package/srv/blockchain/backends/ogmios-backend.d.ts +188 -0
- package/srv/blockchain/backends/ogmios-backend.js +175 -108
- package/srv/blockchain/cardano-client.d.ts +279 -0
- package/srv/blockchain/cardano-client.js +134 -33
- package/srv/blockchain/cardano-indexer.d.ts +330 -0
- package/srv/blockchain/cardano-indexer.js +51 -8
- package/srv/blockchain/cardano-tx-builder.d.ts +113 -0
- package/srv/blockchain/cardano-tx-builder.js +61 -54
- package/srv/blockchain/circuit-breaker.d.ts +37 -0
- package/srv/blockchain/circuit-breaker.js +11 -2
- package/srv/blockchain/request-coalescer.d.ts +23 -0
- package/srv/blockchain/signing/external-signer.d.ts +146 -0
- package/srv/blockchain/signing/external-signer.js +23 -0
- package/srv/blockchain/signing/hsm-signer.d.ts +74 -0
- package/srv/blockchain/signing/hsm-signer.js +20 -5
- package/srv/blockchain/signing/signature-verifier.d.ts +56 -0
- package/srv/blockchain/signing/signature-verifier.js +11 -2
- package/srv/blockchain/transaction-building/buildooor-tx.d.ts +236 -0
- package/srv/blockchain/transaction-building/buildooor-tx.js +626 -187
- package/srv/blockchain/transaction-building/cardano-tx.d.ts +47 -0
- package/srv/cardano-service.cds +23 -3
- package/srv/cardano-service.d.ts +2 -0
- package/srv/cardano-service.js +25 -5
- package/srv/cardano-sign-service.d.ts +2 -0
- package/srv/cardano-sign-service.js +219 -131
- package/srv/cardano-tx-service.d.ts +12 -0
- package/srv/cardano-tx-service.js +152 -110
- package/srv/cbor/index.d.ts +2 -0
- package/srv/cbor/parse.d.ts +64 -0
- package/srv/server.d.ts +90 -0
- package/srv/server.js +27 -9
- package/srv/utils/backend-request-handler.d.ts +20 -0
- package/srv/utils/const.d.ts +183 -0
- package/srv/utils/const.js +13 -6
- package/srv/utils/error-codes.d.ts +79 -0
- package/srv/utils/errors.d.ts +259 -0
- package/srv/utils/errors.js +22 -7
- package/srv/utils/mappers.d.ts +260 -0
- package/srv/utils/mappers.js +34 -10
- package/srv/utils/plutus-placeholders.d.ts +35 -0
- package/srv/utils/plutus-placeholders.js +5 -15
- package/srv/utils/signing-helper.d.ts +23 -0
- package/srv/utils/signing-helper.js +5 -2
- package/srv/utils/tx-build-helper.d.ts +76 -0
- package/srv/utils/tx-build-helper.js +10 -37
- package/srv/utils/types.d.ts +653 -0
- package/srv/utils/validators.d.ts +145 -0
- package/srv/utils/validators.js +28 -1
- package/@cds-models/CardanoWatcherAdminService/index.js +0 -109
- package/@cds-models/CardanoWatcherAdminService/index.js.map +0 -1
- package/@cds-models/CardanoWatcherAdminService/index.ts +0 -263
- package/@cds-models/cds/outbox/index.js.map +0 -1
- package/@cds-models/cds/xt/MTXServices/index.js +0 -8
- package/@cds-models/cds/xt/MTXServices/index.js.map +0 -1
- package/@cds-models/cds/xt/MTXServices/index.ts +0 -4
- package/@cds-models/odatano/reeve/index.js +0 -77
- package/@cds-models/odatano/reeve/index.js.map +0 -1
- package/@cds-models/odatano/reeve/index.ts +0 -57
- package/@cds-models/odatano/transactions/index.js +0 -55
- package/@cds-models/odatano/transactions/index.js.map +0 -1
- package/@cds-models/odatano/transactions/index.ts +0 -18
- package/@cds-models/odatano/watch/index.js +0 -114
- package/@cds-models/odatano/watch/index.js.map +0 -1
- package/@cds-models/odatano/watch/index.ts +0 -110
- package/config/preview/cardano-node/alonzo-genesis.json +0 -196
- package/config/preview/cardano-node/byron-genesis.json +0 -117
- package/config/preview/cardano-node/config.json +0 -117
- package/config/preview/cardano-node/conway-genesis.json +0 -297
- package/config/preview/cardano-node/peer-snapshot.json +0 -890
- package/config/preview/cardano-node/shelley-genesis.json +0 -68
- package/config/preview/cardano-node/topology.json +0 -24
- package/output/sora/iter0_base.json +0 -32
- package/output/sora/iter0_base.mp4 +0 -0
- package/output/sora/logo_ref_1280x720.png +0 -0
- package/output/sora/odatano_full_logo_sky_ref_1280x720.png +0 -0
- package/output/sora/odatano_full_logo_transparent.png +0 -0
- package/output/sora/odatano_full_logo_transparent_dark.png +0 -0
- package/output/sora/odatano_full_logo_v4_8s.json +0 -32
- package/output/sora/odatano_full_logo_v4_8s.mp4 +0 -0
- package/output/sora/odatano_full_logo_v5_create.json +0 -15
- package/output/sora/odatano_full_logo_v5_fixes.json +0 -15
- package/output/sora/odatano_full_logo_v5_fixes.mp4 +0 -0
- package/output/sora/odatano_logo_v1.json +0 -32
- package/output/sora/odatano_logo_v1.mp4 +0 -0
- package/output/sora/odatano_o_only_clean.png +0 -0
- package/output/sora/odatano_o_sky_ref_1280x720.png +0 -0
- package/output/sora/odatano_o_sky_v2_8s.json +0 -32
- package/output/sora/odatano_o_sky_v2_8s.mp4 +0 -0
- package/output/sora/odatano_o_sky_v3_create.json +0 -15
- package/output/sora/odatano_o_sky_v3_splash_text.json +0 -15
- package/output/sora/odatano_o_sky_v3_splash_text.mp4 +0 -0
- package/output/sora/odatano_v6_composite_exact_logo.mp4 +0 -0
- package/output/sora/odatano_v6_composite_exact_logo_clean.mp4 +0 -0
- package/output/sora/odatano_v6_composite_exact_logo_final.mp4 +0 -0
- package/output/sora/odatano_v6_endframe.jpg +0 -0
- package/output/sora/odatano_v6_endframe_clean.jpg +0 -0
- package/output/sora/odatano_v6_endframe_final.jpg +0 -0
- package/output/sora/odatano_v7_1_earlylogo_fadeoldtext.mp4 +0 -0
- package/output/sora/odatano_v7_1_end.jpg +0 -0
- package/output/sora/odatano_v7_1_transition.jpg +0 -0
- package/output/sora/odatano_v7_2_original2d_keep_sky.mp4 +0 -0
- package/output/sora/odatano_v7_endframe_nobg.jpg +0 -0
- package/output/sora/odatano_v7_endframe_nobg_cleanend.jpg +0 -0
- package/output/sora/odatano_v7_spin_splash_logo_nobg.mp4 +0 -0
- package/output/sora/odatano_v7_spin_splash_logo_nobg_cleanend.mp4 +0 -0
- package/prod.mtaext +0 -17
- package/prod.mtaext.example +0 -27
- package/review.md +0 -42
- package/src/index.d.ts.map +0 -1
- package/src/index.js.map +0 -1
- package/src/plugin.d.ts.map +0 -1
- package/src/plugin.js.map +0 -1
- package/srv/blockchain/backends/blockfrost-backend.d.ts.map +0 -1
- package/srv/blockchain/backends/blockfrost-backend.js.map +0 -1
- package/srv/blockchain/backends/cardano-backend.d.ts.map +0 -1
- package/srv/blockchain/backends/cardano-backend.js.map +0 -1
- package/srv/blockchain/backends/koios-backend.d.ts.map +0 -1
- package/srv/blockchain/backends/koios-backend.js.map +0 -1
- package/srv/blockchain/backends/ogmios-backend.d.ts.map +0 -1
- package/srv/blockchain/backends/ogmios-backend.js.map +0 -1
- package/srv/blockchain/cardano-client.d.ts.map +0 -1
- package/srv/blockchain/cardano-client.js.map +0 -1
- package/srv/blockchain/cardano-indexer.d.ts.map +0 -1
- package/srv/blockchain/cardano-indexer.js.map +0 -1
- package/srv/blockchain/cardano-tx-builder.d.ts.map +0 -1
- package/srv/blockchain/cardano-tx-builder.js.map +0 -1
- package/srv/blockchain/circuit-breaker.d.ts.map +0 -1
- package/srv/blockchain/circuit-breaker.js.map +0 -1
- package/srv/blockchain/request-coalescer.d.ts.map +0 -1
- package/srv/blockchain/request-coalescer.js.map +0 -1
- package/srv/blockchain/signing/external-signer.d.ts.map +0 -1
- package/srv/blockchain/signing/external-signer.js.map +0 -1
- package/srv/blockchain/signing/hsm-signer.d.ts.map +0 -1
- package/srv/blockchain/signing/hsm-signer.js.map +0 -1
- package/srv/blockchain/signing/signature-verifier.d.ts.map +0 -1
- package/srv/blockchain/signing/signature-verifier.js.map +0 -1
- package/srv/blockchain/transaction-building/buildooor-tx.d.ts.map +0 -1
- package/srv/blockchain/transaction-building/buildooor-tx.js.map +0 -1
- package/srv/blockchain/transaction-building/cardano-tx.d.ts.map +0 -1
- package/srv/blockchain/transaction-building/cardano-tx.js.map +0 -1
- package/srv/cardano-service.d.ts.map +0 -1
- package/srv/cardano-service.js.map +0 -1
- package/srv/cardano-sign-service.d.ts.map +0 -1
- package/srv/cardano-sign-service.js.map +0 -1
- package/srv/cardano-tx-service.d.ts.map +0 -1
- package/srv/cardano-tx-service.js.map +0 -1
- package/srv/cbor/index.d.ts.map +0 -1
- package/srv/cbor/index.js.map +0 -1
- package/srv/cbor/parse.d.ts.map +0 -1
- package/srv/cbor/parse.js.map +0 -1
- package/srv/server.d.ts.map +0 -1
- package/srv/server.js.map +0 -1
- package/srv/utils/backend-request-handler.d.ts.map +0 -1
- package/srv/utils/backend-request-handler.js.map +0 -1
- package/srv/utils/const.d.ts.map +0 -1
- package/srv/utils/const.js.map +0 -1
- package/srv/utils/error-codes.d.ts.map +0 -1
- package/srv/utils/error-codes.js.map +0 -1
- package/srv/utils/errors.d.ts.map +0 -1
- package/srv/utils/errors.js.map +0 -1
- package/srv/utils/mappers.d.ts.map +0 -1
- package/srv/utils/mappers.js.map +0 -1
- package/srv/utils/plutus-placeholders.d.ts.map +0 -1
- package/srv/utils/plutus-placeholders.js.map +0 -1
- package/srv/utils/signing-helper.d.ts.map +0 -1
- package/srv/utils/signing-helper.js.map +0 -1
- package/srv/utils/tx-build-helper.d.ts.map +0 -1
- package/srv/utils/tx-build-helper.js.map +0 -1
- package/srv/utils/types.d.ts.map +0 -1
- package/srv/utils/types.js.map +0 -1
- package/srv/utils/validators.d.ts.map +0 -1
- package/srv/utils/validators.js.map +0 -1
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import type { CardanoTxBuilder } from "./cardano-tx";
|
|
2
|
+
import type { TxBuildRequest, TxBuildMintRequest, TxBuildPlutusSpendRequest, TxBuildContext, TxBuildResult, LedgerProtocolParameters } from "../../utils/types";
|
|
3
|
+
import { CardanoClient } from "../cardano-client";
|
|
4
|
+
/**
|
|
5
|
+
* BuildooorTxBuilder - Implementation of CardanoTxBuilder using Buildooor library
|
|
6
|
+
*/
|
|
7
|
+
export declare class BuildooorTxBuilder implements CardanoTxBuilder {
|
|
8
|
+
readonly name = "BuildooorTxBuilder";
|
|
9
|
+
private txBuilder;
|
|
10
|
+
private cardanoClient;
|
|
11
|
+
private genesisInfos;
|
|
12
|
+
private paramsFingerprint;
|
|
13
|
+
/**
|
|
14
|
+
* Initialize the builder
|
|
15
|
+
* @param client - The CardanoClient instance
|
|
16
|
+
* @param protocolParams - Optional protocol parameters (if not provided, fetched from backend)
|
|
17
|
+
*/
|
|
18
|
+
init(client: CardanoClient, protocolParams?: LedgerProtocolParameters): Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* Rebuild the TxBuilder when the per-request protocol parameters differ from
|
|
21
|
+
* the ones the current TxBuilder was constructed with. Buildooor's TxBuilder
|
|
22
|
+
* has no setter for protocol params, but its constructor is cheap, so we
|
|
23
|
+
* rebuild on change (effectively once per epoch) instead of staying frozen
|
|
24
|
+
* at init-time parameters for the process lifetime.
|
|
25
|
+
*/
|
|
26
|
+
private _ensureCurrentProtocolParameters;
|
|
27
|
+
private _applyProtocolParameters;
|
|
28
|
+
/**
|
|
29
|
+
* Build unsigned transfer transaction (ADA-only or with native assets).
|
|
30
|
+
*/
|
|
31
|
+
buildUnsignedTransfer(req: TxBuildRequest, ctx: TxBuildContext): Promise<TxBuildResult>;
|
|
32
|
+
/**
|
|
33
|
+
* Build unsigned transfer transaction with attached metadata.
|
|
34
|
+
*/
|
|
35
|
+
buildUnsignedTransactionWithMetadata(req: TxBuildRequest, ctx: TxBuildContext): Promise<TxBuildResult>;
|
|
36
|
+
/**
|
|
37
|
+
* Shared non-script transfer build. The two public entry points only differ in
|
|
38
|
+
* the optional pieces of the request they carry (assets/outputDatum on the
|
|
39
|
+
* plain-transfer path, metadataJson on the metadata path) — all handled here
|
|
40
|
+
* conditionally on the field being present, so behaviour matches both.
|
|
41
|
+
*/
|
|
42
|
+
private _buildSimpleTransfer;
|
|
43
|
+
buildUnsignedMintTransaction(req: TxBuildMintRequest, ctx: TxBuildContext): Promise<TxBuildResult>;
|
|
44
|
+
buildUnsignedPlutusSpendTransaction(req: TxBuildPlutusSpendRequest, ctx: TxBuildContext): Promise<TxBuildResult>;
|
|
45
|
+
/** Extract CBOR, hash, fee, size, inputs and outputs from a built Buildooor Tx */
|
|
46
|
+
private _extractTxDetails;
|
|
47
|
+
/** Build the standard TxBuildResult object */
|
|
48
|
+
private _buildResult;
|
|
49
|
+
/**
|
|
50
|
+
* Build a script-bearing transaction whose redeemers carry *real* execution units and
|
|
51
|
+
* whose fee covers them.
|
|
52
|
+
*
|
|
53
|
+
* Background (verified against the vendored Buildooor source): `initTxBuild` constructs
|
|
54
|
+
* every redeemer with a dummy budget — caller-supplied execution units in the build args
|
|
55
|
+
* are never read — and `onEvaluationResult` unconditionally stamps each redeemer with
|
|
56
|
+
* the budget the local CEK run consumed, even when the script failed (partial budget).
|
|
57
|
+
* So the declared units are whatever the *local* evaluation produced, and any cushion
|
|
58
|
+
* passed into the args silently evaporates. This method makes the declared units real:
|
|
59
|
+
*
|
|
60
|
+
* 1. First pass: build once; redeemers now carry the local CEK budgets.
|
|
61
|
+
* 2. Evaluate that CBOR via Ogmios (when configured) for authoritative per-redeemer
|
|
62
|
+
* budgets, cushioned by EXECUTION_UNIT_BUFFER / ABS_*_BUFFER.
|
|
63
|
+
* 3. Resolve target units per redeemer (Ogmios beats buffered-local; a local failure
|
|
64
|
+
* without an Ogmios result aborts — see makeScriptBuildOpts).
|
|
65
|
+
* 4. Second pass with a fee floor covering the target units (Buildooor prices the fee
|
|
66
|
+
* from its own local budgets, so the floor adds the price + encoding-size delta).
|
|
67
|
+
* 5. Stamp the target units into the redeemers and recompute scriptDataHash.
|
|
68
|
+
*/
|
|
69
|
+
private _buildScriptTx;
|
|
70
|
+
/**
|
|
71
|
+
* Evaluate a transaction via Ogmios and return cushioned budgets keyed per redeemer
|
|
72
|
+
* (`tag:index`). Returns undefined when the evaluation is unusable (transient backend
|
|
73
|
+
* failure, empty result) so callers fall back to buffered local units. A
|
|
74
|
+
* TransactionValidationError or ScriptValidationError from the evaluator is
|
|
75
|
+
* authoritative (the script really failed on the ledger) and is rethrown.
|
|
76
|
+
*/
|
|
77
|
+
private _evaluateExUnitsByRedeemer;
|
|
78
|
+
/**
|
|
79
|
+
* Combined cushion: relative multiplier catches proportional drift on large
|
|
80
|
+
* validators, absolute floor catches sub-percent drift on small ones (observed
|
|
81
|
+
* when metadata affects the real tx body vs the evaluator's ScriptContext).
|
|
82
|
+
*/
|
|
83
|
+
private _applyExUnitBuffer;
|
|
84
|
+
/**
|
|
85
|
+
* Decide the execution units each redeemer must declare.
|
|
86
|
+
* - Local run succeeded + Ogmios result → max of both (local is a real lower bound).
|
|
87
|
+
* - Local run succeeded, no Ogmios → buffered local (cushions local↔ledger drift).
|
|
88
|
+
* - Local run failed + Ogmios result → Ogmios (the local partial budget is meaningless).
|
|
89
|
+
* - Local run failed, no Ogmios → abort: declaring unreliable units would forfeit the
|
|
90
|
+
* collateral of whoever signs and submits the returned CBOR.
|
|
91
|
+
*/
|
|
92
|
+
private _resolveTargetExUnits;
|
|
93
|
+
/** Fee delta of the target vs local units, priced like Buildooor's own fee loop. */
|
|
94
|
+
private _exUnitsPriceDelta;
|
|
95
|
+
/** CBOR size growth (bytes) from stamping larger budgets into the redeemers. */
|
|
96
|
+
private _exUnitsSizeDelta;
|
|
97
|
+
private _txFeePerByte;
|
|
98
|
+
/**
|
|
99
|
+
* Replace the redeemers' execution units and recompute scriptDataHash.
|
|
100
|
+
*
|
|
101
|
+
* Not implemented via TxBuilder.overrideTxRedeemers: that method computes the script
|
|
102
|
+
* data hash from the OLD witness set (library bug), which would yield a phase-1
|
|
103
|
+
* rejection (PPViewHashesDontMatch). We rebuild the witness set first and hash it with
|
|
104
|
+
* the same exported getScriptDataHash + language views the build itself uses.
|
|
105
|
+
*/
|
|
106
|
+
private _stampExecUnits;
|
|
107
|
+
/**
|
|
108
|
+
* Language-view selection for scriptDataHash, mirroring Buildooor's initTxBuild
|
|
109
|
+
* (which flags the languages of *executed* scripts). This builder only attaches
|
|
110
|
+
* scripts inline, so the witness set carries every executed script.
|
|
111
|
+
*/
|
|
112
|
+
private _usedLanguageViewOpts;
|
|
113
|
+
/**
|
|
114
|
+
* Split UTxOs into forced inputs (must be consumed) and remaining candidates (free for
|
|
115
|
+
* coin selection / collateral). Refs in forceInputs that are not present in utxos are
|
|
116
|
+
* silently ignored — the resolver upstream has already validated existence.
|
|
117
|
+
*/
|
|
118
|
+
private _partitionForcedInputs;
|
|
119
|
+
/**
|
|
120
|
+
* Map resolved CIP-31 reference input UTxOs to Buildooor LedgerUTxO format.
|
|
121
|
+
* Returns empty array when no reference inputs are provided.
|
|
122
|
+
*/
|
|
123
|
+
private _mapReferenceInputs;
|
|
124
|
+
/**
|
|
125
|
+
* Build the Buildooor mint-entry array shared by the mint-only flow and the
|
|
126
|
+
* combined spend+mint flow (Buildooor ignores caller-supplied execution units;
|
|
127
|
+
* they are stamped into the redeemers post-build by _buildScriptTx).
|
|
128
|
+
*/
|
|
129
|
+
private _buildMintEntries;
|
|
130
|
+
/**
|
|
131
|
+
* Pick a collateral UTxO and return remaining funding UTxOs.
|
|
132
|
+
* Throws if no ADA-only UTxO is available.
|
|
133
|
+
*
|
|
134
|
+
* Selection: the SMALLEST ADA-only UTxO that still covers the static
|
|
135
|
+
* COLLATERAL_LOVELACE floor (5 ADA ≳ collateralPercentage × any realistic fee).
|
|
136
|
+
* The previous "first ADA-only" pick failed both ways: a dust UTxO below
|
|
137
|
+
* collateralPercentage × fee is rejected at submit, and a large UTxO is
|
|
138
|
+
* fully forfeited on phase-2 failure (Buildooor sets no collateralReturn
|
|
139
|
+
* for ADA-only collateral). Everything above the floor is therefore handed
|
|
140
|
+
* back via an explicit collateralReturn when the excess satisfies min-ADA.
|
|
141
|
+
*/
|
|
142
|
+
private _setupCollateral;
|
|
143
|
+
/** Build a Ledger Value from lovelace + optional multi-asset array */
|
|
144
|
+
private _buildLedgerValue;
|
|
145
|
+
/** Build a TxOut with optional inline datum and optional reference script (CIP-33) */
|
|
146
|
+
private _buildTxOut;
|
|
147
|
+
/**
|
|
148
|
+
* Parse a consumer-provided, CBOR-wrapped Plutus script and reject UPLC 1.0.0
|
|
149
|
+
* code (PlutusV1/V2). `Script.fromCbor` defaults to PlutusV3, so V1/V2 bytes
|
|
150
|
+
* would be hashed with the 0x03 prefix — a silently wrong script hash, i.e.
|
|
151
|
+
* wrong policy IDs and unspendable script addresses with no error anywhere
|
|
152
|
+
* down the line. The UPLC version is the first three flat-encoded naturals
|
|
153
|
+
* of the unwrapped script: [1,0,0] (V1/V2) vs [1,1,0] (V3).
|
|
154
|
+
*/
|
|
155
|
+
private _parsePlutusV3Script;
|
|
156
|
+
/** Parse a Plutus V3 CBOR hex into a Buildooor Script for refScript attachment. */
|
|
157
|
+
private _parseReferenceScript;
|
|
158
|
+
/**
|
|
159
|
+
* Map an input UTxO's scriptRef field to a Buildooor Script when possible.
|
|
160
|
+
* UTxO.scriptRef is overloaded across backends: Blockfrost/Ogmios set it to a 28-byte
|
|
161
|
+
* hash (56 hex chars), Koios sets it to the full CBOR script bytes. Only full bytes
|
|
162
|
+
* are usable here — hash-only entries are preserved only on-chain, not in local eval.
|
|
163
|
+
*/
|
|
164
|
+
private _buildInputRefScript;
|
|
165
|
+
/**
|
|
166
|
+
* Compute the post-sort input order so __INPUT_IDX__ placeholders (FR-3) resolve to the
|
|
167
|
+
* same indices Buildooor will assign during build(). Order: script-input first by convention,
|
|
168
|
+
* then forced + funding sorted lexicographically on (txHash, outputIndex).
|
|
169
|
+
* Buildooor sorts ALL inputs together; we mirror that exact behaviour via sortInputsLikeBuildooor.
|
|
170
|
+
*/
|
|
171
|
+
private _computeSortedInputs;
|
|
172
|
+
/** Extract InputRef list from the Buildooor-shaped funding inputs returned by keepRelevant. */
|
|
173
|
+
private _extractFundingRefs;
|
|
174
|
+
/**
|
|
175
|
+
* Resolve __INPUT_IDX__ placeholders (FR-3) inside each extraOutput.inlineDatum.
|
|
176
|
+
* Returns a new array with resolved datums; non-datum fields pass through unchanged.
|
|
177
|
+
*/
|
|
178
|
+
private _resolveExtraOutputPlaceholders;
|
|
179
|
+
/**
|
|
180
|
+
* Append parsed extraOutputs (FR-2) to the outputs array, enforcing min-ADA per entry.
|
|
181
|
+
* Throws TransactionValidationError with the required min-ADA in the message so consumers
|
|
182
|
+
* can adjust without having to inspect Buildooor internals.
|
|
183
|
+
*/
|
|
184
|
+
private _appendExtraOutputs;
|
|
185
|
+
/**
|
|
186
|
+
* Resolve the transaction's validity window (slots) from the request.
|
|
187
|
+
* Falls back to `now - 2 min` / `now + 1 h` when the request omits bounds.
|
|
188
|
+
* Script-validated builds must call this; plain transfers pass their own
|
|
189
|
+
* explicit bounds through (no defaulting) so replay behavior is opt-in.
|
|
190
|
+
*/
|
|
191
|
+
private _resolveValiditySlots;
|
|
192
|
+
/**
|
|
193
|
+
* Map ODATANO LedgerProtocolParameter to Buildooor's ProtocolParameters shape.
|
|
194
|
+
*
|
|
195
|
+
* Every field is null-guarded: a missing/null source value keeps the library
|
|
196
|
+
* default instead of degrading to 0 (`Number(null) === 0` previously set
|
|
197
|
+
* utxoCostPerByte = 0, disabling min-ADA checks entirely). Cost models and
|
|
198
|
+
* execution-unit prices are mapped because they feed the scriptDataHash
|
|
199
|
+
* (language views) and the fee/ExUnits math — stale defaults there cause
|
|
200
|
+
* PPViewHashesDontMatch or fee underestimation on-chain.
|
|
201
|
+
*/
|
|
202
|
+
private _mapLedgerParametersToBuildooorParams;
|
|
203
|
+
/**
|
|
204
|
+
* Parse the cost-models JSON blob (backend-normalized number arrays, keys
|
|
205
|
+
* 'PlutusV1'/'PlutusV2'/'PlutusV3' or Ogmios 'plutus:vN') into Buildooor's
|
|
206
|
+
* CostModels shape ('PlutusScriptVN' keys). Returns undefined when nothing
|
|
207
|
+
* usable is found, so the caller can keep defaults and warn.
|
|
208
|
+
*/
|
|
209
|
+
private _mapCostModels;
|
|
210
|
+
/**
|
|
211
|
+
* Map ODATANO UTxO to Ledger UTxO (ADA-only)
|
|
212
|
+
*/
|
|
213
|
+
private _mapOdatanoUtxoToLedgerUtxo;
|
|
214
|
+
/**
|
|
215
|
+
* Map ODATANO UTxO to Ledger UTxO (with multi-asset support)
|
|
216
|
+
*/
|
|
217
|
+
private _mapMultiAssetUtxoToLedgerUtxo;
|
|
218
|
+
/**
|
|
219
|
+
* Map ODATANO metadata JSON to Ledger TxMetadata
|
|
220
|
+
*/
|
|
221
|
+
private _mapOdatanoMetadataToLedgerMetadata;
|
|
222
|
+
/**
|
|
223
|
+
* Recursively convert JSON value to TxMetadatum.
|
|
224
|
+
*
|
|
225
|
+
* Ledger rules enforced here (instead of a node-side rejection or a raw 500):
|
|
226
|
+
* - numbers must be integers (BigInt(1.5) would throw a bare RangeError)
|
|
227
|
+
* - text and byte values are limited to 64 BYTES per metadatum — longer values
|
|
228
|
+
* are chunked into a list of ≤64-byte pieces (the established convention,
|
|
229
|
+
* e.g. CIP-25 long strings)
|
|
230
|
+
* - strings prefixed with "0x" (even hex length) become byte metadata
|
|
231
|
+
* - map keys are not auto-chunked (readers match on the literal key) — over-long
|
|
232
|
+
* keys are rejected with a clear 400
|
|
233
|
+
*/
|
|
234
|
+
private _jsonToTxMetadatum;
|
|
235
|
+
}
|
|
236
|
+
//# sourceMappingURL=buildooor-tx.d.ts.map
|