@anastasia-labs/cardano-multiplatform-lib-browser 6.0.2-1 → 6.0.2-2
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/cardano_multiplatform_lib.d.ts +291 -291
- package/cardano_multiplatform_lib_bg.js +424 -422
- package/cardano_multiplatform_lib_bg.wasm +0 -0
- package/package.json +1 -1
|
@@ -17,6 +17,18 @@ export function emip3_encrypt_with_password(password: string, salt: string, nonc
|
|
|
17
17
|
*/
|
|
18
18
|
export function emip3_decrypt_with_password(password: string, data: string): string;
|
|
19
19
|
/**
|
|
20
|
+
* encodes arbitrary bytes into chunks of 64 bytes (the limit for bytes) as a list to be valid Metadata
|
|
21
|
+
* @param {Uint8Array} bytes
|
|
22
|
+
* @returns {TransactionMetadatum}
|
|
23
|
+
*/
|
|
24
|
+
export function encode_arbitrary_bytes_as_metadatum(bytes: Uint8Array): TransactionMetadatum;
|
|
25
|
+
/**
|
|
26
|
+
* decodes from chunks of bytes in a list to a byte vector if that is the metadata format, otherwise returns None
|
|
27
|
+
* @param {TransactionMetadatum} metadata
|
|
28
|
+
* @returns {Uint8Array | undefined}
|
|
29
|
+
*/
|
|
30
|
+
export function decode_arbitrary_bytes_from_metadatum(metadata: TransactionMetadatum): Uint8Array | undefined;
|
|
31
|
+
/**
|
|
20
32
|
* @param {AuxiliaryData} auxiliary_data
|
|
21
33
|
* @returns {AuxiliaryDataHash}
|
|
22
34
|
*/
|
|
@@ -92,6 +104,33 @@ export function get_implicit_input(txbody: TransactionBody, pool_deposit: bigint
|
|
|
92
104
|
*/
|
|
93
105
|
export function get_deposit(txbody: TransactionBody, pool_deposit: bigint, key_deposit: bigint): bigint;
|
|
94
106
|
/**
|
|
107
|
+
*
|
|
108
|
+
* * Min fee for JUST the script, NOT including ref inputs
|
|
109
|
+
*
|
|
110
|
+
* @param {Transaction} tx
|
|
111
|
+
* @param {ExUnitPrices} ex_unit_prices
|
|
112
|
+
* @returns {bigint}
|
|
113
|
+
*/
|
|
114
|
+
export function min_script_fee(tx: Transaction, ex_unit_prices: ExUnitPrices): bigint;
|
|
115
|
+
/**
|
|
116
|
+
* @param {Transaction} tx
|
|
117
|
+
* @param {LinearFee} linear_fee
|
|
118
|
+
* @returns {bigint}
|
|
119
|
+
*/
|
|
120
|
+
export function min_no_script_fee(tx: Transaction, linear_fee: LinearFee): bigint;
|
|
121
|
+
/**
|
|
122
|
+
*
|
|
123
|
+
* * Calculates the cost of all ref scripts
|
|
124
|
+
* * * `total_ref_script_size` - Total size (original, not hashes) of all ref scripts. Duplicate scripts are counted as many times as they occur
|
|
125
|
+
*
|
|
126
|
+
* @param {Transaction} tx
|
|
127
|
+
* @param {LinearFee} linear_fee
|
|
128
|
+
* @param {ExUnitPrices} ex_unit_prices
|
|
129
|
+
* @param {bigint} total_ref_script_size
|
|
130
|
+
* @returns {bigint}
|
|
131
|
+
*/
|
|
132
|
+
export function min_fee(tx: Transaction, linear_fee: LinearFee, ex_unit_prices: ExUnitPrices, total_ref_script_size: bigint): bigint;
|
|
133
|
+
/**
|
|
95
134
|
* Converts JSON to Metadata according to MetadataJsonSchema
|
|
96
135
|
* @param {string} json
|
|
97
136
|
* @param {MetadataJsonSchema} schema
|
|
@@ -106,47 +145,11 @@ export function encode_json_str_to_metadatum(json: string, schema: MetadataJsonS
|
|
|
106
145
|
*/
|
|
107
146
|
export function decode_metadatum_to_json_str(metadatum: TransactionMetadatum, schema: MetadataJsonSchema): string;
|
|
108
147
|
/**
|
|
109
|
-
* @param {string} json
|
|
110
|
-
* @param {CardanoNodePlutusDatumSchema} schema
|
|
111
|
-
* @returns {PlutusData}
|
|
112
|
-
*/
|
|
113
|
-
export function encode_json_str_to_plutus_datum(json: string, schema: CardanoNodePlutusDatumSchema): PlutusData;
|
|
114
|
-
/**
|
|
115
|
-
* @param {PlutusData} datum
|
|
116
|
-
* @param {CardanoNodePlutusDatumSchema} schema
|
|
117
|
-
* @returns {string}
|
|
118
|
-
*/
|
|
119
|
-
export function decode_plutus_datum_to_json_str(datum: PlutusData, schema: CardanoNodePlutusDatumSchema): string;
|
|
120
|
-
/**
|
|
121
|
-
* @param {TransactionOutput} output
|
|
122
|
-
* @param {bigint} coins_per_utxo_byte
|
|
123
|
-
* @returns {bigint}
|
|
124
|
-
*/
|
|
125
|
-
export function min_ada_required(output: TransactionOutput, coins_per_utxo_byte: bigint): bigint;
|
|
126
|
-
/**
|
|
127
148
|
* @param {Redeemers} redeemers
|
|
128
149
|
* @returns {ExUnits}
|
|
129
150
|
*/
|
|
130
151
|
export function compute_total_ex_units(redeemers: Redeemers): ExUnits;
|
|
131
152
|
/**
|
|
132
|
-
* encodes arbitrary bytes into chunks of 64 bytes (the limit for bytes) as a list to be valid Metadata
|
|
133
|
-
* @param {Uint8Array} bytes
|
|
134
|
-
* @returns {TransactionMetadatum}
|
|
135
|
-
*/
|
|
136
|
-
export function encode_arbitrary_bytes_as_metadatum(bytes: Uint8Array): TransactionMetadatum;
|
|
137
|
-
/**
|
|
138
|
-
* decodes from chunks of bytes in a list to a byte vector if that is the metadata format, otherwise returns None
|
|
139
|
-
* @param {TransactionMetadatum} metadata
|
|
140
|
-
* @returns {Uint8Array | undefined}
|
|
141
|
-
*/
|
|
142
|
-
export function decode_arbitrary_bytes_from_metadatum(metadata: TransactionMetadatum): Uint8Array | undefined;
|
|
143
|
-
/**
|
|
144
|
-
* @param {TransactionHash} tx_body_hash
|
|
145
|
-
* @param {PrivateKey} sk
|
|
146
|
-
* @returns {Vkeywitness}
|
|
147
|
-
*/
|
|
148
|
-
export function make_vkey_witness(tx_body_hash: TransactionHash, sk: PrivateKey): Vkeywitness;
|
|
149
|
-
/**
|
|
150
153
|
* @param {TransactionHash} tx_body_hash
|
|
151
154
|
* @param {ByronAddress} addr
|
|
152
155
|
* @param {LegacyDaedalusPrivateKey} key
|
|
@@ -161,71 +164,77 @@ export function make_daedalus_bootstrap_witness(tx_body_hash: TransactionHash, a
|
|
|
161
164
|
*/
|
|
162
165
|
export function make_icarus_bootstrap_witness(tx_body_hash: TransactionHash, addr: ByronAddress, key: Bip32PrivateKey): BootstrapWitness;
|
|
163
166
|
/**
|
|
164
|
-
*
|
|
165
|
-
*
|
|
166
|
-
*
|
|
167
|
-
* @param {Transaction} tx
|
|
168
|
-
* @param {ExUnitPrices} ex_unit_prices
|
|
169
|
-
* @returns {bigint}
|
|
167
|
+
* @param {TransactionHash} tx_body_hash
|
|
168
|
+
* @param {PrivateKey} sk
|
|
169
|
+
* @returns {Vkeywitness}
|
|
170
170
|
*/
|
|
171
|
-
export function
|
|
171
|
+
export function make_vkey_witness(tx_body_hash: TransactionHash, sk: PrivateKey): Vkeywitness;
|
|
172
172
|
/**
|
|
173
|
-
* @param {
|
|
174
|
-
* @param {
|
|
173
|
+
* @param {TransactionOutput} output
|
|
174
|
+
* @param {bigint} coins_per_utxo_byte
|
|
175
175
|
* @returns {bigint}
|
|
176
176
|
*/
|
|
177
|
-
export function
|
|
177
|
+
export function min_ada_required(output: TransactionOutput, coins_per_utxo_byte: bigint): bigint;
|
|
178
178
|
/**
|
|
179
|
-
*
|
|
180
|
-
*
|
|
181
|
-
*
|
|
182
|
-
*
|
|
183
|
-
* @param {Transaction} tx
|
|
184
|
-
* @param {LinearFee} linear_fee
|
|
185
|
-
* @param {ExUnitPrices} ex_unit_prices
|
|
186
|
-
* @param {bigint} total_ref_script_size
|
|
187
|
-
* @returns {bigint}
|
|
179
|
+
* @param {string} json
|
|
180
|
+
* @param {CardanoNodePlutusDatumSchema} schema
|
|
181
|
+
* @returns {PlutusData}
|
|
188
182
|
*/
|
|
189
|
-
export function
|
|
183
|
+
export function encode_json_str_to_plutus_datum(json: string, schema: CardanoNodePlutusDatumSchema): PlutusData;
|
|
190
184
|
/**
|
|
185
|
+
* @param {PlutusData} datum
|
|
186
|
+
* @param {CardanoNodePlutusDatumSchema} schema
|
|
187
|
+
* @returns {string}
|
|
191
188
|
*/
|
|
192
|
-
export
|
|
193
|
-
NoConversions = 0,
|
|
194
|
-
BasicConversions = 1,
|
|
195
|
-
DetailedSchema = 2,
|
|
196
|
-
}
|
|
189
|
+
export function decode_plutus_datum_to_json_str(datum: PlutusData, schema: CardanoNodePlutusDatumSchema): string;
|
|
197
190
|
/**
|
|
198
191
|
*/
|
|
199
|
-
export enum
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
192
|
+
export enum PlutusDataKind {
|
|
193
|
+
ConstrPlutusData = 0,
|
|
194
|
+
Map = 1,
|
|
195
|
+
List = 2,
|
|
196
|
+
Integer = 3,
|
|
197
|
+
Bytes = 4,
|
|
204
198
|
}
|
|
205
199
|
/**
|
|
206
200
|
*/
|
|
207
|
-
export enum
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
201
|
+
export enum MetadataJsonSchema {
|
|
202
|
+
NoConversions = 0,
|
|
203
|
+
BasicConversions = 1,
|
|
204
|
+
DetailedSchema = 2,
|
|
211
205
|
}
|
|
212
206
|
/**
|
|
213
207
|
*/
|
|
214
|
-
export enum
|
|
215
|
-
|
|
216
|
-
|
|
208
|
+
export enum TransactionOutputKind {
|
|
209
|
+
AlonzoFormatTxOut = 0,
|
|
210
|
+
ConwayFormatTxOut = 1,
|
|
217
211
|
}
|
|
218
212
|
/**
|
|
219
213
|
*/
|
|
220
|
-
export enum
|
|
221
|
-
|
|
222
|
-
|
|
214
|
+
export enum CertificateKind {
|
|
215
|
+
StakeRegistration = 0,
|
|
216
|
+
StakeDeregistration = 1,
|
|
217
|
+
StakeDelegation = 2,
|
|
218
|
+
PoolRegistration = 3,
|
|
219
|
+
PoolRetirement = 4,
|
|
220
|
+
RegCert = 5,
|
|
221
|
+
UnregCert = 6,
|
|
222
|
+
VoteDelegCert = 7,
|
|
223
|
+
StakeVoteDelegCert = 8,
|
|
224
|
+
StakeRegDelegCert = 9,
|
|
225
|
+
VoteRegDelegCert = 10,
|
|
226
|
+
StakeVoteRegDelegCert = 11,
|
|
227
|
+
AuthCommitteeHotCert = 12,
|
|
228
|
+
ResignCommitteeColdCert = 13,
|
|
229
|
+
RegDrepCert = 14,
|
|
230
|
+
UnregDrepCert = 15,
|
|
231
|
+
UpdateDrepCert = 16,
|
|
223
232
|
}
|
|
224
233
|
/**
|
|
225
234
|
*/
|
|
226
|
-
export enum
|
|
227
|
-
|
|
228
|
-
|
|
235
|
+
export enum CredentialKind {
|
|
236
|
+
PubKey = 0,
|
|
237
|
+
Script = 1,
|
|
229
238
|
}
|
|
230
239
|
/**
|
|
231
240
|
*/
|
|
@@ -235,45 +244,87 @@ export enum NonceKind {
|
|
|
235
244
|
}
|
|
236
245
|
/**
|
|
237
246
|
*/
|
|
238
|
-
export enum
|
|
239
|
-
|
|
240
|
-
|
|
247
|
+
export enum VoterKind {
|
|
248
|
+
ConstitutionalCommitteeHotKeyHash = 0,
|
|
249
|
+
ConstitutionalCommitteeHotScriptHash = 1,
|
|
250
|
+
DRepKeyHash = 2,
|
|
251
|
+
DRepScriptHash = 3,
|
|
252
|
+
StakingPoolKeyHash = 4,
|
|
241
253
|
}
|
|
242
254
|
/**
|
|
243
|
-
* Careful: this enum doesn't include the network ID part of the header
|
|
244
|
-
* ex: base address isn't 0b0000_0000 but instead 0b0000
|
|
245
|
-
* Use `header_matches_kind` if you don't want to implement the bitwise operators yourself
|
|
246
255
|
*/
|
|
247
|
-
export enum
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
PointerKey = 4,
|
|
253
|
-
PointerScript = 5,
|
|
254
|
-
EnterpriseKey = 6,
|
|
255
|
-
EnterpriseScript = 7,
|
|
256
|
-
Byron = 8,
|
|
257
|
-
RewardKey = 14,
|
|
258
|
-
RewardScript = 15,
|
|
256
|
+
export enum ScriptKind {
|
|
257
|
+
Native = 0,
|
|
258
|
+
PlutusV1 = 1,
|
|
259
|
+
PlutusV2 = 2,
|
|
260
|
+
PlutusV3 = 3,
|
|
259
261
|
}
|
|
260
262
|
/**
|
|
263
|
+
* JSON <-> PlutusData conversion schemas.
|
|
264
|
+
* Follows ScriptDataJsonSchema in cardano-cli defined at:
|
|
265
|
+
* https://github.com/input-output-hk/cardano-node/blob/master/cardano-api/src/Cardano/Api/ScriptData.hs#L254
|
|
266
|
+
*
|
|
267
|
+
* All methods here have the following restrictions due to limitations on dependencies:
|
|
268
|
+
* * JSON numbers above u64::MAX (positive) or below i64::MIN (negative) will throw errors
|
|
269
|
+
* * Hex strings for bytes don't accept odd-length (half-byte) strings.
|
|
270
|
+
* cardano-cli seems to support these however but it seems to be different than just 0-padding
|
|
271
|
+
* on either side when tested so proceed with caution
|
|
261
272
|
*/
|
|
262
|
-
export enum
|
|
263
|
-
SingleKey = 0,
|
|
264
|
-
BootstrapEra = 1,
|
|
265
|
-
}
|
|
273
|
+
export enum CardanoNodePlutusDatumSchema {
|
|
266
274
|
/**
|
|
275
|
+
* ScriptDataJsonNoSchema in cardano-node.
|
|
276
|
+
*
|
|
277
|
+
* This is the format used by --script-data-value in cardano-cli
|
|
278
|
+
* This tries to accept most JSON but does not support the full spectrum of Plutus datums.
|
|
279
|
+
* From JSON:
|
|
280
|
+
* * null/true/false/floats NOT supported
|
|
281
|
+
* * strings starting with 0x are treated as hex bytes. All other strings are encoded as their utf8 bytes.
|
|
282
|
+
* To JSON:
|
|
283
|
+
* * ConstrPlutusData not supported in ANY FORM (neither keys nor values)
|
|
284
|
+
* * Lists not supported in keys
|
|
285
|
+
* * Maps not supported in keys
|
|
267
286
|
*/
|
|
268
|
-
|
|
269
|
-
|
|
287
|
+
BasicConversions = 0,
|
|
288
|
+
/**
|
|
289
|
+
* ScriptDataJsonDetailedSchema in cardano-node.
|
|
290
|
+
*
|
|
291
|
+
* This is the format used by --script-data-file in cardano-cli
|
|
292
|
+
* This covers almost all (only minor exceptions) Plutus datums, but the JSON must conform to a strict schema.
|
|
293
|
+
* The schema specifies that ALL keys and ALL values must be contained in a JSON map with 2 cases:
|
|
294
|
+
* 1. For ConstrPlutusData there must be two fields "constructor" contianing a number and "fields" containing its fields
|
|
295
|
+
* e.g. { "constructor": 2, "fields": [{"int": 2}, {"list": [{"bytes": "CAFEF00D"}]}]}
|
|
296
|
+
* 2. For all other cases there must be only one field named "int", "bytes", "list" or "map"
|
|
297
|
+
* BigInteger's value is a JSON number e.g. {"int": 100}
|
|
298
|
+
* Bytes' value is a hex string representing the bytes WITHOUT any prefix e.g. {"bytes": "CAFEF00D"}
|
|
299
|
+
* Lists' value is a JSON list of its elements encoded via the same schema e.g. {"list": [{"bytes": "CAFEF00D"}]}
|
|
300
|
+
* Maps' value is a JSON list of objects, one for each key-value pair in the map, with keys "k" and "v"
|
|
301
|
+
* respectively with their values being the plutus datum encoded via this same schema
|
|
302
|
+
* e.g. {"map": [
|
|
303
|
+
* {"k": {"int": 2}, "v": {"int": 5}},
|
|
304
|
+
* {"k": {"map": [{"k": {"list": [{"int": 1}]}, "v": {"bytes": "FF03"}}]}, "v": {"list": []}}
|
|
305
|
+
* ]}
|
|
306
|
+
* From JSON:
|
|
307
|
+
* * null/true/false/floats NOT supported
|
|
308
|
+
* * the JSON must conform to a very specific schema
|
|
309
|
+
* To JSON:
|
|
310
|
+
* * all Plutus datums should be fully supported outside of the integer range limitations outlined above.
|
|
311
|
+
*/
|
|
312
|
+
DetailedSchema = 1,
|
|
270
313
|
}
|
|
271
314
|
/**
|
|
272
315
|
*/
|
|
273
|
-
export enum
|
|
274
|
-
|
|
316
|
+
export enum DRepKind {
|
|
317
|
+
Key = 0,
|
|
275
318
|
Script = 1,
|
|
276
|
-
|
|
319
|
+
AlwaysAbstain = 2,
|
|
320
|
+
AlwaysNoConfidence = 3,
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
*/
|
|
324
|
+
export enum AuxiliaryDataKind {
|
|
325
|
+
Shelley = 0,
|
|
326
|
+
ShelleyMA = 1,
|
|
327
|
+
Conway = 2,
|
|
277
328
|
}
|
|
278
329
|
/**
|
|
279
330
|
*/
|
|
@@ -286,145 +337,108 @@ export enum RedeemerTag {
|
|
|
286
337
|
Proposing = 5,
|
|
287
338
|
}
|
|
288
339
|
/**
|
|
340
|
+
* Which version of the CIP25 spec to use. See CIP25 for details.
|
|
341
|
+
* This will change how things are encoded but for the most part contains
|
|
342
|
+
* the same information.
|
|
289
343
|
*/
|
|
290
|
-
export enum
|
|
291
|
-
Shelley = 0,
|
|
292
|
-
ShelleyMA = 1,
|
|
293
|
-
Conway = 2,
|
|
294
|
-
}
|
|
344
|
+
export enum CIP25Version {
|
|
295
345
|
/**
|
|
346
|
+
* Initial version of CIP25 with only string (utf8) asset names allowed.
|
|
296
347
|
*/
|
|
297
|
-
|
|
298
|
-
SingleHostAddr = 0,
|
|
299
|
-
SingleHostName = 1,
|
|
300
|
-
MultiHostName = 2,
|
|
301
|
-
}
|
|
348
|
+
V1 = 0,
|
|
302
349
|
/**
|
|
350
|
+
* Second version of CIP25. Supports any type of asset names.
|
|
303
351
|
*/
|
|
304
|
-
|
|
305
|
-
ConstitutionalCommitteeHotKeyHash = 0,
|
|
306
|
-
ConstitutionalCommitteeHotScriptHash = 1,
|
|
307
|
-
DRepKeyHash = 2,
|
|
308
|
-
DRepScriptHash = 3,
|
|
309
|
-
StakingPoolKeyHash = 4,
|
|
352
|
+
V2 = 1,
|
|
310
353
|
}
|
|
311
354
|
/**
|
|
312
355
|
*/
|
|
313
|
-
export enum
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
356
|
+
export enum NativeScriptKind {
|
|
357
|
+
ScriptPubkey = 0,
|
|
358
|
+
ScriptAll = 1,
|
|
359
|
+
ScriptAny = 2,
|
|
360
|
+
ScriptNOfK = 3,
|
|
361
|
+
ScriptInvalidBefore = 4,
|
|
362
|
+
ScriptInvalidHereafter = 5,
|
|
319
363
|
}
|
|
320
364
|
/**
|
|
321
365
|
*/
|
|
322
|
-
export enum
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
366
|
+
export enum TransactionMetadatumKind {
|
|
367
|
+
Map = 0,
|
|
368
|
+
List = 1,
|
|
369
|
+
Int = 2,
|
|
370
|
+
Bytes = 3,
|
|
371
|
+
Text = 4,
|
|
326
372
|
}
|
|
327
373
|
/**
|
|
328
374
|
*/
|
|
329
|
-
export enum
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
Enterprise = 2,
|
|
333
|
-
Reward = 3,
|
|
334
|
-
Byron = 4,
|
|
375
|
+
export enum DatumOptionKind {
|
|
376
|
+
Hash = 0,
|
|
377
|
+
Datum = 1,
|
|
335
378
|
}
|
|
336
379
|
/**
|
|
337
380
|
*/
|
|
338
|
-
export enum
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
ScriptNOfK = 3,
|
|
343
|
-
ScriptInvalidBefore = 4,
|
|
344
|
-
ScriptInvalidHereafter = 5,
|
|
381
|
+
export enum Language {
|
|
382
|
+
PlutusV1 = 0,
|
|
383
|
+
PlutusV2 = 1,
|
|
384
|
+
PlutusV3 = 2,
|
|
345
385
|
}
|
|
346
386
|
/**
|
|
347
|
-
* JSON <-> PlutusData conversion schemas.
|
|
348
|
-
* Follows ScriptDataJsonSchema in cardano-cli defined at:
|
|
349
|
-
* https://github.com/input-output-hk/cardano-node/blob/master/cardano-api/src/Cardano/Api/ScriptData.hs#L254
|
|
350
|
-
*
|
|
351
|
-
* All methods here have the following restrictions due to limitations on dependencies:
|
|
352
|
-
* * JSON numbers above u64::MAX (positive) or below i64::MIN (negative) will throw errors
|
|
353
|
-
* * Hex strings for bytes don't accept odd-length (half-byte) strings.
|
|
354
|
-
* cardano-cli seems to support these however but it seems to be different than just 0-padding
|
|
355
|
-
* on either side when tested so proceed with caution
|
|
356
387
|
*/
|
|
357
|
-
export enum
|
|
388
|
+
export enum RelayKind {
|
|
389
|
+
SingleHostAddr = 0,
|
|
390
|
+
SingleHostName = 1,
|
|
391
|
+
MultiHostName = 2,
|
|
392
|
+
}
|
|
358
393
|
/**
|
|
359
|
-
* ScriptDataJsonNoSchema in cardano-node.
|
|
360
|
-
*
|
|
361
|
-
* This is the format used by --script-data-value in cardano-cli
|
|
362
|
-
* This tries to accept most JSON but does not support the full spectrum of Plutus datums.
|
|
363
|
-
* From JSON:
|
|
364
|
-
* * null/true/false/floats NOT supported
|
|
365
|
-
* * strings starting with 0x are treated as hex bytes. All other strings are encoded as their utf8 bytes.
|
|
366
|
-
* To JSON:
|
|
367
|
-
* * ConstrPlutusData not supported in ANY FORM (neither keys nor values)
|
|
368
|
-
* * Lists not supported in keys
|
|
369
|
-
* * Maps not supported in keys
|
|
370
394
|
*/
|
|
371
|
-
|
|
395
|
+
export enum DelegationDistributionKind {
|
|
396
|
+
Weighted = 0,
|
|
397
|
+
Legacy = 1,
|
|
398
|
+
}
|
|
372
399
|
/**
|
|
373
|
-
*
|
|
374
|
-
*
|
|
375
|
-
*
|
|
376
|
-
* This covers almost all (only minor exceptions) Plutus datums, but the JSON must conform to a strict schema.
|
|
377
|
-
* The schema specifies that ALL keys and ALL values must be contained in a JSON map with 2 cases:
|
|
378
|
-
* 1. For ConstrPlutusData there must be two fields "constructor" contianing a number and "fields" containing its fields
|
|
379
|
-
* e.g. { "constructor": 2, "fields": [{"int": 2}, {"list": [{"bytes": "CAFEF00D"}]}]}
|
|
380
|
-
* 2. For all other cases there must be only one field named "int", "bytes", "list" or "map"
|
|
381
|
-
* BigInteger's value is a JSON number e.g. {"int": 100}
|
|
382
|
-
* Bytes' value is a hex string representing the bytes WITHOUT any prefix e.g. {"bytes": "CAFEF00D"}
|
|
383
|
-
* Lists' value is a JSON list of its elements encoded via the same schema e.g. {"list": [{"bytes": "CAFEF00D"}]}
|
|
384
|
-
* Maps' value is a JSON list of objects, one for each key-value pair in the map, with keys "k" and "v"
|
|
385
|
-
* respectively with their values being the plutus datum encoded via this same schema
|
|
386
|
-
* e.g. {"map": [
|
|
387
|
-
* {"k": {"int": 2}, "v": {"int": 5}},
|
|
388
|
-
* {"k": {"map": [{"k": {"list": [{"int": 1}]}, "v": {"bytes": "FF03"}}]}, "v": {"list": []}}
|
|
389
|
-
* ]}
|
|
390
|
-
* From JSON:
|
|
391
|
-
* * null/true/false/floats NOT supported
|
|
392
|
-
* * the JSON must conform to a very specific schema
|
|
393
|
-
* To JSON:
|
|
394
|
-
* * all Plutus datums should be fully supported outside of the integer range limitations outlined above.
|
|
400
|
+
* Careful: this enum doesn't include the network ID part of the header
|
|
401
|
+
* ex: base address isn't 0b0000_0000 but instead 0b0000
|
|
402
|
+
* Use `header_matches_kind` if you don't want to implement the bitwise operators yourself
|
|
395
403
|
*/
|
|
396
|
-
|
|
404
|
+
export enum AddressHeaderKind {
|
|
405
|
+
BasePaymentKeyStakeKey = 0,
|
|
406
|
+
BasePaymentScriptStakeKey = 1,
|
|
407
|
+
BasePaymentKeyStakeScript = 2,
|
|
408
|
+
BasePaymentScriptStakeScript = 3,
|
|
409
|
+
PointerKey = 4,
|
|
410
|
+
PointerScript = 5,
|
|
411
|
+
EnterpriseKey = 6,
|
|
412
|
+
EnterpriseScript = 7,
|
|
413
|
+
Byron = 8,
|
|
414
|
+
RewardKey = 14,
|
|
415
|
+
RewardScript = 15,
|
|
397
416
|
}
|
|
398
417
|
/**
|
|
399
418
|
*/
|
|
400
|
-
export enum
|
|
401
|
-
|
|
402
|
-
|
|
419
|
+
export enum ChunkableStringKind {
|
|
420
|
+
Single = 0,
|
|
421
|
+
Chunked = 1,
|
|
403
422
|
}
|
|
404
423
|
/**
|
|
405
424
|
*/
|
|
406
|
-
export enum
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
PlutusV3 = 3,
|
|
425
|
+
export enum SpendingDataKind {
|
|
426
|
+
SpendingDataPubKey = 0,
|
|
427
|
+
SpendingDataScript = 1,
|
|
428
|
+
SpendingDataRedeem = 2,
|
|
411
429
|
}
|
|
412
430
|
/**
|
|
413
431
|
*/
|
|
414
|
-
export enum
|
|
415
|
-
|
|
432
|
+
export enum ByronAddrType {
|
|
433
|
+
PublicKey = 0,
|
|
416
434
|
Script = 1,
|
|
435
|
+
Redeem = 2,
|
|
417
436
|
}
|
|
418
437
|
/**
|
|
419
438
|
*/
|
|
420
|
-
export enum
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
TreasuryWithdrawalsAction = 2,
|
|
424
|
-
NoConfidence = 3,
|
|
425
|
-
UpdateCommittee = 4,
|
|
426
|
-
NewConstitution = 5,
|
|
427
|
-
InfoAction = 6,
|
|
439
|
+
export enum RedeemersKind {
|
|
440
|
+
ArrLegacyRedeemer = 0,
|
|
441
|
+
MapRedeemerKeyToRedeemerVal = 1,
|
|
428
442
|
}
|
|
429
443
|
/**
|
|
430
444
|
*/
|
|
@@ -448,55 +462,41 @@ export enum CoinSelectionStrategyCIP2 {
|
|
|
448
462
|
}
|
|
449
463
|
/**
|
|
450
464
|
*/
|
|
451
|
-
export enum
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
Abstain = 2,
|
|
465
|
+
export enum StakeDistributionKind {
|
|
466
|
+
SingleKey = 0,
|
|
467
|
+
BootstrapEra = 1,
|
|
455
468
|
}
|
|
456
469
|
/**
|
|
457
470
|
*/
|
|
458
|
-
export enum
|
|
459
|
-
|
|
460
|
-
StakeDeregistration = 1,
|
|
461
|
-
StakeDelegation = 2,
|
|
462
|
-
PoolRegistration = 3,
|
|
463
|
-
PoolRetirement = 4,
|
|
464
|
-
RegCert = 5,
|
|
465
|
-
UnregCert = 6,
|
|
466
|
-
VoteDelegCert = 7,
|
|
467
|
-
StakeVoteDelegCert = 8,
|
|
468
|
-
StakeRegDelegCert = 9,
|
|
469
|
-
VoteRegDelegCert = 10,
|
|
470
|
-
StakeVoteRegDelegCert = 11,
|
|
471
|
-
AuthCommitteeHotCert = 12,
|
|
472
|
-
ResignCommitteeColdCert = 13,
|
|
473
|
-
RegDrepCert = 14,
|
|
474
|
-
UnregDrepCert = 15,
|
|
475
|
-
UpdateDrepCert = 16,
|
|
471
|
+
export enum ChangeSelectionAlgo {
|
|
472
|
+
Default = 0,
|
|
476
473
|
}
|
|
477
474
|
/**
|
|
478
475
|
*/
|
|
479
|
-
export enum
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
476
|
+
export enum GovActionKind {
|
|
477
|
+
ParameterChangeAction = 0,
|
|
478
|
+
HardForkInitiationAction = 1,
|
|
479
|
+
TreasuryWithdrawalsAction = 2,
|
|
480
|
+
NoConfidence = 3,
|
|
481
|
+
UpdateCommittee = 4,
|
|
482
|
+
NewConstitution = 5,
|
|
483
|
+
InfoAction = 6,
|
|
485
484
|
}
|
|
486
485
|
/**
|
|
487
|
-
* Which version of the CIP25 spec to use. See CIP25 for details.
|
|
488
|
-
* This will change how things are encoded but for the most part contains
|
|
489
|
-
* the same information.
|
|
490
|
-
*/
|
|
491
|
-
export enum CIP25Version {
|
|
492
|
-
/**
|
|
493
|
-
* Initial version of CIP25 with only string (utf8) asset names allowed.
|
|
494
486
|
*/
|
|
495
|
-
|
|
487
|
+
export enum AddressKind {
|
|
488
|
+
Base = 0,
|
|
489
|
+
Ptr = 1,
|
|
490
|
+
Enterprise = 2,
|
|
491
|
+
Reward = 3,
|
|
492
|
+
Byron = 4,
|
|
493
|
+
}
|
|
496
494
|
/**
|
|
497
|
-
* Second version of CIP25. Supports any type of asset names.
|
|
498
495
|
*/
|
|
499
|
-
|
|
496
|
+
export enum Vote {
|
|
497
|
+
No = 0,
|
|
498
|
+
Yes = 1,
|
|
499
|
+
Abstain = 2,
|
|
500
500
|
}
|
|
501
501
|
/**
|
|
502
502
|
*/
|
|
@@ -1072,51 +1072,6 @@ export class AssetName {
|
|
|
1072
1072
|
free(): void;
|
|
1073
1073
|
/**
|
|
1074
1074
|
*
|
|
1075
|
-
* * Create an AssetName from utf8 string. 64 byte (not char!) maximum.
|
|
1076
|
-
*
|
|
1077
|
-
* @param {string} utf8_str
|
|
1078
|
-
* @returns {AssetName}
|
|
1079
|
-
*/
|
|
1080
|
-
static from_str(utf8_str: string): AssetName;
|
|
1081
|
-
/**
|
|
1082
|
-
*
|
|
1083
|
-
* * AssetName as a utf8 string if it's possible. Will error if the asset is not utf8
|
|
1084
|
-
*
|
|
1085
|
-
* @returns {string}
|
|
1086
|
-
*/
|
|
1087
|
-
to_str(): string;
|
|
1088
|
-
/**
|
|
1089
|
-
*
|
|
1090
|
-
* * Direct raw bytes without any CBOR structure
|
|
1091
|
-
*
|
|
1092
|
-
* @returns {Uint8Array}
|
|
1093
|
-
*/
|
|
1094
|
-
to_raw_bytes(): Uint8Array;
|
|
1095
|
-
/**
|
|
1096
|
-
*
|
|
1097
|
-
* * Parse from the direct raw bytes, without any CBOR structure
|
|
1098
|
-
*
|
|
1099
|
-
* @param {Uint8Array} bytes
|
|
1100
|
-
* @returns {AssetName}
|
|
1101
|
-
*/
|
|
1102
|
-
static from_raw_bytes(bytes: Uint8Array): AssetName;
|
|
1103
|
-
/**
|
|
1104
|
-
*
|
|
1105
|
-
* * Direct raw bytes without any CBOR structure, as a hex-encoded string
|
|
1106
|
-
*
|
|
1107
|
-
* @returns {string}
|
|
1108
|
-
*/
|
|
1109
|
-
to_hex(): string;
|
|
1110
|
-
/**
|
|
1111
|
-
*
|
|
1112
|
-
* * Parse from a hex string of the direct raw bytes, without any CBOR structure
|
|
1113
|
-
*
|
|
1114
|
-
* @param {string} input
|
|
1115
|
-
* @returns {AssetName}
|
|
1116
|
-
*/
|
|
1117
|
-
static from_hex(input: string): AssetName;
|
|
1118
|
-
/**
|
|
1119
|
-
*
|
|
1120
1075
|
* * Serialize this type to CBOR bytes
|
|
1121
1076
|
* * This type type supports encoding preservation so this will preserve round-trip CBOR formats.
|
|
1122
1077
|
* * If created from scratch the CBOR will be canonical.
|
|
@@ -1177,6 +1132,51 @@ export class AssetName {
|
|
|
1177
1132
|
* @returns {AssetName}
|
|
1178
1133
|
*/
|
|
1179
1134
|
static from_json(json: string): AssetName;
|
|
1135
|
+
/**
|
|
1136
|
+
*
|
|
1137
|
+
* * Create an AssetName from utf8 string. 64 byte (not char!) maximum.
|
|
1138
|
+
*
|
|
1139
|
+
* @param {string} utf8_str
|
|
1140
|
+
* @returns {AssetName}
|
|
1141
|
+
*/
|
|
1142
|
+
static from_str(utf8_str: string): AssetName;
|
|
1143
|
+
/**
|
|
1144
|
+
*
|
|
1145
|
+
* * AssetName as a utf8 string if it's possible. Will error if the asset is not utf8
|
|
1146
|
+
*
|
|
1147
|
+
* @returns {string}
|
|
1148
|
+
*/
|
|
1149
|
+
to_str(): string;
|
|
1150
|
+
/**
|
|
1151
|
+
*
|
|
1152
|
+
* * Direct raw bytes without any CBOR structure
|
|
1153
|
+
*
|
|
1154
|
+
* @returns {Uint8Array}
|
|
1155
|
+
*/
|
|
1156
|
+
to_raw_bytes(): Uint8Array;
|
|
1157
|
+
/**
|
|
1158
|
+
*
|
|
1159
|
+
* * Parse from the direct raw bytes, without any CBOR structure
|
|
1160
|
+
*
|
|
1161
|
+
* @param {Uint8Array} bytes
|
|
1162
|
+
* @returns {AssetName}
|
|
1163
|
+
*/
|
|
1164
|
+
static from_raw_bytes(bytes: Uint8Array): AssetName;
|
|
1165
|
+
/**
|
|
1166
|
+
*
|
|
1167
|
+
* * Direct raw bytes without any CBOR structure, as a hex-encoded string
|
|
1168
|
+
*
|
|
1169
|
+
* @returns {string}
|
|
1170
|
+
*/
|
|
1171
|
+
to_hex(): string;
|
|
1172
|
+
/**
|
|
1173
|
+
*
|
|
1174
|
+
* * Parse from a hex string of the direct raw bytes, without any CBOR structure
|
|
1175
|
+
*
|
|
1176
|
+
* @param {string} input
|
|
1177
|
+
* @returns {AssetName}
|
|
1178
|
+
*/
|
|
1179
|
+
static from_hex(input: string): AssetName;
|
|
1180
1180
|
}
|
|
1181
1181
|
/**
|
|
1182
1182
|
*/
|