Releases: IntersectMBO/evolution-sdk
@evolution-sdk/[email protected]
Patch Changes
-
#113
7905507Thanks @solidsnakedev! - AddattachMetadata()operation to TransactionBuilder for attaching transaction metadata according to CIP-10 standard.Changes:
- Added
attachMetadata()method to attach metadata with custom labels - Metadata labels are now bigint (unbounded positive integers) supporting CIP-20 messages (label 674) and custom labels
- Automatic computation of auxiliaryDataHash in transaction body when metadata is present
- Proper fee calculation accounting for auxiliary data size
- TransactionMetadatum refactored to simple union type:
string | bigint | Uint8Array | Map | Array - Added
NonNegativeIntegerschema to Numeric module for unbounded non-negative integers
Example:
await client .newTx() .attachMetadata({ label: 674n, // CIP-20 message label metadata: "Hello Cardano!" }) .payToAddress({ address, assets }) .build() .then((tx) => tx.sign().submit())
- Added
@evolution-sdk/[email protected]
Patch Changes
- Updated dependencies [
7905507]:- @evolution-sdk/[email protected]
@evolution-sdk/[email protected]
Patch Changes
-
#112
c59507eThanks @solidsnakedev! - Add transaction chaining support viaSignBuilder.chainResult()- Add
chainResult()method toSignBuilderfor building dependent transactions - Returns
ChainResultwithconsumed,availableUTxOs and pre-computedtxHash - Lazy evaluation with memoization - computed on first call, cached for subsequent calls
- Add
signAndSubmit()convenience method combining sign and submit in one call - Remove redundant
chain(),chainEffect(),chainEither()methods from TransactionBuilder
- Add
-
#110
9ddc79dThanks @solidsnakedev! - ### Native Scripts & Multi-Sig SupportaddSigneroperation: Add required signers to transactions for multi-sig and script validation- Native script minting: Full support for
ScriptAll,ScriptAny,ScriptNOfK,InvalidBefore,InvalidHereafter - Reference scripts: Use native scripts via
readFrominstead of attaching them to transactions - Multi-sig spending: Spend from native script addresses with multi-party signing
- Improved fee calculation: Accurate fee estimation for transactions with native scripts and reference scripts
API Changes
UTxO.scriptReftype changed fromScriptReftoScriptfor better type safetyPayToAddressParams.scriptRefrenamed toscriptfor consistency- Wallet
signTxnow acceptsreferenceUtxoscontext for native script signer detection - Client
signTxauto-fetches reference UTxOs when signing transactions with reference inputs
-
#109
0730f23Thanks @solidsnakedev! - ### TxBuilder setValidity APIAdd
setValidity()method to TxBuilder for setting transaction validity intervals:client.newTx() .setValidity({ from: Date.now(), // Valid after this Unix time (optional) to: Date.now() + 300_000 // Expires after this Unix time (optional) }) .payToAddress({ ... }) .build()
- Times are provided as Unix milliseconds and converted to slots during transaction assembly
- At least one of
fromortomust be specified - Validates that
from < towhen both are provided
slotConfig support for devnets
Add
slotConfigparameter tocreateClient()for custom slot configurations:const slotConfig = Cluster.getSlotConfig(devnetCluster) const client = createClient({ network: 0, slotConfig, // Custom slot config for devnet provider: { ... }, wallet: { ... } })
Priority chain for slot config resolution:
BuildOptions.slotConfig(per-transaction override)TxBuilderConfig.slotConfig(client default)SLOT_CONFIG_NETWORK[network](hardcoded fallback)
Cluster.getSlotConfig helper
Add
getSlotConfig()helper to derive slot configuration from devnet cluster genesis:const slotConfig = Cluster.getSlotConfig(cluster) // Returns: { zeroTime, zeroSlot, slotLength }
@evolution-sdk/[email protected]
Patch Changes
-
#109
0730f23Thanks @solidsnakedev! - ### TxBuilder setValidity APIAdd
setValidity()method to TxBuilder for setting transaction validity intervals:client.newTx() .setValidity({ from: Date.now(), // Valid after this Unix time (optional) to: Date.now() + 300_000 // Expires after this Unix time (optional) }) .payToAddress({ ... }) .build()
- Times are provided as Unix milliseconds and converted to slots during transaction assembly
- At least one of
fromortomust be specified - Validates that
from < towhen both are provided
slotConfig support for devnets
Add
slotConfigparameter tocreateClient()for custom slot configurations:const slotConfig = Cluster.getSlotConfig(devnetCluster) const client = createClient({ network: 0, slotConfig, // Custom slot config for devnet provider: { ... }, wallet: { ... } })
Priority chain for slot config resolution:
BuildOptions.slotConfig(per-transaction override)TxBuilderConfig.slotConfig(client default)SLOT_CONFIG_NETWORK[network](hardcoded fallback)
Cluster.getSlotConfig helper
Add
getSlotConfig()helper to derive slot configuration from devnet cluster genesis:const slotConfig = Cluster.getSlotConfig(cluster) // Returns: { zeroTime, zeroSlot, slotLength }
-
Updated dependencies [
c59507e,9ddc79d,0730f23]:- @evolution-sdk/[email protected]
@evolution-sdk/[email protected]
Patch Changes
-
#107
1e1aec8Thanks @solidsnakedev! - ### Added: Redeemer Labels for Script DebuggingAdded optional
labelproperty to redeemer operations (collectFrom,withdraw,mint, and stake operations) to help identify which script failed during evaluation.client .newTx() .collectFrom({ inputs: [utxo], redeemer: makeSpendRedeemer(999n), label: "coordinator-spend-utxo" // Shows in failure output }) .withdraw({ stakeCredential, amount: 0n, redeemer: makeWithdrawRedeemer([999n]), label: "coordinator-withdrawal" })
When scripts fail, the
EvaluationErrornow includes a structuredfailuresarray:interface ScriptFailure { purpose: "spend" | "mint" | "withdraw" | "cert" index: number label?: string // User-provided label redeemerKey: string // e.g., "spend:0", "withdraw:0" utxoRef?: string // For spend failures credential?: string // For withdraw/cert failures policyId?: string // For mint failures validationError: string traces: string[] }
Added: Stake Operations
Full support for Conway-era stake operations:
registerStake- Register stake credential (RegCert)deregisterStake- Deregister stake credential (UnregCert)delegateTo- Delegate to pool and/or DRep (StakeDelegation, VoteDelegCert, StakeVoteDelegCert)registerAndDelegateTo- Combined registration + delegation (StakeRegDelegCert, VoteRegDelegCert, StakeVoteRegDelegCert)withdraw- Withdraw staking rewards (supports coordinator pattern with amount: 0n)
All operations support script-controlled credentials with RedeemerBuilder for deferred redeemer resolution.
@evolution-sdk/[email protected]
Patch Changes
-
#107
1e1aec8Thanks @solidsnakedev! - ### Added: Redeemer Labels for Script DebuggingAdded optional
labelproperty to redeemer operations (collectFrom,withdraw,mint, and stake operations) to help identify which script failed during evaluation.client .newTx() .collectFrom({ inputs: [utxo], redeemer: makeSpendRedeemer(999n), label: "coordinator-spend-utxo" // Shows in failure output }) .withdraw({ stakeCredential, amount: 0n, redeemer: makeWithdrawRedeemer([999n]), label: "coordinator-withdrawal" })
When scripts fail, the
EvaluationErrornow includes a structuredfailuresarray:interface ScriptFailure { purpose: "spend" | "mint" | "withdraw" | "cert" index: number label?: string // User-provided label redeemerKey: string // e.g., "spend:0", "withdraw:0" utxoRef?: string // For spend failures credential?: string // For withdraw/cert failures policyId?: string // For mint failures validationError: string traces: string[] }
Added: Stake Operations
Full support for Conway-era stake operations:
registerStake- Register stake credential (RegCert)deregisterStake- Deregister stake credential (UnregCert)delegateTo- Delegate to pool and/or DRep (StakeDelegation, VoteDelegCert, StakeVoteDelegCert)registerAndDelegateTo- Combined registration + delegation (StakeRegDelegCert, VoteRegDelegCert, StakeVoteRegDelegCert)withdraw- Withdraw staking rewards (supports coordinator pattern with amount: 0n)
All operations support script-controlled credentials with RedeemerBuilder for deferred redeemer resolution.
-
Updated dependencies [
1e1aec8]:- @evolution-sdk/[email protected]
@evolution-sdk/[email protected]
Patch Changes
-
#105
98b59faThanks @solidsnakedev! - Add deferred redeemer construction for dynamic index resolutionRedeemerBuilder module (
RedeemerBuilder.ts):IndexedInputtype:{ index: number, utxo: UTxO }- provides the final sorted index and original UTxO after coin selection- Three modes for redeemer construction:
Static: Direct Data value when index not neededSelf: Per-input function(input: IndexedInput) => Datafor single UTxO indexBatch: Multi-input function(inputs: IndexedInput[]) => Datafor stake validator coordinator pattern
- Type guards:
isSelfFn,isBatchBuilder,isStaticData - Internal types:
DeferredRedeemer,toDeferredRedeemer
Evaluation phase updates:
- Add
resolveDeferredRedeemersto convert deferred redeemers after coin selection - Build
refToIndexandrefToUtxomappings from sorted inputs - Invoke Self/Batch callbacks with resolved
IndexedInputobjects
Operations updates:
collectFromandmintTokensnow acceptRedeemerArg(Data | SelfRedeemerFn | BatchRedeemerBuilder)- Store deferred redeemers in
state.deferredRedeemersfor later resolution
Test coverage (
TxBuilder.RedeemerBuilder.test.ts):- Tests for all three modes with mint_multi_validator.ak spec
Architecture docs (
redeemer-indexing.mdx):- Document the circular dependency problem and deferred construction solution
- Explain stake validator coordinator pattern with O(1) index lookup
@evolution-sdk/[email protected]
Patch Changes
-
#105
98b59faThanks @solidsnakedev! - Add deferred redeemer construction for dynamic index resolutionRedeemerBuilder module (
RedeemerBuilder.ts):IndexedInputtype:{ index: number, utxo: UTxO }- provides the final sorted index and original UTxO after coin selection- Three modes for redeemer construction:
Static: Direct Data value when index not neededSelf: Per-input function(input: IndexedInput) => Datafor single UTxO indexBatch: Multi-input function(inputs: IndexedInput[]) => Datafor stake validator coordinator pattern
- Type guards:
isSelfFn,isBatchBuilder,isStaticData - Internal types:
DeferredRedeemer,toDeferredRedeemer
Evaluation phase updates:
- Add
resolveDeferredRedeemersto convert deferred redeemers after coin selection - Build
refToIndexandrefToUtxomappings from sorted inputs - Invoke Self/Batch callbacks with resolved
IndexedInputobjects
Operations updates:
collectFromandmintTokensnow acceptRedeemerArg(Data | SelfRedeemerFn | BatchRedeemerBuilder)- Store deferred redeemers in
state.deferredRedeemersfor later resolution
Test coverage (
TxBuilder.RedeemerBuilder.test.ts):- Tests for all three modes with mint_multi_validator.ak spec
Architecture docs (
redeemer-indexing.mdx):- Document the circular dependency problem and deferred construction solution
- Explain stake validator coordinator pattern with O(1) index lookup
-
Updated dependencies [
98b59fa]:- @evolution-sdk/[email protected]
@evolution-sdk/[email protected]
Patch Changes
-
#101
aaf0882Thanks @solidsnakedev! - ### Core Module EnhancementsMint Module
- Added
Mint.getByHex()andMint.getAssetsByPolicyHex()utilities for hex-based lookups - Fixed
Mint.insert,removePolicy,removeAsset, andgetto use content-based equality (Equal.equals) instead of reference equality for PolicyId/AssetName lookups
Fee Calculation
- Fixed
calculateFeeIterativelyto include mint field in fee calculation via TxContext access - Removed unnecessary 5000n fee buffer that caused fee overpayment
Transaction Builder
- Added
.mint()method to TransactionBuilder for native token minting/burning .attachScript()now accepts{ script: CoreScript }parameter format- Improved type safety by using Core types directly instead of SDK wrappers
Devnet Package
Test Infrastructure
- Added
TxBuilder.Mint.test.tswith devnet submit tests for minting and burning - Updated
TxBuilder.Scripts.test.tsto use Core types (PlutusV2.PlutusV2) instead of SDK format - Refactored
createCoreTestUtxohelper to accept CoreScripttypes directly - Removed unused
createTestUtxo(SDK format) helper - Added
Genesis.calculateUtxosFromConfig()for retrieving initial UTxOs from genesis config - Replaced all
Buffer.from().toString("hex")withText.toHex()in tests
Breaking Changes
attachScript()now requires{ script: ... }object format instead of passing script directly- Test helpers now use Core types exclusively
- Added
-
#103
65b7259Thanks @solidsnakedev! - ### Remove Buffer Usage from Source CodeReplaced all
Buffer.from()usage withBytes.fromHex()andBytes.toHex()from the core module for better cross-platform compatibility.Files Updated:
TxBuilderImpl.ts- UseBytes.toHex()for key hash hex conversion inbuildFakeWitnessSetAssets/index.ts- UseBytes.fromHex()for policy ID and asset name decodingMaestroEffect.ts- UseBytes.fromHex()for transaction CBOR conversionOgmios.ts- UseBytes.toHex()for datum hash hex conversionKupmiosEffects.ts- UseBytes.fromHex()for datum hash and script bytes decoding
-
#104
c26391aThanks @solidsnakedev! - ### PlutusV3 Minting Support- Add PlutusV3 script minting with automatic script evaluation via Ogmios
- Add
mintAssetsbuilder method for Plutus script-based minting policies - Add
attachScriptbuilder method for attaching Plutus scripts to transactions - Support both minting (positive amounts) and burning (negative amounts)
Redeemer API Improvements
- Breaking: Change
redeemerparameter type fromstring(CBOR hex) toData.Data- Affects
collectFrom()andmintAssets()builder methods - Provides type-safe redeemer construction without manual CBOR encoding
- Example:
redeemer: Data.constr(0n, [Data.int(1n)])instead of hex strings
- Affects
Core Module Additions
- Add
Redeemersmodule with Conway CDDL-compliant encoding (array format) - Refactor
hashScriptDatato use proper module encoders for redeemers and datums - Add
Redeemers.toCBORBytes()for script data hash computation
Internal Improvements
- Store
PlutusData.Datadirectly in builder state instead of CBOR hex strings - Remove redundant CBOR hex encoding/decoding in transaction assembly
- Add PlutusV3 minting devnet tests with real script evaluation
@evolution-sdk/[email protected]
Patch Changes
-
#101
aaf0882Thanks @solidsnakedev! - ### Core Module EnhancementsMint Module
- Added
Mint.getByHex()andMint.getAssetsByPolicyHex()utilities for hex-based lookups - Fixed
Mint.insert,removePolicy,removeAsset, andgetto use content-based equality (Equal.equals) instead of reference equality for PolicyId/AssetName lookups
Fee Calculation
- Fixed
calculateFeeIterativelyto include mint field in fee calculation via TxContext access - Removed unnecessary 5000n fee buffer that caused fee overpayment
Transaction Builder
- Added
.mint()method to TransactionBuilder for native token minting/burning .attachScript()now accepts{ script: CoreScript }parameter format- Improved type safety by using Core types directly instead of SDK wrappers
Devnet Package
Test Infrastructure
- Added
TxBuilder.Mint.test.tswith devnet submit tests for minting and burning - Updated
TxBuilder.Scripts.test.tsto use Core types (PlutusV2.PlutusV2) instead of SDK format - Refactored
createCoreTestUtxohelper to accept CoreScripttypes directly - Removed unused
createTestUtxo(SDK format) helper - Added
Genesis.calculateUtxosFromConfig()for retrieving initial UTxOs from genesis config - Replaced all
Buffer.from().toString("hex")withText.toHex()in tests
Breaking Changes
attachScript()now requires{ script: ... }object format instead of passing script directly- Test helpers now use Core types exclusively
- Added
-
#104
c26391aThanks @solidsnakedev! - ### PlutusV3 Minting Support- Add PlutusV3 script minting with automatic script evaluation via Ogmios
- Add
mintAssetsbuilder method for Plutus script-based minting policies - Add
attachScriptbuilder method for attaching Plutus scripts to transactions - Support both minting (positive amounts) and burning (negative amounts)
Redeemer API Improvements
- Breaking: Change
redeemerparameter type fromstring(CBOR hex) toData.Data- Affects
collectFrom()andmintAssets()builder methods - Provides type-safe redeemer construction without manual CBOR encoding
- Example:
redeemer: Data.constr(0n, [Data.int(1n)])instead of hex strings
- Affects
Core Module Additions
- Add
Redeemersmodule with Conway CDDL-compliant encoding (array format) - Refactor
hashScriptDatato use proper module encoders for redeemers and datums - Add
Redeemers.toCBORBytes()for script data hash computation
Internal Improvements
- Store
PlutusData.Datadirectly in builder state instead of CBOR hex strings - Remove redundant CBOR hex encoding/decoding in transaction assembly
- Add PlutusV3 minting devnet tests with real script evaluation
-
Updated dependencies [
aaf0882,65b7259,c26391a]:- @evolution-sdk/[email protected]