@lucid-evolution/tx-graph 0.0.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/LICENSE +21 -0
- package/README.md +108 -0
- package/dist/index.cjs +4292 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +477 -0
- package/dist/index.d.ts +477 -0
- package/dist/index.js +4229 -0
- package/dist/index.js.map +1 -0
- package/package.json +54 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,477 @@
|
|
|
1
|
+
import { RedeemerTag, TxHash, Credential, Unit, DatumHash, Datum, ScriptType, ScriptHash, Transaction, RewardAddress, UTxO, Provider, TxOutput } from '@lucid-evolution/core-types';
|
|
2
|
+
import * as CML from '@anastasia-labs/cardano-multiplatform-lib-nodejs';
|
|
3
|
+
|
|
4
|
+
type TraceAmount = string;
|
|
5
|
+
type TraceAssets = Record<Unit | "lovelace", TraceAmount>;
|
|
6
|
+
type TraceOutRef = {
|
|
7
|
+
readonly txHash: TxHash;
|
|
8
|
+
readonly outputIndex: number;
|
|
9
|
+
};
|
|
10
|
+
type TraceStatus = "built" | "signed" | "submitted" | "confirmed" | "failed";
|
|
11
|
+
type TraceScriptRef = {
|
|
12
|
+
readonly type: ScriptType;
|
|
13
|
+
readonly hash?: ScriptHash;
|
|
14
|
+
readonly sizeBytes: number;
|
|
15
|
+
};
|
|
16
|
+
type TraceTxOutput = {
|
|
17
|
+
readonly address: string;
|
|
18
|
+
readonly paymentCredential?: Credential;
|
|
19
|
+
readonly stakeCredential?: Credential;
|
|
20
|
+
readonly assets: TraceAssets;
|
|
21
|
+
readonly datumHash?: DatumHash;
|
|
22
|
+
readonly datum?: Datum;
|
|
23
|
+
readonly scriptRef?: TraceScriptRef;
|
|
24
|
+
};
|
|
25
|
+
type TraceUtxo = TraceOutRef & TraceTxOutput & {
|
|
26
|
+
readonly resolution: "resolved" | "unresolved" | "genesis";
|
|
27
|
+
readonly unresolvedReason?: string;
|
|
28
|
+
readonly tags: string[];
|
|
29
|
+
};
|
|
30
|
+
type TraceRedeemer = {
|
|
31
|
+
readonly tag: RedeemerTag;
|
|
32
|
+
readonly index: TraceAmount;
|
|
33
|
+
readonly redeemerListIndex: number;
|
|
34
|
+
readonly data: string;
|
|
35
|
+
readonly exUnits: {
|
|
36
|
+
readonly mem: TraceAmount;
|
|
37
|
+
readonly steps: TraceAmount;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
type TraceEvaluationRedeemer = {
|
|
41
|
+
readonly tag: RedeemerTag;
|
|
42
|
+
readonly redeemerIndex: number;
|
|
43
|
+
readonly exUnits: {
|
|
44
|
+
readonly mem: TraceAmount;
|
|
45
|
+
readonly steps: TraceAmount;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
type TraceWithdrawal = {
|
|
49
|
+
readonly rewardAddress: RewardAddress;
|
|
50
|
+
readonly amount: TraceAmount;
|
|
51
|
+
};
|
|
52
|
+
type TraceCertificate = {
|
|
53
|
+
readonly index: number;
|
|
54
|
+
readonly kind: number;
|
|
55
|
+
readonly kindName: string;
|
|
56
|
+
readonly cbor?: string;
|
|
57
|
+
};
|
|
58
|
+
type TraceValidityInterval = {
|
|
59
|
+
readonly validFrom?: TraceAmount;
|
|
60
|
+
readonly validTo?: TraceAmount;
|
|
61
|
+
};
|
|
62
|
+
type TraceTransaction = {
|
|
63
|
+
readonly hash: TxHash;
|
|
64
|
+
readonly label?: string;
|
|
65
|
+
readonly status: TraceStatus;
|
|
66
|
+
readonly failureMessage?: string;
|
|
67
|
+
readonly cbor: Transaction;
|
|
68
|
+
readonly sizeBytes: number;
|
|
69
|
+
readonly fee: TraceAmount;
|
|
70
|
+
readonly validityInterval: TraceValidityInterval;
|
|
71
|
+
readonly inputs: TraceOutRef[];
|
|
72
|
+
readonly referenceInputs: TraceOutRef[];
|
|
73
|
+
readonly collateralInputs: TraceOutRef[];
|
|
74
|
+
readonly collateralReturn?: TraceTxOutput;
|
|
75
|
+
readonly totalCollateral?: TraceAmount;
|
|
76
|
+
readonly outputs: TraceUtxo[];
|
|
77
|
+
readonly mint: TraceAssets;
|
|
78
|
+
readonly mintedAssets: TraceAssets;
|
|
79
|
+
readonly burnedAssets: TraceAssets;
|
|
80
|
+
readonly withdrawals: TraceWithdrawal[];
|
|
81
|
+
readonly certificates: TraceCertificate[];
|
|
82
|
+
readonly redeemers: TraceRedeemer[];
|
|
83
|
+
readonly evaluation?: TraceEvaluationRedeemer[];
|
|
84
|
+
readonly requiredSigners: string[];
|
|
85
|
+
readonly auxiliaryDataHash?: string;
|
|
86
|
+
};
|
|
87
|
+
type TraceEdgeKind = "spends" | "reads" | "collateral" | "collateralReturn" | "produces" | "mints" | "burns" | "withdraws" | "certifies" | "requiresSigner";
|
|
88
|
+
type TraceEdge = {
|
|
89
|
+
readonly kind: TraceEdgeKind;
|
|
90
|
+
readonly from: string;
|
|
91
|
+
readonly to: string;
|
|
92
|
+
};
|
|
93
|
+
type TraceWarning = {
|
|
94
|
+
readonly code: string;
|
|
95
|
+
readonly message: string;
|
|
96
|
+
readonly txHash?: TxHash;
|
|
97
|
+
readonly outRef?: TraceOutRef;
|
|
98
|
+
};
|
|
99
|
+
type TraceAliases = {
|
|
100
|
+
readonly assets: Record<string, string>;
|
|
101
|
+
readonly addresses: Record<string, string>;
|
|
102
|
+
};
|
|
103
|
+
type TxGraphTrace = {
|
|
104
|
+
readonly version: 1;
|
|
105
|
+
readonly createdAt?: string;
|
|
106
|
+
readonly transactions: TraceTransaction[];
|
|
107
|
+
readonly utxos: Record<string, TraceUtxo>;
|
|
108
|
+
readonly edges: TraceEdge[];
|
|
109
|
+
readonly warnings: TraceWarning[];
|
|
110
|
+
readonly aliases: TraceAliases;
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
type TxGraphTaggerContext = {
|
|
114
|
+
readonly utxo: TraceUtxo;
|
|
115
|
+
readonly direction: "input" | "output";
|
|
116
|
+
readonly transaction: TraceTransaction;
|
|
117
|
+
readonly graph: TxGraphTrace;
|
|
118
|
+
};
|
|
119
|
+
type TxGraphTagger = (context: TxGraphTaggerContext) => string | ReadonlyArray<string> | undefined;
|
|
120
|
+
declare const tagByAddress: (label: string, address: string) => TxGraphTagger;
|
|
121
|
+
declare const tagByCredential: (label: string, credential: Credential) => TxGraphTagger;
|
|
122
|
+
declare const tagByUnit: (label: string, unit: Unit | "lovelace") => TxGraphTagger;
|
|
123
|
+
declare const tagByPolicyId: (label: string, policyId: string) => TxGraphTagger;
|
|
124
|
+
declare const tagByDatumHash: (label: string, datumHash: DatumHash) => TxGraphTagger;
|
|
125
|
+
declare const tagByDatum: (label: string, predicate: (datum: string, context: TxGraphTaggerContext) => boolean) => TxGraphTagger;
|
|
126
|
+
type TagByScriptRefOptions = {
|
|
127
|
+
readonly type?: ScriptType;
|
|
128
|
+
readonly hash?: string;
|
|
129
|
+
};
|
|
130
|
+
declare const tagByScriptRef: (label: string, options?: TagByScriptRefOptions) => TxGraphTagger;
|
|
131
|
+
type TagChangeOptions = {
|
|
132
|
+
readonly changeAddress?: string;
|
|
133
|
+
readonly walletAddress?: string;
|
|
134
|
+
readonly knownWalletUtxos?: ReadonlyArray<UTxO>;
|
|
135
|
+
};
|
|
136
|
+
declare const tagChange: (label: string, options: TagChangeOptions) => TxGraphTagger;
|
|
137
|
+
|
|
138
|
+
type TxGraphTransactionInput = Transaction | CML.Transaction | {
|
|
139
|
+
toCBOR: (options?: {
|
|
140
|
+
canonical: boolean;
|
|
141
|
+
}) => Transaction;
|
|
142
|
+
} | {
|
|
143
|
+
toTransaction: () => CML.Transaction;
|
|
144
|
+
};
|
|
145
|
+
type ParseTransactionOptions = {
|
|
146
|
+
readonly label?: string;
|
|
147
|
+
readonly status?: TraceStatus;
|
|
148
|
+
};
|
|
149
|
+
declare const parseTransaction: (input: TxGraphTransactionInput, options?: ParseTransactionOptions) => TraceTransaction;
|
|
150
|
+
declare const parseTransactionCbor: (cbor: Transaction, options?: ParseTransactionOptions) => TraceTransaction;
|
|
151
|
+
|
|
152
|
+
type TxGraphResolutionProvider = Pick<Provider, "getUtxosByOutRef">;
|
|
153
|
+
type TxGraphUtxoResolver = (outRefs: TraceOutRef[]) => Promise<ReadonlyArray<UTxO | TraceUtxo>> | ReadonlyArray<UTxO | TraceUtxo>;
|
|
154
|
+
type TxGraphResolutionSource = "scenario-cache" | "provider" | "known-utxos" | "resolver" | "genesis" | "unresolved";
|
|
155
|
+
type ResolveOutRefsOptions = {
|
|
156
|
+
readonly provider?: TxGraphResolutionProvider;
|
|
157
|
+
readonly resolver?: TxGraphUtxoResolver;
|
|
158
|
+
};
|
|
159
|
+
type ResolveOutRefsResult = {
|
|
160
|
+
readonly utxos: TraceUtxo[];
|
|
161
|
+
readonly sources: Record<string, TxGraphResolutionSource>;
|
|
162
|
+
readonly warnings: TraceWarning[];
|
|
163
|
+
};
|
|
164
|
+
type TxGraphResolutionCache = {
|
|
165
|
+
addProducedUtxos: (utxos: ReadonlyArray<TraceUtxo>) => void;
|
|
166
|
+
addTransactionOutputs: (transaction: Pick<TraceTransaction, "outputs">) => void;
|
|
167
|
+
addResolvedUtxos: (utxos: ReadonlyArray<UTxO | TraceUtxo>) => void;
|
|
168
|
+
getProducedUtxo: (outRef: TraceOutRef) => TraceUtxo | undefined;
|
|
169
|
+
getKnownUtxo: (outRef: TraceOutRef) => TraceUtxo | undefined;
|
|
170
|
+
resolveOutRefs: (outRefs: ReadonlyArray<TraceOutRef>, options?: ResolveOutRefsOptions) => Promise<ResolveOutRefsResult>;
|
|
171
|
+
};
|
|
172
|
+
declare const createResolutionCache: () => TxGraphResolutionCache;
|
|
173
|
+
declare const outRefKey: (outRef: TraceOutRef) => string;
|
|
174
|
+
declare const parseOutRefKey: (key: string) => TraceOutRef;
|
|
175
|
+
declare const producedUtxosFromTransaction: (transaction: Pick<TraceTransaction, "outputs">) => TraceUtxo[];
|
|
176
|
+
declare const toTraceUtxo: (utxo: UTxO, options?: {
|
|
177
|
+
readonly tags?: ReadonlyArray<string>;
|
|
178
|
+
readonly resolution?: TraceUtxo["resolution"];
|
|
179
|
+
readonly unresolvedReason?: string;
|
|
180
|
+
}) => TraceUtxo;
|
|
181
|
+
declare const toTraceTxOutput: (output: TxOutput) => TraceTxOutput;
|
|
182
|
+
declare const unresolvedUtxo: (outRef: TraceOutRef, reason: string) => TraceUtxo;
|
|
183
|
+
declare const genesisUtxo: (outRef: TraceOutRef) => TraceUtxo;
|
|
184
|
+
|
|
185
|
+
type VisualRenderMode = "overview" | "audit" | "debug";
|
|
186
|
+
type VisualRenderView = "flow" | "scriptInteraction";
|
|
187
|
+
type VisualPrivacyPolicy = {
|
|
188
|
+
readonly hash: "full" | "short" | "hidden";
|
|
189
|
+
readonly address: "alias" | "short" | "full" | "hidden";
|
|
190
|
+
readonly datum: "marker" | "hash" | "short" | "full" | "hidden";
|
|
191
|
+
readonly redeemer: "label" | "constructor" | "short" | "full" | "hidden";
|
|
192
|
+
readonly cbor: "hidden" | "prefix" | "full";
|
|
193
|
+
};
|
|
194
|
+
type VisualComplexityBudget = {
|
|
195
|
+
readonly maxVisibleInputs: number;
|
|
196
|
+
readonly maxVisibleOutputs: number;
|
|
197
|
+
readonly maxVisibleAssetsPerUtxo: number;
|
|
198
|
+
readonly maxVisibleSigners: number;
|
|
199
|
+
readonly maxVisibleWarnings: number;
|
|
200
|
+
readonly maxVisibleRedeemerFields: number;
|
|
201
|
+
};
|
|
202
|
+
type VisualRendererOptions = {
|
|
203
|
+
readonly mode?: VisualRenderMode;
|
|
204
|
+
readonly view?: VisualRenderView;
|
|
205
|
+
readonly privacy?: Partial<VisualPrivacyPolicy>;
|
|
206
|
+
readonly budget?: Partial<VisualComplexityBudget>;
|
|
207
|
+
};
|
|
208
|
+
type ResolvedVisualRendererOptions = {
|
|
209
|
+
readonly mode: VisualRenderMode;
|
|
210
|
+
readonly view: VisualRenderView;
|
|
211
|
+
readonly privacy: VisualPrivacyPolicy;
|
|
212
|
+
readonly budget: VisualComplexityBudget;
|
|
213
|
+
};
|
|
214
|
+
type VisualEdgeStyle = {
|
|
215
|
+
readonly color: string;
|
|
216
|
+
readonly style: "solid" | "dashed" | "dotted";
|
|
217
|
+
};
|
|
218
|
+
declare const resolveVisualRendererOptions: (options?: VisualRendererOptions) => ResolvedVisualRendererOptions;
|
|
219
|
+
declare const visualEdgeStyle: (kind: string) => VisualEdgeStyle;
|
|
220
|
+
|
|
221
|
+
type VisualTone = "neutral" | "info" | "success" | "warning" | "danger" | "accent";
|
|
222
|
+
type VisualNodeKind = "transaction" | "utxo" | "asset" | "signer" | "withdrawal" | "certificate" | "collateralReturn" | "diagnostic";
|
|
223
|
+
type VisualEdgeKind = "spend" | "read" | "collateral" | "produce" | "collateralReturn" | "mint" | "burn" | "withdraw" | "certify" | "sign" | "diagnostic" | "summary";
|
|
224
|
+
type VisualPortSide = "left" | "right" | "top" | "bottom";
|
|
225
|
+
type VisualField = {
|
|
226
|
+
readonly id: string;
|
|
227
|
+
readonly label: string;
|
|
228
|
+
readonly rawLabel?: string;
|
|
229
|
+
readonly value: string;
|
|
230
|
+
readonly rawValue?: string;
|
|
231
|
+
readonly tone?: VisualTone;
|
|
232
|
+
readonly mono?: boolean;
|
|
233
|
+
};
|
|
234
|
+
type VisualSection = {
|
|
235
|
+
readonly id: string;
|
|
236
|
+
readonly title: string;
|
|
237
|
+
readonly rows: VisualField[];
|
|
238
|
+
readonly collapsed?: boolean;
|
|
239
|
+
};
|
|
240
|
+
type VisualChip = {
|
|
241
|
+
readonly label: string;
|
|
242
|
+
readonly tone?: VisualTone;
|
|
243
|
+
};
|
|
244
|
+
type VisualPort = {
|
|
245
|
+
readonly id: string;
|
|
246
|
+
readonly nodeId: string;
|
|
247
|
+
readonly side: VisualPortSide;
|
|
248
|
+
readonly label: string;
|
|
249
|
+
readonly edgeKind?: VisualEdgeKind;
|
|
250
|
+
};
|
|
251
|
+
type VisualRawRef = {
|
|
252
|
+
readonly type: "transaction";
|
|
253
|
+
readonly txHash: string;
|
|
254
|
+
} | {
|
|
255
|
+
readonly type: "utxo";
|
|
256
|
+
readonly outRef: TraceOutRef;
|
|
257
|
+
} | {
|
|
258
|
+
readonly type: "assetPolicy";
|
|
259
|
+
readonly policyId: string;
|
|
260
|
+
} | {
|
|
261
|
+
readonly type: "signer";
|
|
262
|
+
readonly keyHash: string;
|
|
263
|
+
} | {
|
|
264
|
+
readonly type: "withdrawal";
|
|
265
|
+
readonly rewardAddress: string;
|
|
266
|
+
} | {
|
|
267
|
+
readonly type: "certificate";
|
|
268
|
+
readonly txHash: string;
|
|
269
|
+
readonly index: number;
|
|
270
|
+
} | {
|
|
271
|
+
readonly type: "collateralReturn";
|
|
272
|
+
readonly txHash: string;
|
|
273
|
+
} | {
|
|
274
|
+
readonly type: "diagnostic";
|
|
275
|
+
readonly code: string;
|
|
276
|
+
readonly count?: number;
|
|
277
|
+
readonly group?: string;
|
|
278
|
+
};
|
|
279
|
+
type VisualNode = {
|
|
280
|
+
readonly id: string;
|
|
281
|
+
readonly kind: VisualNodeKind;
|
|
282
|
+
readonly title: string;
|
|
283
|
+
readonly subtitle?: string;
|
|
284
|
+
readonly sections: VisualSection[];
|
|
285
|
+
readonly ports: VisualPort[];
|
|
286
|
+
readonly chips: VisualChip[];
|
|
287
|
+
readonly severity?: "info" | "warning" | "error";
|
|
288
|
+
readonly rawRef: VisualRawRef;
|
|
289
|
+
};
|
|
290
|
+
type RedeemerKey = {
|
|
291
|
+
readonly tag: TraceRedeemer["tag"];
|
|
292
|
+
readonly index: string;
|
|
293
|
+
readonly redeemerListIndex: number;
|
|
294
|
+
};
|
|
295
|
+
type VisualAction = {
|
|
296
|
+
readonly label: string;
|
|
297
|
+
readonly intent?: string;
|
|
298
|
+
readonly fields?: Record<string, string>;
|
|
299
|
+
readonly source: "user" | "schema" | "constructor" | "generic";
|
|
300
|
+
readonly confidence: "high" | "medium" | "fallback";
|
|
301
|
+
};
|
|
302
|
+
type VisualEdgeTargetRef = {
|
|
303
|
+
readonly type: "input";
|
|
304
|
+
readonly inputKind: "spend" | "read" | "collateral";
|
|
305
|
+
readonly txHash: string;
|
|
306
|
+
readonly index: number;
|
|
307
|
+
readonly outRef: TraceOutRef;
|
|
308
|
+
} | {
|
|
309
|
+
readonly type: "output";
|
|
310
|
+
readonly txHash: string;
|
|
311
|
+
readonly index: number;
|
|
312
|
+
readonly outRef: TraceOutRef;
|
|
313
|
+
} | {
|
|
314
|
+
readonly type: "assetPolicy";
|
|
315
|
+
readonly txHash: string;
|
|
316
|
+
readonly policyId: string;
|
|
317
|
+
readonly policyIndex: number;
|
|
318
|
+
readonly assets: Record<string, string>;
|
|
319
|
+
} | {
|
|
320
|
+
readonly type: "withdrawal";
|
|
321
|
+
readonly txHash: string;
|
|
322
|
+
readonly index: number;
|
|
323
|
+
readonly rewardAddress: string;
|
|
324
|
+
} | {
|
|
325
|
+
readonly type: "certificate";
|
|
326
|
+
readonly txHash: string;
|
|
327
|
+
readonly index: number;
|
|
328
|
+
} | {
|
|
329
|
+
readonly type: "signer";
|
|
330
|
+
readonly txHash: string;
|
|
331
|
+
readonly keyHash: string;
|
|
332
|
+
} | {
|
|
333
|
+
readonly type: "collateralReturn";
|
|
334
|
+
readonly txHash: string;
|
|
335
|
+
} | {
|
|
336
|
+
readonly type: "diagnostic";
|
|
337
|
+
readonly txHash?: string;
|
|
338
|
+
readonly code: string;
|
|
339
|
+
readonly count?: number;
|
|
340
|
+
readonly group?: string;
|
|
341
|
+
};
|
|
342
|
+
type VisualEdge = {
|
|
343
|
+
readonly id: string;
|
|
344
|
+
readonly kind: VisualEdgeKind;
|
|
345
|
+
readonly from: string;
|
|
346
|
+
readonly to: string;
|
|
347
|
+
readonly fromPort?: string;
|
|
348
|
+
readonly toPort?: string;
|
|
349
|
+
readonly label: string;
|
|
350
|
+
readonly action?: VisualAction;
|
|
351
|
+
readonly redeemerKey?: RedeemerKey;
|
|
352
|
+
readonly targetRef: VisualEdgeTargetRef;
|
|
353
|
+
readonly severity?: "info" | "warning" | "error";
|
|
354
|
+
readonly rawRef: VisualRawRef;
|
|
355
|
+
};
|
|
356
|
+
type VisualDiagnostic = {
|
|
357
|
+
readonly id: string;
|
|
358
|
+
readonly severity: "warning" | "error";
|
|
359
|
+
readonly code: string;
|
|
360
|
+
readonly message: string;
|
|
361
|
+
readonly txHash?: string;
|
|
362
|
+
readonly outRef?: TraceOutRef;
|
|
363
|
+
readonly redeemerKey?: RedeemerKey;
|
|
364
|
+
};
|
|
365
|
+
type VisualLegendItem = {
|
|
366
|
+
readonly kind: string;
|
|
367
|
+
readonly label: string;
|
|
368
|
+
};
|
|
369
|
+
type VisualLegend = {
|
|
370
|
+
readonly nodes: VisualLegendItem[];
|
|
371
|
+
readonly edges: VisualLegendItem[];
|
|
372
|
+
};
|
|
373
|
+
type SemanticRenderGraph = {
|
|
374
|
+
readonly version: 1;
|
|
375
|
+
readonly nodes: VisualNode[];
|
|
376
|
+
readonly edges: VisualEdge[];
|
|
377
|
+
readonly diagnostics: VisualDiagnostic[];
|
|
378
|
+
readonly legend: VisualLegend;
|
|
379
|
+
readonly aliases: TraceAliases;
|
|
380
|
+
};
|
|
381
|
+
type RedeemerDescriberContext = {
|
|
382
|
+
readonly trace: TxGraphTrace;
|
|
383
|
+
readonly transaction: TraceTransaction;
|
|
384
|
+
readonly redeemer: TraceRedeemer;
|
|
385
|
+
readonly target: VisualEdgeTargetRef;
|
|
386
|
+
readonly edge: Omit<VisualEdge, "action">;
|
|
387
|
+
};
|
|
388
|
+
type RedeemerDescriber = (context: RedeemerDescriberContext) => VisualAction | undefined;
|
|
389
|
+
type RedeemerSelector = {
|
|
390
|
+
readonly tag: TraceRedeemer["tag"];
|
|
391
|
+
readonly index: number | string;
|
|
392
|
+
readonly txHash?: string;
|
|
393
|
+
readonly target?: (target: VisualEdgeTargetRef) => boolean;
|
|
394
|
+
};
|
|
395
|
+
type ConstructorRedeemerSelector = RedeemerSelector & {
|
|
396
|
+
readonly constructor: number;
|
|
397
|
+
};
|
|
398
|
+
type SemanticRenderOptions = {
|
|
399
|
+
readonly redeemers?: ReadonlyArray<RedeemerDescriber>;
|
|
400
|
+
};
|
|
401
|
+
declare const buildSemanticRenderGraph: (trace: TxGraphTrace, options?: SemanticRenderOptions) => SemanticRenderGraph;
|
|
402
|
+
declare const labelRedeemer: (selector: RedeemerSelector, label: string, intent?: string) => RedeemerDescriber;
|
|
403
|
+
declare const describeRedeemerByConstructor: (selector: ConstructorRedeemerSelector, label: string, intent?: string) => RedeemerDescriber;
|
|
404
|
+
declare const describeRedeemerWith: (describe: RedeemerDescriber) => RedeemerDescriber;
|
|
405
|
+
|
|
406
|
+
type TraceToDotOptions = VisualRendererOptions & SemanticRenderOptions & {
|
|
407
|
+
readonly graphName?: string;
|
|
408
|
+
readonly legacy?: boolean;
|
|
409
|
+
};
|
|
410
|
+
declare const traceToDot: (trace: TxGraphTrace, options?: TraceToDotOptions) => string;
|
|
411
|
+
|
|
412
|
+
type FormattedSemanticGraph = {
|
|
413
|
+
readonly nodes: VisualNode[];
|
|
414
|
+
readonly edges: VisualEdge[];
|
|
415
|
+
};
|
|
416
|
+
|
|
417
|
+
type TraceToSvgOptions = VisualRendererOptions & SemanticRenderOptions & {
|
|
418
|
+
readonly title?: string;
|
|
419
|
+
};
|
|
420
|
+
declare const traceToSvg: (trace: TxGraphTrace, options?: TraceToSvgOptions) => string;
|
|
421
|
+
declare const semanticSvgForTesting: (trace: TxGraphTrace, options?: TraceToSvgOptions) => {
|
|
422
|
+
readonly semantic: FormattedSemanticGraph;
|
|
423
|
+
readonly nodes: VisualNode[];
|
|
424
|
+
};
|
|
425
|
+
|
|
426
|
+
type TraceToHtmlOptions = TraceToSvgOptions & SemanticRenderOptions & {
|
|
427
|
+
readonly title?: string;
|
|
428
|
+
readonly includeRawMetadata?: boolean;
|
|
429
|
+
};
|
|
430
|
+
declare const traceToHtml: (trace: TxGraphTrace, options?: TraceToHtmlOptions) => string;
|
|
431
|
+
|
|
432
|
+
type TraceToMermaidOptions = VisualRendererOptions & SemanticRenderOptions & {
|
|
433
|
+
readonly direction?: "LR" | "TD";
|
|
434
|
+
readonly legacy?: boolean;
|
|
435
|
+
};
|
|
436
|
+
declare const traceToMermaid: (trace: TxGraphTrace, options?: TraceToMermaidOptions) => string;
|
|
437
|
+
|
|
438
|
+
type TxGraphProviderWrapperOptions = {
|
|
439
|
+
readonly submitLabel?: string;
|
|
440
|
+
readonly evaluateLabel?: string;
|
|
441
|
+
readonly recordEvaluate?: boolean;
|
|
442
|
+
};
|
|
443
|
+
declare const wrapProvider: (provider: Provider, graph: TxGraph, options?: TxGraphProviderWrapperOptions) => Provider;
|
|
444
|
+
|
|
445
|
+
type CreateTxGraphOptions = {
|
|
446
|
+
readonly provider?: TxGraphResolutionProvider;
|
|
447
|
+
readonly resolver?: TxGraphUtxoResolver;
|
|
448
|
+
readonly labels?: ReadonlyArray<TxGraphTagger>;
|
|
449
|
+
readonly assets?: Record<string, string>;
|
|
450
|
+
readonly addresses?: Record<string, string>;
|
|
451
|
+
readonly aliases?: Partial<TraceAliases>;
|
|
452
|
+
readonly createdAt?: string;
|
|
453
|
+
};
|
|
454
|
+
type TxGraphRecordOptions = ParseTransactionOptions & {
|
|
455
|
+
readonly status?: TraceStatus;
|
|
456
|
+
readonly failureMessage?: string;
|
|
457
|
+
readonly evaluation?: ReadonlyArray<TraceEvaluationRedeemer>;
|
|
458
|
+
};
|
|
459
|
+
type TxGraph = {
|
|
460
|
+
record: (tx: TxGraphTransactionInput, options?: TxGraphRecordOptions) => Promise<TraceTransaction>;
|
|
461
|
+
recordCbor: (cbor: string, options?: TxGraphRecordOptions) => Promise<TraceTransaction>;
|
|
462
|
+
addResolvedUtxos: (utxos: ReadonlyArray<UTxO | TraceUtxo>) => void;
|
|
463
|
+
resolveWith: (resolver: TxGraphUtxoResolver) => void;
|
|
464
|
+
addWarning: (warning: TraceWarning) => void;
|
|
465
|
+
wrapProvider: (provider: Provider, options?: TxGraphProviderWrapperOptions) => Provider;
|
|
466
|
+
toJSON: () => TxGraphTrace;
|
|
467
|
+
toSemantic: (options?: SemanticRenderOptions) => SemanticRenderGraph;
|
|
468
|
+
toDot: (options?: TraceToDotOptions) => string;
|
|
469
|
+
toHtml: (options?: TraceToHtmlOptions) => string;
|
|
470
|
+
toMermaid: (options?: TraceToMermaidOptions) => string;
|
|
471
|
+
toSvg: (options?: TraceToSvgOptions) => string;
|
|
472
|
+
};
|
|
473
|
+
declare const createTxGraph: (options?: CreateTxGraphOptions) => TxGraph;
|
|
474
|
+
|
|
475
|
+
declare const traceToJSON: (trace: TxGraphTrace) => TxGraphTrace;
|
|
476
|
+
|
|
477
|
+
export { type ConstructorRedeemerSelector, type CreateTxGraphOptions, type ParseTransactionOptions, type RedeemerDescriber, type RedeemerDescriberContext, type RedeemerKey, type RedeemerSelector, type ResolveOutRefsOptions, type ResolveOutRefsResult, type ResolvedVisualRendererOptions, type SemanticRenderGraph, type SemanticRenderOptions, type TagByScriptRefOptions, type TagChangeOptions, type TraceAliases, type TraceAmount, type TraceAssets, type TraceCertificate, type TraceEdge, type TraceEdgeKind, type TraceEvaluationRedeemer, type TraceOutRef, type TraceRedeemer, type TraceScriptRef, type TraceStatus, type TraceToDotOptions, type TraceToHtmlOptions, type TraceToMermaidOptions, type TraceToSvgOptions, type TraceTransaction, type TraceTxOutput, type TraceUtxo, type TraceValidityInterval, type TraceWarning, type TraceWithdrawal, type TxGraph, type TxGraphProviderWrapperOptions, type TxGraphRecordOptions, type TxGraphResolutionCache, type TxGraphResolutionProvider, type TxGraphResolutionSource, type TxGraphTagger, type TxGraphTaggerContext, type TxGraphTrace, type TxGraphTransactionInput, type TxGraphUtxoResolver, type VisualAction, type VisualChip, type VisualComplexityBudget, type VisualDiagnostic, type VisualEdge, type VisualEdgeKind, type VisualEdgeStyle, type VisualEdgeTargetRef, type VisualField, type VisualLegend, type VisualLegendItem, type VisualNode, type VisualNodeKind, type VisualPort, type VisualPortSide, type VisualPrivacyPolicy, type VisualRawRef, type VisualRenderMode, type VisualRenderView, type VisualRendererOptions, type VisualSection, type VisualTone, buildSemanticRenderGraph, createResolutionCache, createTxGraph, describeRedeemerByConstructor, describeRedeemerWith, genesisUtxo, labelRedeemer, outRefKey, parseOutRefKey, parseTransaction, parseTransactionCbor, producedUtxosFromTransaction, resolveVisualRendererOptions, semanticSvgForTesting, tagByAddress, tagByCredential, tagByDatum, tagByDatumHash, tagByPolicyId, tagByScriptRef, tagByUnit, tagChange, toTraceTxOutput, toTraceUtxo, traceToDot, traceToHtml, traceToJSON, traceToMermaid, traceToSvg, unresolvedUtxo, visualEdgeStyle, wrapProvider };
|