@laceio/sdk 0.1.2-canary.0 → 0.1.2-canary.1
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/{TransactionBuilder-CCjOn7NA.cjs → TransactionBuilder-X1H9Gze6.cjs} +22 -14
- package/dist/{TransactionBuilder-CIzdw18M.js → TransactionBuilder-bp2aMDhg.js} +22 -14
- package/dist/cardano.cjs +1 -1
- package/dist/cardano.d.ts +11 -5
- package/dist/cardano.js +1 -1
- package/dist/{delegation-tx-builder-CCjiakoy.cjs → delegation-tx-builder-Dof_0N_d.cjs} +1 -1
- package/dist/{delegation-tx-builder-DZFjHDS8.js → delegation-tx-builder-Dy3-2Auz.js} +1 -1
- package/dist/{deregistration-tx-builder-CQP35yex.cjs → deregistration-tx-builder-CcLwyFpj.cjs} +1 -1
- package/dist/{deregistration-tx-builder-Bf6xAYp4.js → deregistration-tx-builder-QkWW_gWl.js} +1 -1
- package/dist/{earn-rewards-tx-builder-GuxofYns.cjs → earn-rewards-tx-builder-BP5JMIKS.cjs} +1 -1
- package/dist/{earn-rewards-tx-builder-Bsga3yFb.js → earn-rewards-tx-builder-Cku4BmNU.js} +1 -1
- package/dist/experimental.cjs +3 -3
- package/dist/experimental.d.ts +11 -5
- package/dist/experimental.js +3 -3
- package/dist/index.cjs +2 -2
- package/dist/index.d.ts +11 -5
- package/dist/index.js +2 -2
- package/dist/{init-CuW7rHNA.js → init-C5mYyFTv.js} +1 -1
- package/dist/{init-DrRdf5sZ.cjs → init-Clu8pxwQ.cjs} +9 -4
- package/dist/{init-Cz0rz5fU.cjs → init-DRzJR02G.cjs} +1 -1
- package/dist/{init-8v_n8boO.js → init-qSEd_Spq.js} +10 -5
- package/dist/{modules-cardano-BYeYHrRm.cjs → modules-cardano-D9Gs2j60.cjs} +6 -6
- package/dist/{modules-cardano-B1nDUWqy.js → modules-cardano-VIM8fKu-.js} +6 -6
- package/dist/{vote-delegation-tx-builder-C6FiS7zI.js → vote-delegation-tx-builder-BsBSDmcX.js} +1 -1
- package/dist/{vote-delegation-tx-builder-BUg1S2Ep.cjs → vote-delegation-tx-builder-DSs8nybk.cjs} +1 -1
- package/package.json +1 -1
|
@@ -779,8 +779,12 @@ const correctFeeAfterEvaluation = ({ balancedTx, evaluatedRedeemers, resolvedInp
|
|
|
779
779
|
let fee = seedFee;
|
|
780
780
|
let priced = priceAt(fee);
|
|
781
781
|
for (let iteration = 0; iteration < MAX_FEE_CORRECTION_ITERATIONS && priced.requiredFee < fee; iteration++) {
|
|
782
|
-
|
|
783
|
-
|
|
782
|
+
let candidateFee = priced.requiredFee;
|
|
783
|
+
let candidatePriced = priceAt(candidateFee);
|
|
784
|
+
for (let climb = 0; climb < MAX_FEE_CORRECTION_ITERATIONS && candidatePriced.requiredFee > candidateFee && candidatePriced.requiredFee < fee; climb++) {
|
|
785
|
+
candidateFee = candidatePriced.requiredFee;
|
|
786
|
+
candidatePriced = priceAt(candidateFee);
|
|
787
|
+
}
|
|
784
788
|
if (candidatePriced.requiredFee > candidateFee) break;
|
|
785
789
|
fee = candidateFee;
|
|
786
790
|
priced = candidatePriced;
|
|
@@ -1975,9 +1979,14 @@ var TransactionBuilder = class {
|
|
|
1975
1979
|
}
|
|
1976
1980
|
/**
|
|
1977
1981
|
* Sets the pool of UTxOs the builder may draw collateral from for a Plutus
|
|
1978
|
-
* transaction. The builder selects largest-first
|
|
1979
|
-
* cover the required collateral
|
|
1980
|
-
* assets) to the collateral change address
|
|
1982
|
+
* transaction. The builder selects largest-first and may combine several to
|
|
1983
|
+
* cover the required collateral. A collateral return sends the unused portion
|
|
1984
|
+
* (incl. native assets) to the collateral change address on script failure;
|
|
1985
|
+
* an ADA-only remainder below min-ADA may be absorbed into total collateral.
|
|
1986
|
+
*
|
|
1987
|
+
* The pool may overlap `setUnspentOutputs`; overlapping UTxOs may be spent as
|
|
1988
|
+
* funding inputs on success. To keep a dedicated collateral UTxO unspent,
|
|
1989
|
+
* supply it only here, not to `setUnspentOutputs` or `addInput`.
|
|
1981
1990
|
*
|
|
1982
1991
|
* @param utxos - Candidate collateral UTxOs (need not be pure ADA).
|
|
1983
1992
|
* @returns `this` for fluent chaining.
|
|
@@ -2226,8 +2235,6 @@ var TransactionBuilder = class {
|
|
|
2226
2235
|
const seeded = this.buildCollateralFields(reservedCollateral, coverageTarget);
|
|
2227
2236
|
unbalancedTx.body.totalCollateral = seeded.totalCollateral;
|
|
2228
2237
|
if (seeded.collateralReturn) unbalancedTx.body.collateralReturn = seeded.collateralReturn;
|
|
2229
|
-
const reservedKeys = new Set(reservedCollateral.map(utxoRefKey));
|
|
2230
|
-
spendableUtxos = this.availableUtxos.filter((utxo) => !reservedKeys.has(utxoRefKey(utxo)));
|
|
2231
2238
|
}
|
|
2232
2239
|
if (this.referenceUtxos.length > 0) spendableUtxos = spendableUtxos.filter((utxo) => !this.isReferenced(utxo));
|
|
2233
2240
|
if (this.scripts.length > 0) unbalancedTx.witness.scripts = this.scripts;
|
|
@@ -2449,8 +2456,9 @@ var TransactionBuilder = class {
|
|
|
2449
2456
|
}
|
|
2450
2457
|
/**
|
|
2451
2458
|
* Selects collateral inputs largest-first from `collateralUtxos`, combining
|
|
2452
|
-
* up to `maxCollateralInputs` until they cover `coverAmount
|
|
2453
|
-
*
|
|
2459
|
+
* up to `maxCollateralInputs` until they cover `coverAmount`. Native assets
|
|
2460
|
+
* and positive remainders under an execution estimate must fund a return
|
|
2461
|
+
* output; otherwise an ADA-only pick needs nothing further.
|
|
2454
2462
|
*
|
|
2455
2463
|
* @param coverAmount - Lovelace the selected collateral must cover.
|
|
2456
2464
|
* @returns The selected collateral UTxOs.
|
|
@@ -2470,13 +2478,13 @@ var TransactionBuilder = class {
|
|
|
2470
2478
|
const total = (0, _laceio_cardano_core.coalesceValueQuantities)(selected.map(([, out]) => out.value));
|
|
2471
2479
|
if (total.coins < coverAmount) continue;
|
|
2472
2480
|
const returnCoin = total.coins - coverAmount;
|
|
2473
|
-
|
|
2474
|
-
if (returnCoin === 0n && !hasAssets) return selected;
|
|
2475
|
-
const returnValue = { coins: returnCoin };
|
|
2476
|
-
if (hasAssets) returnValue.assets = total.assets;
|
|
2481
|
+
if (!((total.assets?.size ?? 0) > 0) && (this.plutusContext?.executionUnitsEstimate === void 0 || returnCoin === 0n)) return selected;
|
|
2477
2482
|
if (returnCoin >= (0, _laceio_cardano_tx_construction.minAdaRequired)({
|
|
2478
2483
|
address: returnAddress,
|
|
2479
|
-
value:
|
|
2484
|
+
value: {
|
|
2485
|
+
coins: returnCoin,
|
|
2486
|
+
assets: total.assets
|
|
2487
|
+
}
|
|
2480
2488
|
}, BigInt(this.params.coinsPerUtxoByte))) return selected;
|
|
2481
2489
|
}
|
|
2482
2490
|
throw new InsufficientCollateralError(`Collateral UTxOs cannot cover ${coverAmount} lovelace plus a valid return output (max ${maxInputs} inputs)`);
|
|
@@ -778,8 +778,12 @@ const correctFeeAfterEvaluation = ({ balancedTx, evaluatedRedeemers, resolvedInp
|
|
|
778
778
|
let fee = seedFee;
|
|
779
779
|
let priced = priceAt(fee);
|
|
780
780
|
for (let iteration = 0; iteration < MAX_FEE_CORRECTION_ITERATIONS && priced.requiredFee < fee; iteration++) {
|
|
781
|
-
|
|
782
|
-
|
|
781
|
+
let candidateFee = priced.requiredFee;
|
|
782
|
+
let candidatePriced = priceAt(candidateFee);
|
|
783
|
+
for (let climb = 0; climb < MAX_FEE_CORRECTION_ITERATIONS && candidatePriced.requiredFee > candidateFee && candidatePriced.requiredFee < fee; climb++) {
|
|
784
|
+
candidateFee = candidatePriced.requiredFee;
|
|
785
|
+
candidatePriced = priceAt(candidateFee);
|
|
786
|
+
}
|
|
783
787
|
if (candidatePriced.requiredFee > candidateFee) break;
|
|
784
788
|
fee = candidateFee;
|
|
785
789
|
priced = candidatePriced;
|
|
@@ -1974,9 +1978,14 @@ var TransactionBuilder = class {
|
|
|
1974
1978
|
}
|
|
1975
1979
|
/**
|
|
1976
1980
|
* Sets the pool of UTxOs the builder may draw collateral from for a Plutus
|
|
1977
|
-
* transaction. The builder selects largest-first
|
|
1978
|
-
* cover the required collateral
|
|
1979
|
-
* assets) to the collateral change address
|
|
1981
|
+
* transaction. The builder selects largest-first and may combine several to
|
|
1982
|
+
* cover the required collateral. A collateral return sends the unused portion
|
|
1983
|
+
* (incl. native assets) to the collateral change address on script failure;
|
|
1984
|
+
* an ADA-only remainder below min-ADA may be absorbed into total collateral.
|
|
1985
|
+
*
|
|
1986
|
+
* The pool may overlap `setUnspentOutputs`; overlapping UTxOs may be spent as
|
|
1987
|
+
* funding inputs on success. To keep a dedicated collateral UTxO unspent,
|
|
1988
|
+
* supply it only here, not to `setUnspentOutputs` or `addInput`.
|
|
1980
1989
|
*
|
|
1981
1990
|
* @param utxos - Candidate collateral UTxOs (need not be pure ADA).
|
|
1982
1991
|
* @returns `this` for fluent chaining.
|
|
@@ -2225,8 +2234,6 @@ var TransactionBuilder = class {
|
|
|
2225
2234
|
const seeded = this.buildCollateralFields(reservedCollateral, coverageTarget);
|
|
2226
2235
|
unbalancedTx.body.totalCollateral = seeded.totalCollateral;
|
|
2227
2236
|
if (seeded.collateralReturn) unbalancedTx.body.collateralReturn = seeded.collateralReturn;
|
|
2228
|
-
const reservedKeys = new Set(reservedCollateral.map(utxoRefKey));
|
|
2229
|
-
spendableUtxos = this.availableUtxos.filter((utxo) => !reservedKeys.has(utxoRefKey(utxo)));
|
|
2230
2237
|
}
|
|
2231
2238
|
if (this.referenceUtxos.length > 0) spendableUtxos = spendableUtxos.filter((utxo) => !this.isReferenced(utxo));
|
|
2232
2239
|
if (this.scripts.length > 0) unbalancedTx.witness.scripts = this.scripts;
|
|
@@ -2448,8 +2455,9 @@ var TransactionBuilder = class {
|
|
|
2448
2455
|
}
|
|
2449
2456
|
/**
|
|
2450
2457
|
* Selects collateral inputs largest-first from `collateralUtxos`, combining
|
|
2451
|
-
* up to `maxCollateralInputs` until they cover `coverAmount
|
|
2452
|
-
*
|
|
2458
|
+
* up to `maxCollateralInputs` until they cover `coverAmount`. Native assets
|
|
2459
|
+
* and positive remainders under an execution estimate must fund a return
|
|
2460
|
+
* output; otherwise an ADA-only pick needs nothing further.
|
|
2453
2461
|
*
|
|
2454
2462
|
* @param coverAmount - Lovelace the selected collateral must cover.
|
|
2455
2463
|
* @returns The selected collateral UTxOs.
|
|
@@ -2469,13 +2477,13 @@ var TransactionBuilder = class {
|
|
|
2469
2477
|
const total = coalesceValueQuantities(selected.map(([, out]) => out.value));
|
|
2470
2478
|
if (total.coins < coverAmount) continue;
|
|
2471
2479
|
const returnCoin = total.coins - coverAmount;
|
|
2472
|
-
|
|
2473
|
-
if (returnCoin === 0n && !hasAssets) return selected;
|
|
2474
|
-
const returnValue = { coins: returnCoin };
|
|
2475
|
-
if (hasAssets) returnValue.assets = total.assets;
|
|
2480
|
+
if (!((total.assets?.size ?? 0) > 0) && (this.plutusContext?.executionUnitsEstimate === void 0 || returnCoin === 0n)) return selected;
|
|
2476
2481
|
if (returnCoin >= minAdaRequired({
|
|
2477
2482
|
address: returnAddress,
|
|
2478
|
-
value:
|
|
2483
|
+
value: {
|
|
2484
|
+
coins: returnCoin,
|
|
2485
|
+
assets: total.assets
|
|
2486
|
+
}
|
|
2479
2487
|
}, BigInt(this.params.coinsPerUtxoByte))) return selected;
|
|
2480
2488
|
}
|
|
2481
2489
|
throw new InsufficientCollateralError(`Collateral UTxOs cannot cover ${coverAmount} lovelace plus a valid return output (max ${maxInputs} inputs)`);
|
package/dist/cardano.cjs
CHANGED
|
@@ -12,7 +12,7 @@ const require_const = require("./const-iwzZEE_w.cjs");
|
|
|
12
12
|
const require_account_id_vo = require("./account-id.vo-DwqFjK5u.cjs");
|
|
13
13
|
const require_const$1 = require("./const-D-eZIS4n.cjs");
|
|
14
14
|
const require_contract = require("./contract-MKLzYVkW.cjs");
|
|
15
|
-
const require_modules_cardano = require("./modules-cardano-
|
|
15
|
+
const require_modules_cardano = require("./modules-cardano-D9Gs2j60.cjs");
|
|
16
16
|
let _laceio_cardano_core = require("@laceio/cardano/core");
|
|
17
17
|
let _laceio_cardano_util = require("@laceio/cardano/util");
|
|
18
18
|
exports.AccountId = require_account_id_vo.AccountId;
|
package/dist/cardano.d.ts
CHANGED
|
@@ -19667,9 +19667,14 @@ declare class TransactionBuilder {
|
|
|
19667
19667
|
addRequiredSigner(keyHash: Crypto.Ed25519KeyHashHex): TransactionBuilder;
|
|
19668
19668
|
/**
|
|
19669
19669
|
* Sets the pool of UTxOs the builder may draw collateral from for a Plutus
|
|
19670
|
-
* transaction. The builder selects largest-first
|
|
19671
|
-
* cover the required collateral
|
|
19672
|
-
* assets) to the collateral change address
|
|
19670
|
+
* transaction. The builder selects largest-first and may combine several to
|
|
19671
|
+
* cover the required collateral. A collateral return sends the unused portion
|
|
19672
|
+
* (incl. native assets) to the collateral change address on script failure;
|
|
19673
|
+
* an ADA-only remainder below min-ADA may be absorbed into total collateral.
|
|
19674
|
+
*
|
|
19675
|
+
* The pool may overlap `setUnspentOutputs`; overlapping UTxOs may be spent as
|
|
19676
|
+
* funding inputs on success. To keep a dedicated collateral UTxO unspent,
|
|
19677
|
+
* supply it only here, not to `setUnspentOutputs` or `addInput`.
|
|
19673
19678
|
*
|
|
19674
19679
|
* @param utxos - Candidate collateral UTxOs (need not be pure ADA).
|
|
19675
19680
|
* @returns `this` for fluent chaining.
|
|
@@ -19900,8 +19905,9 @@ declare class TransactionBuilder {
|
|
|
19900
19905
|
private collateralCoverageTarget;
|
|
19901
19906
|
/**
|
|
19902
19907
|
* Selects collateral inputs largest-first from `collateralUtxos`, combining
|
|
19903
|
-
* up to `maxCollateralInputs` until they cover `coverAmount
|
|
19904
|
-
*
|
|
19908
|
+
* up to `maxCollateralInputs` until they cover `coverAmount`. Native assets
|
|
19909
|
+
* and positive remainders under an execution estimate must fund a return
|
|
19910
|
+
* output; otherwise an ADA-only pick needs nothing further.
|
|
19905
19911
|
*
|
|
19906
19912
|
* @param coverAmount - Lovelace the selected collateral must cover.
|
|
19907
19913
|
* @returns The selected collateral UTxOs.
|
package/dist/cardano.js
CHANGED
|
@@ -12,6 +12,6 @@ import { t as FEATURE_FLAG_NETWORK_TYPE } from "./const-CjmfjBP3.js";
|
|
|
12
12
|
import { t as AccountId } from "./account-id.vo-OPz2v-JZ.js";
|
|
13
13
|
import { n as FEATURE_FLAG_CARDANO } from "./const-BJfIK_G-.js";
|
|
14
14
|
import { r as LazyWalletMismatchError } from "./contract-1R86jhSw.js";
|
|
15
|
-
import { _ as PasskeyWalletMismatchError, a as submitCardanoTx, c as waitForNetworkInfo, d as createRemotePasskeySigner, f as createRemoteCardanoVaultModule, g as createPasskeyWalletEntity, h as createSignerClient, i as createSteelSwapProvider, l as createRemotePasskeyWalletEntity, m as RemoteSignerResultError, o as signCardanoTx, p as CardanoRemoteSignerFactory, s as createTxBuilder, t as modules_cardano_exports, v as createPasskeyVaultModule, y as createLazyInMemoryVaultModule } from "./modules-cardano-
|
|
15
|
+
import { _ as PasskeyWalletMismatchError, a as submitCardanoTx, c as waitForNetworkInfo, d as createRemotePasskeySigner, f as createRemoteCardanoVaultModule, g as createPasskeyWalletEntity, h as createSignerClient, i as createSteelSwapProvider, l as createRemotePasskeyWalletEntity, m as RemoteSignerResultError, o as signCardanoTx, p as CardanoRemoteSignerFactory, s as createTxBuilder, t as modules_cardano_exports, v as createPasskeyVaultModule, y as createLazyInMemoryVaultModule } from "./modules-cardano-VIM8fKu-.js";
|
|
16
16
|
import { n as HexBlob, r as Serialization, t as Cardano } from "./cardano-DfPwhwm-.js";
|
|
17
17
|
export { AccountId, Cardano, CardanoRemoteSignerFactory, FEATURE_FLAG_CARDANO, FEATURE_FLAG_NETWORK_TYPE, HexBlob, HexBytes, LazyWalletMismatchError, Milliseconds, PasskeyWalletMismatchError, RemoteSignerError, RemoteSignerResultError, Serialization, SignerClosedError, SignerPopupBlockedError, WalletId, WalletType, createInMemoryWalletEntity, createLaceWallet, createLazyInMemoryVaultModule, createPasskeyKeySource, createPasskeyVaultModule, createPasskeyWalletEntity, createRemoteCardanoVaultModule, createRemotePasskeySigner, createRemotePasskeyWalletEntity, createSignerClient, createSteelSwapProvider, createTxBuilder, modules_cardano_exports as m, signCardanoTx, submitCardanoTx, waitForNetworkInfo };
|
|
@@ -2,7 +2,7 @@ require("./rolldown-runtime-Br2OG8yv.cjs");
|
|
|
2
2
|
const require_util = require("./util-Bu4W5lF4.cjs");
|
|
3
3
|
const require_bignum_vo = require("./bignum.vo-hx2kuqlA.cjs");
|
|
4
4
|
const require_const = require("./const-D-eZIS4n.cjs");
|
|
5
|
-
const require_TransactionBuilder = require("./TransactionBuilder-
|
|
5
|
+
const require_TransactionBuilder = require("./TransactionBuilder-X1H9Gze6.cjs");
|
|
6
6
|
const require_account_guards = require("./account-guards-BtjTGxDZ.cjs");
|
|
7
7
|
let _laceio_cardano_core = require("@laceio/cardano/core");
|
|
8
8
|
let rxjs = require("rxjs");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as filterSpendableUtxos } from "./util-Cp5cZkfK.js";
|
|
2
2
|
import { t as BigNumber } from "./bignum.vo-CEXOIew0.js";
|
|
3
3
|
import { r as LOVELACE_TOKEN_ID } from "./const-BJfIK_G-.js";
|
|
4
|
-
import { n as TransactionBuilder } from "./TransactionBuilder-
|
|
4
|
+
import { n as TransactionBuilder } from "./TransactionBuilder-bp2aMDhg.js";
|
|
5
5
|
import { t as refuseExtensionAccount } from "./account-guards-D9Lu5T3W.js";
|
|
6
6
|
import { Cardano } from "@laceio/cardano/core";
|
|
7
7
|
import { defer, firstValueFrom, of } from "rxjs";
|
package/dist/{deregistration-tx-builder-CQP35yex.cjs → deregistration-tx-builder-CcLwyFpj.cjs}
RENAMED
|
@@ -2,7 +2,7 @@ require("./rolldown-runtime-Br2OG8yv.cjs");
|
|
|
2
2
|
const require_util = require("./util-Bu4W5lF4.cjs");
|
|
3
3
|
const require_bignum_vo = require("./bignum.vo-hx2kuqlA.cjs");
|
|
4
4
|
const require_const = require("./const-D-eZIS4n.cjs");
|
|
5
|
-
const require_TransactionBuilder = require("./TransactionBuilder-
|
|
5
|
+
const require_TransactionBuilder = require("./TransactionBuilder-X1H9Gze6.cjs");
|
|
6
6
|
const require_account_guards = require("./account-guards-BtjTGxDZ.cjs");
|
|
7
7
|
let _laceio_cardano_core = require("@laceio/cardano/core");
|
|
8
8
|
let rxjs = require("rxjs");
|
package/dist/{deregistration-tx-builder-Bf6xAYp4.js → deregistration-tx-builder-QkWW_gWl.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as filterSpendableUtxos } from "./util-Cp5cZkfK.js";
|
|
2
2
|
import { t as BigNumber } from "./bignum.vo-CEXOIew0.js";
|
|
3
3
|
import { r as LOVELACE_TOKEN_ID } from "./const-BJfIK_G-.js";
|
|
4
|
-
import { n as TransactionBuilder } from "./TransactionBuilder-
|
|
4
|
+
import { n as TransactionBuilder } from "./TransactionBuilder-bp2aMDhg.js";
|
|
5
5
|
import { t as refuseExtensionAccount } from "./account-guards-D9Lu5T3W.js";
|
|
6
6
|
import { Cardano } from "@laceio/cardano/core";
|
|
7
7
|
import { defer, firstValueFrom, of } from "rxjs";
|
|
@@ -2,7 +2,7 @@ require("./rolldown-runtime-Br2OG8yv.cjs");
|
|
|
2
2
|
const require_util = require("./util-Bu4W5lF4.cjs");
|
|
3
3
|
const require_bignum_vo = require("./bignum.vo-hx2kuqlA.cjs");
|
|
4
4
|
const require_const = require("./const-D-eZIS4n.cjs");
|
|
5
|
-
const require_TransactionBuilder = require("./TransactionBuilder-
|
|
5
|
+
const require_TransactionBuilder = require("./TransactionBuilder-X1H9Gze6.cjs");
|
|
6
6
|
const require_account_guards = require("./account-guards-BtjTGxDZ.cjs");
|
|
7
7
|
let _laceio_cardano_core = require("@laceio/cardano/core");
|
|
8
8
|
let rxjs = require("rxjs");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as filterSpendableUtxos } from "./util-Cp5cZkfK.js";
|
|
2
2
|
import { t as BigNumber } from "./bignum.vo-CEXOIew0.js";
|
|
3
3
|
import { r as LOVELACE_TOKEN_ID } from "./const-BJfIK_G-.js";
|
|
4
|
-
import { n as TransactionBuilder } from "./TransactionBuilder-
|
|
4
|
+
import { n as TransactionBuilder } from "./TransactionBuilder-bp2aMDhg.js";
|
|
5
5
|
import { t as refuseExtensionAccount } from "./account-guards-D9Lu5T3W.js";
|
|
6
6
|
import { Cardano } from "@laceio/cardano/core";
|
|
7
7
|
import { defer, firstValueFrom, of } from "rxjs";
|
package/dist/experimental.cjs
CHANGED
|
@@ -28,10 +28,10 @@ const require_outputs = require("./outputs-CJoQBIA2.cjs");
|
|
|
28
28
|
const require_tokens = require("./tokens-Cevp7rdU.cjs");
|
|
29
29
|
const require_grant_status = require("./grant-status-DOr3t_u8.cjs");
|
|
30
30
|
const require_identity = require("./identity-BMLuufva.cjs");
|
|
31
|
-
const require_TransactionBuilder = require("./TransactionBuilder-
|
|
31
|
+
const require_TransactionBuilder = require("./TransactionBuilder-X1H9Gze6.cjs");
|
|
32
32
|
const require_pending_operation = require("./pending-operation-B0_P78Jo.cjs");
|
|
33
33
|
const require_contract = require("./contract-MKLzYVkW.cjs");
|
|
34
|
-
const require_modules_cardano = require("./modules-cardano-
|
|
34
|
+
const require_modules_cardano = require("./modules-cardano-D9Gs2j60.cjs");
|
|
35
35
|
const require_slice$1 = require("./slice-t8Gzj55G2.cjs");
|
|
36
36
|
const require_providers = require("./providers-FjhM47BH.cjs");
|
|
37
37
|
const require_device_commitment_hex_vo = require("./device-commitment-hex.vo-CT3RmAug.cjs");
|
|
@@ -3530,7 +3530,7 @@ const custodyModule = require_store.inferModuleContext({
|
|
|
3530
3530
|
}
|
|
3531
3531
|
},
|
|
3532
3532
|
store: require_store.inferStoreContext({
|
|
3533
|
-
load: async () => Promise.resolve().then(() => require("./init-
|
|
3533
|
+
load: async () => Promise.resolve().then(() => require("./init-DRzJR02G.cjs")),
|
|
3534
3534
|
context: {
|
|
3535
3535
|
actions: {},
|
|
3536
3536
|
selectors: {}
|
package/dist/experimental.d.ts
CHANGED
|
@@ -20641,9 +20641,14 @@ declare class TransactionBuilder {
|
|
|
20641
20641
|
addRequiredSigner(keyHash: Crypto.Ed25519KeyHashHex): TransactionBuilder;
|
|
20642
20642
|
/**
|
|
20643
20643
|
* Sets the pool of UTxOs the builder may draw collateral from for a Plutus
|
|
20644
|
-
* transaction. The builder selects largest-first
|
|
20645
|
-
* cover the required collateral
|
|
20646
|
-
* assets) to the collateral change address
|
|
20644
|
+
* transaction. The builder selects largest-first and may combine several to
|
|
20645
|
+
* cover the required collateral. A collateral return sends the unused portion
|
|
20646
|
+
* (incl. native assets) to the collateral change address on script failure;
|
|
20647
|
+
* an ADA-only remainder below min-ADA may be absorbed into total collateral.
|
|
20648
|
+
*
|
|
20649
|
+
* The pool may overlap `setUnspentOutputs`; overlapping UTxOs may be spent as
|
|
20650
|
+
* funding inputs on success. To keep a dedicated collateral UTxO unspent,
|
|
20651
|
+
* supply it only here, not to `setUnspentOutputs` or `addInput`.
|
|
20647
20652
|
*
|
|
20648
20653
|
* @param utxos - Candidate collateral UTxOs (need not be pure ADA).
|
|
20649
20654
|
* @returns `this` for fluent chaining.
|
|
@@ -20874,8 +20879,9 @@ declare class TransactionBuilder {
|
|
|
20874
20879
|
private collateralCoverageTarget;
|
|
20875
20880
|
/**
|
|
20876
20881
|
* Selects collateral inputs largest-first from `collateralUtxos`, combining
|
|
20877
|
-
* up to `maxCollateralInputs` until they cover `coverAmount
|
|
20878
|
-
*
|
|
20882
|
+
* up to `maxCollateralInputs` until they cover `coverAmount`. Native assets
|
|
20883
|
+
* and positive remainders under an execution estimate must fund a return
|
|
20884
|
+
* output; otherwise an ADA-only pick needs nothing further.
|
|
20879
20885
|
*
|
|
20880
20886
|
* @param coverAmount - Lovelace the selected collateral must cover.
|
|
20881
20887
|
* @returns The selected collateral UTxOs.
|
package/dist/experimental.js
CHANGED
|
@@ -29,10 +29,10 @@ import { E as findCustodyGrantViolations, L as addressOfRepresentableRecipient,
|
|
|
29
29
|
import { n as custodyGrantAssetId, r as parseCustodyAccountTokenName } from "./tokens-Diw4MLRM.js";
|
|
30
30
|
import { a as custodyDeviceFingerprint, b as parseCustodyAccountRecord, c as custodyGrantLiveness, d as serializeCustodyRequestedGrantScope, f as inspectCustodyTransaction, i as classifyCardanoCustodyAccount, l as compareRequestedGrantScope, o as deriveCustodyDeviceKey, r as CARDANO_CUSTODY_DEFAULT_GRANT_FEE_BOUND, s as classifyCustodyAccountUtxos, t as classifyCardanoCustodyGrants, u as parseCustodyRequestedGrantScope, v as canonicalCustodyAccountRecord, y as createCustodyAccountRecord } from "./grant-status-B2y49iIu.js";
|
|
31
31
|
import { n as chainIdFromNetworkMagic, t as verifyCardanoCustodyAccountIdentity } from "./identity-DII6f-h7.js";
|
|
32
|
-
import { c as getUniqueSignerKeyHashes, l as SLOT_CONFIG_NETWORK } from "./TransactionBuilder-
|
|
32
|
+
import { c as getUniqueSignerKeyHashes, l as SLOT_CONFIG_NETWORK } from "./TransactionBuilder-bp2aMDhg.js";
|
|
33
33
|
import { t as cardanoCustodyActivityMetadataOf } from "./pending-operation-BIS6mpjB.js";
|
|
34
34
|
import { r as LazyWalletMismatchError } from "./contract-1R86jhSw.js";
|
|
35
|
-
import { _ as PasskeyWalletMismatchError, a as submitCardanoTx, c as waitForNetworkInfo, d as createRemotePasskeySigner, f as createRemoteCardanoVaultModule, g as createPasskeyWalletEntity, h as createSignerClient, i as createSteelSwapProvider, l as createRemotePasskeyWalletEntity, m as RemoteSignerResultError, n as sdk_default$5, o as signCardanoTx, p as CardanoRemoteSignerFactory, r as sdk_default$4, s as createTxBuilder, u as sdk_default$3, v as createPasskeyVaultModule, y as createLazyInMemoryVaultModule } from "./modules-cardano-
|
|
35
|
+
import { _ as PasskeyWalletMismatchError, a as submitCardanoTx, c as waitForNetworkInfo, d as createRemotePasskeySigner, f as createRemoteCardanoVaultModule, g as createPasskeyWalletEntity, h as createSignerClient, i as createSteelSwapProvider, l as createRemotePasskeyWalletEntity, m as RemoteSignerResultError, n as sdk_default$5, o as signCardanoTx, p as CardanoRemoteSignerFactory, r as sdk_default$4, s as createTxBuilder, u as sdk_default$3, v as createPasskeyVaultModule, y as createLazyInMemoryVaultModule } from "./modules-cardano-VIM8fKu-.js";
|
|
36
36
|
import { n as HexBlob, r as Serialization, t as Cardano } from "./cardano-DfPwhwm-.js";
|
|
37
37
|
import { r as passportSelectors, t as passportActions } from "./slice-t8Q1cHm-.js";
|
|
38
38
|
import { i as AccAddress, n as createHttpProver, r as applyNetworkId, t as createMidnightProviders } from "./providers-WtiSuxFu.js";
|
|
@@ -3528,7 +3528,7 @@ const custodyModule = inferModuleContext({
|
|
|
3528
3528
|
}
|
|
3529
3529
|
},
|
|
3530
3530
|
store: inferStoreContext({
|
|
3531
|
-
load: async () => import("./init-
|
|
3531
|
+
load: async () => import("./init-C5mYyFTv.js"),
|
|
3532
3532
|
context: {
|
|
3533
3533
|
actions: {},
|
|
3534
3534
|
selectors: {}
|
package/dist/index.cjs
CHANGED
|
@@ -25,9 +25,9 @@ const require_activity_type = require("./activity-type-Ch6ljxBy.cjs");
|
|
|
25
25
|
const require_slice$1 = require("./slice-C34iOOUH.cjs");
|
|
26
26
|
const require_token_id_vo = require("./token-id.vo-DXv5uS9n.cjs");
|
|
27
27
|
const require_const$1 = require("./const-D-eZIS4n.cjs");
|
|
28
|
-
const require_TransactionBuilder = require("./TransactionBuilder-
|
|
28
|
+
const require_TransactionBuilder = require("./TransactionBuilder-X1H9Gze6.cjs");
|
|
29
29
|
const require_contract = require("./contract-MKLzYVkW.cjs");
|
|
30
|
-
const require_modules_cardano = require("./modules-cardano-
|
|
30
|
+
const require_modules_cardano = require("./modules-cardano-D9Gs2j60.cjs");
|
|
31
31
|
const require_error = require("./error-Cb3EnD0u.cjs");
|
|
32
32
|
const require_http_client = require("./http-client-B3N-TMxu.cjs");
|
|
33
33
|
const require_is_retriable_error = require("./is-retriable-error-Dpt860if.cjs");
|
package/dist/index.d.ts
CHANGED
|
@@ -20715,9 +20715,14 @@ declare class TransactionBuilder {
|
|
|
20715
20715
|
addRequiredSigner(keyHash: Crypto.Ed25519KeyHashHex): TransactionBuilder;
|
|
20716
20716
|
/**
|
|
20717
20717
|
* Sets the pool of UTxOs the builder may draw collateral from for a Plutus
|
|
20718
|
-
* transaction. The builder selects largest-first
|
|
20719
|
-
* cover the required collateral
|
|
20720
|
-
* assets) to the collateral change address
|
|
20718
|
+
* transaction. The builder selects largest-first and may combine several to
|
|
20719
|
+
* cover the required collateral. A collateral return sends the unused portion
|
|
20720
|
+
* (incl. native assets) to the collateral change address on script failure;
|
|
20721
|
+
* an ADA-only remainder below min-ADA may be absorbed into total collateral.
|
|
20722
|
+
*
|
|
20723
|
+
* The pool may overlap `setUnspentOutputs`; overlapping UTxOs may be spent as
|
|
20724
|
+
* funding inputs on success. To keep a dedicated collateral UTxO unspent,
|
|
20725
|
+
* supply it only here, not to `setUnspentOutputs` or `addInput`.
|
|
20721
20726
|
*
|
|
20722
20727
|
* @param utxos - Candidate collateral UTxOs (need not be pure ADA).
|
|
20723
20728
|
* @returns `this` for fluent chaining.
|
|
@@ -20948,8 +20953,9 @@ declare class TransactionBuilder {
|
|
|
20948
20953
|
private collateralCoverageTarget;
|
|
20949
20954
|
/**
|
|
20950
20955
|
* Selects collateral inputs largest-first from `collateralUtxos`, combining
|
|
20951
|
-
* up to `maxCollateralInputs` until they cover `coverAmount
|
|
20952
|
-
*
|
|
20956
|
+
* up to `maxCollateralInputs` until they cover `coverAmount`. Native assets
|
|
20957
|
+
* and positive remainders under an execution estimate must fund a return
|
|
20958
|
+
* output; otherwise an ADA-only pick needs nothing further.
|
|
20953
20959
|
*
|
|
20954
20960
|
* @param coverAmount - Lovelace the selected collateral must cover.
|
|
20955
20961
|
* @returns The selected collateral UTxOs.
|
package/dist/index.js
CHANGED
|
@@ -26,9 +26,9 @@ import { t as ActivityType } from "./activity-type-GsJGWs-3.js";
|
|
|
26
26
|
import { a as MAX_ACTIVITIES_PER_ACCOUNT, i as ActivitiesPaginationFailureId } from "./slice-D-9aPKG-.js";
|
|
27
27
|
import { t as TokenId } from "./token-id.vo-Bvwhr3ZE.js";
|
|
28
28
|
import { n as FEATURE_FLAG_CARDANO } from "./const-BJfIK_G-.js";
|
|
29
|
-
import { n as TransactionBuilder } from "./TransactionBuilder-
|
|
29
|
+
import { n as TransactionBuilder } from "./TransactionBuilder-bp2aMDhg.js";
|
|
30
30
|
import { r as LazyWalletMismatchError } from "./contract-1R86jhSw.js";
|
|
31
|
-
import { _ as PasskeyWalletMismatchError, a as submitCardanoTx, c as waitForNetworkInfo, d as createRemotePasskeySigner, f as createRemoteCardanoVaultModule, g as createPasskeyWalletEntity, h as createSignerClient, i as createSteelSwapProvider, l as createRemotePasskeyWalletEntity, m as RemoteSignerResultError, n as sdk_default$5, o as signCardanoTx, p as CardanoRemoteSignerFactory, r as sdk_default$4, s as createTxBuilder, u as sdk_default$3, v as createPasskeyVaultModule, y as createLazyInMemoryVaultModule } from "./modules-cardano-
|
|
31
|
+
import { _ as PasskeyWalletMismatchError, a as submitCardanoTx, c as waitForNetworkInfo, d as createRemotePasskeySigner, f as createRemoteCardanoVaultModule, g as createPasskeyWalletEntity, h as createSignerClient, i as createSteelSwapProvider, l as createRemotePasskeyWalletEntity, m as RemoteSignerResultError, n as sdk_default$5, o as signCardanoTx, p as CardanoRemoteSignerFactory, r as sdk_default$4, s as createTxBuilder, u as sdk_default$3, v as createPasskeyVaultModule, y as createLazyInMemoryVaultModule } from "./modules-cardano-VIM8fKu-.js";
|
|
32
32
|
import { a as isNotFoundError } from "./error-DIZOY2Lw.js";
|
|
33
33
|
import { n as buildUrl, t as HttpClient } from "./http-client-TRlhDZGh.js";
|
|
34
34
|
import { t as isRetriableError } from "./is-retriable-error-BUiVJDwH.js";
|
|
@@ -8,7 +8,7 @@ import { A as isCustodyLovelaceAsset, E as findCustodyGrantViolations, F as enco
|
|
|
8
8
|
import { n as custodyGrantAssetId, r as parseCustodyAccountTokenName, t as CUSTODY_SLOT_LIMIT } from "./tokens-Diw4MLRM.js";
|
|
9
9
|
import { S as findCustodyScopeViolations, c as custodyGrantLiveness, d as serializeCustodyRequestedGrantScope, f as inspectCustodyTransaction, g as encodeCustodyStakeRedeemer, h as encodeCustodyMintRedeemer, i as classifyCardanoCustodyAccount, m as encodeCustodyLogicRedeemer, n as isCardanoCustodyGrantExhausted, o as deriveCustodyDeviceKey, p as encodeCustodyAccountRedeemer, r as CARDANO_CUSTODY_DEFAULT_GRANT_FEE_BOUND, u as parseCustodyRequestedGrantScope, x as custodyGrantAfterSpend, y as createCustodyAccountRecord } from "./grant-status-B2y49iIu.js";
|
|
10
10
|
import { i as identityOfValidatedCreator, n as chainIdFromNetworkMagic, r as deriveCustodyAccountIdentity, t as verifyCardanoCustodyAccountIdentity } from "./identity-DII6f-h7.js";
|
|
11
|
-
import { a as referenceScriptSize, c as getUniqueSignerKeyHashes, i as referenceScriptFee, n as TransactionBuilder, o as EvaluatedFeeShortfallError, r as LargeFirstCoinSelector, s as InputSelectionError, t as InsufficientCollateralError } from "./TransactionBuilder-
|
|
11
|
+
import { a as referenceScriptSize, c as getUniqueSignerKeyHashes, i as referenceScriptFee, n as TransactionBuilder, o as EvaluatedFeeShortfallError, r as LargeFirstCoinSelector, s as InputSelectionError, t as InsufficientCollateralError } from "./TransactionBuilder-bp2aMDhg.js";
|
|
12
12
|
import { t as isRetriableError } from "./is-retriable-error-BUiVJDwH.js";
|
|
13
13
|
import { t as unwrapProviderResult } from "./unwrap-provider-result-BZSiwabU.js";
|
|
14
14
|
import { Hash28ByteBase16, blake2b } from "@laceio/cardano/crypto";
|
|
@@ -11,7 +11,7 @@ require("./retry-config-BaCfVC1H.cjs");
|
|
|
11
11
|
const require_activity_type = require("./activity-type-Ch6ljxBy.cjs");
|
|
12
12
|
const require_cardano_network_id_vo = require("./cardano-network-id.vo-BEDPn6Li.cjs");
|
|
13
13
|
const require_const = require("./const-D-eZIS4n.cjs");
|
|
14
|
-
const require_TransactionBuilder = require("./TransactionBuilder-
|
|
14
|
+
const require_TransactionBuilder = require("./TransactionBuilder-X1H9Gze6.cjs");
|
|
15
15
|
const require_apply_vkey_witnesses = require("./apply-vkey-witnesses-ZnFS0jnJ.cjs");
|
|
16
16
|
const require_account_guards = require("./account-guards-BtjTGxDZ.cjs");
|
|
17
17
|
const require_unwrap_provider_result = require("./unwrap-provider-result-ZqfBsTkk.cjs");
|
|
@@ -788,7 +788,7 @@ const buildNightDesignationTx = async (params, dependencies) => {
|
|
|
788
788
|
if (!blueprintResult.ok) return blueprintResult;
|
|
789
789
|
const blueprint = blueprintResult.value;
|
|
790
790
|
const builder = new require_TransactionBuilder.TransactionBuilder(dependencies.networkMagic, params.protocolParameters);
|
|
791
|
-
builder.setChangeAddress(params.changeAddress).setUnspentOutputs(dependencies.coverUtxos).setCollateralUtxos(dependencies.
|
|
791
|
+
builder.setChangeAddress(params.changeAddress).setUnspentOutputs(dependencies.coverUtxos).setCollateralUtxos(dependencies.collateralUtxos).setCollateralChangeAddress(params.changeAddress).setPlutusContext({
|
|
792
792
|
costModels: params.protocolParameters.costModels,
|
|
793
793
|
txEvaluator: dependencies.txEvaluator,
|
|
794
794
|
inputResolver: dependencies.inputResolver
|
|
@@ -1016,10 +1016,14 @@ const buildDesignation = async (state, dependencies, pendingActivities) => {
|
|
|
1016
1016
|
const [protocolParameters, tip] = await Promise.all([(0, rxjs.firstValueFrom)(require_unwrap_provider_result.unwrapProviderResult(() => dependencies.cardanoProvider.getProtocolParameters({ chainId }))), (0, rxjs.firstValueFrom)(require_unwrap_provider_result.unwrapProviderResult(() => dependencies.cardanoProvider.getTip({ chainId })))]);
|
|
1017
1017
|
const network = CardanoDustNetwork.fromNetworkMagic(chainId.networkMagic);
|
|
1018
1018
|
const { primaryAddress, paymentKeyHash, stakeKeyHash } = resolveAccountKeyHashes(cardanoAddresses, accountId);
|
|
1019
|
-
const
|
|
1019
|
+
const accountUtxos = allAccountUtxos[accountId] ?? [];
|
|
1020
|
+
const reservedUtxos = unspendableUtxos[accountId] ?? [];
|
|
1021
|
+
const spendable = require_util.filterSpendableUtxos(accountUtxos, reservedUtxos);
|
|
1020
1022
|
const cnightAssetId = getCnightAssetId(network);
|
|
1021
1023
|
const cnightUtxos = spendable.filter(([, out]) => out.value.assets?.has(cnightAssetId));
|
|
1022
1024
|
const coverUtxos = spendable.filter(([, out]) => !out.value.assets?.has(cnightAssetId));
|
|
1025
|
+
const reservedKeys = new Set(reservedUtxos.map(require_util.utxoKey));
|
|
1026
|
+
const reservedCollateral = require_util.getEligibleCollateralUtxo(accountUtxos.filter((utxo) => reservedKeys.has(require_util.utxoKey(utxo)) && utxo[1].address === primaryAddress));
|
|
1023
1027
|
const action = await resolveAction({
|
|
1024
1028
|
state,
|
|
1025
1029
|
network,
|
|
@@ -1028,7 +1032,7 @@ const buildDesignation = async (state, dependencies, pendingActivities) => {
|
|
|
1028
1032
|
chainId,
|
|
1029
1033
|
pendingActivities
|
|
1030
1034
|
});
|
|
1031
|
-
if (coverUtxos.length === 0) return failure(/* @__PURE__ */ new Error("No ADA-only UTxO available to cover fee and
|
|
1035
|
+
if (coverUtxos.length === 0) return failure(/* @__PURE__ */ new Error("No ADA-only UTxO available to cover fee and outputs"), "no-cardano-utxos");
|
|
1032
1036
|
const result = await buildNightDesignationTx({
|
|
1033
1037
|
network,
|
|
1034
1038
|
action,
|
|
@@ -1041,6 +1045,7 @@ const buildDesignation = async (state, dependencies, pendingActivities) => {
|
|
|
1041
1045
|
}, {
|
|
1042
1046
|
networkMagic: chainId.networkMagic,
|
|
1043
1047
|
coverUtxos,
|
|
1048
|
+
collateralUtxos: reservedCollateral ? [reservedCollateral] : coverUtxos,
|
|
1044
1049
|
txEvaluator: createProviderExUnitsEvaluator({
|
|
1045
1050
|
cardanoProvider: dependencies.cardanoProvider,
|
|
1046
1051
|
chainId,
|
|
@@ -9,7 +9,7 @@ const require_outputs = require("./outputs-CJoQBIA2.cjs");
|
|
|
9
9
|
const require_tokens = require("./tokens-Cevp7rdU.cjs");
|
|
10
10
|
const require_grant_status = require("./grant-status-DOr3t_u8.cjs");
|
|
11
11
|
const require_identity = require("./identity-BMLuufva.cjs");
|
|
12
|
-
const require_TransactionBuilder = require("./TransactionBuilder-
|
|
12
|
+
const require_TransactionBuilder = require("./TransactionBuilder-X1H9Gze6.cjs");
|
|
13
13
|
const require_is_retriable_error = require("./is-retriable-error-Dpt860if.cjs");
|
|
14
14
|
const require_unwrap_provider_result = require("./unwrap-provider-result-ZqfBsTkk.cjs");
|
|
15
15
|
let _laceio_cardano_crypto = require("@laceio/cardano/crypto");
|
|
@@ -3,7 +3,7 @@ import "./_polyfill-buffer-patch-yNxN4d5E.js";
|
|
|
3
3
|
import "./libsodium-wrappers-BhbOA8dQ.js";
|
|
4
4
|
import "./codecs-Dc1Krpbt.js";
|
|
5
5
|
import { t as SecretBox } from "./secret-box-DUR0ACYz.js";
|
|
6
|
-
import { _ as CardanoRewardAccount, n as filterSpendableUtxos, s as isCardanoAddressOfSupportedNetwork, t as createInputResolver } from "./util-Cp5cZkfK.js";
|
|
6
|
+
import { _ as CardanoRewardAccount, d as utxoKey, n as filterSpendableUtxos, r as getEligibleCollateralUtxo, s as isCardanoAddressOfSupportedNetwork, t as createInputResolver } from "./util-Cp5cZkfK.js";
|
|
7
7
|
import { t as ByteArray } from "./bytes.vo-BB7_4JK6.js";
|
|
8
8
|
import { t as BigNumber } from "./bignum.vo-CEXOIew0.js";
|
|
9
9
|
import { n as Ok$1, t as Err$1 } from "./asyncoption-CruEYOBI.js";
|
|
@@ -12,7 +12,7 @@ import "./retry-config-Dmgt28wM.js";
|
|
|
12
12
|
import { t as ActivityType } from "./activity-type-GsJGWs-3.js";
|
|
13
13
|
import { t as CardanoNetworkId } from "./cardano-network-id.vo-Cfpvbod9.js";
|
|
14
14
|
import { r as LOVELACE_TOKEN_ID } from "./const-BJfIK_G-.js";
|
|
15
|
-
import { n as TransactionBuilder, s as InputSelectionError } from "./TransactionBuilder-
|
|
15
|
+
import { n as TransactionBuilder, s as InputSelectionError } from "./TransactionBuilder-bp2aMDhg.js";
|
|
16
16
|
import { t as applyVkeyWitnesses } from "./apply-vkey-witnesses-BKx3lcs0.js";
|
|
17
17
|
import { t as refuseExtensionAccount } from "./account-guards-D9Lu5T3W.js";
|
|
18
18
|
import { t as unwrapProviderResult } from "./unwrap-provider-result-BZSiwabU.js";
|
|
@@ -789,7 +789,7 @@ const buildNightDesignationTx = async (params, dependencies) => {
|
|
|
789
789
|
if (!blueprintResult.ok) return blueprintResult;
|
|
790
790
|
const blueprint = blueprintResult.value;
|
|
791
791
|
const builder = new TransactionBuilder(dependencies.networkMagic, params.protocolParameters);
|
|
792
|
-
builder.setChangeAddress(params.changeAddress).setUnspentOutputs(dependencies.coverUtxos).setCollateralUtxos(dependencies.
|
|
792
|
+
builder.setChangeAddress(params.changeAddress).setUnspentOutputs(dependencies.coverUtxos).setCollateralUtxos(dependencies.collateralUtxos).setCollateralChangeAddress(params.changeAddress).setPlutusContext({
|
|
793
793
|
costModels: params.protocolParameters.costModels,
|
|
794
794
|
txEvaluator: dependencies.txEvaluator,
|
|
795
795
|
inputResolver: dependencies.inputResolver
|
|
@@ -1017,10 +1017,14 @@ const buildDesignation = async (state, dependencies, pendingActivities) => {
|
|
|
1017
1017
|
const [protocolParameters, tip] = await Promise.all([firstValueFrom(unwrapProviderResult(() => dependencies.cardanoProvider.getProtocolParameters({ chainId }))), firstValueFrom(unwrapProviderResult(() => dependencies.cardanoProvider.getTip({ chainId })))]);
|
|
1018
1018
|
const network = CardanoDustNetwork.fromNetworkMagic(chainId.networkMagic);
|
|
1019
1019
|
const { primaryAddress, paymentKeyHash, stakeKeyHash } = resolveAccountKeyHashes(cardanoAddresses, accountId);
|
|
1020
|
-
const
|
|
1020
|
+
const accountUtxos = allAccountUtxos[accountId] ?? [];
|
|
1021
|
+
const reservedUtxos = unspendableUtxos[accountId] ?? [];
|
|
1022
|
+
const spendable = filterSpendableUtxos(accountUtxos, reservedUtxos);
|
|
1021
1023
|
const cnightAssetId = getCnightAssetId(network);
|
|
1022
1024
|
const cnightUtxos = spendable.filter(([, out]) => out.value.assets?.has(cnightAssetId));
|
|
1023
1025
|
const coverUtxos = spendable.filter(([, out]) => !out.value.assets?.has(cnightAssetId));
|
|
1026
|
+
const reservedKeys = new Set(reservedUtxos.map(utxoKey));
|
|
1027
|
+
const reservedCollateral = getEligibleCollateralUtxo(accountUtxos.filter((utxo) => reservedKeys.has(utxoKey(utxo)) && utxo[1].address === primaryAddress));
|
|
1024
1028
|
const action = await resolveAction({
|
|
1025
1029
|
state,
|
|
1026
1030
|
network,
|
|
@@ -1029,7 +1033,7 @@ const buildDesignation = async (state, dependencies, pendingActivities) => {
|
|
|
1029
1033
|
chainId,
|
|
1030
1034
|
pendingActivities
|
|
1031
1035
|
});
|
|
1032
|
-
if (coverUtxos.length === 0) return failure(/* @__PURE__ */ new Error("No ADA-only UTxO available to cover fee and
|
|
1036
|
+
if (coverUtxos.length === 0) return failure(/* @__PURE__ */ new Error("No ADA-only UTxO available to cover fee and outputs"), "no-cardano-utxos");
|
|
1033
1037
|
const result = await buildNightDesignationTx({
|
|
1034
1038
|
network,
|
|
1035
1039
|
action,
|
|
@@ -1042,6 +1046,7 @@ const buildDesignation = async (state, dependencies, pendingActivities) => {
|
|
|
1042
1046
|
}, {
|
|
1043
1047
|
networkMagic: chainId.networkMagic,
|
|
1044
1048
|
coverUtxos,
|
|
1049
|
+
collateralUtxos: reservedCollateral ? [reservedCollateral] : coverUtxos,
|
|
1045
1050
|
txEvaluator: createProviderExUnitsEvaluator({
|
|
1046
1051
|
cardanoProvider: dependencies.cardanoProvider,
|
|
1047
1052
|
chainId,
|
|
@@ -11,7 +11,7 @@ const require_slice = require("./slice-DTZTiJle.cjs");
|
|
|
11
11
|
const require_in_memory_wallet_integration = require("./in-memory-wallet-integration-t9I00R_V.cjs");
|
|
12
12
|
const require_cardano_tx_id_vo = require("./cardano-tx-id.vo-TLjJZHCI.cjs");
|
|
13
13
|
const require_const = require("./const-D-eZIS4n.cjs");
|
|
14
|
-
const require_TransactionBuilder = require("./TransactionBuilder-
|
|
14
|
+
const require_TransactionBuilder = require("./TransactionBuilder-X1H9Gze6.cjs");
|
|
15
15
|
const require_composite_signer_factory = require("./composite-signer-factory-m5cVs9h_.cjs");
|
|
16
16
|
const require_contract = require("./contract-MKLzYVkW.cjs");
|
|
17
17
|
let _laceio_cardano_key_management = require("@laceio/cardano/key-management");
|
|
@@ -550,7 +550,7 @@ const dependsOnContracts = require_store.combineContracts([
|
|
|
550
550
|
//#endregion
|
|
551
551
|
//#region ../../packages/module/blockchain-cardano/src/store/index.ts
|
|
552
552
|
var store_default$1 = require_store.inferStoreContext({
|
|
553
|
-
load: async () => Promise.resolve().then(() => require("./init-
|
|
553
|
+
load: async () => Promise.resolve().then(() => require("./init-Clu8pxwQ.cjs")),
|
|
554
554
|
context: {
|
|
555
555
|
actions: {},
|
|
556
556
|
selectors: {}
|
|
@@ -579,11 +579,11 @@ var sdk_default$2 = require_store.inferModuleContext({
|
|
|
579
579
|
addons: {
|
|
580
580
|
loadInMemoryWalletIntegration: async () => Promise.resolve().then(() => require("./in-memory-wallet-integration-Cm6P8sk6.cjs")),
|
|
581
581
|
loadAddressBookAddressValidators: async () => Promise.resolve().then(() => require("./address-book-address-validator-Dte_YQ2L.cjs")),
|
|
582
|
-
loadDelegationTxBuilder: async () => Promise.resolve().then(() => require("./delegation-tx-builder-
|
|
582
|
+
loadDelegationTxBuilder: async () => Promise.resolve().then(() => require("./delegation-tx-builder-Dof_0N_d.cjs")),
|
|
583
583
|
loadTokenIdMapper: async () => Promise.resolve().then(() => require("./token-id-mapper-CVyQJUKY.cjs")),
|
|
584
|
-
loadDeregistrationTxBuilder: async () => Promise.resolve().then(() => require("./deregistration-tx-builder-
|
|
585
|
-
loadVoteDelegationTxBuilder: async () => Promise.resolve().then(() => require("./vote-delegation-tx-builder-
|
|
586
|
-
loadEarnRewardsTxBuilder: async () => Promise.resolve().then(() => require("./earn-rewards-tx-builder-
|
|
584
|
+
loadDeregistrationTxBuilder: async () => Promise.resolve().then(() => require("./deregistration-tx-builder-CcLwyFpj.cjs")),
|
|
585
|
+
loadVoteDelegationTxBuilder: async () => Promise.resolve().then(() => require("./vote-delegation-tx-builder-DSs8nybk.cjs")),
|
|
586
|
+
loadEarnRewardsTxBuilder: async () => Promise.resolve().then(() => require("./earn-rewards-tx-builder-BP5JMIKS.cjs")),
|
|
587
587
|
loadSignerFactory: async () => Promise.resolve().then(() => require("./signer-factory-Ds6G2AZk.cjs"))
|
|
588
588
|
}
|
|
589
589
|
});
|
|
@@ -11,7 +11,7 @@ import { r as cardanoContextSelectors } from "./slice-qt0uBExh.js";
|
|
|
11
11
|
import { i as createLazyAccountsFromAccountPublicKey } from "./in-memory-wallet-integration-CljprQQV.js";
|
|
12
12
|
import { t as CardanoTxId } from "./cardano-tx-id.vo-eVnKuzlm.js";
|
|
13
13
|
import { n as FEATURE_FLAG_CARDANO } from "./const-BJfIK_G-.js";
|
|
14
|
-
import { n as TransactionBuilder } from "./TransactionBuilder-
|
|
14
|
+
import { n as TransactionBuilder } from "./TransactionBuilder-bp2aMDhg.js";
|
|
15
15
|
import { t as CompositeSignerFactory } from "./composite-signer-factory-CR8YHA1y.js";
|
|
16
16
|
import { n as addressBookAddressValidatorAddonContract, r as LazyWalletMismatchError, t as tokenIdMapperAddonContract } from "./contract-1R86jhSw.js";
|
|
17
17
|
import { InMemoryKeyAgent, KeyPurpose } from "@laceio/cardano/key-management";
|
|
@@ -550,7 +550,7 @@ const dependsOnContracts = combineContracts([
|
|
|
550
550
|
//#endregion
|
|
551
551
|
//#region ../../packages/module/blockchain-cardano/src/store/index.ts
|
|
552
552
|
var store_default$1 = inferStoreContext({
|
|
553
|
-
load: async () => import("./init-
|
|
553
|
+
load: async () => import("./init-qSEd_Spq.js"),
|
|
554
554
|
context: {
|
|
555
555
|
actions: {},
|
|
556
556
|
selectors: {}
|
|
@@ -579,11 +579,11 @@ var sdk_default$2 = inferModuleContext({
|
|
|
579
579
|
addons: {
|
|
580
580
|
loadInMemoryWalletIntegration: async () => import("./in-memory-wallet-integration-ChIOirMW.js"),
|
|
581
581
|
loadAddressBookAddressValidators: async () => import("./address-book-address-validator-0J9XAADH.js"),
|
|
582
|
-
loadDelegationTxBuilder: async () => import("./delegation-tx-builder-
|
|
582
|
+
loadDelegationTxBuilder: async () => import("./delegation-tx-builder-Dy3-2Auz.js"),
|
|
583
583
|
loadTokenIdMapper: async () => import("./token-id-mapper-D29Ggv8h.js"),
|
|
584
|
-
loadDeregistrationTxBuilder: async () => import("./deregistration-tx-builder-
|
|
585
|
-
loadVoteDelegationTxBuilder: async () => import("./vote-delegation-tx-builder-
|
|
586
|
-
loadEarnRewardsTxBuilder: async () => import("./earn-rewards-tx-builder-
|
|
584
|
+
loadDeregistrationTxBuilder: async () => import("./deregistration-tx-builder-QkWW_gWl.js"),
|
|
585
|
+
loadVoteDelegationTxBuilder: async () => import("./vote-delegation-tx-builder-BsBSDmcX.js"),
|
|
586
|
+
loadEarnRewardsTxBuilder: async () => import("./earn-rewards-tx-builder-Cku4BmNU.js"),
|
|
587
587
|
loadSignerFactory: async () => import("./signer-factory-DObB55D4.js")
|
|
588
588
|
}
|
|
589
589
|
});
|
package/dist/{vote-delegation-tx-builder-C6FiS7zI.js → vote-delegation-tx-builder-BsBSDmcX.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as filterSpendableUtxos } from "./util-Cp5cZkfK.js";
|
|
2
2
|
import { t as BigNumber } from "./bignum.vo-CEXOIew0.js";
|
|
3
3
|
import { r as LOVELACE_TOKEN_ID } from "./const-BJfIK_G-.js";
|
|
4
|
-
import { n as TransactionBuilder } from "./TransactionBuilder-
|
|
4
|
+
import { n as TransactionBuilder } from "./TransactionBuilder-bp2aMDhg.js";
|
|
5
5
|
import { t as refuseExtensionAccount } from "./account-guards-D9Lu5T3W.js";
|
|
6
6
|
import { Cardano } from "@laceio/cardano/core";
|
|
7
7
|
import { defer, firstValueFrom, of } from "rxjs";
|
package/dist/{vote-delegation-tx-builder-BUg1S2Ep.cjs → vote-delegation-tx-builder-DSs8nybk.cjs}
RENAMED
|
@@ -2,7 +2,7 @@ require("./rolldown-runtime-Br2OG8yv.cjs");
|
|
|
2
2
|
const require_util = require("./util-Bu4W5lF4.cjs");
|
|
3
3
|
const require_bignum_vo = require("./bignum.vo-hx2kuqlA.cjs");
|
|
4
4
|
const require_const = require("./const-D-eZIS4n.cjs");
|
|
5
|
-
const require_TransactionBuilder = require("./TransactionBuilder-
|
|
5
|
+
const require_TransactionBuilder = require("./TransactionBuilder-X1H9Gze6.cjs");
|
|
6
6
|
const require_account_guards = require("./account-guards-BtjTGxDZ.cjs");
|
|
7
7
|
let _laceio_cardano_core = require("@laceio/cardano/core");
|
|
8
8
|
let rxjs = require("rxjs");
|