@easy1staking/cip113-sdk-ts 0.1.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.
Files changed (61) hide show
  1. package/README.md +49 -0
  2. package/blueprints/standard/v0.3.0/plutus.json +596 -0
  3. package/blueprints/substandards/dummy/v0.1.0/plutus.json +58 -0
  4. package/blueprints/substandards/freeze-and-seize/v0.1.0/plutus.json +380 -0
  5. package/dist/core/evo-utils.d.ts +160 -0
  6. package/dist/core/evo-utils.d.ts.map +1 -0
  7. package/dist/core/evo-utils.js +401 -0
  8. package/dist/core/evo-utils.js.map +1 -0
  9. package/dist/core/registry.d.ts +31 -0
  10. package/dist/core/registry.d.ts.map +1 -0
  11. package/dist/core/registry.js +72 -0
  12. package/dist/core/registry.js.map +1 -0
  13. package/dist/index.d.ts +89 -0
  14. package/dist/index.d.ts.map +1 -0
  15. package/dist/index.js +158 -0
  16. package/dist/index.js.map +1 -0
  17. package/dist/provider/address-utils.d.ts +15 -0
  18. package/dist/provider/address-utils.d.ts.map +1 -0
  19. package/dist/provider/address-utils.js +29 -0
  20. package/dist/provider/address-utils.js.map +1 -0
  21. package/dist/provider/tx-utils.d.ts +15 -0
  22. package/dist/provider/tx-utils.d.ts.map +1 -0
  23. package/dist/provider/tx-utils.js +18 -0
  24. package/dist/provider/tx-utils.js.map +1 -0
  25. package/dist/standard/blueprint.d.ts +31 -0
  26. package/dist/standard/blueprint.d.ts.map +1 -0
  27. package/dist/standard/blueprint.js +49 -0
  28. package/dist/standard/blueprint.js.map +1 -0
  29. package/dist/standard/params.d.ts +6 -0
  30. package/dist/standard/params.d.ts.map +1 -0
  31. package/dist/standard/params.js +5 -0
  32. package/dist/standard/params.js.map +1 -0
  33. package/dist/standard/scripts.d.ts +51 -0
  34. package/dist/standard/scripts.d.ts.map +1 -0
  35. package/dist/standard/scripts.js +110 -0
  36. package/dist/standard/scripts.js.map +1 -0
  37. package/dist/substandards/dummy/index.d.ts +16 -0
  38. package/dist/substandards/dummy/index.d.ts.map +1 -0
  39. package/dist/substandards/dummy/index.js +158 -0
  40. package/dist/substandards/dummy/index.js.map +1 -0
  41. package/dist/substandards/freeze-and-seize/index.d.ts +17 -0
  42. package/dist/substandards/freeze-and-seize/index.d.ts.map +1 -0
  43. package/dist/substandards/freeze-and-seize/index.js +769 -0
  44. package/dist/substandards/freeze-and-seize/index.js.map +1 -0
  45. package/dist/substandards/freeze-and-seize/scripts.d.ts +25 -0
  46. package/dist/substandards/freeze-and-seize/scripts.d.ts.map +1 -0
  47. package/dist/substandards/freeze-and-seize/scripts.js +54 -0
  48. package/dist/substandards/freeze-and-seize/scripts.js.map +1 -0
  49. package/dist/substandards/freeze-and-seize/types.d.ts +18 -0
  50. package/dist/substandards/freeze-and-seize/types.d.ts.map +1 -0
  51. package/dist/substandards/freeze-and-seize/types.js +8 -0
  52. package/dist/substandards/freeze-and-seize/types.js.map +1 -0
  53. package/dist/substandards/interface.d.ts +166 -0
  54. package/dist/substandards/interface.d.ts.map +1 -0
  55. package/dist/substandards/interface.js +10 -0
  56. package/dist/substandards/interface.js.map +1 -0
  57. package/dist/types.d.ts +93 -0
  58. package/dist/types.d.ts.map +1 -0
  59. package/dist/types.js +8 -0
  60. package/dist/types.js.map +1 -0
  61. package/package.json +53 -0
package/dist/index.js ADDED
@@ -0,0 +1,158 @@
1
+ /**
2
+ * CIP-113 Programmable Tokens SDK
3
+ *
4
+ * @example
5
+ * ```ts
6
+ * import { CIP113 } from '@cip113/sdk';
7
+ * import { dummySubstandard } from '@cip113/sdk/dummy';
8
+ * import { freezeAndSeizeSubstandard } from '@cip113/sdk/freeze-and-seize';
9
+ *
10
+ * // Create Evolution SDK client
11
+ * const evoClient = client(preprod)
12
+ * .withBlockfrost({ projectId: '...' })
13
+ * .withAddress(walletAddress);
14
+ *
15
+ * const protocol = CIP113.init({
16
+ * client: evoClient,
17
+ * standard: { blueprint: standardBlueprint, deployment: deploymentParams },
18
+ * substandards: [dummySubstandard({ blueprint: dummyBlueprint })],
19
+ * });
20
+ *
21
+ * const tx = await protocol.register('freeze-and-seize', { ... });
22
+ * ```
23
+ */
24
+ import { validateStandardBlueprint } from "./standard/blueprint.js";
25
+ import { buildDeploymentScripts } from "./standard/scripts.js";
26
+ // ---------------------------------------------------------------------------
27
+ // Init
28
+ // ---------------------------------------------------------------------------
29
+ export const CIP113 = {
30
+ /**
31
+ * Initialize a CIP-113 protocol instance.
32
+ *
33
+ * This validates the standard blueprint, parameterizes all standard scripts,
34
+ * and initializes registered substandards.
35
+ */
36
+ init(config) {
37
+ // Validate standard blueprint has all required validators
38
+ validateStandardBlueprint(config.standard.blueprint);
39
+ // Build parameterized standard scripts (uses Evolution SDK directly)
40
+ const scripts = buildDeploymentScripts(config.standard.blueprint, config.standard.deployment);
41
+ // Registry of substandard plugins
42
+ const substandards = new Map();
43
+ // Build the substandard context
44
+ const substandardContext = {
45
+ client: config.client,
46
+ standardScripts: scripts,
47
+ deployment: config.standard.deployment,
48
+ network: config.client.chain.id === 1 ? "mainnet" : "preprod",
49
+ };
50
+ // Initialize and register provided substandards
51
+ if (config.substandards) {
52
+ for (const plugin of config.substandards) {
53
+ plugin.init(substandardContext);
54
+ substandards.set(plugin.id, plugin);
55
+ }
56
+ }
57
+ // Helper: try all substandards
58
+ async function tryAllSubstandards(operation, policyId, fn) {
59
+ let lastError;
60
+ for (const plugin of substandards.values()) {
61
+ try {
62
+ return await fn(plugin);
63
+ }
64
+ catch (e) {
65
+ lastError = e;
66
+ continue;
67
+ }
68
+ }
69
+ throw new Error(`No substandard can handle ${operation} for policy ${policyId}. ` +
70
+ `Available: [${[...substandards.keys()].join(", ")}]. ` +
71
+ `Last error: ${lastError instanceof Error ? lastError.message : String(lastError)}. ` +
72
+ `Hint: pass substandardId to route directly.`);
73
+ }
74
+ function requireSubstandard(id) {
75
+ const plugin = substandards.get(id);
76
+ if (!plugin) {
77
+ throw new Error(`Substandard "${id}" not registered. Available: ${[...substandards.keys()].join(", ")}`);
78
+ }
79
+ return plugin;
80
+ }
81
+ return {
82
+ scripts,
83
+ deployment: config.standard.deployment,
84
+ client: config.client,
85
+ async register(substandardId, params) {
86
+ return requireSubstandard(substandardId).register(params);
87
+ },
88
+ async mint(params) {
89
+ if (params.substandardId) {
90
+ return requireSubstandard(params.substandardId).mint(params);
91
+ }
92
+ return tryAllSubstandards("mint", params.tokenPolicyId, (p) => p.mint(params));
93
+ },
94
+ async burn(params) {
95
+ if (params.substandardId) {
96
+ return requireSubstandard(params.substandardId).burn(params);
97
+ }
98
+ return tryAllSubstandards("burn", params.tokenPolicyId, (p) => p.burn(params));
99
+ },
100
+ async transfer(params) {
101
+ if (params.substandardId) {
102
+ return requireSubstandard(params.substandardId).transfer(params);
103
+ }
104
+ return tryAllSubstandards("transfer", params.tokenPolicyId, (p) => p.transfer(params));
105
+ },
106
+ compliance: {
107
+ async init(substandardId, params) {
108
+ const plugin = requireSubstandard(substandardId);
109
+ if (!plugin.initCompliance) {
110
+ throw new Error(`Substandard "${substandardId}" does not support compliance initialization`);
111
+ }
112
+ return plugin.initCompliance(params);
113
+ },
114
+ async freeze(params) {
115
+ return tryAllSubstandards("freeze", params.tokenPolicyId, (p) => {
116
+ if (!p.freeze)
117
+ throw new Error(`${p.id} does not support freeze`);
118
+ return p.freeze(params);
119
+ });
120
+ },
121
+ async unfreeze(params) {
122
+ return tryAllSubstandards("unfreeze", params.tokenPolicyId, (p) => {
123
+ if (!p.unfreeze)
124
+ throw new Error(`${p.id} does not support unfreeze`);
125
+ return p.unfreeze(params);
126
+ });
127
+ },
128
+ async seize(params) {
129
+ return tryAllSubstandards("seize", params.tokenPolicyId, (p) => {
130
+ if (!p.seize)
131
+ throw new Error(`${p.id} does not support seize`);
132
+ return p.seize(params);
133
+ });
134
+ },
135
+ },
136
+ registerSubstandard(plugin) {
137
+ plugin.init(substandardContext);
138
+ substandards.set(plugin.id, plugin);
139
+ },
140
+ getSubstandard(id) {
141
+ return substandards.get(id);
142
+ },
143
+ listSubstandards() {
144
+ return [...substandards.keys()];
145
+ },
146
+ };
147
+ },
148
+ };
149
+ export { buildEvoScript, computeScriptHash, parameterizeScript, scriptAddress, rewardAddress, baseAddress, stakingCredentialHash, paymentCredentialHash, stringToHex, MAX_NEXT, voidData, outputReference, scriptCredential, keyCredential, labeledAssetName, stripCIP67Label, hasCIP67Label, buildCIP68FTDatum, } from "./core/evo-utils.js";
150
+ export { sortTxInputs, findRefInputIndex } from "./core/registry.js";
151
+ export { addressHexToBech32 } from "./provider/address-utils.js";
152
+ export { assembleSignedTx } from "./provider/tx-utils.js";
153
+ // Re-export Evolution SDK essentials so consumers don't need a direct dependency
154
+ export { preview as previewChain, preprod as preprodChain, mainnet as mainnetChain, Address as EvoAddress, Assets as EvoAssets, TransactionHash as EvoTransactionHash, Transaction as EvoTransaction, Data as EvoData, } from "@evolution-sdk/evolution";
155
+ // In 0.4.0 `client(chain)` became `Client.make(chain)` — re-export a compatible wrapper
156
+ import { Client } from "@evolution-sdk/evolution";
157
+ export const evoClient = Client.make;
158
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAgBH,OAAO,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAgC,MAAM,uBAAuB,CAAC;AA4E7F,8EAA8E;AAC9E,OAAO;AACP,8EAA8E;AAE9E,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB;;;;;OAKG;IACH,IAAI,CAAC,MAAoB;QACvB,0DAA0D;QAC1D,yBAAyB,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;QAErD,qEAAqE;QACrE,MAAM,OAAO,GAAG,sBAAsB,CACpC,MAAM,CAAC,QAAQ,CAAC,SAAS,EACzB,MAAM,CAAC,QAAQ,CAAC,UAAU,CAC3B,CAAC;QAEF,kC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AAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAG1D,iFAAiF;AACjF,OAAO,EACL,OAAO,IAAI,YAAY,EACvB,OAAO,IAAI,YAAY,EACvB,OAAO,IAAI,YAAY,EACvB,OAAO,IAAI,UAAU,EACrB,MAAM,IAAI,SAAS,EACnB,eAAe,IAAI,kBAAkB,EACrC,WAAW,IAAI,cAAc,EAC7B,IAAI,IAAI,OAAO,GAChB,MAAM,0BAA0B,CAAC;AAElC,wFAAwF;AACxF,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Address utilities using Evolution SDK.
3
+ *
4
+ * This is the only other file (besides the adapter) that imports Evolution SDK,
5
+ * specifically for address format conversion.
6
+ */
7
+ /**
8
+ * Convert a hex-encoded Cardano address to bech32.
9
+ * If already bech32, returns as-is.
10
+ *
11
+ * CIP-30 wallets return hex-encoded addresses — this converts them
12
+ * to the human-readable bech32 format (addr_test1..., addr1..., stake_test1...).
13
+ */
14
+ export declare function addressHexToBech32(hexOrBech32: string): string;
15
+ //# sourceMappingURL=address-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"address-utils.d.ts","sourceRoot":"","sources":["../../src/provider/address-utils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAa9D"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Address utilities using Evolution SDK.
3
+ *
4
+ * This is the only other file (besides the adapter) that imports Evolution SDK,
5
+ * specifically for address format conversion.
6
+ */
7
+ import { Address as EvoAddress } from "@evolution-sdk/evolution";
8
+ /**
9
+ * Convert a hex-encoded Cardano address to bech32.
10
+ * If already bech32, returns as-is.
11
+ *
12
+ * CIP-30 wallets return hex-encoded addresses — this converts them
13
+ * to the human-readable bech32 format (addr_test1..., addr1..., stake_test1...).
14
+ */
15
+ export function addressHexToBech32(hexOrBech32) {
16
+ // Already bech32?
17
+ if (hexOrBech32.startsWith("addr") || hexOrBech32.startsWith("stake")) {
18
+ return hexOrBech32;
19
+ }
20
+ try {
21
+ const addr = EvoAddress.fromHex(hexOrBech32);
22
+ return EvoAddress.toBech32(addr);
23
+ }
24
+ catch {
25
+ // If Evolution SDK can't parse it, return as-is
26
+ return hexOrBech32;
27
+ }
28
+ }
29
+ //# sourceMappingURL=address-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"address-utils.js","sourceRoot":"","sources":["../../src/provider/address-utils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEjE;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAAC,WAAmB;IACpD,kBAAkB;IAClB,IAAI,WAAW,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,WAAW,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QACtE,OAAO,WAAW,CAAC;IACrB,CAAC;IAED,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,UAAU,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QAC7C,OAAO,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IAAC,MAAM,CAAC;QACP,gDAAgD;QAChD,OAAO,WAAW,CAAC;IACrB,CAAC;AACH,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Transaction utilities — witness merging for CIP-103 stake registration flows.
3
+ *
4
+ * Previously contained a manual CBOR-level workaround for
5
+ * https://github.com/IntersectMBO/evolution-sdk/issues/232
6
+ * Fixed in @evolution-sdk/evolution 0.4.0 — now delegates to the SDK.
7
+ */
8
+ /**
9
+ * Assemble a signed transaction from an unsigned tx CBOR hex and a
10
+ * CIP-30 witness set CBOR hex. Merges vkey witnesses into the transaction.
11
+ *
12
+ * This function will likely be removed once CIP-103 is fully implemented.
13
+ */
14
+ export declare function assembleSignedTx(unsignedTxHex: string, witnessSetHex: string): string;
15
+ //# sourceMappingURL=tx-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tx-utils.d.ts","sourceRoot":"","sources":["../../src/provider/tx-utils.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,aAAa,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,MAAM,CAErF"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Transaction utilities — witness merging for CIP-103 stake registration flows.
3
+ *
4
+ * Previously contained a manual CBOR-level workaround for
5
+ * https://github.com/IntersectMBO/evolution-sdk/issues/232
6
+ * Fixed in @evolution-sdk/evolution 0.4.0 — now delegates to the SDK.
7
+ */
8
+ import { Transaction } from "@evolution-sdk/evolution";
9
+ /**
10
+ * Assemble a signed transaction from an unsigned tx CBOR hex and a
11
+ * CIP-30 witness set CBOR hex. Merges vkey witnesses into the transaction.
12
+ *
13
+ * This function will likely be removed once CIP-103 is fully implemented.
14
+ */
15
+ export function assembleSignedTx(unsignedTxHex, witnessSetHex) {
16
+ return Transaction.addVKeyWitnessesHex(unsignedTxHex, witnessSetHex);
17
+ }
18
+ //# sourceMappingURL=tx-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tx-utils.js","sourceRoot":"","sources":["../../src/provider/tx-utils.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,aAAqB,EAAE,aAAqB;IAC3E,OAAO,WAAW,CAAC,mBAAmB,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;AACvE,CAAC"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Blueprint loading and validator lookup.
3
+ */
4
+ import type { PlutusBlueprint, BlueprintValidator, HexString } from "../types.js";
5
+ /**
6
+ * Standard validator titles as they appear in the blueprint.
7
+ */
8
+ export declare const STANDARD_VALIDATORS: {
9
+ readonly ALWAYS_FAIL: "always_fail.always_fail.spend";
10
+ readonly PROTOCOL_PARAMS_MINT: "protocol_params_mint.protocol_params_mint.mint";
11
+ readonly PROGRAMMABLE_LOGIC_GLOBAL: "programmable_logic_global.programmable_logic_global.withdraw";
12
+ readonly PROGRAMMABLE_LOGIC_BASE: "programmable_logic_base.programmable_logic_base.spend";
13
+ readonly ISSUANCE_CBOR_HEX_MINT: "issuance_cbor_hex_mint.issuance_cbor_hex_mint.mint";
14
+ readonly ISSUANCE_MINT: "issuance_mint.issuance_mint.mint";
15
+ readonly REGISTRY_MINT: "registry_mint.registry_mint.mint";
16
+ readonly REGISTRY_SPEND: "registry_spend.registry_spend.spend";
17
+ };
18
+ /**
19
+ * Get a validator's compiled code from a blueprint by title.
20
+ * Throws if the validator is not found.
21
+ */
22
+ export declare function getValidatorCode(blueprint: PlutusBlueprint, title: string): HexString;
23
+ /**
24
+ * Get a validator entry from a blueprint by title.
25
+ */
26
+ export declare function getValidator(blueprint: PlutusBlueprint, title: string): BlueprintValidator;
27
+ /**
28
+ * Validate that a blueprint contains all required standard validators.
29
+ */
30
+ export declare function validateStandardBlueprint(blueprint: PlutusBlueprint): void;
31
+ //# sourceMappingURL=blueprint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blueprint.d.ts","sourceRoot":"","sources":["../../src/standard/blueprint.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAElF;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;CAStB,CAAC;AAEX;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,eAAe,EAC1B,KAAK,EAAE,MAAM,GACZ,SAAS,CAQX;AAED;;GAEG;AACH,wBAAgB,YAAY,CAC1B,SAAS,EAAE,eAAe,EAC1B,KAAK,EAAE,MAAM,GACZ,kBAAkB,CAQpB;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,eAAe,GAAG,IAAI,CAS1E"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Blueprint loading and validator lookup.
3
+ */
4
+ /**
5
+ * Standard validator titles as they appear in the blueprint.
6
+ */
7
+ export const STANDARD_VALIDATORS = {
8
+ ALWAYS_FAIL: "always_fail.always_fail.spend",
9
+ PROTOCOL_PARAMS_MINT: "protocol_params_mint.protocol_params_mint.mint",
10
+ PROGRAMMABLE_LOGIC_GLOBAL: "programmable_logic_global.programmable_logic_global.withdraw",
11
+ PROGRAMMABLE_LOGIC_BASE: "programmable_logic_base.programmable_logic_base.spend",
12
+ ISSUANCE_CBOR_HEX_MINT: "issuance_cbor_hex_mint.issuance_cbor_hex_mint.mint",
13
+ ISSUANCE_MINT: "issuance_mint.issuance_mint.mint",
14
+ REGISTRY_MINT: "registry_mint.registry_mint.mint",
15
+ REGISTRY_SPEND: "registry_spend.registry_spend.spend",
16
+ };
17
+ /**
18
+ * Get a validator's compiled code from a blueprint by title.
19
+ * Throws if the validator is not found.
20
+ */
21
+ export function getValidatorCode(blueprint, title) {
22
+ const validator = blueprint.validators.find((v) => v.title === title);
23
+ if (!validator) {
24
+ throw new Error(`Validator "${title}" not found in blueprint "${blueprint.preamble.title} v${blueprint.preamble.version}"`);
25
+ }
26
+ return validator.compiledCode;
27
+ }
28
+ /**
29
+ * Get a validator entry from a blueprint by title.
30
+ */
31
+ export function getValidator(blueprint, title) {
32
+ const validator = blueprint.validators.find((v) => v.title === title);
33
+ if (!validator) {
34
+ throw new Error(`Validator "${title}" not found in blueprint "${blueprint.preamble.title} v${blueprint.preamble.version}"`);
35
+ }
36
+ return validator;
37
+ }
38
+ /**
39
+ * Validate that a blueprint contains all required standard validators.
40
+ */
41
+ export function validateStandardBlueprint(blueprint) {
42
+ const titles = blueprint.validators.map((v) => v.title);
43
+ for (const [name, title] of Object.entries(STANDARD_VALIDATORS)) {
44
+ if (!titles.includes(title)) {
45
+ throw new Error(`Standard blueprint is missing required validator "${name}" (title: "${title}")`);
46
+ }
47
+ }
48
+ }
49
+ //# sourceMappingURL=blueprint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blueprint.js","sourceRoot":"","sources":["../../src/standard/blueprint.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,WAAW,EAAE,+BAA+B;IAC5C,oBAAoB,EAAE,gDAAgD;IACtE,yBAAyB,EAAE,8DAA8D;IACzF,uBAAuB,EAAE,uDAAuD;IAChF,sBAAsB,EAAE,oDAAoD;IAC5E,aAAa,EAAE,kCAAkC;IACjD,aAAa,EAAE,kCAAkC;IACjD,cAAc,EAAE,qCAAqC;CAC7C,CAAC;AAEX;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAC9B,SAA0B,EAC1B,KAAa;IAEb,MAAM,SAAS,GAAG,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC;IACtE,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CACb,cAAc,KAAK,6BAA6B,SAAS,CAAC,QAAQ,CAAC,KAAK,KAAK,SAAS,CAAC,QAAQ,CAAC,OAAO,GAAG,CAC3G,CAAC;IACJ,CAAC;IACD,OAAO,SAAS,CAAC,YAAY,CAAC;AAChC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAC1B,SAA0B,EAC1B,KAAa;IAEb,MAAM,SAAS,GAAG,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC;IACtE,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CACb,cAAc,KAAK,6BAA6B,SAAS,CAAC,QAAQ,CAAC,KAAK,KAAK,SAAS,CAAC,QAAQ,CAAC,OAAO,GAAG,CAC3G,CAAC;IACJ,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,yBAAyB,CAAC,SAA0B;IAClE,MAAM,MAAM,GAAG,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IACxD,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,mBAAmB,CAAC,EAAE,CAAC;QAChE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;YAC5B,MAAM,IAAI,KAAK,CACb,qDAAqD,IAAI,cAAc,KAAK,IAAI,CACjF,CAAC;QACJ,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Re-export DeploymentParams and provide helpers for working with them.
3
+ */
4
+ export type { DeploymentParams } from "../types.js";
5
+ export type { TxInput } from "../types.js";
6
+ //# sourceMappingURL=params.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"params.d.ts","sourceRoot":"","sources":["../../src/standard/params.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,YAAY,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACpD,YAAY,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Re-export DeploymentParams and provide helpers for working with them.
3
+ */
4
+ export {};
5
+ //# sourceMappingURL=params.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"params.js","sourceRoot":"","sources":["../../src/standard/params.ts"],"names":[],"mappings":"AAAA;;GAEG"}
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Standard script parameterization.
3
+ *
4
+ * Replicates the parameterization chain from ProtocolScriptBuilderService.java.
5
+ * Uses Evolution SDK directly for UPLC.applyParamsToScript and ScriptHash.
6
+ *
7
+ * Dependency graph:
8
+ *
9
+ * always_fail(nonce) → hash
10
+ * protocol_params_mint(utxo_ref, always_fail_hash) → hash
11
+ * programmable_logic_global(protocol_params_hash) → hash
12
+ * programmable_logic_base(Script(plg_hash)) → hash
13
+ * issuance_cbor_hex_mint(utxo_ref, always_fail_hash) → hash
14
+ * registry_mint(utxo_ref, issuance_cbor_hex_hash) → hash
15
+ * registry_spend(protocol_params_hash) → hash
16
+ * issuance_mint(Script(plb_hash), registry_mint_hash, Script(minting_logic_hash)) → hash
17
+ */
18
+ import type { DeploymentParams, HexString, PlutusBlueprint, PlutusScript, ScriptHash, TxInput } from "../types.js";
19
+ export interface StandardScripts {
20
+ alwaysFail(nonce: HexString): PlutusScript;
21
+ protocolParamsMint(utxoRef: TxInput, alwaysFailHash: ScriptHash): PlutusScript;
22
+ programmableLogicGlobal(protocolParamsHash: ScriptHash): PlutusScript;
23
+ programmableLogicBase(plgHash: ScriptHash): PlutusScript;
24
+ issuanceCborHexMint(utxoRef: TxInput, alwaysFailHash: ScriptHash): PlutusScript;
25
+ registryMint(utxoRef: TxInput, issuanceCborHexHash: ScriptHash): PlutusScript;
26
+ registrySpend(protocolParamsHash: ScriptHash): PlutusScript;
27
+ issuanceMint(plbHash: ScriptHash, registryMintHash: ScriptHash, mintingLogicHash: ScriptHash): PlutusScript;
28
+ }
29
+ /**
30
+ * Create standard script builders from a blueprint.
31
+ * Uses Evolution SDK directly for parameterization and hashing.
32
+ */
33
+ export declare function createStandardScripts(blueprint: PlutusBlueprint): StandardScripts;
34
+ /**
35
+ * Build resolved standard scripts from deployment params.
36
+ *
37
+ * IMPORTANT: Uses the known hashes from DeploymentParams (the source of truth)
38
+ * rather than re-deriving them from the blueprint.
39
+ */
40
+ export declare function buildDeploymentScripts(blueprint: PlutusBlueprint, deployment: DeploymentParams): ResolvedStandardScripts;
41
+ export interface ResolvedStandardScripts {
42
+ protocolParamsMint: PlutusScript;
43
+ programmableLogicGlobal: PlutusScript;
44
+ programmableLogicBase: PlutusScript;
45
+ issuanceCborHexMint: PlutusScript;
46
+ registryMint: PlutusScript;
47
+ registrySpend: PlutusScript;
48
+ /** Build issuance_mint for a specific minting logic — NOT cached */
49
+ buildIssuanceMint(mintingLogicHash: ScriptHash): PlutusScript;
50
+ }
51
+ //# sourceMappingURL=scripts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scripts.d.ts","sourceRoot":"","sources":["../../src/standard/scripts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,KAAK,EACV,gBAAgB,EAChB,SAAS,EACT,eAAe,EACf,YAAY,EACZ,UAAU,EACV,OAAO,EACR,MAAM,aAAa,CAAC;AAYrB,MAAM,WAAW,eAAe;IAC9B,UAAU,CAAC,KAAK,EAAE,SAAS,GAAG,YAAY,CAAC;IAC3C,kBAAkB,CAAC,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,UAAU,GAAG,YAAY,CAAC;IAC/E,uBAAuB,CAAC,kBAAkB,EAAE,UAAU,GAAG,YAAY,CAAC;IACtE,qBAAqB,CAAC,OAAO,EAAE,UAAU,GAAG,YAAY,CAAC;IACzD,mBAAmB,CAAC,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,UAAU,GAAG,YAAY,CAAC;IAChF,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,UAAU,GAAG,YAAY,CAAC;IAC9E,aAAa,CAAC,kBAAkB,EAAE,UAAU,GAAG,YAAY,CAAC;IAC5D,YAAY,CAAC,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,UAAU,EAAE,gBAAgB,EAAE,UAAU,GAAG,YAAY,CAAC;CAC7G;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,eAAe,GACzB,eAAe,CA4DjB;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,eAAe,EAC1B,UAAU,EAAE,gBAAgB,GAC3B,uBAAuB,CAmDzB;AAED,MAAM,WAAW,uBAAuB;IACtC,kBAAkB,EAAE,YAAY,CAAC;IACjC,uBAAuB,EAAE,YAAY,CAAC;IACtC,qBAAqB,EAAE,YAAY,CAAC;IACpC,mBAAmB,EAAE,YAAY,CAAC;IAClC,YAAY,EAAE,YAAY,CAAC;IAC3B,aAAa,EAAE,YAAY,CAAC;IAC5B,oEAAoE;IACpE,iBAAiB,CAAC,gBAAgB,EAAE,UAAU,GAAG,YAAY,CAAC;CAC/D"}
@@ -0,0 +1,110 @@
1
+ /**
2
+ * Standard script parameterization.
3
+ *
4
+ * Replicates the parameterization chain from ProtocolScriptBuilderService.java.
5
+ * Uses Evolution SDK directly for UPLC.applyParamsToScript and ScriptHash.
6
+ *
7
+ * Dependency graph:
8
+ *
9
+ * always_fail(nonce) → hash
10
+ * protocol_params_mint(utxo_ref, always_fail_hash) → hash
11
+ * programmable_logic_global(protocol_params_hash) → hash
12
+ * programmable_logic_base(Script(plg_hash)) → hash
13
+ * issuance_cbor_hex_mint(utxo_ref, always_fail_hash) → hash
14
+ * registry_mint(utxo_ref, issuance_cbor_hex_hash) → hash
15
+ * registry_spend(protocol_params_hash) → hash
16
+ * issuance_mint(Script(plb_hash), registry_mint_hash, Script(minting_logic_hash)) → hash
17
+ */
18
+ import { Data } from "@evolution-sdk/evolution";
19
+ import { getValidatorCode, STANDARD_VALIDATORS } from "./blueprint.js";
20
+ import { parameterizeScript, outputReference, scriptCredential, } from "../core/evo-utils.js";
21
+ /**
22
+ * Create standard script builders from a blueprint.
23
+ * Uses Evolution SDK directly for parameterization and hashing.
24
+ */
25
+ export function createStandardScripts(blueprint) {
26
+ function parameterize(validatorTitle, params) {
27
+ const code = getValidatorCode(blueprint, validatorTitle);
28
+ return parameterizeScript(code, params);
29
+ }
30
+ return {
31
+ alwaysFail(nonce) {
32
+ return parameterize(STANDARD_VALIDATORS.ALWAYS_FAIL, [
33
+ Data.bytearray(nonce),
34
+ ]);
35
+ },
36
+ protocolParamsMint(utxoRef, alwaysFailHash) {
37
+ return parameterize(STANDARD_VALIDATORS.PROTOCOL_PARAMS_MINT, [
38
+ outputReference(utxoRef),
39
+ Data.bytearray(alwaysFailHash),
40
+ ]);
41
+ },
42
+ programmableLogicGlobal(protocolParamsHash) {
43
+ return parameterize(STANDARD_VALIDATORS.PROGRAMMABLE_LOGIC_GLOBAL, [
44
+ Data.bytearray(protocolParamsHash),
45
+ ]);
46
+ },
47
+ programmableLogicBase(plgHash) {
48
+ return parameterize(STANDARD_VALIDATORS.PROGRAMMABLE_LOGIC_BASE, [
49
+ scriptCredential(plgHash),
50
+ ]);
51
+ },
52
+ issuanceCborHexMint(utxoRef, alwaysFailHash) {
53
+ return parameterize(STANDARD_VALIDATORS.ISSUANCE_CBOR_HEX_MINT, [
54
+ outputReference(utxoRef),
55
+ Data.bytearray(alwaysFailHash),
56
+ ]);
57
+ },
58
+ registryMint(utxoRef, issuanceCborHexHash) {
59
+ return parameterize(STANDARD_VALIDATORS.REGISTRY_MINT, [
60
+ outputReference(utxoRef),
61
+ Data.bytearray(issuanceCborHexHash),
62
+ ]);
63
+ },
64
+ registrySpend(protocolParamsHash) {
65
+ return parameterize(STANDARD_VALIDATORS.REGISTRY_SPEND, [
66
+ Data.bytearray(protocolParamsHash),
67
+ ]);
68
+ },
69
+ issuanceMint(plbHash, registryMintHash, mintingLogicHash) {
70
+ return parameterize(STANDARD_VALIDATORS.ISSUANCE_MINT, [
71
+ scriptCredential(plbHash),
72
+ Data.bytearray(registryMintHash),
73
+ scriptCredential(mintingLogicHash),
74
+ ]);
75
+ },
76
+ };
77
+ }
78
+ /**
79
+ * Build resolved standard scripts from deployment params.
80
+ *
81
+ * IMPORTANT: Uses the known hashes from DeploymentParams (the source of truth)
82
+ * rather than re-deriving them from the blueprint.
83
+ */
84
+ export function buildDeploymentScripts(blueprint, deployment) {
85
+ const builders = createStandardScripts(blueprint);
86
+ const protocolParamsMint = builders.protocolParamsMint(deployment.protocolParams.txInput, deployment.protocolParams.alwaysFailScriptHash);
87
+ protocolParamsMint.hash = deployment.protocolParams.policyId;
88
+ const programmableLogicGlobal = builders.programmableLogicGlobal(deployment.protocolParams.policyId);
89
+ programmableLogicGlobal.hash = deployment.programmableLogicGlobal.scriptHash;
90
+ const programmableLogicBase = builders.programmableLogicBase(deployment.programmableLogicGlobal.scriptHash);
91
+ programmableLogicBase.hash = deployment.programmableLogicBase.scriptHash;
92
+ const issuanceCborHexMint = builders.issuanceCborHexMint(deployment.issuance.txInput, deployment.issuance.alwaysFailScriptHash);
93
+ issuanceCborHexMint.hash = deployment.issuance.policyId;
94
+ const registryMint = builders.registryMint(deployment.directoryMint.txInput, deployment.issuance.policyId);
95
+ registryMint.hash = deployment.directoryMint.scriptHash;
96
+ const registrySpend = builders.registrySpend(deployment.protocolParams.policyId);
97
+ registrySpend.hash = deployment.directorySpend.scriptHash;
98
+ return {
99
+ protocolParamsMint,
100
+ programmableLogicGlobal,
101
+ programmableLogicBase,
102
+ issuanceCborHexMint,
103
+ registryMint,
104
+ registrySpend,
105
+ buildIssuanceMint(mintingLogicHash) {
106
+ return builders.issuanceMint(deployment.programmableLogicBase.scriptHash, deployment.directoryMint.scriptHash, mintingLogicHash);
107
+ },
108
+ };
109
+ }
110
+ //# sourceMappingURL=scripts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scripts.js","sourceRoot":"","sources":["../../src/standard/scripts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAShD,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,gBAAgB,GACjB,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QAAQ,CAAC,OAAO,EAC3B,UAAU,CAAC,QAAQ,CAAC,oBAAoB,CACzC,CAAC;IACF,mBAAmB,CAAC,IAAI,GAAG,UAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC;IAExD,MAAM,YAAY,GAAG,QAAQ,CAAC,YAAY,CACxC,UAAU,CAAC,aAAa,CAAC,OAAO,EAChC,UAAU,CAAC,QAAQ,CAAC,QAAQ,CAC7B,CAAC;IACF,YAAY,CAAC,IAAI,GAAG,UAAU,CAAC,aAAa,CAAC,UAAU,CAAC;IAExD,MAAM,aAAa,GAAG,QAAQ,CAAC,aAAa,CAC1C,UAAU,CAAC,cAAc,CAAC,QAAQ,CACnC,CAAC;IACF,aAAa,CAAC,IAAI,GAAG,UAAU,CAAC,cAAc,CAAC,UAAU,CAAC;IAE1D,OAAO;QACL,kBAAkB;QAClB,uBAAuB;QACvB,qBAAqB;QACrB,mBAAmB;QACnB,YAAY;QACZ,aAAa;QACb,iBAAiB,CAAC,gBAA4B;YAC5C,OAAO,QAAQ,CAAC,YAAY,CAC1B,UAAU,CAAC,qBAAqB,CAAC,UAAU,EAC3C,UAAU,CAAC,aAAa,CAAC,UAAU,EACnC,gBAAgB,CACjB,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Dummy substandard — minimal programmable token.
3
+ *
4
+ * Uses simple withdraw validators:
5
+ * - issue: redeemer == 100
6
+ * - transfer: redeemer == 200
7
+ *
8
+ * No compliance features, no blacklist.
9
+ * Uses Evolution SDK directly — no adapter abstraction.
10
+ */
11
+ import type { PlutusBlueprint } from "../../types.js";
12
+ import type { SubstandardPlugin } from "../interface.js";
13
+ export declare function dummySubstandard(config: {
14
+ blueprint: PlutusBlueprint;
15
+ }): SubstandardPlugin;
16
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/substandards/dummy/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAUH,OAAO,KAAK,EAAE,eAAe,EAAgB,MAAM,gBAAgB,CAAC;AACpE,OAAO,KAAK,EACV,iBAAiB,EAQlB,MAAM,iBAAiB,CAAC;AA6BzB,wBAAgB,gBAAgB,CAAC,MAAM,EAAE;IACvC,SAAS,EAAE,eAAe,CAAC;CAC5B,GAAG,iBAAiB,CAqJpB"}