@easy1staking/cip113-sdk-ts 0.7.0 → 0.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/README.md +72 -2
- package/blueprints/standard/v0.5.0-alpha.3/UPSTREAM_PIN.json +35 -0
- package/blueprints/standard/v0.5.0-alpha.3/plutus.json +1126 -0
- package/blueprints/standard/v0.5.0-alpha.4/UPSTREAM_PIN.json +36 -0
- package/blueprints/standard/v0.5.0-alpha.4/plutus.json +1434 -0
- package/dist/core/evo-utils.d.ts +357 -39
- package/dist/core/evo-utils.d.ts.map +1 -1
- package/dist/core/evo-utils.js +513 -27
- package/dist/core/evo-utils.js.map +1 -1
- package/dist/core/ledger-order.d.ts +204 -18
- package/dist/core/ledger-order.d.ts.map +1 -1
- package/dist/core/ledger-order.js +385 -28
- package/dist/core/ledger-order.js.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -3
- package/dist/index.js.map +1 -1
- package/dist/standard/blueprint.d.ts +128 -29
- package/dist/standard/blueprint.d.ts.map +1 -1
- package/dist/standard/blueprint.js +244 -47
- package/dist/standard/blueprint.js.map +1 -1
- package/dist/standard/scripts.d.ts +143 -75
- package/dist/standard/scripts.d.ts.map +1 -1
- package/dist/standard/scripts.js +211 -116
- package/dist/standard/scripts.js.map +1 -1
- package/dist/substandards/dummy/index.d.ts +19 -0
- package/dist/substandards/dummy/index.d.ts.map +1 -1
- package/dist/substandards/dummy/index.js +322 -73
- package/dist/substandards/dummy/index.js.map +1 -1
- package/dist/substandards/freeze-and-seize/index.d.ts.map +1 -1
- package/dist/substandards/freeze-and-seize/index.js +455 -117
- package/dist/substandards/freeze-and-seize/index.js.map +1 -1
- package/dist/types.d.ts +131 -48
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -58,6 +58,76 @@ await client.awaitTx(txHash);
|
|
|
58
58
|
| `@easy1staking/cip113-sdk-ts/freeze-and-seize` | Freeze-and-Seize substandard |
|
|
59
59
|
| `@easy1staking/cip113-sdk-ts/dummy` | Dummy substandard |
|
|
60
60
|
|
|
61
|
+
## Migrating to 0.9.0 (CIP-113 0.5.0-alpha.4)
|
|
62
|
+
|
|
63
|
+
**0.9.0 targets a different protocol version and breaks every published consumer.** It is a
|
|
64
|
+
minor bump because this package is pre-1.0; treat it as major. Version 0.8.0 was never published,
|
|
65
|
+
so the real upgrade path is 0.3.1, or any later published release up to 0.7.0, to 0.9.0 and crosses both the
|
|
66
|
+
alpha.2-to-alpha.3 and alpha.3-to-alpha.4 boundaries described here.
|
|
67
|
+
|
|
68
|
+
⛔ **The alpha.3 change that will not announce itself.** `programmable_logic_base`'s redeemer went
|
|
69
|
+
from a three-constructor enum to a single record:
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
0.5.0-alpha.2 SpendViaTransfer(params_idx, wdrl_idx) = Constr(0, [Int, Int])
|
|
73
|
+
0.5.0-alpha.3 BaseSpendRedeemer{params_idx, wdrl_idx} = Constr(0, [Int, Int])
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Those are **byte-identical**. A stale builder emitting `SpendViaTransfer` produces a redeemer that
|
|
77
|
+
decodes cleanly and fails later on a credential check — because `wdrl_idx` now indexes the
|
|
78
|
+
**dispatcher's** withdrawal, not the delegate's. `SpendViaThirdParty` and `SpendViaUnfracking`
|
|
79
|
+
(constructors 1 and 2) fail loudly instead, so **the silence lands on the transfer path — the common
|
|
80
|
+
one**. This SDK refuses the stale call shape at the API surface, because nothing downstream can.
|
|
81
|
+
|
|
82
|
+
⛔ **The alpha.4 datum change is silent for the same reason.** The protocol-params datum grew
|
|
83
|
+
from four fields to six, and `issuance_logic_cred` was inserted at **index 1**, not appended:
|
|
84
|
+
|
|
85
|
+
| protocol version | protocol-params datum | size |
|
|
86
|
+
|---|---|---|
|
|
87
|
+
| 0.5.0-alpha.3 | `[plg, transfer, third_party, upgrade]` | 4 fields |
|
|
88
|
+
| 0.5.0-alpha.4 | `[plg, ISSUANCE_LOGIC, transfer, third_party, upgrade, pending]` | 6 fields |
|
|
89
|
+
|
|
90
|
+
Indices 1, 2 and 3 all hold a `Credential` before and after the change. An alpha.3 positional
|
|
91
|
+
reader therefore returns well-formed credentials with the wrong meanings: `transfer_cred` moved
|
|
92
|
+
to index 2, `third_party_cred` moved to index 3, and the old index 3 is no longer the upgrade
|
|
93
|
+
credential. Nothing throws or fails to decode. Change positional readers to the six-field alpha.4
|
|
94
|
+
layout and treat the field names, not their old positions, as the authority.
|
|
95
|
+
|
|
96
|
+
⛔ **Every mint and burn now needs `issuance_logic`'s withdraw-0.** `issuance_mint` does not
|
|
97
|
+
diagnose an omitted withdrawal: `covered_by` scans the transaction redeemers, returns `False` when
|
|
98
|
+
it finds no matching withdrawal, and the mint fails naming no withdrawal, no policy and no index.
|
|
99
|
+
Calling `register()`, `mint()`, or `burn()` on a 0.9.0 protocol emits the withdrawal and its
|
|
100
|
+
policy-keyed redeemer alongside the minting-logic withdrawal.
|
|
101
|
+
|
|
102
|
+
⚠ **CIP-68 metadata now meets the deployment's inline-datum bound on the issuance path.** At the
|
|
103
|
+
CIP-68 datum shape, the chain's `serialise_data` measurement is exactly 2 bytes fewer than the
|
|
104
|
+
SDK's `Data.toCBORBytes` measurement: Evolution emits indefinite-length CBOR for the outer
|
|
105
|
+
constructor and metadata map, while Plutus's canonical encoder uses definite-length headers. The
|
|
106
|
+
SDK is conservative: it never accepts a record the chain refuses. A caller's usable budget is
|
|
107
|
+
`maxInlineDatumBytes - 2`; do not loosen the SDK comparison to reclaim those two bytes.
|
|
108
|
+
|
|
109
|
+
| what changed | before | after |
|
|
110
|
+
|---|---|---|
|
|
111
|
+
| params NFT policy vs address | two derivations | **one hash serves both** (`protocolParams.policyId`) |
|
|
112
|
+
| registry node policy vs address | `directoryMint` / `directorySpend` | **one hash serves both** (`registry.scriptHash`) |
|
|
113
|
+
| protocol-params datum | 7 fields | **4** in alpha.3, then **6** in alpha.4 |
|
|
114
|
+
| PLB redeemer | `SpendVia*` enum | `BaseSpendRedeemer` record; the act moved to the dispatcher |
|
|
115
|
+
| `transferRedeemer` | `(params_idx, proofs)` | `(proofs)` |
|
|
116
|
+
| `thirdPartyRedeemer` / `unfrackingRedeemer` | `(params_idx, node_idx, outputs_start_idx)` | `(node_idx, outputs_start_idx)` |
|
|
117
|
+
| every programmable tx | delegate withdraw-0 | **plus the dispatcher's** — every `wdrl_idx` shifts |
|
|
118
|
+
| every mint and burn | minting-logic withdraw-0 | **plus `issuance_logic`** |
|
|
119
|
+
| new deployment input | — | `maxInlineDatumBytes`, a **choice**, baked into four script hashes |
|
|
120
|
+
| gone | `coordinationNonce`, `coordination`, `directoryMint`, `directorySpend` | — |
|
|
121
|
+
|
|
122
|
+
⚠ **`max_inline_datum_bytes` changed KIND, not just place.** It was a mutable datum field
|
|
123
|
+
(re-tunable by an in-place upgrade) and is now a compile-time parameter of four delegates —
|
|
124
|
+
`transfer`, `third_party`, `unfracking` and `issuance_logic` — so changing it is a redeployment.
|
|
125
|
+
|
|
126
|
+
⚠ **Neither an alpha.3 nor an alpha.2 deployment can be represented by this SDK.** A 4-field
|
|
127
|
+
alpha.3 params datum and a 7-field alpha.2 one are rejected outright rather than read
|
|
128
|
+
positionally. No published release of this SDK operates an alpha.3 instance; its 0.8.x source line
|
|
129
|
+
must be built from git. Point an alpha.2 instance at a published 0.7.x release.
|
|
130
|
+
|
|
61
131
|
## Examples
|
|
62
132
|
|
|
63
133
|
> ### ⚠ The examples do not currently run. Do not follow this section yet.
|
|
@@ -65,8 +135,8 @@ await client.awaitTx(txHash);
|
|
|
65
135
|
> Two things are wrong with it, both known and neither hidden:
|
|
66
136
|
>
|
|
67
137
|
> 1. **The scripts target a superseded protocol.** They are written against a CIP-113 **0.3.x**
|
|
68
|
-
> deployment on preprod. This SDK now targets **0.5.0-alpha.
|
|
69
|
-
>
|
|
138
|
+
> deployment on preprod. This SDK now targets **0.5.0-alpha.3**, in which `DeploymentParams`
|
|
139
|
+
> has a different shape again — see the migration note below.
|
|
70
140
|
> The scripts cannot work against that deployment, and the deployment cannot be represented
|
|
71
141
|
> by this SDK.
|
|
72
142
|
> 2. **`.env.example` does not exist.** The `cp` below has never worked.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"artifact": "plutus.json",
|
|
3
|
+
"sha256": "19bd7f1d4f5db0f0b63e3229d2393dd645d84ca8dd4d3318d78a5e5fbe364b34",
|
|
4
|
+
"declares": {
|
|
5
|
+
"title": "cardano-foundation/cip113-programmable-tokens",
|
|
6
|
+
"version": "0.5.0-alpha.3",
|
|
7
|
+
"compiler": "Aiken v1.1.23+8949565",
|
|
8
|
+
"validators": 28
|
|
9
|
+
},
|
|
10
|
+
"upstream": {
|
|
11
|
+
"repo": "https://github.com/cardano-foundation/cip113-programmable-tokens",
|
|
12
|
+
"commit": "f14b3594e1d6d3ae9e8511b99d39f17dfd4a3b65",
|
|
13
|
+
"ref": "main",
|
|
14
|
+
"note": "PINNED TO THE COMMIT, NOT THE VERSION STRING — same reasoning as v0.5.0-alpha.2: upstream publishes NO git tags, so \"0.5.0-alpha.3\" is a `version` field inside plutus.json on a MOVING branch and will eventually name two different programs. Reachability was VERIFIED, not assumed: `git merge-base --is-ancestor f14b359 origin/main` after a fetch. Full 40-char sha recorded deliberately — this repo has twice pinned an abbreviation or an orphan (013c1154, then 2e067fe, which GitHub's squash-merge orphaned the instant it landed)."
|
|
15
|
+
},
|
|
16
|
+
"blueprint_reproduced": true,
|
|
17
|
+
"provenance": "VERIFIED",
|
|
18
|
+
"reproduce": {
|
|
19
|
+
"requires": "Aiken v1.1.23+8949565",
|
|
20
|
+
"command": "git clone https://github.com/cardano-foundation/cip113-programmable-tokens && git checkout f14b3594e1d6d3ae9e8511b99d39f17dfd4a3b65 && aikup install v1.1.23 && aiken build",
|
|
21
|
+
"note": "`aikup install v1.1.23` with the version explicit, never bare `aikup install`, which follows latest and will stop reproducing this artifact the moment v1.1.24 ships. ⚠ aiken BUILDS ANYWAY on a mismatched compiler, emitting only a warning — check the preamble's compiler field, do not trust the environment."
|
|
22
|
+
},
|
|
23
|
+
"verified": {
|
|
24
|
+
"date": "2026-09-07",
|
|
25
|
+
"method": "REPRODUCED FROM SOURCE",
|
|
26
|
+
"findings": [
|
|
27
|
+
"OBSERVED: `aiken build` at upstream commit f14b3594e1d6d3ae9e8511b99d39f17dfd4a3b65, with Aiken v1.1.23+8949565, produced a plutus.json BYTE-IDENTICAL to the one upstream commits at that same commit. Both sha256 19bd7f1d4f5db0f0b63e3229d2393dd645d84ca8dd4d3318d78a5e5fbe364b34, both 113366 bytes. The build ran in a THROWAWAY CLONE, and upstream's committed plutus.json was DELETED before the build so it could not be mistaken for output.",
|
|
28
|
+
"⚠ ONE DEPENDENCY IS A MUTABLE BRANCH, AND THE REPRODUCIBILITY CLAIM IS SCOPED ACCORDINGLY. aiken.toml pins `aiken-lang/stdlib` to the TAG v3.1.0 (immutable), but `aiken-lang/fuzz` to `main` — a BRANCH. aiken.lock's [etags] records the fetched content hash. `fuzz` is referenced only from `test` and `bench` definitions and the generators serving them; `aiken build` emits neither, which is why byte-identity holds despite the mutable pin. A future rebuild could still see a different `fuzz` without that changing this blueprint.",
|
|
29
|
+
"This is the ONLY 0.5.0-alpha.3 artifact this repository ships, and it supersedes NOTHING: v0.5.0-alpha.2 is retained alongside because a LIVE preview protocol instance runs it (bootstrap tx 35954fc8c92db95dc7d1de361da3fe7d6ad0f6711f9501ebf7d7cf4219262031) and its record is deployments/preview/alpha2.json. Deleting alpha.2 would orphan a running deployment.",
|
|
30
|
+
"SURFACE DELTA vs alpha.2, measured by hashing every validator either side rather than read from upstream's changelog: 4 unchanged, 15 changed, 9 added, 8 removed (handler-level). Distinct validators REMOVED: coordination_spend, protocol_params_mint, registry_mint, registry_spend. ADDED: programmable_logic_global (3 params, the reintroduced dispatcher), protocol_params (1 param, mint+spend merged), registry (2 params, mint+spend merged). ARITY CHANGES: transfer, third_party and unfracking all go 1 -> 3 parameters while keeping their titles — a title that survives is not a validator that survived.",
|
|
31
|
+
"⚠ ProgrammableLogicGlobalParams went from SEVEN fields to FOUR, and not by truncation: it is now (plg_cred, transfer_cred, third_party_cred, upgrade_cred). registry_node_cs, unfracking_cred and max_inline_datum_bytes are gone; plg_cred is new. A positional parser written for the 7-field shape misreads every field from index 0 and throws nothing. RegistryNode is UNCHANGED at 7 fields.",
|
|
32
|
+
"DERIVED: because the pin is keyed to a commit on a moving branch, re-running `aiken build` against `main` at a LATER date will legitimately produce a different artifact. That is not drift in this pin — it is a new pin. Do not update this file's sha256 to make a newer build pass; add a new directory."
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
}
|