@xo-cash/utils 0.0.3 → 0.0.4-development.16005132483
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/dist/index.d.mts +330 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +523 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -3,6 +3,335 @@ import { XOInvitationVariableValue, XOTemplate } from "@xo-cash/types";
|
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { $ZodIssue } from "zod/v4/core";
|
|
5
5
|
|
|
6
|
+
//#region source/errors.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* Error thrown when a waitFor timeout is reached
|
|
9
|
+
*/
|
|
10
|
+
declare class WaitForTimeoutError extends Error {
|
|
11
|
+
constructor(type: string);
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region source/event-emitter.d.ts
|
|
15
|
+
type EventMap = Record<string, unknown>;
|
|
16
|
+
type Listener<T> = (detail: T) => void;
|
|
17
|
+
/**
|
|
18
|
+
* Callback returned by {@link on} and {@link once} for removing a listener.
|
|
19
|
+
*/
|
|
20
|
+
type OffCallback = () => void;
|
|
21
|
+
/**
|
|
22
|
+
* A simple event emitter implementation.
|
|
23
|
+
* @template T - The event map type.
|
|
24
|
+
*/
|
|
25
|
+
declare class EventEmitter<T extends EventMap> {
|
|
26
|
+
#private;
|
|
27
|
+
/**
|
|
28
|
+
* Add a listener for an event.
|
|
29
|
+
* @param type - The event type.
|
|
30
|
+
* @param listener - The listener function.
|
|
31
|
+
* @param debounceMilliseconds - The debounce time in milliseconds.
|
|
32
|
+
* @returns An off callback that can be called to stop listening for events.
|
|
33
|
+
*/
|
|
34
|
+
on<K extends keyof T>(type: K, listener: Listener<T[K]>, debounceMilliseconds?: number): OffCallback;
|
|
35
|
+
/**
|
|
36
|
+
* Add a one-time listener for an event.
|
|
37
|
+
* @param type - The event type.
|
|
38
|
+
* @param listener - The listener function.
|
|
39
|
+
* @param debounceMilliseconds - The debounce time in milliseconds.
|
|
40
|
+
* @returns An off callback that can be called to stop listening for events.
|
|
41
|
+
*/
|
|
42
|
+
once<K extends keyof T>(type: K, listener: Listener<T[K]>, debounceMilliseconds?: number): OffCallback;
|
|
43
|
+
/**
|
|
44
|
+
* Remove a listener for an event.
|
|
45
|
+
* @param type - The event type.
|
|
46
|
+
* @param listener - The listener function.
|
|
47
|
+
*/
|
|
48
|
+
off<K extends keyof T>(type: K, listener?: Listener<T[K]>): void;
|
|
49
|
+
/**
|
|
50
|
+
* Emit an event.
|
|
51
|
+
*
|
|
52
|
+
* @remarks The caller is responsible for ensuring the payload suits the intended mutability requirements.
|
|
53
|
+
* By default, the payload will be mutable, so listeners may mutate the payload, effecting both
|
|
54
|
+
* the original object and the other listeners.
|
|
55
|
+
* To prevent this, the caller can use the {@link Object.freeze} or {@link deepFreeze} function to freeze the payload.
|
|
56
|
+
* This will need to be defined in the EventMap using the built-in {@link Readonly} type or the provided {@link DeeplyReadonly} type.
|
|
57
|
+
*
|
|
58
|
+
* @param type - The event type.
|
|
59
|
+
* @param payload - The event payload.
|
|
60
|
+
* @returns True if there are listeners for the event, false otherwise.
|
|
61
|
+
*/
|
|
62
|
+
emit<K extends keyof T>(type: K, payload: T[K]): boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Remove all listeners.
|
|
65
|
+
*/
|
|
66
|
+
removeAllListeners(): void;
|
|
67
|
+
/**
|
|
68
|
+
* Wait for an event to be emitted that matches the provided predicate function's criteria.
|
|
69
|
+
* @param type - The event type.
|
|
70
|
+
* @param predicate - Predicate function to filter for whether the event payload matches the criteria.
|
|
71
|
+
* @param timeoutMs - The timeout in milliseconds.
|
|
72
|
+
* @returns The event payload.
|
|
73
|
+
*/
|
|
74
|
+
waitFor<K extends keyof T>(type: K, predicate: (payload: T[K]) => boolean, timeoutMs?: number): Promise<T[K]>;
|
|
75
|
+
/**
|
|
76
|
+
* Debounce a function.
|
|
77
|
+
*
|
|
78
|
+
* @remarks If {@link off} is called on a listener while it is debounced, the timeout is not cleared with clearTimeout.
|
|
79
|
+
* Instead, the function is no-oped.
|
|
80
|
+
*
|
|
81
|
+
* @param func - The function to debounce.
|
|
82
|
+
* @param wait - The wait time in milliseconds.
|
|
83
|
+
* @returns The debounced function.
|
|
84
|
+
*/
|
|
85
|
+
private debounce;
|
|
86
|
+
/**
|
|
87
|
+
* Make a function cancellable.
|
|
88
|
+
* @param func - The function to make cancelable.
|
|
89
|
+
* @returns The cancellable function with a cancel method.
|
|
90
|
+
*/
|
|
91
|
+
private cancellable;
|
|
92
|
+
}
|
|
93
|
+
//#endregion
|
|
94
|
+
//#region source/exponential-backoff/errors.d.ts
|
|
95
|
+
/**
|
|
96
|
+
* Error thrown when the maximum number of retries is hit in an exponential backoff
|
|
97
|
+
*/
|
|
98
|
+
declare class ExponentialBackoffMaxRetriesHitError extends Error {
|
|
99
|
+
constructor(errors: Array<Error>);
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Error thrown when the exponential backoff retries are stopped
|
|
103
|
+
*/
|
|
104
|
+
declare class ExponentialBackoffStoppedRetriesError extends Error {
|
|
105
|
+
constructor(reason: unknown);
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Error thrown when an exponential backoff option is too small
|
|
109
|
+
*/
|
|
110
|
+
declare class ExponentialBackoffNumberTooSmallError extends Error {
|
|
111
|
+
constructor(option: string, value: number, min: number);
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Error thrown when an exponential backoff option is out of bounds
|
|
115
|
+
*/
|
|
116
|
+
declare class ExponentialBackoffNumberOutOfBoundsError extends Error {
|
|
117
|
+
constructor(option: string, value: number, min: number, max: number);
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Error thrown when an exponential backoff option is an invalid infinite integer
|
|
121
|
+
*/
|
|
122
|
+
declare class ExponentialBackoffNumberNotFiniteError extends Error {
|
|
123
|
+
constructor(option: string, value: number);
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Error thrown when an exponential backoff option is not an integer
|
|
127
|
+
*/
|
|
128
|
+
declare class ExponentialBackoffNonIntegerError extends Error {
|
|
129
|
+
constructor(option: string, value: number);
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Error thrown when an externally aborted exponential backoff is aborted
|
|
133
|
+
* due to the external abort signal that was passed in to the constructor being aborted by an upstream consumer
|
|
134
|
+
*/
|
|
135
|
+
declare class ExternallyAbortedExponentialBackoffExternalSignalAbortedError extends Error {
|
|
136
|
+
constructor(reason: unknown);
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Error thrown when an externally aborted exponential backoff is aborted
|
|
140
|
+
* due to the internal abort signal being aborted using the .abort() method
|
|
141
|
+
*/
|
|
142
|
+
declare class ExternallyAbortedExponentialBackoffInternalSignalAbortedError extends Error {
|
|
143
|
+
constructor(reason: unknown);
|
|
144
|
+
}
|
|
145
|
+
//#endregion
|
|
146
|
+
//#region source/exponential-backoff/exponential-backoff.d.ts
|
|
147
|
+
type ExponentialBackoffOptions = {
|
|
148
|
+
/**
|
|
149
|
+
* The maximum delay between attempts in milliseconds
|
|
150
|
+
*/
|
|
151
|
+
maxDelay: number;
|
|
152
|
+
/**
|
|
153
|
+
* The maximum number of attempts. Passing 0 will result in infinite attempts.
|
|
154
|
+
*/
|
|
155
|
+
maxAttempts: number;
|
|
156
|
+
/**
|
|
157
|
+
* The base delay between attempts in milliseconds
|
|
158
|
+
*/
|
|
159
|
+
baseDelay: number;
|
|
160
|
+
/**
|
|
161
|
+
* The growth rate of the delay
|
|
162
|
+
*/
|
|
163
|
+
growthRate: number;
|
|
164
|
+
/**
|
|
165
|
+
* The jitter of the delay as a percentage of growthRate. The jitter is subtracted from the delay.
|
|
166
|
+
*/
|
|
167
|
+
jitter: number;
|
|
168
|
+
};
|
|
169
|
+
/**
|
|
170
|
+
* The function to call to stop the retries.
|
|
171
|
+
* This mimics the AbortSignal.abort function by taking in a reason for stopping
|
|
172
|
+
*
|
|
173
|
+
* @param reason - The reason for stopping the retries.
|
|
174
|
+
*/
|
|
175
|
+
type ExponentialBackoffStopRetriesFunction = (reason: unknown) => void;
|
|
176
|
+
/**
|
|
177
|
+
* The parameters for the task function
|
|
178
|
+
*
|
|
179
|
+
* @param stopRetries - The function to call to stop the retries
|
|
180
|
+
*/
|
|
181
|
+
type ExponentialBackoffCallbackParameters = {
|
|
182
|
+
stopRetries: ExponentialBackoffStopRetriesFunction;
|
|
183
|
+
};
|
|
184
|
+
/**
|
|
185
|
+
* Options that control a single exponential-backoff run.
|
|
186
|
+
*/
|
|
187
|
+
type ExponentialBackoffRunOptions = {
|
|
188
|
+
/**
|
|
189
|
+
* Called after each failed task attempt.
|
|
190
|
+
*/
|
|
191
|
+
onError?: ((error: Error) => void) | undefined;
|
|
192
|
+
/**
|
|
193
|
+
* Stops pending delays and prevents future attempts when aborted.
|
|
194
|
+
*/
|
|
195
|
+
signal?: AbortSignal | undefined;
|
|
196
|
+
};
|
|
197
|
+
/**
|
|
198
|
+
* Options accepted by the static exponential-backoff run helper.
|
|
199
|
+
*/
|
|
200
|
+
type ExponentialBackoffStaticRunOptions = Partial<ExponentialBackoffOptions> & ExponentialBackoffRunOptions;
|
|
201
|
+
/**
|
|
202
|
+
* Exponential backoff is a technique used to retry a function after a delay.
|
|
203
|
+
*
|
|
204
|
+
* The delay increases exponentially with each attempt, up to a maximum delay.
|
|
205
|
+
*
|
|
206
|
+
* The jitter is a random amount of time subtracted from the delay to prevent thundering herd problems.
|
|
207
|
+
*
|
|
208
|
+
* The growth rate is the factor by which the delay increases with each attempt.
|
|
209
|
+
*/
|
|
210
|
+
declare class ExponentialBackoff {
|
|
211
|
+
#private;
|
|
212
|
+
/**
|
|
213
|
+
* Creates a new exponential-backoff instance.
|
|
214
|
+
*
|
|
215
|
+
* Unspecified options use the defaults listed below.
|
|
216
|
+
*
|
|
217
|
+
* @param options - Exponential-backoff configuration overrides.
|
|
218
|
+
* @param options.maxDelay - Maximum delay between retries. Default: `10_000` ms.
|
|
219
|
+
* @param options.maxAttempts - Maximum number of attempts; `0` retries indefinitely. Default: `10`.
|
|
220
|
+
* @param options.baseDelay - Delay used as the basis for the first retry. Default: `1_000` ms.
|
|
221
|
+
* @param options.growthRate - Multiplier applied to the delay after each attempt. Default: `2`.
|
|
222
|
+
* @param options.jitter - Maximum proportional reduction subtracted from each delay (0–1). Default: `0.1`.
|
|
223
|
+
*
|
|
224
|
+
* @throws An {@link ExponentialBackoffNumberNotFiniteError} if a provided option is not a finite number
|
|
225
|
+
* @throws An {@link ExponentialBackoffNumberOutOfBoundsError} if a provided option is out of bounds
|
|
226
|
+
* @throws An {@link ExponentialBackoffNumberTooSmallError} if a provided option is too small
|
|
227
|
+
* @throws An {@link ExponentialBackoffNonIntegerError} if a provided option is not an integer
|
|
228
|
+
*/
|
|
229
|
+
constructor(options?: Partial<ExponentialBackoffOptions>);
|
|
230
|
+
/**
|
|
231
|
+
* Create a new ExponentialBackoff instance
|
|
232
|
+
*
|
|
233
|
+
* @param config - The configuration for the exponential backoff
|
|
234
|
+
*
|
|
235
|
+
* @throws An {@link ExponentialBackoffNumberNotFiniteError} if a provided option is not a finite number
|
|
236
|
+
* @throws An {@link ExponentialBackoffNumberOutOfBoundsError} if a provided option is out of bounds
|
|
237
|
+
* @throws An {@link ExponentialBackoffNumberTooSmallError} if a provided option is too small
|
|
238
|
+
* @throws An {@link ExponentialBackoffNonIntegerError} if a provided option is not an integer
|
|
239
|
+
*
|
|
240
|
+
* @returns The ExponentialBackoff instance
|
|
241
|
+
*/
|
|
242
|
+
static from(config?: Partial<ExponentialBackoffOptions>): ExponentialBackoff;
|
|
243
|
+
/**
|
|
244
|
+
* Run the function with exponential backoff
|
|
245
|
+
*
|
|
246
|
+
* @param taskFn - The function to run
|
|
247
|
+
* @param options - Backoff configuration and options for this run
|
|
248
|
+
*
|
|
249
|
+
* @throws An {@link ExponentialBackoffMaxRetriesHitError} with all the errors that were thrown by the task function
|
|
250
|
+
* @throws An {@link ExponentialBackoffStoppedRetriesError} if the abort signal is activated
|
|
251
|
+
*
|
|
252
|
+
* @returns The result of the function
|
|
253
|
+
*/
|
|
254
|
+
static run<T>(taskFn: (callbackParameters: ExponentialBackoffCallbackParameters) => Promise<T>, options?: Partial<ExponentialBackoffStaticRunOptions>): Promise<T>;
|
|
255
|
+
/**
|
|
256
|
+
* Validate the options for the exponential backoff
|
|
257
|
+
*
|
|
258
|
+
* @param options - The options to validate
|
|
259
|
+
*
|
|
260
|
+
* @throws {@link ExponentialBackoffNumberNotFiniteError} if a provided option is not a finite number
|
|
261
|
+
* @throws {@link ExponentialBackoffNonIntegerError} if a provided option is not an integer
|
|
262
|
+
* @throws {@link ExponentialBackoffNumberOutOfBoundsError} if a provided option is out of bounds
|
|
263
|
+
* @throws {@link ExponentialBackoffNumberTooSmallError} if a provided option is too small
|
|
264
|
+
*/
|
|
265
|
+
static validateOptions(options: ExponentialBackoffOptions): void;
|
|
266
|
+
/**
|
|
267
|
+
* Run the function with exponential backoff
|
|
268
|
+
*
|
|
269
|
+
* If the function fails but we have not hit the max attempts, the error will be passed to the onError callback
|
|
270
|
+
* and the function will be retried with an exponential delay
|
|
271
|
+
*
|
|
272
|
+
* If every attempt fails, an ExponentialBackoffMaxRetriesHitError will be thrown
|
|
273
|
+
* with all errors from the task function.
|
|
274
|
+
*
|
|
275
|
+
* @param taskFn - The function to run
|
|
276
|
+
* @param options - Options that control this run
|
|
277
|
+
*
|
|
278
|
+
* @throws An {@link ExponentialBackoffMaxRetriesHitError} with all the errors that were thrown by the task function
|
|
279
|
+
* @throws An {@link ExponentialBackoffStoppedRetriesError} if the abort signal is activated
|
|
280
|
+
*
|
|
281
|
+
* @returns The result of the function
|
|
282
|
+
*/
|
|
283
|
+
run<T>(taskFn: (callbackParameters: ExponentialBackoffCallbackParameters) => Promise<T>, options?: ExponentialBackoffRunOptions): Promise<T>;
|
|
284
|
+
}
|
|
285
|
+
//#endregion
|
|
286
|
+
//#region source/exponential-backoff/exponential-backoff-externally-aborted.d.ts
|
|
287
|
+
/**
|
|
288
|
+
* Options for the ExponentialBackoffExternallyAbortable class
|
|
289
|
+
*
|
|
290
|
+
* @extends Partial<ExponentialBackoffOptions>
|
|
291
|
+
* @property abortSignal - The abort signal to use for this instance
|
|
292
|
+
*/
|
|
293
|
+
type ExponentialBackoffExternallyAbortableOptions = Partial<ExponentialBackoffOptions> & {
|
|
294
|
+
abortSignal: AbortSignal;
|
|
295
|
+
};
|
|
296
|
+
/**
|
|
297
|
+
* An exponential backoff that can be stopped by calling `.abort()` or by passing an
|
|
298
|
+
* `abortSignal` to the constructor.
|
|
299
|
+
*
|
|
300
|
+
* @remarks One instance can run many tasks. Aborting it stops retries for every run.
|
|
301
|
+
*/
|
|
302
|
+
declare class ExponentialBackoffExternallyAbortable {
|
|
303
|
+
#private;
|
|
304
|
+
constructor(options?: Partial<ExponentialBackoffExternallyAbortableOptions>);
|
|
305
|
+
/**
|
|
306
|
+
* Run the function with exponential backoff
|
|
307
|
+
*
|
|
308
|
+
* If the function fails but we have not hit the max attempts, the error will be passed to the onError callback
|
|
309
|
+
* and the function will be retried with an exponential delay
|
|
310
|
+
*
|
|
311
|
+
* If every attempt fails, an ExponentialBackoffMaxRetriesHitError will be thrown
|
|
312
|
+
* with all errors from the task function.
|
|
313
|
+
*
|
|
314
|
+
* @param taskFn - The function to run
|
|
315
|
+
* @param options - Options that control this run
|
|
316
|
+
*
|
|
317
|
+
* @throws An {@link ExponentialBackoffMaxRetriesHitError} with all the errors that were thrown by the task function
|
|
318
|
+
* @throws An {@link ExponentialBackoffStoppedRetriesError} if the abort signal is activated
|
|
319
|
+
* @throws An {@link ExternallyAbortedExponentialBackoffExternalSignalAbortedError}
|
|
320
|
+
* if the abort signal that was provided during construction is activated
|
|
321
|
+
* @throws An {@link ExternallyAbortedExponentialBackoffInternalSignalAbortedError}
|
|
322
|
+
* if {@link ExponentialBackoffExternallyAbortable.abort} is called on this class
|
|
323
|
+
*
|
|
324
|
+
* @returns The result of the function
|
|
325
|
+
*/
|
|
326
|
+
run<T>(taskFn: (callbackParameters: ExponentialBackoffCallbackParameters) => Promise<T>, options?: Partial<ExponentialBackoffRunOptions>): Promise<T>;
|
|
327
|
+
/**
|
|
328
|
+
* Stops retries for all current and future runs.
|
|
329
|
+
*
|
|
330
|
+
* @param reason - The reason for stopping retries
|
|
331
|
+
*/
|
|
332
|
+
abort(reason: unknown): void;
|
|
333
|
+
}
|
|
334
|
+
//#endregion
|
|
6
335
|
//#region source/extended-json.d.ts
|
|
7
336
|
/**
|
|
8
337
|
* The JSON replacer that encodes `bigint` and `Uint8Array` values in Extended JSON format,
|
|
@@ -1908,5 +2237,5 @@ declare class CashAssemblyVmNumberDecodeError extends Error {
|
|
|
1908
2237
|
*/
|
|
1909
2238
|
declare const serializeTemplate: (template: XOTemplate) => string;
|
|
1910
2239
|
//#endregion
|
|
1911
|
-
export { AsyncPushIterator, CASHASSEMBLY_EVALUATION_PATTERN, CASHASSEMBLY_EXPRESSION_PATTERN, CASHASSEMBLY_LITERAL_TOKEN_PATTERN, CASHASSEMBLY_VARIABLE_METHOD_REFERENCE_PATTERN, CASHASSEMBLY_VARIABLE_PATTERN, CashAssemblyCompilationFailedError, CashAssemblyNumberNotSafeIntegerError, CashAssemblyPrimitiveMethodMissingError, CashAssemblyPrimitiveVariableMissingError, CashAssemblyRequiredVariableMissingError, CashAssemblyUnsupportedValueTypeError, CashAssemblyVariableTypeMismatchError, CashAssemblyVmNumberDecodeError, CompileCashAssemblyStringParameters, CompiledCashAssemblyDecodeMode, ResolvePrimitiveMethodBytesParameters, SSEEventParser, SSEEventParserOptions, TemplateInvalidError, TemplateJsonMalformedError, TemplateSerializationFailedError, VIEW_PROPERTIES_DESCRIPTION_MAX_LENGTH, VIEW_PROPERTIES_ICON_MAX_LENGTH, VIEW_PROPERTIES_NAME_MAX_LENGTH, bchVmVersionSchema, buildErrorDescription, compileCashAssemblyEvaluations, compileCashAssemblyString, convertValueToBytes, decodeCompiledCashAssemblyEvaluation, extendedJsonReplacer, extendedJsonReviver, extractCashAssemblyEvaluations, extractVariablesFromEvaluations, fromExtendedJson, generateCashAssemblyBytecode, generateTemplateIdentifier, isCashAssemblyExpression, parseTemplate, resolvePrimitiveMethodBytes, satoshisSchema, scriptToScriptHash, serializeTemplate, toExtendedJson, uint8ArraySchema, xoTemplateActionIntentSchema, xoTemplateActionRequirementsSchema, xoTemplateActionRoleRequirementsSchema, xoTemplateActionRoleSchema, xoTemplateActionSchema, xoTemplateAssetAmountsSchema, xoTemplateBaseTypeSchema, xoTemplateConstantSchema, xoTemplateDataSchema, xoTemplateDefaultsSchema, xoTemplateIconSchema, xoTemplateImportDefaultValueSchema, xoTemplateInputSchema, xoTemplateIntentSchema, xoTemplateLockingScriptIntentSchema, xoTemplateLockingScriptRoleSchema, xoTemplateLockingScriptSchema, xoTemplateLockingTypeSchema, xoTemplateNftCapabilitySchema, xoTemplateNonFungibleTokenDetailsSchema, xoTemplateOutputIntentSchema, xoTemplateOutputSchema, xoTemplatePrimitiveTypeSchema, xoTemplateResourceSchema, xoTemplateRoleSlotSchema, xoTemplateRoleSlotsRequirementsSchema, xoTemplateSchema, xoTemplateStateSchema, xoTemplateTokenSchema, xoTemplateTransactionInputSchema, xoTemplateTransactionOutputSchema, xoTemplateTransactionRoleDataSchema, xoTemplateTransactionSchema, xoTemplateVariableSchema, xoTemplateViewPropertiesSchema };
|
|
2240
|
+
export { AsyncPushIterator, CASHASSEMBLY_EVALUATION_PATTERN, CASHASSEMBLY_EXPRESSION_PATTERN, CASHASSEMBLY_LITERAL_TOKEN_PATTERN, CASHASSEMBLY_VARIABLE_METHOD_REFERENCE_PATTERN, CASHASSEMBLY_VARIABLE_PATTERN, CashAssemblyCompilationFailedError, CashAssemblyNumberNotSafeIntegerError, CashAssemblyPrimitiveMethodMissingError, CashAssemblyPrimitiveVariableMissingError, CashAssemblyRequiredVariableMissingError, CashAssemblyUnsupportedValueTypeError, CashAssemblyVariableTypeMismatchError, CashAssemblyVmNumberDecodeError, CompileCashAssemblyStringParameters, CompiledCashAssemblyDecodeMode, EventEmitter, EventMap, ExponentialBackoff, ExponentialBackoffCallbackParameters, ExponentialBackoffExternallyAbortable, ExponentialBackoffExternallyAbortableOptions, ExponentialBackoffMaxRetriesHitError, ExponentialBackoffNonIntegerError, ExponentialBackoffNumberNotFiniteError, ExponentialBackoffNumberOutOfBoundsError, ExponentialBackoffNumberTooSmallError, ExponentialBackoffOptions, ExponentialBackoffRunOptions, ExponentialBackoffStaticRunOptions, ExponentialBackoffStopRetriesFunction, ExponentialBackoffStoppedRetriesError, ExternallyAbortedExponentialBackoffExternalSignalAbortedError, ExternallyAbortedExponentialBackoffInternalSignalAbortedError, OffCallback, ResolvePrimitiveMethodBytesParameters, SSEEventParser, SSEEventParserOptions, TemplateInvalidError, TemplateJsonMalformedError, TemplateSerializationFailedError, VIEW_PROPERTIES_DESCRIPTION_MAX_LENGTH, VIEW_PROPERTIES_ICON_MAX_LENGTH, VIEW_PROPERTIES_NAME_MAX_LENGTH, WaitForTimeoutError, bchVmVersionSchema, buildErrorDescription, compileCashAssemblyEvaluations, compileCashAssemblyString, convertValueToBytes, decodeCompiledCashAssemblyEvaluation, extendedJsonReplacer, extendedJsonReviver, extractCashAssemblyEvaluations, extractVariablesFromEvaluations, fromExtendedJson, generateCashAssemblyBytecode, generateTemplateIdentifier, isCashAssemblyExpression, parseTemplate, resolvePrimitiveMethodBytes, satoshisSchema, scriptToScriptHash, serializeTemplate, toExtendedJson, uint8ArraySchema, xoTemplateActionIntentSchema, xoTemplateActionRequirementsSchema, xoTemplateActionRoleRequirementsSchema, xoTemplateActionRoleSchema, xoTemplateActionSchema, xoTemplateAssetAmountsSchema, xoTemplateBaseTypeSchema, xoTemplateConstantSchema, xoTemplateDataSchema, xoTemplateDefaultsSchema, xoTemplateIconSchema, xoTemplateImportDefaultValueSchema, xoTemplateInputSchema, xoTemplateIntentSchema, xoTemplateLockingScriptIntentSchema, xoTemplateLockingScriptRoleSchema, xoTemplateLockingScriptSchema, xoTemplateLockingTypeSchema, xoTemplateNftCapabilitySchema, xoTemplateNonFungibleTokenDetailsSchema, xoTemplateOutputIntentSchema, xoTemplateOutputSchema, xoTemplatePrimitiveTypeSchema, xoTemplateResourceSchema, xoTemplateRoleSlotSchema, xoTemplateRoleSlotsRequirementsSchema, xoTemplateSchema, xoTemplateStateSchema, xoTemplateTokenSchema, xoTemplateTransactionInputSchema, xoTemplateTransactionOutputSchema, xoTemplateTransactionRoleDataSchema, xoTemplateTransactionSchema, xoTemplateVariableSchema, xoTemplateViewPropertiesSchema };
|
|
1912
2241
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../source/extended-json.ts","../source/script.ts","../source/sse-session/async-push-iterator.ts","../source/sse-session/types.ts","../source/sse-session/sse-event-parser.ts","../source/template/errors.ts","../source/template/identifier.ts","../source/template/parser.ts","../source/template/schemas.ts","../source/cash-assembly/evaluations.ts","../source/cash-assembly/primitive-evaluations.ts","../source/cash-assembly/bytes.ts","../source/cash-assembly/defaults.ts","../source/cash-assembly/errors.ts","../source/template/serialization.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../source/errors.ts","../source/event-emitter.ts","../source/exponential-backoff/errors.ts","../source/exponential-backoff/exponential-backoff.ts","../source/exponential-backoff/exponential-backoff-externally-aborted.ts","../source/extended-json.ts","../source/script.ts","../source/sse-session/async-push-iterator.ts","../source/sse-session/types.ts","../source/sse-session/sse-event-parser.ts","../source/template/errors.ts","../source/template/identifier.ts","../source/template/parser.ts","../source/template/schemas.ts","../source/cash-assembly/evaluations.ts","../source/cash-assembly/primitive-evaluations.ts","../source/cash-assembly/bytes.ts","../source/cash-assembly/defaults.ts","../source/cash-assembly/errors.ts","../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