@anastasia-labs/cardano-multiplatform-lib-browser 6.0.2-1 → 6.0.2-3
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 +348 -348
- package/cardano_multiplatform_lib_bg.js +708 -706
- package/cardano_multiplatform_lib_bg.wasm +0 -0
- package/package.json +1 -1
|
@@ -17,6 +17,64 @@ 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
|
+
/**
|
|
32
|
+
*
|
|
33
|
+
* * Min fee for JUST the script, NOT including ref inputs
|
|
34
|
+
*
|
|
35
|
+
* @param {Transaction} tx
|
|
36
|
+
* @param {ExUnitPrices} ex_unit_prices
|
|
37
|
+
* @returns {bigint}
|
|
38
|
+
*/
|
|
39
|
+
export function min_script_fee(tx: Transaction, ex_unit_prices: ExUnitPrices): bigint;
|
|
40
|
+
/**
|
|
41
|
+
* @param {Transaction} tx
|
|
42
|
+
* @param {LinearFee} linear_fee
|
|
43
|
+
* @returns {bigint}
|
|
44
|
+
*/
|
|
45
|
+
export function min_no_script_fee(tx: Transaction, linear_fee: LinearFee): bigint;
|
|
46
|
+
/**
|
|
47
|
+
*
|
|
48
|
+
* * Calculates the cost of all ref scripts
|
|
49
|
+
* * * `total_ref_script_size` - Total size (original, not hashes) of all ref scripts. Duplicate scripts are counted as many times as they occur
|
|
50
|
+
*
|
|
51
|
+
* @param {Transaction} tx
|
|
52
|
+
* @param {LinearFee} linear_fee
|
|
53
|
+
* @param {ExUnitPrices} ex_unit_prices
|
|
54
|
+
* @param {bigint} total_ref_script_size
|
|
55
|
+
* @returns {bigint}
|
|
56
|
+
*/
|
|
57
|
+
export function min_fee(tx: Transaction, linear_fee: LinearFee, ex_unit_prices: ExUnitPrices, total_ref_script_size: bigint): bigint;
|
|
58
|
+
/**
|
|
59
|
+
* @param {TransactionHash} tx_body_hash
|
|
60
|
+
* @param {ByronAddress} addr
|
|
61
|
+
* @param {LegacyDaedalusPrivateKey} key
|
|
62
|
+
* @returns {BootstrapWitness}
|
|
63
|
+
*/
|
|
64
|
+
export function make_daedalus_bootstrap_witness(tx_body_hash: TransactionHash, addr: ByronAddress, key: LegacyDaedalusPrivateKey): BootstrapWitness;
|
|
65
|
+
/**
|
|
66
|
+
* @param {TransactionHash} tx_body_hash
|
|
67
|
+
* @param {ByronAddress} addr
|
|
68
|
+
* @param {Bip32PrivateKey} key
|
|
69
|
+
* @returns {BootstrapWitness}
|
|
70
|
+
*/
|
|
71
|
+
export function make_icarus_bootstrap_witness(tx_body_hash: TransactionHash, addr: ByronAddress, key: Bip32PrivateKey): BootstrapWitness;
|
|
72
|
+
/**
|
|
73
|
+
* @param {Redeemers} redeemers
|
|
74
|
+
* @returns {ExUnits}
|
|
75
|
+
*/
|
|
76
|
+
export function compute_total_ex_units(redeemers: Redeemers): ExUnits;
|
|
77
|
+
/**
|
|
20
78
|
* @param {AuxiliaryData} auxiliary_data
|
|
21
79
|
* @returns {AuxiliaryDataHash}
|
|
22
80
|
*/
|
|
@@ -78,6 +136,12 @@ export function calc_script_data_hash(redeemers: Redeemers, datums: PlutusDataLi
|
|
|
78
136
|
*/
|
|
79
137
|
export function calc_script_data_hash_from_witness(witnesses: TransactionWitnessSet, cost_models: CostModels): ScriptDataHash | undefined;
|
|
80
138
|
/**
|
|
139
|
+
* @param {TransactionHash} tx_body_hash
|
|
140
|
+
* @param {PrivateKey} sk
|
|
141
|
+
* @returns {Vkeywitness}
|
|
142
|
+
*/
|
|
143
|
+
export function make_vkey_witness(tx_body_hash: TransactionHash, sk: PrivateKey): Vkeywitness;
|
|
144
|
+
/**
|
|
81
145
|
* @param {TransactionBody} txbody
|
|
82
146
|
* @param {bigint} pool_deposit
|
|
83
147
|
* @param {bigint} key_deposit
|
|
@@ -124,83 +188,59 @@ export function decode_plutus_datum_to_json_str(datum: PlutusData, schema: Carda
|
|
|
124
188
|
*/
|
|
125
189
|
export function min_ada_required(output: TransactionOutput, coins_per_utxo_byte: bigint): bigint;
|
|
126
190
|
/**
|
|
127
|
-
* @param {Redeemers} redeemers
|
|
128
|
-
* @returns {ExUnits}
|
|
129
|
-
*/
|
|
130
|
-
export function compute_total_ex_units(redeemers: Redeemers): ExUnits;
|
|
131
|
-
/**
|
|
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
191
|
*/
|
|
142
|
-
export
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
* @param {PrivateKey} sk
|
|
146
|
-
* @returns {Vkeywitness}
|
|
147
|
-
*/
|
|
148
|
-
export function make_vkey_witness(tx_body_hash: TransactionHash, sk: PrivateKey): Vkeywitness;
|
|
192
|
+
export enum ChangeSelectionAlgo {
|
|
193
|
+
Default = 0,
|
|
194
|
+
}
|
|
149
195
|
/**
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
*
|
|
153
|
-
* @returns {BootstrapWitness}
|
|
196
|
+
* Which version of the CIP25 spec to use. See CIP25 for details.
|
|
197
|
+
* This will change how things are encoded but for the most part contains
|
|
198
|
+
* the same information.
|
|
154
199
|
*/
|
|
155
|
-
export
|
|
200
|
+
export enum CIP25Version {
|
|
156
201
|
/**
|
|
157
|
-
*
|
|
158
|
-
* @param {ByronAddress} addr
|
|
159
|
-
* @param {Bip32PrivateKey} key
|
|
160
|
-
* @returns {BootstrapWitness}
|
|
202
|
+
* Initial version of CIP25 with only string (utf8) asset names allowed.
|
|
161
203
|
*/
|
|
162
|
-
|
|
204
|
+
V1 = 0,
|
|
163
205
|
/**
|
|
164
|
-
*
|
|
165
|
-
* * Min fee for JUST the script, NOT including ref inputs
|
|
166
|
-
*
|
|
167
|
-
* @param {Transaction} tx
|
|
168
|
-
* @param {ExUnitPrices} ex_unit_prices
|
|
169
|
-
* @returns {bigint}
|
|
206
|
+
* Second version of CIP25. Supports any type of asset names.
|
|
170
207
|
*/
|
|
171
|
-
|
|
208
|
+
V2 = 1,
|
|
209
|
+
}
|
|
172
210
|
/**
|
|
173
|
-
* @param {Transaction} tx
|
|
174
|
-
* @param {LinearFee} linear_fee
|
|
175
|
-
* @returns {bigint}
|
|
176
211
|
*/
|
|
177
|
-
export
|
|
212
|
+
export enum PlutusDataKind {
|
|
213
|
+
ConstrPlutusData = 0,
|
|
214
|
+
Map = 1,
|
|
215
|
+
List = 2,
|
|
216
|
+
Integer = 3,
|
|
217
|
+
Bytes = 4,
|
|
218
|
+
}
|
|
178
219
|
/**
|
|
179
|
-
*
|
|
180
|
-
* * Calculates the cost of all ref scripts
|
|
181
|
-
* * * `total_ref_script_size` - Total size (original, not hashes) of all ref scripts. Duplicate scripts are counted as many times as they occur
|
|
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}
|
|
188
220
|
*/
|
|
189
|
-
export
|
|
221
|
+
export enum GovActionKind {
|
|
222
|
+
ParameterChangeAction = 0,
|
|
223
|
+
HardForkInitiationAction = 1,
|
|
224
|
+
TreasuryWithdrawalsAction = 2,
|
|
225
|
+
NoConfidence = 3,
|
|
226
|
+
UpdateCommittee = 4,
|
|
227
|
+
NewConstitution = 5,
|
|
228
|
+
InfoAction = 6,
|
|
229
|
+
}
|
|
190
230
|
/**
|
|
191
231
|
*/
|
|
192
|
-
export enum
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
232
|
+
export enum ScriptKind {
|
|
233
|
+
Native = 0,
|
|
234
|
+
PlutusV1 = 1,
|
|
235
|
+
PlutusV2 = 2,
|
|
236
|
+
PlutusV3 = 3,
|
|
196
237
|
}
|
|
197
238
|
/**
|
|
198
239
|
*/
|
|
199
|
-
export enum
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
AlwaysNoConfidence = 3,
|
|
240
|
+
export enum Vote {
|
|
241
|
+
No = 0,
|
|
242
|
+
Yes = 1,
|
|
243
|
+
Abstain = 2,
|
|
204
244
|
}
|
|
205
245
|
/**
|
|
206
246
|
*/
|
|
@@ -210,36 +250,6 @@ export enum Language {
|
|
|
210
250
|
PlutusV3 = 2,
|
|
211
251
|
}
|
|
212
252
|
/**
|
|
213
|
-
*/
|
|
214
|
-
export enum RedeemersKind {
|
|
215
|
-
ArrLegacyRedeemer = 0,
|
|
216
|
-
MapRedeemerKeyToRedeemerVal = 1,
|
|
217
|
-
}
|
|
218
|
-
/**
|
|
219
|
-
*/
|
|
220
|
-
export enum ChunkableStringKind {
|
|
221
|
-
Single = 0,
|
|
222
|
-
Chunked = 1,
|
|
223
|
-
}
|
|
224
|
-
/**
|
|
225
|
-
*/
|
|
226
|
-
export enum DelegationDistributionKind {
|
|
227
|
-
Weighted = 0,
|
|
228
|
-
Legacy = 1,
|
|
229
|
-
}
|
|
230
|
-
/**
|
|
231
|
-
*/
|
|
232
|
-
export enum NonceKind {
|
|
233
|
-
Identity = 0,
|
|
234
|
-
Hash = 1,
|
|
235
|
-
}
|
|
236
|
-
/**
|
|
237
|
-
*/
|
|
238
|
-
export enum DatumOptionKind {
|
|
239
|
-
Hash = 0,
|
|
240
|
-
Datum = 1,
|
|
241
|
-
}
|
|
242
|
-
/**
|
|
243
253
|
* Careful: this enum doesn't include the network ID part of the header
|
|
244
254
|
* ex: base address isn't 0b0000_0000 but instead 0b0000
|
|
245
255
|
* Use `header_matches_kind` if you don't want to implement the bitwise operators yourself
|
|
@@ -259,38 +269,36 @@ export enum AddressHeaderKind {
|
|
|
259
269
|
}
|
|
260
270
|
/**
|
|
261
271
|
*/
|
|
262
|
-
export enum
|
|
263
|
-
|
|
264
|
-
|
|
272
|
+
export enum AuxiliaryDataKind {
|
|
273
|
+
Shelley = 0,
|
|
274
|
+
ShelleyMA = 1,
|
|
275
|
+
Conway = 2,
|
|
265
276
|
}
|
|
266
277
|
/**
|
|
267
278
|
*/
|
|
268
|
-
export enum
|
|
269
|
-
|
|
279
|
+
export enum DatumOptionKind {
|
|
280
|
+
Hash = 0,
|
|
281
|
+
Datum = 1,
|
|
270
282
|
}
|
|
271
283
|
/**
|
|
272
284
|
*/
|
|
273
|
-
export enum
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
Redeem = 2,
|
|
285
|
+
export enum NonceKind {
|
|
286
|
+
Identity = 0,
|
|
287
|
+
Hash = 1,
|
|
277
288
|
}
|
|
278
289
|
/**
|
|
279
290
|
*/
|
|
280
|
-
export enum
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
Voting = 4,
|
|
286
|
-
Proposing = 5,
|
|
291
|
+
export enum DRepKind {
|
|
292
|
+
Key = 0,
|
|
293
|
+
Script = 1,
|
|
294
|
+
AlwaysAbstain = 2,
|
|
295
|
+
AlwaysNoConfidence = 3,
|
|
287
296
|
}
|
|
288
297
|
/**
|
|
289
298
|
*/
|
|
290
|
-
export enum
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
Conway = 2,
|
|
299
|
+
export enum ChunkableStringKind {
|
|
300
|
+
Single = 0,
|
|
301
|
+
Chunked = 1,
|
|
294
302
|
}
|
|
295
303
|
/**
|
|
296
304
|
*/
|
|
@@ -301,28 +309,35 @@ export enum RelayKind {
|
|
|
301
309
|
}
|
|
302
310
|
/**
|
|
303
311
|
*/
|
|
304
|
-
export enum
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
DRepKeyHash = 2,
|
|
308
|
-
DRepScriptHash = 3,
|
|
309
|
-
StakingPoolKeyHash = 4,
|
|
312
|
+
export enum RedeemersKind {
|
|
313
|
+
ArrLegacyRedeemer = 0,
|
|
314
|
+
MapRedeemerKeyToRedeemerVal = 1,
|
|
310
315
|
}
|
|
311
316
|
/**
|
|
312
317
|
*/
|
|
313
|
-
export enum
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
318
|
+
export enum CoinSelectionStrategyCIP2 {
|
|
319
|
+
/**
|
|
320
|
+
* Performs CIP2's Largest First ada-only selection. Will error if outputs contain non-ADA assets.
|
|
321
|
+
*/
|
|
322
|
+
LargestFirst = 0,
|
|
323
|
+
/**
|
|
324
|
+
* Performs CIP2's Random Improve ada-only selection. Will error if outputs contain non-ADA assets.
|
|
325
|
+
*/
|
|
326
|
+
RandomImprove = 1,
|
|
327
|
+
/**
|
|
328
|
+
* Same as LargestFirst, but before adding ADA, will insert by largest-first for each asset type.
|
|
329
|
+
*/
|
|
330
|
+
LargestFirstMultiAsset = 2,
|
|
331
|
+
/**
|
|
332
|
+
* Same as RandomImprove, but before adding ADA, will insert by random-improve for each asset type.
|
|
333
|
+
*/
|
|
334
|
+
RandomImproveMultiAsset = 3,
|
|
319
335
|
}
|
|
320
336
|
/**
|
|
321
337
|
*/
|
|
322
|
-
export enum
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
SpendingDataRedeem = 2,
|
|
338
|
+
export enum CredentialKind {
|
|
339
|
+
PubKey = 0,
|
|
340
|
+
Script = 1,
|
|
326
341
|
}
|
|
327
342
|
/**
|
|
328
343
|
*/
|
|
@@ -335,6 +350,46 @@ export enum AddressKind {
|
|
|
335
350
|
}
|
|
336
351
|
/**
|
|
337
352
|
*/
|
|
353
|
+
export enum RedeemerTag {
|
|
354
|
+
Spend = 0,
|
|
355
|
+
Mint = 1,
|
|
356
|
+
Cert = 2,
|
|
357
|
+
Reward = 3,
|
|
358
|
+
Voting = 4,
|
|
359
|
+
Proposing = 5,
|
|
360
|
+
}
|
|
361
|
+
/**
|
|
362
|
+
*/
|
|
363
|
+
export enum ByronAddrType {
|
|
364
|
+
PublicKey = 0,
|
|
365
|
+
Script = 1,
|
|
366
|
+
Redeem = 2,
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
*/
|
|
370
|
+
export enum TransactionMetadatumKind {
|
|
371
|
+
Map = 0,
|
|
372
|
+
List = 1,
|
|
373
|
+
Int = 2,
|
|
374
|
+
Bytes = 3,
|
|
375
|
+
Text = 4,
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
*/
|
|
379
|
+
export enum SpendingDataKind {
|
|
380
|
+
SpendingDataPubKey = 0,
|
|
381
|
+
SpendingDataScript = 1,
|
|
382
|
+
SpendingDataRedeem = 2,
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
*/
|
|
386
|
+
export enum MetadataJsonSchema {
|
|
387
|
+
NoConversions = 0,
|
|
388
|
+
BasicConversions = 1,
|
|
389
|
+
DetailedSchema = 2,
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
*/
|
|
338
393
|
export enum NativeScriptKind {
|
|
339
394
|
ScriptPubkey = 0,
|
|
340
395
|
ScriptAll = 1,
|
|
@@ -344,6 +399,33 @@ export enum NativeScriptKind {
|
|
|
344
399
|
ScriptInvalidHereafter = 5,
|
|
345
400
|
}
|
|
346
401
|
/**
|
|
402
|
+
*/
|
|
403
|
+
export enum TransactionOutputKind {
|
|
404
|
+
AlonzoFormatTxOut = 0,
|
|
405
|
+
ConwayFormatTxOut = 1,
|
|
406
|
+
}
|
|
407
|
+
/**
|
|
408
|
+
*/
|
|
409
|
+
export enum VoterKind {
|
|
410
|
+
ConstitutionalCommitteeHotKeyHash = 0,
|
|
411
|
+
ConstitutionalCommitteeHotScriptHash = 1,
|
|
412
|
+
DRepKeyHash = 2,
|
|
413
|
+
DRepScriptHash = 3,
|
|
414
|
+
StakingPoolKeyHash = 4,
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
*/
|
|
418
|
+
export enum DelegationDistributionKind {
|
|
419
|
+
Weighted = 0,
|
|
420
|
+
Legacy = 1,
|
|
421
|
+
}
|
|
422
|
+
/**
|
|
423
|
+
*/
|
|
424
|
+
export enum StakeDistributionKind {
|
|
425
|
+
SingleKey = 0,
|
|
426
|
+
BootstrapEra = 1,
|
|
427
|
+
}
|
|
428
|
+
/**
|
|
347
429
|
* JSON <-> PlutusData conversion schemas.
|
|
348
430
|
* Follows ScriptDataJsonSchema in cardano-cli defined at:
|
|
349
431
|
* https://github.com/input-output-hk/cardano-node/blob/master/cardano-api/src/Cardano/Api/ScriptData.hs#L254
|
|
@@ -397,64 +479,6 @@ export enum CardanoNodePlutusDatumSchema {
|
|
|
397
479
|
}
|
|
398
480
|
/**
|
|
399
481
|
*/
|
|
400
|
-
export enum TransactionOutputKind {
|
|
401
|
-
AlonzoFormatTxOut = 0,
|
|
402
|
-
ConwayFormatTxOut = 1,
|
|
403
|
-
}
|
|
404
|
-
/**
|
|
405
|
-
*/
|
|
406
|
-
export enum ScriptKind {
|
|
407
|
-
Native = 0,
|
|
408
|
-
PlutusV1 = 1,
|
|
409
|
-
PlutusV2 = 2,
|
|
410
|
-
PlutusV3 = 3,
|
|
411
|
-
}
|
|
412
|
-
/**
|
|
413
|
-
*/
|
|
414
|
-
export enum CredentialKind {
|
|
415
|
-
PubKey = 0,
|
|
416
|
-
Script = 1,
|
|
417
|
-
}
|
|
418
|
-
/**
|
|
419
|
-
*/
|
|
420
|
-
export enum GovActionKind {
|
|
421
|
-
ParameterChangeAction = 0,
|
|
422
|
-
HardForkInitiationAction = 1,
|
|
423
|
-
TreasuryWithdrawalsAction = 2,
|
|
424
|
-
NoConfidence = 3,
|
|
425
|
-
UpdateCommittee = 4,
|
|
426
|
-
NewConstitution = 5,
|
|
427
|
-
InfoAction = 6,
|
|
428
|
-
}
|
|
429
|
-
/**
|
|
430
|
-
*/
|
|
431
|
-
export enum CoinSelectionStrategyCIP2 {
|
|
432
|
-
/**
|
|
433
|
-
* Performs CIP2's Largest First ada-only selection. Will error if outputs contain non-ADA assets.
|
|
434
|
-
*/
|
|
435
|
-
LargestFirst = 0,
|
|
436
|
-
/**
|
|
437
|
-
* Performs CIP2's Random Improve ada-only selection. Will error if outputs contain non-ADA assets.
|
|
438
|
-
*/
|
|
439
|
-
RandomImprove = 1,
|
|
440
|
-
/**
|
|
441
|
-
* Same as LargestFirst, but before adding ADA, will insert by largest-first for each asset type.
|
|
442
|
-
*/
|
|
443
|
-
LargestFirstMultiAsset = 2,
|
|
444
|
-
/**
|
|
445
|
-
* Same as RandomImprove, but before adding ADA, will insert by random-improve for each asset type.
|
|
446
|
-
*/
|
|
447
|
-
RandomImproveMultiAsset = 3,
|
|
448
|
-
}
|
|
449
|
-
/**
|
|
450
|
-
*/
|
|
451
|
-
export enum Vote {
|
|
452
|
-
No = 0,
|
|
453
|
-
Yes = 1,
|
|
454
|
-
Abstain = 2,
|
|
455
|
-
}
|
|
456
|
-
/**
|
|
457
|
-
*/
|
|
458
482
|
export enum CertificateKind {
|
|
459
483
|
StakeRegistration = 0,
|
|
460
484
|
StakeDeregistration = 1,
|
|
@@ -476,32 +500,21 @@ export enum CertificateKind {
|
|
|
476
500
|
}
|
|
477
501
|
/**
|
|
478
502
|
*/
|
|
479
|
-
export
|
|
480
|
-
|
|
481
|
-
List = 1,
|
|
482
|
-
Int = 2,
|
|
483
|
-
Bytes = 3,
|
|
484
|
-
Text = 4,
|
|
485
|
-
}
|
|
486
|
-
/**
|
|
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
|
-
*/
|
|
495
|
-
V1 = 0,
|
|
503
|
+
export class AddrAttributes {
|
|
504
|
+
free(): void;
|
|
496
505
|
/**
|
|
497
|
-
*
|
|
506
|
+
* @param {HDAddressPayload | undefined} [hdap]
|
|
507
|
+
* @param {ProtocolMagic | undefined} [protocol_magic]
|
|
508
|
+
* @returns {AddrAttributes}
|
|
498
509
|
*/
|
|
499
|
-
|
|
500
|
-
}
|
|
510
|
+
static new_bootstrap_era(hdap?: HDAddressPayload, protocol_magic?: ProtocolMagic): AddrAttributes;
|
|
501
511
|
/**
|
|
512
|
+
* @param {Bip32PublicKey} pubk
|
|
513
|
+
* @param {HDAddressPayload | undefined} hdap
|
|
514
|
+
* @param {ProtocolMagic} protocol_magic
|
|
515
|
+
* @returns {AddrAttributes}
|
|
502
516
|
*/
|
|
503
|
-
|
|
504
|
-
free(): void;
|
|
517
|
+
static new_single_key(pubk: Bip32PublicKey, hdap: HDAddressPayload | undefined, protocol_magic: ProtocolMagic): AddrAttributes;
|
|
505
518
|
/**
|
|
506
519
|
*
|
|
507
520
|
* * Serialize this type to CBOR bytes.
|
|
@@ -556,28 +569,15 @@ export class AddrAttributes {
|
|
|
556
569
|
/**
|
|
557
570
|
* @param {ProtocolMagic} protocol_magic
|
|
558
571
|
*/
|
|
559
|
-
set_protocol_magic(protocol_magic: ProtocolMagic): void;
|
|
560
|
-
/**
|
|
561
|
-
* @returns {ProtocolMagic | undefined}
|
|
562
|
-
*/
|
|
563
|
-
protocol_magic(): ProtocolMagic | undefined;
|
|
564
|
-
/**
|
|
565
|
-
* @returns {AddrAttributes}
|
|
566
|
-
*/
|
|
567
|
-
static new(): AddrAttributes;
|
|
568
|
-
/**
|
|
569
|
-
* @param {HDAddressPayload | undefined} [hdap]
|
|
570
|
-
* @param {ProtocolMagic | undefined} [protocol_magic]
|
|
571
|
-
* @returns {AddrAttributes}
|
|
572
|
+
set_protocol_magic(protocol_magic: ProtocolMagic): void;
|
|
573
|
+
/**
|
|
574
|
+
* @returns {ProtocolMagic | undefined}
|
|
572
575
|
*/
|
|
573
|
-
|
|
576
|
+
protocol_magic(): ProtocolMagic | undefined;
|
|
574
577
|
/**
|
|
575
|
-
* @param {Bip32PublicKey} pubk
|
|
576
|
-
* @param {HDAddressPayload | undefined} hdap
|
|
577
|
-
* @param {ProtocolMagic} protocol_magic
|
|
578
578
|
* @returns {AddrAttributes}
|
|
579
579
|
*/
|
|
580
|
-
static
|
|
580
|
+
static new(): AddrAttributes;
|
|
581
581
|
}
|
|
582
582
|
/**
|
|
583
583
|
*/
|
|
@@ -699,6 +699,52 @@ export class Address {
|
|
|
699
699
|
export class AddressContent {
|
|
700
700
|
free(): void;
|
|
701
701
|
/**
|
|
702
|
+
* @param {ByronAddrType} addr_type
|
|
703
|
+
* @param {SpendingData} spending_data
|
|
704
|
+
* @param {AddrAttributes} attributes
|
|
705
|
+
* @returns {AddressContent}
|
|
706
|
+
*/
|
|
707
|
+
static hash_and_create(addr_type: ByronAddrType, spending_data: SpendingData, attributes: AddrAttributes): AddressContent;
|
|
708
|
+
/**
|
|
709
|
+
* @param {PublicKey} pubkey
|
|
710
|
+
* @param {ProtocolMagic | undefined} [protocol_magic]
|
|
711
|
+
* @returns {AddressContent}
|
|
712
|
+
*/
|
|
713
|
+
static new_redeem(pubkey: PublicKey, protocol_magic?: ProtocolMagic): AddressContent;
|
|
714
|
+
/**
|
|
715
|
+
* @param {Bip32PublicKey} xpub
|
|
716
|
+
* @param {ProtocolMagic | undefined} [protocol_magic]
|
|
717
|
+
* @returns {AddressContent}
|
|
718
|
+
*/
|
|
719
|
+
static new_simple(xpub: Bip32PublicKey, protocol_magic?: ProtocolMagic): AddressContent;
|
|
720
|
+
/**
|
|
721
|
+
* Do we want to remove this or keep it for people who were using old Byron code?
|
|
722
|
+
* @returns {ByronAddress}
|
|
723
|
+
*/
|
|
724
|
+
to_address(): ByronAddress;
|
|
725
|
+
/**
|
|
726
|
+
* returns the byron protocol magic embedded in the address, or mainnet id if none is present
|
|
727
|
+
* note: for bech32 addresses, you need to use network_id instead
|
|
728
|
+
* @returns {ProtocolMagic}
|
|
729
|
+
*/
|
|
730
|
+
byron_protocol_magic(): ProtocolMagic;
|
|
731
|
+
/**
|
|
732
|
+
* @returns {number}
|
|
733
|
+
*/
|
|
734
|
+
network_id(): number;
|
|
735
|
+
/**
|
|
736
|
+
* @param {Bip32PublicKey} key
|
|
737
|
+
* @param {ProtocolMagic} protocol_magic
|
|
738
|
+
* @returns {AddressContent}
|
|
739
|
+
*/
|
|
740
|
+
static icarus_from_key(key: Bip32PublicKey, protocol_magic: ProtocolMagic): AddressContent;
|
|
741
|
+
/**
|
|
742
|
+
* Check if the Addr can be reconstructed with a specific xpub
|
|
743
|
+
* @param {Bip32PublicKey} xpub
|
|
744
|
+
* @returns {boolean}
|
|
745
|
+
*/
|
|
746
|
+
identical_with_pubkey(xpub: Bip32PublicKey): boolean;
|
|
747
|
+
/**
|
|
702
748
|
*
|
|
703
749
|
* * Serialize this type to CBOR bytes.
|
|
704
750
|
* * This type does NOT support fine-tuned encoding options so this may or may not be
|
|
@@ -752,52 +798,6 @@ export class AddressContent {
|
|
|
752
798
|
* @returns {AddressContent}
|
|
753
799
|
*/
|
|
754
800
|
static new(address_id: AddressId, addr_attributes: AddrAttributes, addr_type: ByronAddrType): AddressContent;
|
|
755
|
-
/**
|
|
756
|
-
* @param {ByronAddrType} addr_type
|
|
757
|
-
* @param {SpendingData} spending_data
|
|
758
|
-
* @param {AddrAttributes} attributes
|
|
759
|
-
* @returns {AddressContent}
|
|
760
|
-
*/
|
|
761
|
-
static hash_and_create(addr_type: ByronAddrType, spending_data: SpendingData, attributes: AddrAttributes): AddressContent;
|
|
762
|
-
/**
|
|
763
|
-
* @param {PublicKey} pubkey
|
|
764
|
-
* @param {ProtocolMagic | undefined} [protocol_magic]
|
|
765
|
-
* @returns {AddressContent}
|
|
766
|
-
*/
|
|
767
|
-
static new_redeem(pubkey: PublicKey, protocol_magic?: ProtocolMagic): AddressContent;
|
|
768
|
-
/**
|
|
769
|
-
* @param {Bip32PublicKey} xpub
|
|
770
|
-
* @param {ProtocolMagic | undefined} [protocol_magic]
|
|
771
|
-
* @returns {AddressContent}
|
|
772
|
-
*/
|
|
773
|
-
static new_simple(xpub: Bip32PublicKey, protocol_magic?: ProtocolMagic): AddressContent;
|
|
774
|
-
/**
|
|
775
|
-
* Do we want to remove this or keep it for people who were using old Byron code?
|
|
776
|
-
* @returns {ByronAddress}
|
|
777
|
-
*/
|
|
778
|
-
to_address(): ByronAddress;
|
|
779
|
-
/**
|
|
780
|
-
* returns the byron protocol magic embedded in the address, or mainnet id if none is present
|
|
781
|
-
* note: for bech32 addresses, you need to use network_id instead
|
|
782
|
-
* @returns {ProtocolMagic}
|
|
783
|
-
*/
|
|
784
|
-
byron_protocol_magic(): ProtocolMagic;
|
|
785
|
-
/**
|
|
786
|
-
* @returns {number}
|
|
787
|
-
*/
|
|
788
|
-
network_id(): number;
|
|
789
|
-
/**
|
|
790
|
-
* @param {Bip32PublicKey} key
|
|
791
|
-
* @param {ProtocolMagic} protocol_magic
|
|
792
|
-
* @returns {AddressContent}
|
|
793
|
-
*/
|
|
794
|
-
static icarus_from_key(key: Bip32PublicKey, protocol_magic: ProtocolMagic): AddressContent;
|
|
795
|
-
/**
|
|
796
|
-
* Check if the Addr can be reconstructed with a specific xpub
|
|
797
|
-
* @param {Bip32PublicKey} xpub
|
|
798
|
-
* @returns {boolean}
|
|
799
|
-
*/
|
|
800
|
-
identical_with_pubkey(xpub: Bip32PublicKey): boolean;
|
|
801
801
|
}
|
|
802
802
|
/**
|
|
803
803
|
*/
|
|
@@ -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
|
*/
|
|
@@ -1935,10 +1935,6 @@ export class BlockHeaderHash {
|
|
|
1935
1935
|
export class BootstrapWitness {
|
|
1936
1936
|
free(): void;
|
|
1937
1937
|
/**
|
|
1938
|
-
* @returns {AddressContent}
|
|
1939
|
-
*/
|
|
1940
|
-
to_address(): AddressContent;
|
|
1941
|
-
/**
|
|
1942
1938
|
*
|
|
1943
1939
|
* * Serialize this type to CBOR bytes
|
|
1944
1940
|
* * This type type supports encoding preservation so this will preserve round-trip CBOR formats.
|
|
@@ -2024,6 +2020,10 @@ export class BootstrapWitness {
|
|
|
2024
2020
|
* @returns {BootstrapWitness}
|
|
2025
2021
|
*/
|
|
2026
2022
|
static new(public_key: PublicKey, signature: Ed25519Signature, chain_code: Uint8Array, attributes: AddrAttributes): BootstrapWitness;
|
|
2023
|
+
/**
|
|
2024
|
+
* @returns {AddressContent}
|
|
2025
|
+
*/
|
|
2026
|
+
to_address(): AddressContent;
|
|
2027
2027
|
}
|
|
2028
2028
|
/**
|
|
2029
2029
|
*/
|
|
@@ -2052,6 +2052,34 @@ export class BootstrapWitnessList {
|
|
|
2052
2052
|
export class ByronAddress {
|
|
2053
2053
|
free(): void;
|
|
2054
2054
|
/**
|
|
2055
|
+
* @returns {string}
|
|
2056
|
+
*/
|
|
2057
|
+
to_base58(): string;
|
|
2058
|
+
/**
|
|
2059
|
+
* @param {string} s
|
|
2060
|
+
* @returns {ByronAddress}
|
|
2061
|
+
*/
|
|
2062
|
+
static from_base58(s: string): ByronAddress;
|
|
2063
|
+
/**
|
|
2064
|
+
* @param {string} s
|
|
2065
|
+
* @returns {boolean}
|
|
2066
|
+
*/
|
|
2067
|
+
static is_valid(s: string): boolean;
|
|
2068
|
+
/**
|
|
2069
|
+
* @returns {Address}
|
|
2070
|
+
*/
|
|
2071
|
+
to_address(): Address;
|
|
2072
|
+
/**
|
|
2073
|
+
* @param {Address} addr
|
|
2074
|
+
* @returns {ByronAddress | undefined}
|
|
2075
|
+
*/
|
|
2076
|
+
static from_address(addr: Address): ByronAddress | undefined;
|
|
2077
|
+
/**
|
|
2078
|
+
* @param {AddressContent} address_content
|
|
2079
|
+
* @returns {ByronAddress}
|
|
2080
|
+
*/
|
|
2081
|
+
static from_address_content(address_content: AddressContent): ByronAddress;
|
|
2082
|
+
/**
|
|
2055
2083
|
*
|
|
2056
2084
|
* * Serialize this type to CBOR bytes.
|
|
2057
2085
|
* * This type does NOT support fine-tuned encoding options so this may or may not be
|
|
@@ -2100,34 +2128,6 @@ export class ByronAddress {
|
|
|
2100
2128
|
* @returns {ByronAddress}
|
|
2101
2129
|
*/
|
|
2102
2130
|
static new(content: AddressContent, crc: Crc32): ByronAddress;
|
|
2103
|
-
/**
|
|
2104
|
-
* @returns {string}
|
|
2105
|
-
*/
|
|
2106
|
-
to_base58(): string;
|
|
2107
|
-
/**
|
|
2108
|
-
* @param {string} s
|
|
2109
|
-
* @returns {ByronAddress}
|
|
2110
|
-
*/
|
|
2111
|
-
static from_base58(s: string): ByronAddress;
|
|
2112
|
-
/**
|
|
2113
|
-
* @param {string} s
|
|
2114
|
-
* @returns {boolean}
|
|
2115
|
-
*/
|
|
2116
|
-
static is_valid(s: string): boolean;
|
|
2117
|
-
/**
|
|
2118
|
-
* @returns {Address}
|
|
2119
|
-
*/
|
|
2120
|
-
to_address(): Address;
|
|
2121
|
-
/**
|
|
2122
|
-
* @param {Address} addr
|
|
2123
|
-
* @returns {ByronAddress | undefined}
|
|
2124
|
-
*/
|
|
2125
|
-
static from_address(addr: Address): ByronAddress | undefined;
|
|
2126
|
-
/**
|
|
2127
|
-
* @param {AddressContent} address_content
|
|
2128
|
-
* @returns {ByronAddress}
|
|
2129
|
-
*/
|
|
2130
|
-
static from_address_content(address_content: AddressContent): ByronAddress;
|
|
2131
2131
|
}
|
|
2132
2132
|
/**
|
|
2133
2133
|
*/
|