Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ math: true

- The JSON schema now lists `dijkstra` as an era name where Ogmios can return it, such as the `era` of a block and the eras in an era mismatch error. The schema also describes the `guard` clause of native scripts and the `guard` script purpose, which Dijkstra transactions can contain. The `guard` purpose appears in redeemer pointers and in the list of missing redeemers. Before, such responses did not match the schema. The schema also describes the `maxReferenceScriptsSizePerBlock` and `maxReferenceScriptsSizePerTransaction` protocol parameters of the Dijkstra era, and accepts the stake addresses that Ogmios uses as keys of the withdrawals in a `treasuryWithdrawals` governance action. Before, responses that contained them did not match the schema.

- In the Dijkstra era, `nextBlock` and `nextTransaction` now return transactions with all their content, with the same fields as in the Conway era: inputs, outputs, certificates, withdrawals, mint, fee, votes, proposals, metadata, signatories, scripts, datums, redeemers, and so on. Before, a Dijkstra transaction only had `id`, `spends` and, when asked for, `cbor`. Dijkstra transactions also have new fields:
- `subTransactions`: the transactions nested in this one. Each has its own `id` and the same fields as a transaction, except `spends`, `fee`, `collaterals`, `collateralReturn`, `totalCollateral`, `startingAccountBalanceIntervals` and `subTransactions`.
- `guards`: the hashes of the scripts that guard the transaction. Guards that are keys are listed in `requiredExtraSignatories`.
- `topLevelGuards`: the guards that the top-level transaction must list, each with `from`, `credential` and, for Plutus scripts, a `datum`.
- `credits`: amounts paid directly into accounts, with the same shape as `withdrawals`.
- `accountBalanceIntervals`: conditions on account balances, each with `from`, `credential` and either `atLeast`, `atMost`, both, or `exactly`.
- `startingAccountBalanceIntervals` (top-level transactions only): the same conditions, checked against the balances before the transaction and its sub-transactions are applied.

### [6.14.0] - 2025-10-16

#### Added
Expand Down
122 changes: 122 additions & 0 deletions clients/TypeScript/packages/schema/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,14 @@ export type AddressAttributes = string;
* Plutus data, CBOR-serialised.
*/
export type RedeemerData = string;
/**
* A constraint on the balance of an account (a.k.a. reward account). The transaction is only valid when the balance falls within the interval.
*/
export type AccountBalanceInterval =
| AccountBalanceIntervalAtLeast
| AccountBalanceIntervalAtMost
| AccountBalanceIntervalWithin
| AccountBalanceIntervalExactly;
export type BootstrapProtocolId = number;
export type GenesisHash = "genesis";
export type VrfProof = string;
Expand Down Expand Up @@ -607,13 +615,22 @@ export interface Transaction {
outputs: TransactionOutput[];
certificates?: Certificate[];
withdrawals?: Withdrawals;
credits?: Credits;
fee?: ValueAdaOnly;
validityInterval?: ValidityInterval;
mint?: Assets;
network?: Network;
scriptIntegrityHash?: DigestBlake2B256;
requiredExtraSignatories?: DigestBlake2B224[];
requiredExtraScripts?: DigestBlake2B224[];
/**
* Hashes of scripts which must run and succeed for the transaction to be valid. From Dijkstra onwards.
*/
guards?: DigestBlake2B224[];
/**
* Guards (keys or scripts) that this transaction must list in its own guards. From Dijkstra onwards.
*/
topLevelGuards?: TopLevelGuard[];
proposals?: GovernanceProposal[];
votes?: GovernanceVote[];
metadata?: Metadata;
Expand All @@ -629,6 +646,18 @@ export interface Transaction {
value?: ValueAdaOnly;
donation?: ValueAdaOnly;
};
/**
* Constraints on account balances, checked against the balances at the time the transaction is applied. From Dijkstra onwards.
*/
accountBalanceIntervals?: AccountBalanceInterval[];
/**
* Constraints on account balances, checked against the balances before the transaction and its sub-transactions are applied. From Dijkstra onwards.
*/
startingAccountBalanceIntervals?: AccountBalanceInterval[];
/**
* Transactions nested in this one. From Dijkstra onwards.
*/
subTransactions?: SubTransaction[];
/**
* The raw serialized (CBOR) transaction, as found on-chain. Use --include-transaction-cbor to ALWAYS include the 'cbor' field. Omitted otherwise.
*/
Expand Down Expand Up @@ -863,6 +892,12 @@ export interface DelegateRepresentativeRetirement {
export interface Withdrawals {
[k: string]: ValueAdaOnly;
}
/**
* Amounts paid directly into accounts (a.k.a. reward accounts), as direct deposits. The opposite of withdrawals.
*/
export interface Credits {
[k: string]: ValueAdaOnly;
}
export interface ValidityInterval {
invalidBefore?: Slot;
invalidAfter?: Slot;
Expand All @@ -872,6 +907,14 @@ export interface Assets {
[k: string]: AssetQuantity;
};
}
/**
* A guard (key or script) that the top-level transaction must list among its own guards (under 'requiredExtraSignatories' for keys, 'guards' for scripts). Plutus script guards come with a datum.
*/
export interface TopLevelGuard {
from: CredentialOrigin;
credential: DigestBlake2B224;
datum?: Datum;
}
export interface GovernanceProposal {
deposit?: ValueAdaOnly;
returnAccount?: RewardAccount;
Expand Down Expand Up @@ -1166,6 +1209,85 @@ export interface RedeemerPointer {
purpose: "spend" | "mint" | "publish" | "withdraw" | "vote" | "propose" | "guard";
index: UInt64;
}
/**
* Minimum (inclusive) balance of the account.
*/
export interface AccountBalanceIntervalAtLeast {
from: CredentialOrigin;
credential: DigestBlake2B224;
atLeast: ValueAdaOnly;
}
/**
* Maximum (exclusive) balance of the account.
*/
export interface AccountBalanceIntervalAtMost {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is misleading, because "AtMost" suggests <= but is actually <. But it was a conscious decision inherited from here: encodeAccountBalanceInterval

from: CredentialOrigin;
credential: DigestBlake2B224;
atMost: ValueAdaOnly;
}
/**
* Minimum (inclusive) and maximum (exclusive) balances of the account.
*/
export interface AccountBalanceIntervalWithin {
from: CredentialOrigin;
credential: DigestBlake2B224;
atLeast: ValueAdaOnly;
atMost: ValueAdaOnly;
}
/**
* Exact balance of the account.
*/
export interface AccountBalanceIntervalExactly {
from: CredentialOrigin;
credential: DigestBlake2B224;
exactly: ValueAdaOnly;
}
/**
* A transaction nested inside another (top-level) transaction. It has no fee and no collaterals of its own. From Dijkstra onwards.
*/
export interface SubTransaction {
id: DigestBlake2B256;
inputs: TransactionOutputReference[];
references?: TransactionOutputReference[];
outputs: TransactionOutput[];
certificates?: Certificate[];
withdrawals?: Withdrawals;
credits?: Credits;
mint?: Assets;
requiredExtraSignatories?: DigestBlake2B224[];
requiredExtraScripts?: DigestBlake2B224[];
/**
* Hashes of scripts which must run and succeed for the sub-transaction to be valid.
*/
guards?: DigestBlake2B224[];
/**
* Guards (keys or scripts) that the top-level transaction must list in its own guards.
*/
topLevelGuards?: TopLevelGuard[];
network?: Network;
scriptIntegrityHash?: DigestBlake2B256;
validityInterval?: ValidityInterval;
proposals?: GovernanceProposal[];
votes?: GovernanceVote[];
treasury?: {
value?: ValueAdaOnly;
donation?: ValueAdaOnly;
};
accountBalanceIntervals?: AccountBalanceInterval[];
metadata?: Metadata;
signatories: Signatory[];
scripts?: {
[k: string]: Script;
};
datums?: {
[k: string]: Datum;
};
redeemers?: Redeemer[];
/**
* The raw serialized (CBOR) sub-transaction. Use --include-transaction-cbor to ALWAYS include the 'cbor' field. Omitted otherwise.
*/
cbor?: string;
}
/**
* A (Byron) delegation certificate.
*/
Expand Down
Loading
Loading