@meshsdk/core-cst 1.6.2 → 1.6.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/dist/index.cjs +2827 -1
- package/dist/index.d.cts +44 -3
- package/dist/index.d.ts +44 -3
- package/dist/index.js +2680 -1
- package/package.json +11 -9
package/dist/index.d.cts
CHANGED
|
@@ -9,11 +9,43 @@ export { _cardano_sdk_util as CardanoSDKUtil };
|
|
|
9
9
|
import * as Crypto from '@cardano-sdk/crypto';
|
|
10
10
|
export { Crypto };
|
|
11
11
|
import { DataSignature, Data, NativeScript as NativeScript$1, PlutusScript, IMeshTxSerializer, DeserializedAddress, BuilderData, IDeserializer, IResolver, MeshTxBuilderBody, Protocol, UTxO, Asset, LanguageVersion } from '@meshsdk/common';
|
|
12
|
+
import * as _cardano_sdk_core_dist_cjs_Cardano from '@cardano-sdk/core/dist/cjs/Cardano';
|
|
13
|
+
import { Buffer as Buffer$1 } from 'buffer';
|
|
14
|
+
|
|
15
|
+
declare class CoseSign1 {
|
|
16
|
+
private protectedMap;
|
|
17
|
+
private unProtectedMap;
|
|
18
|
+
private payload;
|
|
19
|
+
private signature;
|
|
20
|
+
constructor(payload: {
|
|
21
|
+
protectedMap: Map<any, any>;
|
|
22
|
+
unProtectedMap: Map<any, any>;
|
|
23
|
+
payload: Buffer$1 | null;
|
|
24
|
+
signature?: Buffer$1;
|
|
25
|
+
});
|
|
26
|
+
static fromCbor(cbor: string): CoseSign1;
|
|
27
|
+
createSigStructure(externalAad?: Buffer$1): Buffer$1;
|
|
28
|
+
buildMessage(signature: Buffer$1): Buffer$1;
|
|
29
|
+
verifySignature({ externalAad, publicKeyBuffer, }?: {
|
|
30
|
+
externalAad?: Buffer$1;
|
|
31
|
+
publicKeyBuffer?: Buffer$1;
|
|
32
|
+
}): boolean;
|
|
33
|
+
hashPayload(): void;
|
|
34
|
+
getAddress(): Buffer$1;
|
|
35
|
+
getPublicKey(): Buffer$1;
|
|
36
|
+
getSignature(): Buffer$1 | undefined;
|
|
37
|
+
getPayload(): Buffer$1 | null;
|
|
38
|
+
}
|
|
39
|
+
declare const getPublicKeyFromCoseKey: (cbor: string) => Buffer$1;
|
|
40
|
+
declare const getCoseKeyFromPublicKey: (cbor: string) => Buffer$1;
|
|
12
41
|
|
|
13
42
|
declare class PrivateKey extends strica.PrivateKey {
|
|
14
43
|
constructor(privKey: Buffer, extended?: Boolean);
|
|
15
44
|
}
|
|
45
|
+
|
|
16
46
|
declare const PublicKey: typeof strica.PublicKey;
|
|
47
|
+
declare const Bip32PrivateKey$1: typeof strica.Bip32PrivateKey;
|
|
48
|
+
declare const Bip32PublicKey: typeof strica.Bip32PublicKey;
|
|
17
49
|
|
|
18
50
|
declare const Slot: (value: number) => Cardano.Slot;
|
|
19
51
|
type Slot = Cardano.Slot;
|
|
@@ -207,14 +239,21 @@ declare const VrfVkBech32: {
|
|
|
207
239
|
};
|
|
208
240
|
type ScriptPubkey = Serialization.ScriptPubkey;
|
|
209
241
|
declare const ScriptPubkey: typeof Serialization.ScriptPubkey;
|
|
242
|
+
type DRepID = Cardano.DRepID;
|
|
243
|
+
declare const DRepID: {
|
|
244
|
+
(value: string): Cardano.DRepID;
|
|
245
|
+
isValid(value: string): boolean;
|
|
246
|
+
canSign(value: string): boolean;
|
|
247
|
+
};
|
|
210
248
|
|
|
211
249
|
type Signer = {
|
|
212
250
|
address: Address;
|
|
213
251
|
key: PrivateKey;
|
|
214
252
|
};
|
|
215
253
|
|
|
216
|
-
declare const signData: (data: string,
|
|
217
|
-
declare const checkSignature: (data: string, { key, signature }: DataSignature) =>
|
|
254
|
+
declare const signData: (data: string, signer: Signer) => DataSignature;
|
|
255
|
+
declare const checkSignature: (data: string, { key, signature }: DataSignature) => boolean;
|
|
256
|
+
declare const generateNonce: (label?: string, length?: number) => string;
|
|
218
257
|
|
|
219
258
|
declare const resolveDataHash: (data: Data) => string;
|
|
220
259
|
declare const resolveNativeScriptAddress: (script: NativeScript$1, networkId?: number) => Cardano.PaymentAddress | Cardano.RewardAccount;
|
|
@@ -238,6 +277,7 @@ declare class CardanoSDKSerializer implements IMeshTxSerializer {
|
|
|
238
277
|
private datumsProvided;
|
|
239
278
|
private usedLanguages;
|
|
240
279
|
constructor();
|
|
280
|
+
serializeRewardAddress(stakeKeyHash: string, isScriptHash?: boolean, network_id?: 0 | 1): string;
|
|
241
281
|
serializePoolId(hash: string): string;
|
|
242
282
|
serializeAddress(address: DeserializedAddress, networkId?: 0 | 1): string;
|
|
243
283
|
serializeData(data: BuilderData): string;
|
|
@@ -272,6 +312,7 @@ declare const buildKeys: (entropy: string | [string, string], accountIndex: numb
|
|
|
272
312
|
stakeKey: PrivateKey;
|
|
273
313
|
};
|
|
274
314
|
declare const buildScriptPubkey: (keyHash: Ed25519KeyHash) => NativeScript;
|
|
315
|
+
declare const buildDRepID: (dRepKey: Ed25519PublicKeyHex, networkId?: NetworkId, addressType?: AddressType) => _cardano_sdk_core_dist_cjs_Cardano.DRepID;
|
|
275
316
|
|
|
276
317
|
declare const toAddress: (bech32: string) => Address;
|
|
277
318
|
declare const toBaseAddress: (bech32: string) => BaseAddress | undefined;
|
|
@@ -308,4 +349,4 @@ declare function negatives(v: Value): Value;
|
|
|
308
349
|
declare function assetTypes(v: Value): number;
|
|
309
350
|
declare function empty(v: Value): boolean;
|
|
310
351
|
|
|
311
|
-
export { Address, AddressType, AssetFingerprint, AssetId, AssetName, BaseAddress, Bip32PrivateKey, Bip32PrivateKeyHex, CardanoSDKSerializer, CborSet, CborWriter, Certificate, CertificateType, ConstrPlutusData, CostModel, type CostModels, Costmdls, Credential, type CredentialCore, CredentialType, Datum, DatumHash, DatumKind, Ed25519KeyHash, Ed25519KeyHashHex, Ed25519PrivateExtendedKeyHex, Ed25519PrivateNormalKeyHex, Ed25519PublicKey, Ed25519PublicKeyHex, Ed25519Signature, Ed25519SignatureHex, EnterpriseAddress, ExUnits, Hash, Hash28ByteBase16, Hash32ByteBase16, NativeScript, NetworkId, PaymentAddress, PlutusData, PlutusLanguageVersion, PlutusList, PlutusMap, PlutusV1Script, PlutusV2Script, PlutusV3Script, PolicyId, PoolId,
|
|
352
|
+
export { Address, AddressType, AssetFingerprint, AssetId, AssetName, BaseAddress, Bip32PrivateKey, Bip32PrivateKeyHex, CardanoSDKSerializer, CborSet, CborWriter, Certificate, CertificateType, ConstrPlutusData, CostModel, type CostModels, Costmdls, Credential, type CredentialCore, CredentialType, DRepID, Datum, DatumHash, DatumKind, Ed25519KeyHash, Ed25519KeyHashHex, Ed25519PrivateExtendedKeyHex, Ed25519PrivateNormalKeyHex, Ed25519PublicKey, Ed25519PublicKeyHex, Ed25519Signature, Ed25519SignatureHex, EnterpriseAddress, ExUnits, Hash, Hash28ByteBase16, Hash32ByteBase16, NativeScript, NetworkId, 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, StakeDelegation, type StakeDelegationCertificate, StakeRegistration, Bip32PrivateKey$1 as StricaBip32PrivateKey, Bip32PublicKey as StricaBip32PublicKey, CoseSign1 as StricaCoseSign1, PrivateKey as StricaPrivateKey, PublicKey as StricaPublicKey, type TokenMap, Transaction, TransactionBody, TransactionId, TransactionInput, type TransactionInputSet, TransactionOutput, TransactionUnspentOutput, type TransactionWitnessPlutusData, TransactionWitnessSet, Value, VkeyWitness, VrfVkBech32, type Witness, addressToBech32, assetTypes, buildBaseAddress, buildBip32PrivateKey, buildDRepID, buildEnterpriseAddress, buildKeys, buildRewardAddress, buildScriptPubkey, checkSignature, deserializeAddress, deserializeDataHash, deserializeEd25519KeyHash, deserializeNativeScript, deserializePlutusData, deserializePlutusScript, deserializeScriptHash, deserializeScriptRef, deserializeTx, deserializeTxHash, deserializeTxUnspentOutput, deserializeValue, empty, fromNativeScript, fromScriptRef, fromTxUnspentOutput, fromValue, generateNonce, getCoseKeyFromPublicKey, getPublicKeyFromCoseKey, mergeValue, negateValue, negatives, resolveDataHash, resolveNativeScriptAddress, resolveNativeScriptHash, resolvePaymentKeyHash, resolvePlutusScriptAddress, resolvePlutusScriptHash, resolvePoolId, resolvePrivateKey, resolveRewardAddress, resolveScriptRef, resolveStakeKeyHash, resolveTxHash, signData, subValue, toAddress, toBaseAddress, toEnterpriseAddress, toNativeScript, toPlutusData, toRewardAddress, toScriptRef, toTxUnspentOutput, toValue };
|
package/dist/index.d.ts
CHANGED
|
@@ -9,11 +9,43 @@ export { _cardano_sdk_util as CardanoSDKUtil };
|
|
|
9
9
|
import * as Crypto from '@cardano-sdk/crypto';
|
|
10
10
|
export { Crypto };
|
|
11
11
|
import { DataSignature, Data, NativeScript as NativeScript$1, PlutusScript, IMeshTxSerializer, DeserializedAddress, BuilderData, IDeserializer, IResolver, MeshTxBuilderBody, Protocol, UTxO, Asset, LanguageVersion } from '@meshsdk/common';
|
|
12
|
+
import * as _cardano_sdk_core_dist_cjs_Cardano from '@cardano-sdk/core/dist/cjs/Cardano';
|
|
13
|
+
import { Buffer as Buffer$1 } from 'buffer';
|
|
14
|
+
|
|
15
|
+
declare class CoseSign1 {
|
|
16
|
+
private protectedMap;
|
|
17
|
+
private unProtectedMap;
|
|
18
|
+
private payload;
|
|
19
|
+
private signature;
|
|
20
|
+
constructor(payload: {
|
|
21
|
+
protectedMap: Map<any, any>;
|
|
22
|
+
unProtectedMap: Map<any, any>;
|
|
23
|
+
payload: Buffer$1 | null;
|
|
24
|
+
signature?: Buffer$1;
|
|
25
|
+
});
|
|
26
|
+
static fromCbor(cbor: string): CoseSign1;
|
|
27
|
+
createSigStructure(externalAad?: Buffer$1): Buffer$1;
|
|
28
|
+
buildMessage(signature: Buffer$1): Buffer$1;
|
|
29
|
+
verifySignature({ externalAad, publicKeyBuffer, }?: {
|
|
30
|
+
externalAad?: Buffer$1;
|
|
31
|
+
publicKeyBuffer?: Buffer$1;
|
|
32
|
+
}): boolean;
|
|
33
|
+
hashPayload(): void;
|
|
34
|
+
getAddress(): Buffer$1;
|
|
35
|
+
getPublicKey(): Buffer$1;
|
|
36
|
+
getSignature(): Buffer$1 | undefined;
|
|
37
|
+
getPayload(): Buffer$1 | null;
|
|
38
|
+
}
|
|
39
|
+
declare const getPublicKeyFromCoseKey: (cbor: string) => Buffer$1;
|
|
40
|
+
declare const getCoseKeyFromPublicKey: (cbor: string) => Buffer$1;
|
|
12
41
|
|
|
13
42
|
declare class PrivateKey extends strica.PrivateKey {
|
|
14
43
|
constructor(privKey: Buffer, extended?: Boolean);
|
|
15
44
|
}
|
|
45
|
+
|
|
16
46
|
declare const PublicKey: typeof strica.PublicKey;
|
|
47
|
+
declare const Bip32PrivateKey$1: typeof strica.Bip32PrivateKey;
|
|
48
|
+
declare const Bip32PublicKey: typeof strica.Bip32PublicKey;
|
|
17
49
|
|
|
18
50
|
declare const Slot: (value: number) => Cardano.Slot;
|
|
19
51
|
type Slot = Cardano.Slot;
|
|
@@ -207,14 +239,21 @@ declare const VrfVkBech32: {
|
|
|
207
239
|
};
|
|
208
240
|
type ScriptPubkey = Serialization.ScriptPubkey;
|
|
209
241
|
declare const ScriptPubkey: typeof Serialization.ScriptPubkey;
|
|
242
|
+
type DRepID = Cardano.DRepID;
|
|
243
|
+
declare const DRepID: {
|
|
244
|
+
(value: string): Cardano.DRepID;
|
|
245
|
+
isValid(value: string): boolean;
|
|
246
|
+
canSign(value: string): boolean;
|
|
247
|
+
};
|
|
210
248
|
|
|
211
249
|
type Signer = {
|
|
212
250
|
address: Address;
|
|
213
251
|
key: PrivateKey;
|
|
214
252
|
};
|
|
215
253
|
|
|
216
|
-
declare const signData: (data: string,
|
|
217
|
-
declare const checkSignature: (data: string, { key, signature }: DataSignature) =>
|
|
254
|
+
declare const signData: (data: string, signer: Signer) => DataSignature;
|
|
255
|
+
declare const checkSignature: (data: string, { key, signature }: DataSignature) => boolean;
|
|
256
|
+
declare const generateNonce: (label?: string, length?: number) => string;
|
|
218
257
|
|
|
219
258
|
declare const resolveDataHash: (data: Data) => string;
|
|
220
259
|
declare const resolveNativeScriptAddress: (script: NativeScript$1, networkId?: number) => Cardano.PaymentAddress | Cardano.RewardAccount;
|
|
@@ -238,6 +277,7 @@ declare class CardanoSDKSerializer implements IMeshTxSerializer {
|
|
|
238
277
|
private datumsProvided;
|
|
239
278
|
private usedLanguages;
|
|
240
279
|
constructor();
|
|
280
|
+
serializeRewardAddress(stakeKeyHash: string, isScriptHash?: boolean, network_id?: 0 | 1): string;
|
|
241
281
|
serializePoolId(hash: string): string;
|
|
242
282
|
serializeAddress(address: DeserializedAddress, networkId?: 0 | 1): string;
|
|
243
283
|
serializeData(data: BuilderData): string;
|
|
@@ -272,6 +312,7 @@ declare const buildKeys: (entropy: string | [string, string], accountIndex: numb
|
|
|
272
312
|
stakeKey: PrivateKey;
|
|
273
313
|
};
|
|
274
314
|
declare const buildScriptPubkey: (keyHash: Ed25519KeyHash) => NativeScript;
|
|
315
|
+
declare const buildDRepID: (dRepKey: Ed25519PublicKeyHex, networkId?: NetworkId, addressType?: AddressType) => _cardano_sdk_core_dist_cjs_Cardano.DRepID;
|
|
275
316
|
|
|
276
317
|
declare const toAddress: (bech32: string) => Address;
|
|
277
318
|
declare const toBaseAddress: (bech32: string) => BaseAddress | undefined;
|
|
@@ -308,4 +349,4 @@ declare function negatives(v: Value): Value;
|
|
|
308
349
|
declare function assetTypes(v: Value): number;
|
|
309
350
|
declare function empty(v: Value): boolean;
|
|
310
351
|
|
|
311
|
-
export { Address, AddressType, AssetFingerprint, AssetId, AssetName, BaseAddress, Bip32PrivateKey, Bip32PrivateKeyHex, CardanoSDKSerializer, CborSet, CborWriter, Certificate, CertificateType, ConstrPlutusData, CostModel, type CostModels, Costmdls, Credential, type CredentialCore, CredentialType, Datum, DatumHash, DatumKind, Ed25519KeyHash, Ed25519KeyHashHex, Ed25519PrivateExtendedKeyHex, Ed25519PrivateNormalKeyHex, Ed25519PublicKey, Ed25519PublicKeyHex, Ed25519Signature, Ed25519SignatureHex, EnterpriseAddress, ExUnits, Hash, Hash28ByteBase16, Hash32ByteBase16, NativeScript, NetworkId, PaymentAddress, PlutusData, PlutusLanguageVersion, PlutusList, PlutusMap, PlutusV1Script, PlutusV2Script, PlutusV3Script, PolicyId, PoolId,
|
|
352
|
+
export { Address, AddressType, AssetFingerprint, AssetId, AssetName, BaseAddress, Bip32PrivateKey, Bip32PrivateKeyHex, CardanoSDKSerializer, CborSet, CborWriter, Certificate, CertificateType, ConstrPlutusData, CostModel, type CostModels, Costmdls, Credential, type CredentialCore, CredentialType, DRepID, Datum, DatumHash, DatumKind, Ed25519KeyHash, Ed25519KeyHashHex, Ed25519PrivateExtendedKeyHex, Ed25519PrivateNormalKeyHex, Ed25519PublicKey, Ed25519PublicKeyHex, Ed25519Signature, Ed25519SignatureHex, EnterpriseAddress, ExUnits, Hash, Hash28ByteBase16, Hash32ByteBase16, NativeScript, NetworkId, 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, StakeDelegation, type StakeDelegationCertificate, StakeRegistration, Bip32PrivateKey$1 as StricaBip32PrivateKey, Bip32PublicKey as StricaBip32PublicKey, CoseSign1 as StricaCoseSign1, PrivateKey as StricaPrivateKey, PublicKey as StricaPublicKey, type TokenMap, Transaction, TransactionBody, TransactionId, TransactionInput, type TransactionInputSet, TransactionOutput, TransactionUnspentOutput, type TransactionWitnessPlutusData, TransactionWitnessSet, Value, VkeyWitness, VrfVkBech32, type Witness, addressToBech32, assetTypes, buildBaseAddress, buildBip32PrivateKey, buildDRepID, buildEnterpriseAddress, buildKeys, buildRewardAddress, buildScriptPubkey, checkSignature, deserializeAddress, deserializeDataHash, deserializeEd25519KeyHash, deserializeNativeScript, deserializePlutusData, deserializePlutusScript, deserializeScriptHash, deserializeScriptRef, deserializeTx, deserializeTxHash, deserializeTxUnspentOutput, deserializeValue, empty, fromNativeScript, fromScriptRef, fromTxUnspentOutput, fromValue, generateNonce, getCoseKeyFromPublicKey, getPublicKeyFromCoseKey, mergeValue, negateValue, negatives, resolveDataHash, resolveNativeScriptAddress, resolveNativeScriptHash, resolvePaymentKeyHash, resolvePlutusScriptAddress, resolvePlutusScriptHash, resolvePoolId, resolvePrivateKey, resolveRewardAddress, resolveScriptRef, resolveStakeKeyHash, resolveTxHash, signData, subValue, toAddress, toBaseAddress, toEnterpriseAddress, toNativeScript, toPlutusData, toRewardAddress, toScriptRef, toTxUnspentOutput, toValue };
|