@meshsdk/core-cst 1.8.14 → 1.9.0-beta-39
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.cjs +5980 -1439
- package/dist/index.d.cts +155 -112
- package/dist/index.d.ts +155 -112
- package/dist/index.js +6055 -1503
- package/package.json +19 -13
package/dist/index.d.cts
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import * as _cardano_sdk_core from '@cardano-sdk/core';
|
|
2
1
|
import { Cardano, Serialization } from '@cardano-sdk/core';
|
|
3
|
-
|
|
2
|
+
import * as core from '@cardano-sdk/core';
|
|
3
|
+
export { core as CardanoSDK };
|
|
4
4
|
export { Cardano, Serialization } from '@cardano-sdk/core';
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
export {
|
|
5
|
+
import { OpaqueString, HexBlob as HexBlob$1 } from '@cardano-sdk/util';
|
|
6
|
+
import * as util from '@cardano-sdk/util';
|
|
7
|
+
export { util as CardanoSDKUtil };
|
|
8
8
|
import * as Crypto from '@cardano-sdk/crypto';
|
|
9
9
|
export { Crypto };
|
|
10
|
-
import
|
|
11
|
-
import { DataSignature, Data, NativeScript as NativeScript$1, PlutusScript, IMeshTxSerializer, DeserializedAddress, BuilderData, IDeserializer, IResolver, MeshTxBuilderBody, Protocol, UTxO, Asset, LanguageVersion } from '@meshsdk/common';
|
|
10
|
+
import { DataSignature, BuilderData, PlutusDataType, NativeScript as NativeScript$1, PlutusScript, IMeshTxSerializer, Protocol, DeserializedAddress, IDeserializer, IResolver, MeshTxBuilderBody, Asset, Output, UTxO, LanguageVersion, Data, PubKeyAddress, ScriptAddress } from '@meshsdk/common';
|
|
12
11
|
import { Buffer as Buffer$1 } from 'buffer';
|
|
13
|
-
import
|
|
12
|
+
import { CborMap, CborBytes } from '@harmoniclabs/cbor';
|
|
14
13
|
|
|
15
14
|
declare const Slot: (value: number) => Cardano.Slot;
|
|
16
15
|
type Slot = Cardano.Slot;
|
|
@@ -19,16 +18,20 @@ type Value = Serialization.Value;
|
|
|
19
18
|
type TokenMap = Cardano.TokenMap;
|
|
20
19
|
declare const Transaction: typeof Serialization.Transaction;
|
|
21
20
|
type Transaction = Serialization.Transaction;
|
|
22
|
-
declare const TransactionId:
|
|
23
|
-
(value: string): Cardano.TransactionId;
|
|
24
|
-
fromHexBlob(value: _cardano_sdk_util.HexBlob): Cardano.TransactionId;
|
|
25
|
-
fromTxBodyCbor(bodyCbor: _cardano_sdk_core.TxBodyCBOR): Cardano.TransactionId;
|
|
26
|
-
};
|
|
21
|
+
declare const TransactionId: (value: string) => Cardano.TransactionId;
|
|
27
22
|
type TransactionId = Cardano.TransactionId;
|
|
28
23
|
declare const TransactionBody: typeof Serialization.TransactionBody;
|
|
29
24
|
type TransactionBody = Serialization.TransactionBody;
|
|
30
25
|
declare const TransactionWitnessSet: typeof Serialization.TransactionWitnessSet;
|
|
31
26
|
type TransactionWitnessSet = Serialization.TransactionWitnessSet;
|
|
27
|
+
declare const AuxilliaryData: typeof Serialization.AuxiliaryData;
|
|
28
|
+
type AuxiliaryData = Serialization.AuxiliaryData;
|
|
29
|
+
declare const TransactionMetadatum: typeof Serialization.TransactionMetadatum;
|
|
30
|
+
type TransactionMetadatum = Serialization.TransactionMetadatum;
|
|
31
|
+
declare const MetadatumMap: typeof Serialization.MetadatumMap;
|
|
32
|
+
type MetadatumMap = Serialization.MetadatumMap;
|
|
33
|
+
declare const MetadatumList: typeof Serialization.MetadatumList;
|
|
34
|
+
type MetadatumList = Serialization.MetadatumList;
|
|
32
35
|
declare const TransactionUnspentOutput: typeof Serialization.TransactionUnspentOutput;
|
|
33
36
|
type TransactionUnspentOutput = Serialization.TransactionUnspentOutput;
|
|
34
37
|
declare const TransactionInput: typeof Serialization.TransactionInput;
|
|
@@ -65,7 +68,6 @@ declare const AssetId: {
|
|
|
65
68
|
getPolicyId(id: Cardano.AssetId): Cardano.PolicyId;
|
|
66
69
|
getAssetName(id: Cardano.AssetId): Cardano.AssetName;
|
|
67
70
|
fromParts(policyId: Cardano.PolicyId, assetName: Cardano.AssetName): Cardano.AssetId;
|
|
68
|
-
getAssetNameAsText(id: Cardano.AssetId): string;
|
|
69
71
|
};
|
|
70
72
|
type AssetId = Cardano.AssetId;
|
|
71
73
|
declare const ScriptHash: {
|
|
@@ -108,10 +110,7 @@ declare const Hash28ByteBase16: {
|
|
|
108
110
|
fromEd25519KeyHashHex(value: Crypto.Ed25519KeyHashHex): Crypto.Hash28ByteBase16;
|
|
109
111
|
};
|
|
110
112
|
type Hash28ByteBase16 = Crypto.Hash28ByteBase16;
|
|
111
|
-
declare const Hash32ByteBase16:
|
|
112
|
-
(value: string): Crypto.Hash32ByteBase16;
|
|
113
|
-
fromHexBlob<T>(value: _cardano_sdk_util.HexBlob): T;
|
|
114
|
-
};
|
|
113
|
+
declare const Hash32ByteBase16: (value: string) => Crypto.Hash32ByteBase16;
|
|
115
114
|
type Hash32ByteBase16 = Crypto.Hash32ByteBase16;
|
|
116
115
|
declare const CredentialType: typeof Cardano.CredentialType;
|
|
117
116
|
type CredentialType = Cardano.CredentialType;
|
|
@@ -142,6 +141,10 @@ declare const Bip32PrivateKey: typeof Crypto.Bip32PrivateKey;
|
|
|
142
141
|
type Bip32PrivateKey = Crypto.Bip32PrivateKey;
|
|
143
142
|
declare const Bip32PrivateKeyHex: (key: string) => Crypto.Bip32PrivateKeyHex;
|
|
144
143
|
type Bip32PrivateKeyHex = Crypto.Bip32PrivateKeyHex;
|
|
144
|
+
declare const Bip32PublicKey: typeof Crypto.Bip32PublicKey;
|
|
145
|
+
type Bip32PublicKey = Crypto.Bip32PublicKey;
|
|
146
|
+
declare const Bip32PublicKeyHex: (key: string) => Crypto.Bip32PublicKeyHex;
|
|
147
|
+
type Bip32PublicKeyHex = Crypto.Bip32PublicKeyHex;
|
|
145
148
|
declare const PlutusLanguageVersion: typeof Cardano.PlutusLanguageVersion;
|
|
146
149
|
type PlutusLanguageVersion = Cardano.PlutusLanguageVersion;
|
|
147
150
|
declare const NativeScript: typeof Serialization.NativeScript;
|
|
@@ -152,6 +155,14 @@ declare const PlutusV2Script: typeof Serialization.PlutusV2Script;
|
|
|
152
155
|
type PlutusV2Script = Serialization.PlutusV2Script;
|
|
153
156
|
declare const PlutusV3Script: typeof Serialization.PlutusV3Script;
|
|
154
157
|
type PlutusV3Script = Serialization.PlutusV3Script;
|
|
158
|
+
declare const PlutusDataKind: typeof Serialization.PlutusDataKind;
|
|
159
|
+
type PlutusDataKind = Serialization.PlutusDataKind;
|
|
160
|
+
declare const PointerAddress: typeof Cardano.PointerAddress;
|
|
161
|
+
type PointerAddress = Cardano.PointerAddress;
|
|
162
|
+
declare const CertIndex: (value: number) => Cardano.CertIndex;
|
|
163
|
+
type CertIndex = Cardano.CertIndex;
|
|
164
|
+
declare const TxIndex: (value: number) => Cardano.TxIndex;
|
|
165
|
+
type TxIndex = Cardano.TxIndex;
|
|
155
166
|
declare const Costmdls: typeof Serialization.Costmdls;
|
|
156
167
|
type Costmdls = Serialization.Costmdls;
|
|
157
168
|
declare const CostModel: typeof Serialization.CostModel;
|
|
@@ -162,17 +173,14 @@ declare const ConstrPlutusData: typeof Serialization.ConstrPlutusData;
|
|
|
162
173
|
type ConstrPlutusData = Serialization.ConstrPlutusData;
|
|
163
174
|
declare const RewardAccount: {
|
|
164
175
|
(value: string): Cardano.RewardAccount;
|
|
165
|
-
toHash(rewardAccount: Cardano.RewardAccount): Crypto.
|
|
176
|
+
toHash(rewardAccount: Cardano.RewardAccount): Crypto.Hash28ByteBase16;
|
|
166
177
|
fromCredential(credential: Cardano.Credential, networkId: Cardano.NetworkId): Cardano.RewardAccount;
|
|
167
178
|
toNetworkId(rewardAccount: Cardano.RewardAccount): Cardano.NetworkId;
|
|
168
179
|
};
|
|
169
180
|
type RewardAccount = Cardano.RewardAccount;
|
|
170
181
|
declare const Hash: typeof Serialization.Hash;
|
|
171
182
|
type Hash<T extends string> = Serialization.Hash<T>;
|
|
172
|
-
declare const DatumHash:
|
|
173
|
-
(value: string): Crypto.Hash32ByteBase16;
|
|
174
|
-
fromHexBlob<T>(value: _cardano_sdk_util.HexBlob): T;
|
|
175
|
-
};
|
|
183
|
+
declare const DatumHash: (value: string) => Crypto.Hash32ByteBase16;
|
|
176
184
|
type DatumHash = Crypto.Hash32ByteBase16;
|
|
177
185
|
declare const Datum: typeof Serialization.Datum;
|
|
178
186
|
type Datum = PlutusData | DatumHash;
|
|
@@ -208,20 +216,52 @@ type DRepID = Cardano.DRepID;
|
|
|
208
216
|
declare const DRepID: {
|
|
209
217
|
(value: string): Cardano.DRepID;
|
|
210
218
|
isValid(value: string): boolean;
|
|
211
|
-
|
|
219
|
+
cip105FromCredential(credential: Cardano.Credential): Cardano.DRepID;
|
|
220
|
+
cip129FromCredential(credential: Cardano.Credential): Cardano.DRepID;
|
|
221
|
+
toCredential(drepId: Cardano.DRepID): Cardano.Credential;
|
|
222
|
+
toCip105DRepID(drepId: Cardano.DRepID): Cardano.DRepID;
|
|
223
|
+
toCip129DRepID(drepId: Cardano.DRepID): Cardano.DRepID;
|
|
224
|
+
toAddress(drepId: Cardano.DRepID): Cardano.EnterpriseAddress | undefined;
|
|
212
225
|
};
|
|
213
226
|
type DRep = Serialization.DRep;
|
|
214
227
|
declare const DRep: typeof Serialization.DRep;
|
|
215
228
|
type StakeCredentialStatus = Cardano.StakeCredentialStatus;
|
|
216
229
|
declare const StakeCredentialStatus: typeof Cardano.StakeCredentialStatus;
|
|
230
|
+
type Metadatum = Cardano.Metadatum;
|
|
231
|
+
type HexBlob = HexBlob$1;
|
|
232
|
+
declare const HexBlob: {
|
|
233
|
+
(target: string): HexBlob$1;
|
|
234
|
+
fromBytes(bytes: Uint8Array): HexBlob$1;
|
|
235
|
+
fromBase64(rawData: string): HexBlob$1;
|
|
236
|
+
toTypedBech32<T>(prefix: string, hexString: HexBlob$1): T;
|
|
237
|
+
};
|
|
238
|
+
type TxCBOR = Serialization.TxCBOR;
|
|
239
|
+
declare const TxCBOR: {
|
|
240
|
+
(tx: string): Serialization.TxCBOR;
|
|
241
|
+
serialize(tx: Cardano.Tx): Serialization.TxCBOR;
|
|
242
|
+
deserialize(tx: Serialization.TxCBOR): Cardano.Tx;
|
|
243
|
+
};
|
|
244
|
+
type Ed25519PrivateKey = Crypto.Ed25519PrivateKey;
|
|
245
|
+
declare const Ed25519PrivateKey: typeof Crypto.Ed25519PrivateKey;
|
|
246
|
+
declare const computeAuxiliaryDataHash: (data: Cardano.AuxiliaryData | undefined) => Crypto.Hash32ByteBase16 | undefined;
|
|
247
|
+
declare const blake2b: typeof Crypto.blake2b;
|
|
248
|
+
type BootstrapWitness = Serialization.BootstrapWitness;
|
|
249
|
+
declare const BootstrapWitness: typeof Serialization.BootstrapWitness;
|
|
250
|
+
type ByronAttributes = Cardano.ByronAttributes;
|
|
217
251
|
|
|
218
252
|
type Signer = {
|
|
219
253
|
address: Address;
|
|
220
|
-
key:
|
|
254
|
+
key: Ed25519PrivateKey;
|
|
221
255
|
};
|
|
222
256
|
|
|
223
|
-
/**
|
|
224
|
-
|
|
257
|
+
/**
|
|
258
|
+
* Check the signature of a given data string
|
|
259
|
+
* @param data The data string to verify the signature against
|
|
260
|
+
* @param {key, signature} The signature obtained by `signData`
|
|
261
|
+
* @param address Optional Bech32 string of a stake, stake_test1, addr, or addr_test1 address. If provided, this function will validate the signer's address against this value.
|
|
262
|
+
* @returns boolean
|
|
263
|
+
*/
|
|
264
|
+
declare const checkSignature: (data: string, { key, signature }: DataSignature, address?: string) => Promise<boolean>;
|
|
225
265
|
|
|
226
266
|
declare class CoseSign1 {
|
|
227
267
|
private protectedMap;
|
|
@@ -229,10 +269,10 @@ declare class CoseSign1 {
|
|
|
229
269
|
private payload;
|
|
230
270
|
private signature;
|
|
231
271
|
constructor(payload: {
|
|
232
|
-
protectedMap:
|
|
233
|
-
unProtectedMap:
|
|
234
|
-
payload:
|
|
235
|
-
signature?:
|
|
272
|
+
protectedMap: CborMap;
|
|
273
|
+
unProtectedMap: CborMap;
|
|
274
|
+
payload: CborBytes | null;
|
|
275
|
+
signature?: CborBytes;
|
|
236
276
|
});
|
|
237
277
|
static fromCbor(cbor: string): CoseSign1;
|
|
238
278
|
createSigStructure(externalAad?: Buffer$1): Buffer$1;
|
|
@@ -250,89 +290,79 @@ declare class CoseSign1 {
|
|
|
250
290
|
declare const getPublicKeyFromCoseKey: (cbor: string) => Buffer$1;
|
|
251
291
|
declare const getCoseKeyFromPublicKey: (cbor: string) => Buffer$1;
|
|
252
292
|
|
|
293
|
+
/**
|
|
294
|
+
* Generate a nonce string
|
|
295
|
+
* @param label The label to prepend to the nonce
|
|
296
|
+
* @param length The length of the nonce
|
|
297
|
+
* @returns The generated nonce in hex format
|
|
298
|
+
*/
|
|
253
299
|
declare const generateNonce: (label?: string, length?: number) => string;
|
|
254
300
|
|
|
301
|
+
/**
|
|
302
|
+
* Sign the data string using the provided signer
|
|
303
|
+
* @param data The data string to sign
|
|
304
|
+
* @param signer The signer object containing the key and address
|
|
305
|
+
* @returns DataSignature for verification
|
|
306
|
+
*/
|
|
255
307
|
declare const signData: (data: string, signer: Signer) => DataSignature;
|
|
256
308
|
|
|
257
|
-
declare const resolveDataHash: (
|
|
258
|
-
declare const resolveNativeScriptAddress: (script: NativeScript$1, networkId?: number) =>
|
|
309
|
+
declare const resolveDataHash: (rawData: BuilderData["content"], type?: PlutusDataType) => string;
|
|
310
|
+
declare const resolveNativeScriptAddress: (script: NativeScript$1, networkId?: number) => string;
|
|
259
311
|
declare const resolveNativeScriptHash: (script: NativeScript$1) => string;
|
|
260
312
|
declare const resolvePaymentKeyHash: (bech32: string) => string;
|
|
261
|
-
declare const resolvePlutusScriptAddress: (script: PlutusScript, networkId?: number) =>
|
|
313
|
+
declare const resolvePlutusScriptAddress: (script: PlutusScript, networkId?: number) => string;
|
|
262
314
|
declare const resolvePlutusScriptHash: (bech32: string) => string;
|
|
263
315
|
declare const resolvePoolId: (hash: string) => string;
|
|
264
316
|
declare const resolvePrivateKey: (words: string[]) => string;
|
|
265
317
|
declare const resolveScriptRef: (script: PlutusScript | NativeScript$1) => string;
|
|
266
|
-
declare const resolveRewardAddress: (bech32: string) =>
|
|
318
|
+
declare const resolveRewardAddress: (bech32: string) => string;
|
|
267
319
|
declare const resolveStakeKeyHash: (bech32: string) => string;
|
|
268
|
-
declare const resolveTxHash: (txHex: string) =>
|
|
320
|
+
declare const resolveTxHash: (txHex: string) => string;
|
|
321
|
+
declare const resolveScriptHashDRepId: (scriptHash: string) => string;
|
|
322
|
+
declare const resolveEd25519KeyHash: (bech32: string) => string;
|
|
269
323
|
|
|
270
324
|
declare class CardanoSDKSerializer implements IMeshTxSerializer {
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
private txWitnessSet;
|
|
274
|
-
private utxoContext;
|
|
275
|
-
private redeemerContext;
|
|
276
|
-
private scriptsProvided;
|
|
277
|
-
private datumsProvided;
|
|
278
|
-
private usedLanguages;
|
|
279
|
-
constructor(verbose?: boolean);
|
|
325
|
+
protocolParams: Protocol;
|
|
326
|
+
constructor(protocolParams?: Protocol);
|
|
280
327
|
serializeRewardAddress(stakeKeyHash: string, isScriptHash?: boolean, network_id?: 0 | 1): string;
|
|
281
328
|
serializePoolId(hash: string): string;
|
|
282
|
-
serializeAddress(address: DeserializedAddress
|
|
329
|
+
serializeAddress(address: Partial<DeserializedAddress>, networkId?: 0 | 1): string;
|
|
283
330
|
serializeData(data: BuilderData): string;
|
|
284
331
|
deserializer: IDeserializer;
|
|
285
332
|
resolver: IResolver;
|
|
286
|
-
serializeTxBody: (txBuilderBody: MeshTxBuilderBody, protocolParams
|
|
333
|
+
serializeTxBody: (txBuilderBody: MeshTxBuilderBody, protocolParams?: Protocol) => string;
|
|
334
|
+
serializeTxBodyWithMockSignatures(txBuilderBody: MeshTxBuilderBody, protocolParams: Protocol): string;
|
|
287
335
|
addSigningKeys: (txHex: string, signingKeys: string[]) => string;
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
private addScriptTxIn;
|
|
291
|
-
private addSimpleScriptTxIn;
|
|
292
|
-
private addAllOutputs;
|
|
293
|
-
private addOutput;
|
|
294
|
-
private addAllReferenceInputs;
|
|
295
|
-
private addReferenceIput;
|
|
296
|
-
private addAllMints;
|
|
297
|
-
private addMint;
|
|
298
|
-
private addAllCollateralInputs;
|
|
299
|
-
private addCollateralInput;
|
|
300
|
-
private setValidityInterval;
|
|
301
|
-
private buildWitnessSet;
|
|
302
|
-
private balanceTx;
|
|
303
|
-
private createDummyTx;
|
|
336
|
+
serializeValue(value: Asset[]): string;
|
|
337
|
+
serializeOutput(output: Output): string;
|
|
304
338
|
}
|
|
305
339
|
|
|
306
|
-
type StricaPrivateKey = cjsBip32ed25519.PrivateKey;
|
|
307
|
-
declare const StricaPrivateKey: typeof cjsBip32ed25519.PrivateKey;
|
|
308
|
-
type StricaPublicKey = cjsBip32ed25519.PublicKey;
|
|
309
|
-
declare const StricaPublicKey: typeof cjsBip32ed25519.PublicKey;
|
|
310
|
-
type StricaBip32PrivateKey = cjsBip32ed25519.Bip32PrivateKey;
|
|
311
|
-
declare const StricaBip32PrivateKey: typeof cjsBip32ed25519.Bip32PrivateKey;
|
|
312
|
-
type StricaBip32PublicKey = cjsBip32ed25519.Bip32PublicKey;
|
|
313
|
-
declare const StricaBip32PublicKey: typeof cjsBip32ed25519.Bip32PublicKey;
|
|
314
|
-
|
|
315
|
-
declare const StricaEncoder: {
|
|
316
|
-
encode: (input: any, options?: {
|
|
317
|
-
collapseBigNumber: Boolean;
|
|
318
|
-
}) => Buffer;
|
|
319
|
-
};
|
|
320
|
-
declare const StricaDecoder: typeof cjsCbors.Decoder;
|
|
321
|
-
type StricaDecoder = cjsCbors.Decoder;
|
|
322
|
-
|
|
323
340
|
declare const buildBaseAddress: (networkId: number, paymentKeyHash: Hash28ByteBase16, stakeKeyHash: Hash28ByteBase16) => BaseAddress;
|
|
324
341
|
declare const buildEnterpriseAddress: (networkId: number, paymentKeyHash: Hash28ByteBase16) => EnterpriseAddress;
|
|
342
|
+
declare const clampScalar: (scalar: Buffer) => Buffer;
|
|
325
343
|
declare const buildBip32PrivateKey: (entropy: string, password?: string) => Bip32PrivateKey;
|
|
326
344
|
declare const buildRewardAddress: (networkId: number, stakeKeyHash: Hash28ByteBase16) => RewardAddress;
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
345
|
+
/**
|
|
346
|
+
* Build a set of keys from a given private key
|
|
347
|
+
*
|
|
348
|
+
* NOTE - Must be called after `await Crypto.Ready()`
|
|
349
|
+
*
|
|
350
|
+
* @param privateKeyHex - The BIP32 private key hex to derive keys from
|
|
351
|
+
* @param accountIndex - The account index to derive keys for
|
|
352
|
+
* @param keyIndex - The key index to derive keys for
|
|
353
|
+
* @returns The payment and stake keys, and optionally the dRep key if a Bip32PrivateKey is provided
|
|
354
|
+
*/
|
|
355
|
+
declare const buildKeys: (privateKeyHex: string | [string, string], accountIndex: number, keyIndex?: number) => {
|
|
356
|
+
paymentKey: Ed25519PrivateKey;
|
|
357
|
+
stakeKey: Ed25519PrivateKey;
|
|
358
|
+
dRepKey?: Ed25519PrivateKey;
|
|
331
359
|
};
|
|
360
|
+
declare const buildEd25519PrivateKeyFromSecretKey: (secretKeyHex: string) => Crypto.Ed25519PrivateKey;
|
|
332
361
|
declare const buildScriptPubkey: (keyHash: Ed25519KeyHash) => NativeScript;
|
|
333
362
|
declare const buildDRepID: (dRepKey: Ed25519PublicKeyHex, networkId?: NetworkId, addressType?: AddressType) => DRepID;
|
|
334
363
|
|
|
335
364
|
declare const toAddress: (bech32: string) => Address;
|
|
365
|
+
declare const toCardanoAddress: (address: string) => Address;
|
|
336
366
|
declare const toBaseAddress: (bech32: string) => BaseAddress | undefined;
|
|
337
367
|
declare const toEnterpriseAddress: (bech32: string) => EnterpriseAddress | undefined;
|
|
338
368
|
declare const toRewardAddress: (bech32: string) => RewardAddress | undefined;
|
|
@@ -344,13 +374,14 @@ declare const toScriptRef: (script: PlutusScript | NativeScript$1) => Script;
|
|
|
344
374
|
declare const fromScriptRef: (scriptRef: string) => PlutusScript | NativeScript$1 | undefined;
|
|
345
375
|
declare const fromNativeScript: (script: NativeScript) => NativeScript$1;
|
|
346
376
|
declare const toNativeScript: (script: NativeScript$1) => Serialization.NativeScript;
|
|
347
|
-
declare const toPlutusData: (data: Data) => PlutusData;
|
|
348
377
|
declare const toValue: (assets: Asset[]) => Serialization.Value;
|
|
378
|
+
declare const toDRep: (dRepId: string) => Serialization.DRep;
|
|
379
|
+
declare const getDRepIds: (dRepId: string) => {
|
|
380
|
+
cip105: string;
|
|
381
|
+
cip129: string;
|
|
382
|
+
};
|
|
349
383
|
|
|
350
|
-
declare const deserializeAddress: (address: string) => Address;
|
|
351
384
|
declare const deserializeEd25519KeyHash: (ed25519KeyHash: string) => Crypto.Ed25519KeyHash;
|
|
352
|
-
declare const deserializeDataHash: (dataHash: string) => DatumHash;
|
|
353
|
-
declare const deserializePlutusData: (plutusData: string) => PlutusData;
|
|
354
385
|
declare const deserializePlutusScript: (plutusScript: string, version: LanguageVersion) => PlutusV1Script | PlutusV2Script | PlutusV3Script;
|
|
355
386
|
declare const deserializeNativeScript: (nativeScript: string) => NativeScript;
|
|
356
387
|
declare const deserializeScriptHash: (scriptHash: string) => Crypto.Hash28ByteBase16;
|
|
@@ -367,29 +398,39 @@ declare function negatives(v: Value): Value;
|
|
|
367
398
|
declare function assetTypes(v: Value): number;
|
|
368
399
|
declare function empty(v: Value): boolean;
|
|
369
400
|
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
401
|
+
declare const toPlutusData: (data: Data) => PlutusData;
|
|
402
|
+
declare const fromJsonToPlutusData: (data: object) => PlutusData;
|
|
403
|
+
declare const fromBuilderToPlutusData: (data: BuilderData) => PlutusData;
|
|
404
|
+
declare const fromPlutusDataToJson: (data: PlutusData) => object;
|
|
405
|
+
declare const parseDatumCbor: <T = any>(datumCbor: string) => T;
|
|
406
|
+
declare const parseInlineDatum: <T extends {
|
|
407
|
+
inline_datum?: string;
|
|
408
|
+
}, X>(utxo: T) => X;
|
|
409
|
+
declare const deserializeDataHash: (dataHash: string) => DatumHash;
|
|
410
|
+
declare const deserializePlutusData: (plutusData: string) => PlutusData;
|
|
411
|
+
|
|
412
|
+
declare const serialzeAddress: (deserializedAddress: Partial<DeserializedAddress>, networkId?: number) => string;
|
|
413
|
+
declare const addrBech32ToPlutusDataHex: (bech32: string) => string;
|
|
414
|
+
declare const addrBech32ToPlutusDataObj: <T>(bech32: string) => T;
|
|
415
|
+
declare const serializeAddressObj: (plutusDataAddressObject: PubKeyAddress | ScriptAddress, networkId?: number) => string;
|
|
416
|
+
declare const serializePlutusAddressToBech32: (plutusHex: string, networkId?: number) => string;
|
|
417
|
+
declare const deserializeBech32Address: (bech32Addr: string) => DeserializedAddress;
|
|
418
|
+
declare const deserializeAddress: (address: string) => Address;
|
|
419
|
+
declare const scriptHashToBech32: (scriptHash: string, stakeCredentialHash?: string, networkId?: number, isScriptStakeCredentialHash?: boolean) => string;
|
|
420
|
+
declare const v2ScriptToBech32: (scriptCbor: string, stakeCredential?: string, networkId?: number, isScriptStakeCredential?: boolean) => string;
|
|
421
|
+
declare const scriptHashToRewardAddress: (hash: string, networkId?: number) => string;
|
|
422
|
+
declare const keyHashToRewardAddress: (hash: string, networkId?: number) => string;
|
|
423
|
+
|
|
424
|
+
declare const bytesToHex: (bytes: Uint8Array) => HexBlob$1;
|
|
425
|
+
declare const hexToBytes: (hex: HexBlob$1) => Uint8Array;
|
|
426
|
+
declare const utf8ToBytes: (str: string) => Uint8Array;
|
|
427
|
+
declare const utf8ToHex: (str: string) => HexBlob$1;
|
|
428
|
+
declare const hexToBech32: (prefix: string, hex: string) => string;
|
|
429
|
+
|
|
430
|
+
declare const addVKeyWitnessSetToTransaction: (txHex: string, vkeyWitnessSet: string) => string;
|
|
431
|
+
|
|
432
|
+
declare const calculateFees: (minFeeA: number, minFeeB: number, minFeeRefScriptCostPerByte: number, priceMem: number, priceStep: number, tx: Transaction, refScriptSize: number) => bigint;
|
|
433
|
+
|
|
393
434
|
type OutputEncoding = "SingleCBOR" | "DoubleCBOR" | "PurePlutusScriptBytes";
|
|
394
435
|
/**
|
|
395
436
|
* Normalizes a Plutus script by extracting its pure Plutus bytes and applying a specified encoding.
|
|
@@ -408,5 +449,7 @@ type OutputEncoding = "SingleCBOR" | "DoubleCBOR" | "PurePlutusScriptBytes";
|
|
|
408
449
|
* - The normalization process does not modify the logical content of the script, only its representation.
|
|
409
450
|
*/
|
|
410
451
|
declare const normalizePlutusScript: (plutusScript: string, encoding: OutputEncoding) => string;
|
|
452
|
+
declare const applyEncoding: (plutusScript: Uint8Array, outputEncoding: OutputEncoding) => Uint8Array;
|
|
453
|
+
declare const applyParamsToScript: (rawScript: string, params: object[] | Data[], type?: PlutusDataType) => string;
|
|
411
454
|
|
|
412
|
-
export { Address, AddressType, AssetFingerprint, AssetId, AssetName, BaseAddress, Bip32PrivateKey, Bip32PrivateKeyHex, CardanoSDKSerializer, CborSet, CborWriter, Certificate, CertificateType, ConstrPlutusData, CoseSign1, CostModel, type CostModels, Costmdls, Credential, type CredentialCore, CredentialType, DRep, DRepID, Datum, DatumHash, DatumKind, Ed25519KeyHash, Ed25519KeyHashHex, Ed25519PrivateExtendedKeyHex, Ed25519PrivateNormalKeyHex, Ed25519PublicKey, Ed25519PublicKeyHex, Ed25519Signature, Ed25519SignatureHex, EnterpriseAddress, ExUnits, Hash, Hash28ByteBase16, Hash32ByteBase16, NativeScript, NetworkId, type OutputEncoding, PaymentAddress, PlutusData, PlutusLanguageVersion, PlutusList, PlutusMap, PlutusV1Script, PlutusV2Script, PlutusV3Script, PolicyId, PoolId, Redeemer, RedeemerPurpose, RedeemerTag, Redeemers, RequireAllOf, RequireAnyOf, RequireNOf, RequireSignature, RequireTimeAfter, RequireTimeBefore, RewardAccount, RewardAddress, Script, ScriptHash, ScriptPubkey, type Signatures, type Signer, Slot, StakeCredentialStatus, StakeDelegation, type StakeDelegationCertificate, StakeRegistration,
|
|
455
|
+
export { Address, AddressType, AssetFingerprint, AssetId, AssetName, type AuxiliaryData, AuxilliaryData, BaseAddress, Bip32PrivateKey, Bip32PrivateKeyHex, Bip32PublicKey, Bip32PublicKeyHex, BootstrapWitness, type ByronAttributes, CardanoSDKSerializer, CborSet, CborWriter, CertIndex, Certificate, CertificateType, ConstrPlutusData, CoseSign1, CostModel, type CostModels, Costmdls, Credential, type CredentialCore, CredentialType, DRep, DRepID, Datum, DatumHash, DatumKind, Ed25519KeyHash, Ed25519KeyHashHex, Ed25519PrivateExtendedKeyHex, Ed25519PrivateKey, Ed25519PrivateNormalKeyHex, Ed25519PublicKey, Ed25519PublicKeyHex, Ed25519Signature, Ed25519SignatureHex, EnterpriseAddress, ExUnits, Hash, Hash28ByteBase16, Hash32ByteBase16, HexBlob, type Metadatum, MetadatumList, MetadatumMap, NativeScript, NetworkId, type OutputEncoding, PaymentAddress, PlutusData, PlutusDataKind, PlutusLanguageVersion, PlutusList, PlutusMap, PlutusV1Script, PlutusV2Script, PlutusV3Script, PointerAddress, PolicyId, PoolId, Redeemer, RedeemerPurpose, RedeemerTag, Redeemers, RequireAllOf, RequireAnyOf, RequireNOf, RequireSignature, RequireTimeAfter, RequireTimeBefore, RewardAccount, RewardAddress, Script, ScriptHash, ScriptPubkey, type Signatures, type Signer, Slot, StakeCredentialStatus, StakeDelegation, type StakeDelegationCertificate, StakeRegistration, type TokenMap, Transaction, TransactionBody, TransactionId, TransactionInput, type TransactionInputSet, TransactionMetadatum, TransactionOutput, TransactionUnspentOutput, type TransactionWitnessPlutusData, TransactionWitnessSet, TxCBOR, TxIndex, Value, VkeyWitness, VrfVkBech32, type Witness, addVKeyWitnessSetToTransaction, addrBech32ToPlutusDataHex, addrBech32ToPlutusDataObj, addressToBech32, applyEncoding, applyParamsToScript, assetTypes, blake2b, buildBaseAddress, buildBip32PrivateKey, buildDRepID, buildEd25519PrivateKeyFromSecretKey, buildEnterpriseAddress, buildKeys, buildRewardAddress, buildScriptPubkey, bytesToHex, calculateFees, checkSignature, clampScalar, computeAuxiliaryDataHash, deserializeAddress, deserializeBech32Address, deserializeDataHash, deserializeEd25519KeyHash, deserializeNativeScript, deserializePlutusData, deserializePlutusScript, deserializeScriptHash, deserializeScriptRef, deserializeTx, deserializeTxHash, deserializeTxUnspentOutput, deserializeValue, empty, fromBuilderToPlutusData, fromJsonToPlutusData, fromNativeScript, fromPlutusDataToJson, fromScriptRef, fromTxUnspentOutput, fromValue, generateNonce, getCoseKeyFromPublicKey, getDRepIds, getPublicKeyFromCoseKey, hexToBech32, hexToBytes, keyHashToRewardAddress, mergeValue, negateValue, negatives, normalizePlutusScript, parseDatumCbor, parseInlineDatum, resolveDataHash, resolveEd25519KeyHash, resolveNativeScriptAddress, resolveNativeScriptHash, resolvePaymentKeyHash, resolvePlutusScriptAddress, resolvePlutusScriptHash, resolvePoolId, resolvePrivateKey, resolveRewardAddress, resolveScriptHashDRepId, resolveScriptRef, resolveStakeKeyHash, resolveTxHash, scriptHashToBech32, scriptHashToRewardAddress, serializeAddressObj, serializePlutusAddressToBech32, serialzeAddress, signData, subValue, toAddress, toBaseAddress, toCardanoAddress, toDRep, toEnterpriseAddress, toNativeScript, toPlutusData, toRewardAddress, toScriptRef, toTxUnspentOutput, toValue, utf8ToBytes, utf8ToHex, v2ScriptToBech32 };
|