@biglup/cometa 1.0.7 → 1.0.7001

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.
@@ -1759,7 +1759,7 @@ declare enum NetworkMagic {
1759
1759
  * before they are deployed to the Mainnet. It closely mirrors the Mainnet
1760
1760
  * environment, providing a final testing ground for applications.
1761
1761
  */
1762
- PREPROD = 1,
1762
+ Preprod = 1,
1763
1763
  /**
1764
1764
  * \brief The Preview test network.
1765
1765
  *
@@ -1767,14 +1767,14 @@ declare enum NetworkMagic {
1767
1767
  * before they are released to the Pre-Production network. It allows developers
1768
1768
  * to experiment with new functionalities in a controlled environment.
1769
1769
  */
1770
- PREVIEW = 2,
1770
+ Preview = 2,
1771
1771
  /**
1772
1772
  * \brief The SanchoNet test network.
1773
1773
  *
1774
1774
  * SanchoNet is the testnet for rolling out governance features for the Cardano blockchain,
1775
1775
  * aligning with the comprehensive CIP-1694 specifications.
1776
1776
  */
1777
- SANCHONET = 4,
1777
+ Sanchonet = 4,
1778
1778
  /**
1779
1779
  * \brief The Mainnet network.
1780
1780
  *
@@ -1782,7 +1782,7 @@ declare enum NetworkMagic {
1782
1782
  * Applications interacting with the Mainnet are dealing with actual ADA and
1783
1783
  * other assets. Caution should be exercised to ensure correctness and security.
1784
1784
  */
1785
- MAINNET = 764824073
1785
+ Mainnet = 764824073
1786
1786
  }
1787
1787
 
1788
1788
  /**
@@ -4412,7 +4412,7 @@ declare class SoftwareBip32SecureKeyHandler implements Bip32SecureKeyHandler {
4412
4412
  * @returns {Promise<Bip32SecureKeyHandler>} A new instance of the key handler.
4413
4413
  * @warning For security, this function will zero out the `entropy` and `passphrase` Uint8Array buffers after they are used. Do not reuse them.
4414
4414
  */
4415
- static fromEntropy(entropy: Uint8Array, passphrase: Uint8Array, getPassphrase: () => Promise<Uint8Array>): Promise<Bip32SecureKeyHandler>;
4415
+ static fromEntropy(entropy: Uint8Array, passphrase: Uint8Array, getPassphrase: () => Promise<Uint8Array>): Bip32SecureKeyHandler;
4416
4416
  /**
4417
4417
  * Deserializes an encrypted key handler from a byte array.
4418
4418
  *
@@ -5678,6 +5678,15 @@ declare const readTxOut: (ptr: number) => TxOut;
5678
5678
  * @throws {Error} Throws an error if any part of the creation fails (e.g., invalid address format).
5679
5679
  */
5680
5680
  declare const writeTxOut: (txOut: TxOut) => number;
5681
+ /**
5682
+ * @hidden
5683
+ * Deserializes a TxOut from its CBOR hex string representation into a TxOut object.
5684
+ *
5685
+ * @param {string} txOutCbor - The CBOR representation of the TxOut, encoded as a hexadecimal string.
5686
+ * @returns {number} A pointer to the newly created value object in WASM memory.
5687
+ * @throws {Error} Throws an error if the deserialization fails, including a descriptive message from the CBOR parser.
5688
+ */
5689
+ declare const readTxOutFromCbor: (txOutCbor: string) => TxOut;
5681
5690
 
5682
5691
  /**
5683
5692
  * @hidden
@@ -5771,6 +5780,15 @@ declare const writeUtxoList: (utxos: UTxO[]) => number;
5771
5780
  * @returns {UTxO[]} The JavaScript representation of the UTxO list.
5772
5781
  */
5773
5782
  declare const readUtxoList: (ptr: number) => UTxO[];
5783
+ /**
5784
+ * @hidden
5785
+ * Deserializes a UTxO from its CBOR hex string representation into a UTxO object.
5786
+ *
5787
+ * @param {string} utxoCbor - The CBOR representation of the UTxO, encoded as a hexadecimal string.
5788
+ * @returns {number} A pointer to the newly created value object in WASM memory.
5789
+ * @throws {Error} Throws an error if the deserialization fails, including a descriptive message from the CBOR parser.
5790
+ */
5791
+ declare const readUTxOtFromCbor: (utxoCbor: string) => UTxO;
5774
5792
 
5775
5793
  /**
5776
5794
  * @hidden
@@ -5792,6 +5810,15 @@ declare const readValue: (ptr: number) => Value;
5792
5810
  * @throws {Error} If adding an asset to the native value object fails.
5793
5811
  */
5794
5812
  declare const writeValue: (value: Value) => number;
5813
+ /**
5814
+ * @hidden
5815
+ * Deserializes a value from its CBOR hex string representation into a Value object.
5816
+ *
5817
+ * @param {string} valueCbor - The CBOR representation of the value, encoded as a hexadecimal string.
5818
+ * @returns {number} A pointer to the newly created value object in WASM memory.
5819
+ * @throws {Error} Throws an error if the deserialization fails, including a descriptive message from the CBOR parser.
5820
+ */
5821
+ declare const readValueFromCbor: (valueCbor: string) => Value;
5795
5822
 
5796
5823
  /**
5797
5824
  * @hidden
@@ -5867,6 +5894,15 @@ declare const writeVkeyWitnessSet: (set: VkeyWitnessSet) => number;
5867
5894
  */
5868
5895
  declare const writeDerivationPaths: (paths: DerivationPath[]) => number;
5869
5896
  declare const writeAccountDerivationPaths: (path: AccountDerivationPath) => number;
5897
+ /**
5898
+ * @hidden
5899
+ * Deserializes a vkey witness set from its CBOR hex string representation into a Value object.
5900
+ *
5901
+ * @param {string} vkeyWitnessSetCbor - The CBOR representation of the vkey witness set, encoded as a hexadecimal string.
5902
+ * @returns {number} A pointer to the newly created vkey witness set object in WASM memory.
5903
+ * @throws {Error} Throws an error if the deserialization fails, including a descriptive message from the CBOR parser.
5904
+ */
5905
+ declare const readVkeyWitnessSetFromCbor: (vkeyWitnessSetCbor: string) => VkeyWitnessSet;
5870
5906
 
5871
5907
  /**
5872
5908
  * @hidden
@@ -6985,4 +7021,306 @@ declare class EmscriptenTxEvaluator implements TxEvaluator {
6985
7021
  evaluate(tx: string, additionalUtxos?: UTxO[]): Promise<Redeemer[]>;
6986
7022
  }
6987
7023
 
6988
- export { type AccountDerivationPath, Address, AddressType, type AlwaysAbstain, type AlwaysNoConfidence, type Anchor, type AssetAmounts, type AuthCommitteeHotCertificate, Base58, BaseAddress, Bech32, type Bech32DecodeResult, Bip32PrivateKey, Bip32PublicKey, type Bip32SecureKeyHandler, Blake2b, BlockfrostProvider, ByronAddress, ByronAddressType, CborMajorType, CborReader, CborReaderState, CborSimpleValue, CborTag, CborWriter, type Certificate, CertificateType, type CoinSelector, type CoinSelectorParams, type CoinSelectorResult, CoinType, type CommitteeMember, type CommitteeMembers, type Constitution, type ConstrPlutusData, type CostModel, Crc32, type Credential, type CredentialSet, CredentialType, type DRep, type DRepRegistrationCertificate, type DRepThresholds, type DRepUnregistrationCertificate, type Datum, DatumType, type DerivationPath, Ed25519PrivateKey, Ed25519PublicKey, type Ed25519SecureKeyHandler, Ed25519Signature, Emip003, EmscriptenCoinSelector, EmscriptenProvider, EmscriptenTxEvaluator, EnterpriseAddress, type ExUnits, type ExUnitsPrices, type GenesisKeyDelegationCertificate, type GovernanceActionId, InstanceType, KeyDerivationPurpose, KeyDerivationRole, MAX_SIGNED_64BIT, MAX_UNSIGNED_64BIT, MIN_SIGNED_64BIT, type MirCertificate, MirCertificateKind, MirCertificatePot, type MirToPot, type MirToStakeCreds, type NativeScript, NativeScriptKind, NetworkId, NetworkMagic, Pbkdf2HmacSha512, type PlutusData, PlutusLanguageVersion, type PlutusList, type PlutusMap, type PlutusScript, PointerAddress, type PoolParameters, type PoolRegistrationCertificate, type PoolRetirementCertificate, type PoolVotingThresholds, type ProtocolParameters, type ProtocolParametersUpdate, type ProtocolVersion, type Provider, type Redeemer, RedeemerPurpose, type RegistrationCertificate, type Relay, type RelayByAddress, type RelayByName, type RelayByNameMultihost, type RequireAllOfScript, type RequireAnyOfScript, type RequireAtLeastScript, type RequireSignatureScript, type RequireTimeAfterScript, type RequireTimeBeforeScript, type ResignCommitteeColdCertificate, RewardAddress, type Script, ScriptType, type SecureKeyHandler, SoftwareBip32SecureKeyHandler, SoftwareEd25519SecureKeyHandler, type StakeDelegationCertificate, type StakeDeregistrationCertificate, type StakePointer, type StakeRegistrationCertificate, type StakeRegistrationDelegationCertificate, type StakeVoteDelegationCertificate, type StakeVoteRegistrationDelegationCertificate, TransactionBuilder, type TxEvaluator, type TxIn, type TxOut, type UTxO, type UnitInterval, type UnregistrationCertificate, type UpdateDRepCertificate, type Value, type VkeyWitness, type VkeyWitnessSet, Vote, type VoteDelegationCertificate, type VoteRegistrationDelegationCertificate, type Voter, VoterType, type VotingProcedure, type Withdrawals, addWithdrawal, applyVkeyWitnessSet, assertSuccess, assetIdFromParts, assetNameFromAssetId, asyncifyStateTracker, blake2bHashFromBytes, blake2bHashFromHex, bridgeCallbacks, cborToPlutusData, cborToScript, computeScriptHash, deepEqualsPlutusData, deepEqualsScript, derefCostModel, derefCostModels, derefDRepVotingThresholds, derefExUnitPrices, derefExUnits, derefPoolVotingThresholds, derefProtocolParameters, derefProtocolVersion, derefUnitInterval, entropyToMnemonic, finalizationRegistry, getErrorString, getFromInstanceRegistry, getLibCardanoCVersion, getModule, getScriptAddress, harden, hexToBufferObject, hexToUint8Array, isDRepAbstain, isDRepCredential, isDRepNoConfidence, isNativeScript, isPlutusDataBigInt, isPlutusDataByteArray, isPlutusDataConstr, isPlutusDataList, isPlutusDataMap, isPlutusDataWithCborCache, isPlutusScript, isReady, jsonToNativeScript, mnemonicToEntropy, nativeScriptToJson, plutusDataToCbor, policyIdFromAssetId, prepareUtxoForEvaluation, readAnchor, readAssetId, readAuthCommitteeHotCertificate, readBlake2bHashData, readBufferData, readCertificate, readCommitteeMembersMap, readConstitution, readCostModel, readCostModels, readCredential, readCredentialSet, readDRepRegistrationCertificate, readDRepUnregistrationCertificate, readDRepVotingThresholds, readDatum, readExUnitPrices, readExUnits, readGenesisKeyDelegationCertificate, readGovernanceActionId, readI64, readInputSet, readIntervalComponents, readMoveInstantaneousRewardsCertificate, readPlutusData, readPoolParameters, readPoolRegistrationCertificate, readPoolRetirementCertificate, readPoolVotingThresholds, readProtocolParamUpdate, readProtocolParameters, readProtocolVersion, readRedeemer, readRedeemerList, readRedeemersFromTx, readRegistrationCertificate, readResignCommitteeColdCertificate, readScript, readStakeDelegationCertificate, readStakeDeregistrationCertificate, readStakeRegistrationCertificate, readStakeRegistrationDelegationCertificate, readStakeVoteDelegationCertificate, readStakeVoteRegistrationDelegationCertificate, readTransactionFromCbor, readTxIn, readTxOut, readUnitIntervalAsDouble, readUnregistrationCertificate, readUpdateDRepCertificate, readUtxo, readUtxoList, readValue, readVkeyWitnessSet, readVoteDelegationCertificate, readVoteRegistrationDelegationCertificate, readVoter, readVotingProcedure, readWithdrawalMap, ready, registerBridgeErrorHandler, registerInstance, reportBridgeError, scriptToCbor, splitToLowHigh64bit, toUnitInterval, uint8ArrayToHex, uint8ArrayToUtf8, unrefObject, unregisterBridgeErrorHandler, unregisterInstance, utf8ByteLen, utf8ToUint8Array, writeAccountDerivationPaths, writeAnchor, writeAssetId, writeAuthCommitteeHotCertificate, writeBytesToMemory, writeCertificate, writeCommitteeMembersMap, writeConstitution, writeCostModel, writeCostModels, writeCredential, writeCredentialSet, writeDRepRegistrationCertificate, writeDRepUnregistrationCertificate, writeDRepVotingThresholds, writeDatum, writeDerivationPaths, writeExUnitPrices, writeExUnits, writeGenesisKeyDelegationCertificate, writeGovernanceActionId, writeI64, writeInputSet, writeMoveInstantaneousRewardsCertificate, writePlutusData, writePoolParameters, writePoolRegistrationCertificate, writePoolRetirementCertificate, writePoolVotingThresholds, writeProtocolParamUpdate, writeProtocolParameters, writeProtocolVersion, writeRedeemer, writeRedeemerList, writeRegistrationCertificate, writeResignCommitteeColdCertificate, writeScript, writeStakeDelegationCertificate, writeStakeDeregistrationCertificate, writeStakeRegistrationCertificate, writeStakeRegistrationDelegationCertificate, writeStakeVoteDelegationCertificate, writeStakeVoteRegistrationDelegationCertificate, writeStringToMemory, writeTransactionToCbor, writeTxIn, writeTxOut, writeUnitInterval, writeUnitIntervalAsDouble, writeUnregistrationCertificate, writeUpdateDRepCertificate, writeUtxo, writeUtxoList, writeValue, writeVkeyWitnessSet, writeVoteDelegationCertificate, writeVoteRegistrationDelegationCertificate, writeVoter, writeVotingProcedure, writeWithdrawalMap };
7024
+ /**
7025
+ * Represents a CIP-30 compatible Cardano wallet for dApp interaction.
7026
+ */
7027
+ interface Cip30Wallet {
7028
+ /**
7029
+ * Returns the wallet's current network ID.
7030
+ * @returns {Promise<number>} A promise that resolves to the network ID (0 for Testnet, 1 for Mainnet).
7031
+ * @remarks This is used to ensure the dApp and wallet are operating on the same network.
7032
+ */
7033
+ getNetworkId(): Promise<number>;
7034
+ /**
7035
+ * Returns a list of all Unspent Transaction Outputs (UTXOs) controlled by the wallet.
7036
+ * @returns {Promise<string[] | undefined>} A promise that resolves to an array of UTXOs.
7037
+ * @remarks UTXOs represent the "coins" or assets in the wallet that are available to be spent.
7038
+ */
7039
+ getUtxos(): Promise<string[] | undefined>;
7040
+ /**
7041
+ * Returns the total balance of all assets controlled by the wallet.
7042
+ * @returns {Promise<string>} A promise that resolves to the wallet's total balance, including Lovelace and any native tokens.
7043
+ */
7044
+ getBalance(): Promise<string>;
7045
+ /**
7046
+ * Returns a list of addresses that have been used in past transactions.
7047
+ * @returns {Promise<string[]>} A promise that resolves to an array of used, Bech32-encoded addresses.
7048
+ */
7049
+ getUsedAddresses(): Promise<string[]>;
7050
+ /**
7051
+ * Returns a list of unused addresses for receiving payments.
7052
+ * @returns {Promise<string[]>} A promise that resolves to an array of unused, Bech32-encoded addresses.
7053
+ * @remarks Using a fresh address for each transaction can improve user privacy.
7054
+ */
7055
+ getUnusedAddresses(): Promise<string[]>;
7056
+ /**
7057
+ * Returns a single, unused address suitable for receiving change from a transaction.
7058
+ * @returns {Promise<string>} A promise that resolves to a Bech32-encoded change address.
7059
+ */
7060
+ getChangeAddress(): Promise<string>;
7061
+ /**
7062
+ * Returns the wallet's reward addresses, used for receiving staking rewards.
7063
+ * @returns {Promise<string[]>} A promise that resolves to an array of Bech32-encoded reward addresses.
7064
+ */
7065
+ getRewardAddresses(): Promise<string[]>;
7066
+ /**
7067
+ * Requests the user to sign a given transaction.
7068
+ * @param {string} tx - The transaction to be signed, provided as a CBOR hex string.
7069
+ * @param {boolean} partialSign - If true, the wallet will only add its witness and not require all signatures to be present. This is for multi-signature transactions.
7070
+ * @returns {Promise<string>} A promise that resolves to the CBOR hex string of the transaction witness set.
7071
+ */
7072
+ signTx(tx: string, partialSign: boolean): Promise<string>;
7073
+ /**
7074
+ * Requests the user to sign arbitrary data with a specific address, compliant with CIP-8.
7075
+ * @param {string} address - The Bech32-encoded address to sign with.
7076
+ * @param {string} payload - The hex-encoded data payload to be signed.
7077
+ * @returns {Promise<{ signature: string; key: string }>} A promise that resolves to the signature and public key.
7078
+ * @remarks This is useful for proving ownership of an address without creating a blockchain transaction.
7079
+ */
7080
+ signData(address: string, payload: string): Promise<{
7081
+ signature: string;
7082
+ key: string;
7083
+ }>;
7084
+ /**
7085
+ * Submits a fully signed transaction to the blockchain through the wallet's provider.
7086
+ * @param {string} tx - The fully signed transaction, provided as a CBOR hex string.
7087
+ * @returns {Promise<string>} A promise that resolves to the transaction ID (hash).
7088
+ */
7089
+ submitTx(tx: string): Promise<string>;
7090
+ /**
7091
+ * Returns a list of UTXOs that are designated as collateral.
7092
+ * @returns {Promise<string[]>} A promise that resolves to an array of collateral UTXOs.
7093
+ * @remarks Collateral is required for transactions that interact with Plutus smart contracts to cover potential script execution failure fees.
7094
+ */
7095
+ getCollateral(): Promise<string[]>;
7096
+ }
7097
+
7098
+ /**
7099
+ * Defines the standard interface for a Cardano wallet.
7100
+ * This interface provides dApps with a consistent way to interact with a user's wallet for querying information
7101
+ * and requesting transaction creation.
7102
+ */
7103
+ interface Wallet {
7104
+ /**
7105
+ * Returns the wallet's current network ID.
7106
+ * @returns {Promise<NetworkId>} A promise that resolves to the network ID (0 for Testnet, 1 for Mainnet).
7107
+ * @remarks This is used to ensure the dApp and wallet are operating on the same network.
7108
+ */
7109
+ getNetworkId(): Promise<NetworkId>;
7110
+ /**
7111
+ * Returns a list of all Unspent Transaction Outputs (UTxOs) controlled by the wallet.
7112
+ * @returns {Promise<UTxO[]>} A promise that resolves to an array of UTxOs.
7113
+ * @remarks UTxOs represent the "coins" or assets in the wallet that are available to be spent.
7114
+ */
7115
+ getUnspentOutputs(): Promise<UTxO[]>;
7116
+ /**
7117
+ * Returns the total balance of all assets controlled by the wallet.
7118
+ * @returns {Promise<Value>} A promise that resolves to the wallet's total balance, including Lovelace and any native tokens.
7119
+ */
7120
+ getBalance(): Promise<Value>;
7121
+ /**
7122
+ * Returns a list of addresses that have been used in past transactions.
7123
+ * @returns {Promise<string[]>} A promise that resolves to an array of used, Bech32-encoded addresses.
7124
+ */
7125
+ getUsedAddresses(): Promise<Address[]>;
7126
+ /**
7127
+ * Returns a list of unused addresses for receiving payments.
7128
+ * @returns {Promise<string[]>} A promise that resolves to an array of unused, Bech32-encoded addresses.
7129
+ * @remarks Using a fresh address for each transaction can improve user privacy.
7130
+ */
7131
+ getUnusedAddresses(): Promise<Address[]>;
7132
+ /**
7133
+ * Returns a single, unused address suitable for receiving change from a transaction.
7134
+ * @returns {Promise<string>} A promise that resolves to a Bech32-encoded change address.
7135
+ */
7136
+ getChangeAddress(): Promise<Address>;
7137
+ /**
7138
+ * Returns the wallet's reward addresses, used for receiving staking rewards.
7139
+ * @returns {Promise<string[]>} A promise that resolves to an array of Bech32-encoded reward addresses.
7140
+ */
7141
+ getRewardAddresses(): Promise<RewardAddress[]>;
7142
+ /**
7143
+ * Requests the user to sign a given transaction.
7144
+ * @param {string} txCbor - The transaction to be signed, provided as a CBOR hex string.
7145
+ * @param {boolean} partialSign - If true, the wallet will only add its witness and not require all signatures to be present. This is for multi-signature transactions.
7146
+ * @returns {Promise<VkeyWitness>} A promise that resolves to the CBOR hex string of the transaction witness set.
7147
+ */
7148
+ signTransaction(txCbor: string, partialSign: boolean): Promise<VkeyWitnessSet>;
7149
+ /**
7150
+ * Requests the user to sign arbitrary data with a specific address, compliant with CIP-8.
7151
+ * @param {Address | string} address - The Bech32-encoded address to sign with.
7152
+ * @param {string} payload - The hex-encoded data payload to be signed.
7153
+ * @returns {Promise<{ signature: string; key: string }>} A promise that resolves to the signature and public key.
7154
+ * @remarks This is useful for proving ownership of an address without creating a blockchain transaction.
7155
+ */
7156
+ signData(address: Address | string, payload: string): Promise<{
7157
+ signature: string;
7158
+ key: string;
7159
+ }>;
7160
+ /**
7161
+ * Submits a fully signed transaction to the blockchain through the wallet's provider.
7162
+ * @param {string} txCbor - The fully signed transaction, provided as a CBOR hex string.
7163
+ * @returns {Promise<string>} A promise that resolves to the transaction ID (hash).
7164
+ */
7165
+ submitTransaction(txCbor: string): Promise<string>;
7166
+ /**
7167
+ * Returns a list of UTxOs that are designated as collateral.
7168
+ * @returns {Promise<UTxO[]>} A promise that resolves to an array of collateral UTxOs.
7169
+ * @remarks Collateral is required for transactions that interact with Plutus smart contracts to cover potential script execution failure fees.
7170
+ */
7171
+ getCollateral(): Promise<UTxO[]>;
7172
+ }
7173
+
7174
+ /**
7175
+ * Defines part of the BIP-44 derivation path components for a single Cardano address.
7176
+ * @property {number} account - The account index.
7177
+ * @property {number} paymentIndex - The address index for the payment key (role 0).
7178
+ * @property {number} [stakingIndex] - The address index for the staking key (role 2). If provided, a **Base address** (payment + staking) will be derived. If omitted, an **Enterprise address** (payment only) will be derived.
7179
+ */
7180
+ type SingleAddressCredentialsConfig = {
7181
+ account: number;
7182
+ paymentIndex: number;
7183
+ stakingIndex?: number;
7184
+ };
7185
+ /**
7186
+ * Configuration for creating a `SingleAddressWallet` instance from pre-existing key objects.
7187
+ * @property {Bip32SecureKeyHandler} secureKeyHandler - The handler that manages encrypted private keys.
7188
+ * @property {Bip32PublicKey} accountRootPublicKey - The public key for the specified account from which addresses are derived.
7189
+ * @property {Provider} provider - The provider instance for interacting with the Cardano blockchain.
7190
+ * @property {SingleAddressCredentialsConfig} credentialsConfig - Specifies the derivation path for the address this wallet will manage.
7191
+ */
7192
+ type SingleAddressWalletConfig = {
7193
+ secureKeyHandler: Bip32SecureKeyHandler;
7194
+ accountRootPublicKey: Bip32PublicKey;
7195
+ provider: Provider;
7196
+ credentialsConfig: SingleAddressCredentialsConfig;
7197
+ };
7198
+ /**
7199
+ * Configuration for creating a `SingleAddressWallet` instance from a mnemonic phrase.
7200
+ * @property {string[]} mnemonics - The mnemonic (seed) phrase used to derive the root key.
7201
+ * @property {Provider} provider - The provider instance for interacting with the Cardano blockchain.
7202
+ * @property {SingleAddressCredentialsConfig} credentialsConfig - Specifies the derivation path for the address this wallet will manage.
7203
+ * @property {() => Promise<Uint8Array>} getPassword - An async callback function that securely provides the password for encrypting the derived keys.
7204
+ */
7205
+ type SingleAddressWalletFromMnemonicsConfig = {
7206
+ mnemonics: string[];
7207
+ provider: Provider;
7208
+ credentialsConfig: SingleAddressCredentialsConfig;
7209
+ getPassword: () => Promise<Uint8Array>;
7210
+ };
7211
+ /**
7212
+ * A simple, single-address wallet implementation for programmatic use.
7213
+ *
7214
+ * @class SingleAddressWallet
7215
+ * @implements {Wallet}
7216
+ * @remarks
7217
+ * This class provides a straightforward wallet interface that manages a single
7218
+ * payment and staking key pair derived from a specific path. It is not a
7219
+ * full Hierarchical Deterministic (HD) wallet and does not perform address
7220
+ * discovery. Its simplicity makes it ideal for testing, scripting, or backend
7221
+ * applications where interaction with a single, known address is required.
7222
+ */
7223
+ declare class SingleAddressWallet implements Wallet {
7224
+ private secureKeyHandler;
7225
+ private provider;
7226
+ private credentialsConfig;
7227
+ private accountRootPublicKey;
7228
+ private paymentAddress;
7229
+ private rewardAddress;
7230
+ /**
7231
+ * Constructs a new instance of the SingleAddressWallet.
7232
+ * @param {SingleAddressWalletConfig} config - The configuration object for the wallet.
7233
+ * @remarks This constructor is private. Use the static `createFromMnemonics` method to create an instance.
7234
+ */
7235
+ constructor({ secureKeyHandler, provider, credentialsConfig, accountRootPublicKey }: SingleAddressWalletConfig);
7236
+ /**
7237
+ * Creates a new wallet instance from a mnemonic phrase.
7238
+ *
7239
+ * This factory method is the primary way to instantiate a wallet from a user's
7240
+ * seed phrase, handling the necessary key derivation and encryption.
7241
+ *
7242
+ * @param {SingleAddressWalletFromMnemonicsConfig} config - The configuration options for creating the wallet.
7243
+ * @returns {Promise<SingleAddressWallet>} A promise that resolves to the newly created wallet instance.
7244
+ */
7245
+ static createFromMnemonics({ mnemonics, provider, credentialsConfig, getPassword }: SingleAddressWalletFromMnemonicsConfig): Promise<SingleAddressWallet>;
7246
+ /**
7247
+ * Returns the wallet's current network ID.
7248
+ * @returns {Promise<NetworkId>} A promise that resolves to the network ID (0 for Testnet, 1 for Mainnet).
7249
+ */
7250
+ getNetworkId(): Promise<NetworkId>;
7251
+ /**
7252
+ * Fetches all Unspent Transaction Outputs (UTxOs) for the wallet's address.
7253
+ * @returns {Promise<UTxO[]>} A promise that resolves to an array of the wallet's UTxOs.
7254
+ */
7255
+ getUnspentOutputs(): Promise<UTxO[]>;
7256
+ /**
7257
+ * Fetches and deserializes the total balance of all assets controlled by the wallet.
7258
+ * @returns {Promise<Value>} A promise that resolves to a `Value` object representing the wallet's complete balance.
7259
+ */
7260
+ getBalance(): Promise<Value>;
7261
+ /**
7262
+ * Fetches and parses all used addresses controlled by the wallet.
7263
+ * @returns {Promise<Address[]>} A promise that resolves to an array of parsed `Address` objects.
7264
+ */
7265
+ getUsedAddresses(): Promise<Address[]>;
7266
+ /**
7267
+ * Fetches and parses all unused addresses controlled by the wallet.
7268
+ * @returns {Promise<Address[]>} A promise that resolves to an array of parsed `Address` objects.
7269
+ */
7270
+ getUnusedAddresses(): Promise<Address[]>;
7271
+ /**
7272
+ * Fetches and parses a single change address from the wallet.
7273
+ * @returns {Promise<Address>} A promise that resolves to a parsed `Address` object.
7274
+ */
7275
+ getChangeAddress(): Promise<Address>;
7276
+ /**
7277
+ * Fetches and parses all reward addresses controlled by the wallet.
7278
+ * @returns {Promise<RewardAddress[]>} A promise that resolves to an array of parsed `RewardAddress` objects.
7279
+ */
7280
+ getRewardAddresses(): Promise<RewardAddress[]>;
7281
+ /**
7282
+ * Requests a signature for a transaction using the wallet's keys.
7283
+ * @param {string} txCbor - The transaction to be signed, provided as a CBOR hex string.
7284
+ * @param {boolean} partialSign - A flag to control which credentials are used for signing.
7285
+ * @returns {Promise<VkeyWitnessSet>} A promise that resolves to the deserialized `VkeyWitnessSet`.
7286
+ * @remarks
7287
+ * For this type of wallet, we are going to hijack this flag and break the interface contract:
7288
+ * - When `partialSign` is `true`, the transaction is signed **only** with the payment credential.
7289
+ * - When `partialSign` is `false`, the transaction is signed with **both** the payment and staking credentials..
7290
+ */
7291
+ signTransaction(txCbor: string, partialSign: boolean): Promise<VkeyWitnessSet>;
7292
+ /**
7293
+ * Requests a CIP-8 compliant data signature from the wallet.
7294
+ * @param {Address | string} _address - The address to sign with (as an `Address` object or Bech32 string).
7295
+ * @param {string} _payload - The hex-encoded data payload to be signed.
7296
+ * @returns {Promise<{ signature: string; key: string }>} A promise that resolves to the signature and public key.
7297
+ */
7298
+ signData(_address: Address | string, _payload: string): Promise<{
7299
+ signature: string;
7300
+ key: string;
7301
+ }>;
7302
+ /**
7303
+ * Submits a fully signed transaction to the blockchain via the wallet's provider.
7304
+ * @param {string} txCbor - The fully signed transaction as a CBOR hex string.
7305
+ * @returns {Promise<string>} A promise that resolves to the transaction ID (hash).
7306
+ */
7307
+ submitTransaction(txCbor: string): Promise<string>;
7308
+ /**
7309
+ * Fetches and deserializes the wallet's collateral UTxOs.
7310
+ * @returns {Promise<TxOut[]>} A promise that resolves to an array of collateral `TxOut` objects.
7311
+ * @remarks Collateral is required for transactions involving Plutus smart contracts.
7312
+ */
7313
+ getCollateral(): Promise<UTxO[]>;
7314
+ /**
7315
+ * Derives the payment address based on the wallet's configuration.
7316
+ * @returns {Promise<Address>} A promise resolving to a BaseAddress (with staking) or an EnterpriseAddress (without staking).
7317
+ */
7318
+ private getAddress;
7319
+ /**
7320
+ * Derives the rewards address based on the wallet's configuration.
7321
+ * @returns {Promise<Address>} A promise resolving to a Rewards.
7322
+ */
7323
+ private getRewardAddress;
7324
+ }
7325
+
7326
+ export { type AccountDerivationPath, Address, AddressType, type AlwaysAbstain, type AlwaysNoConfidence, type Anchor, type AssetAmounts, type AuthCommitteeHotCertificate, Base58, BaseAddress, Bech32, type Bech32DecodeResult, Bip32PrivateKey, Bip32PublicKey, type Bip32SecureKeyHandler, Blake2b, BlockfrostProvider, ByronAddress, ByronAddressType, CborMajorType, CborReader, CborReaderState, CborSimpleValue, CborTag, CborWriter, type Certificate, CertificateType, type Cip30Wallet, type CoinSelector, type CoinSelectorParams, type CoinSelectorResult, CoinType, type CommitteeMember, type CommitteeMembers, type Constitution, type ConstrPlutusData, type CostModel, Crc32, type Credential, type CredentialSet, CredentialType, type DRep, type DRepRegistrationCertificate, type DRepThresholds, type DRepUnregistrationCertificate, type Datum, DatumType, type DerivationPath, Ed25519PrivateKey, Ed25519PublicKey, type Ed25519SecureKeyHandler, Ed25519Signature, Emip003, EmscriptenCoinSelector, EmscriptenProvider, EmscriptenTxEvaluator, EnterpriseAddress, type ExUnits, type ExUnitsPrices, type GenesisKeyDelegationCertificate, type GovernanceActionId, InstanceType, KeyDerivationPurpose, KeyDerivationRole, MAX_SIGNED_64BIT, MAX_UNSIGNED_64BIT, MIN_SIGNED_64BIT, type MirCertificate, MirCertificateKind, MirCertificatePot, type MirToPot, type MirToStakeCreds, type NativeScript, NativeScriptKind, NetworkId, NetworkMagic, Pbkdf2HmacSha512, type PlutusData, PlutusLanguageVersion, type PlutusList, type PlutusMap, type PlutusScript, PointerAddress, type PoolParameters, type PoolRegistrationCertificate, type PoolRetirementCertificate, type PoolVotingThresholds, type ProtocolParameters, type ProtocolParametersUpdate, type ProtocolVersion, type Provider, type Redeemer, RedeemerPurpose, type RegistrationCertificate, type Relay, type RelayByAddress, type RelayByName, type RelayByNameMultihost, type RequireAllOfScript, type RequireAnyOfScript, type RequireAtLeastScript, type RequireSignatureScript, type RequireTimeAfterScript, type RequireTimeBeforeScript, type ResignCommitteeColdCertificate, RewardAddress, type Script, ScriptType, type SecureKeyHandler, type SingleAddressCredentialsConfig, SingleAddressWallet, type SingleAddressWalletConfig, type SingleAddressWalletFromMnemonicsConfig, SoftwareBip32SecureKeyHandler, SoftwareEd25519SecureKeyHandler, type StakeDelegationCertificate, type StakeDeregistrationCertificate, type StakePointer, type StakeRegistrationCertificate, type StakeRegistrationDelegationCertificate, type StakeVoteDelegationCertificate, type StakeVoteRegistrationDelegationCertificate, TransactionBuilder, type TxEvaluator, type TxIn, type TxOut, type UTxO, type UnitInterval, type UnregistrationCertificate, type UpdateDRepCertificate, type Value, type VkeyWitness, type VkeyWitnessSet, Vote, type VoteDelegationCertificate, type VoteRegistrationDelegationCertificate, type Voter, VoterType, type VotingProcedure, type Wallet, type Withdrawals, addWithdrawal, applyVkeyWitnessSet, assertSuccess, assetIdFromParts, assetNameFromAssetId, asyncifyStateTracker, blake2bHashFromBytes, blake2bHashFromHex, bridgeCallbacks, cborToPlutusData, cborToScript, computeScriptHash, deepEqualsPlutusData, deepEqualsScript, derefCostModel, derefCostModels, derefDRepVotingThresholds, derefExUnitPrices, derefExUnits, derefPoolVotingThresholds, derefProtocolParameters, derefProtocolVersion, derefUnitInterval, entropyToMnemonic, finalizationRegistry, getErrorString, getFromInstanceRegistry, getLibCardanoCVersion, getModule, getScriptAddress, harden, hexToBufferObject, hexToUint8Array, isDRepAbstain, isDRepCredential, isDRepNoConfidence, isNativeScript, isPlutusDataBigInt, isPlutusDataByteArray, isPlutusDataConstr, isPlutusDataList, isPlutusDataMap, isPlutusDataWithCborCache, isPlutusScript, isReady, jsonToNativeScript, mnemonicToEntropy, nativeScriptToJson, plutusDataToCbor, policyIdFromAssetId, prepareUtxoForEvaluation, readAnchor, readAssetId, readAuthCommitteeHotCertificate, readBlake2bHashData, readBufferData, readCertificate, readCommitteeMembersMap, readConstitution, readCostModel, readCostModels, readCredential, readCredentialSet, readDRepRegistrationCertificate, readDRepUnregistrationCertificate, readDRepVotingThresholds, readDatum, readExUnitPrices, readExUnits, readGenesisKeyDelegationCertificate, readGovernanceActionId, readI64, readInputSet, readIntervalComponents, readMoveInstantaneousRewardsCertificate, readPlutusData, readPoolParameters, readPoolRegistrationCertificate, readPoolRetirementCertificate, readPoolVotingThresholds, readProtocolParamUpdate, readProtocolParameters, readProtocolVersion, readRedeemer, readRedeemerList, readRedeemersFromTx, readRegistrationCertificate, readResignCommitteeColdCertificate, readScript, readStakeDelegationCertificate, readStakeDeregistrationCertificate, readStakeRegistrationCertificate, readStakeRegistrationDelegationCertificate, readStakeVoteDelegationCertificate, readStakeVoteRegistrationDelegationCertificate, readTransactionFromCbor, readTxIn, readTxOut, readTxOutFromCbor, readUTxOtFromCbor, readUnitIntervalAsDouble, readUnregistrationCertificate, readUpdateDRepCertificate, readUtxo, readUtxoList, readValue, readValueFromCbor, readVkeyWitnessSet, readVkeyWitnessSetFromCbor, readVoteDelegationCertificate, readVoteRegistrationDelegationCertificate, readVoter, readVotingProcedure, readWithdrawalMap, ready, registerBridgeErrorHandler, registerInstance, reportBridgeError, scriptToCbor, splitToLowHigh64bit, toUnitInterval, uint8ArrayToHex, uint8ArrayToUtf8, unrefObject, unregisterBridgeErrorHandler, unregisterInstance, utf8ByteLen, utf8ToUint8Array, writeAccountDerivationPaths, writeAnchor, writeAssetId, writeAuthCommitteeHotCertificate, writeBytesToMemory, writeCertificate, writeCommitteeMembersMap, writeConstitution, writeCostModel, writeCostModels, writeCredential, writeCredentialSet, writeDRepRegistrationCertificate, writeDRepUnregistrationCertificate, writeDRepVotingThresholds, writeDatum, writeDerivationPaths, writeExUnitPrices, writeExUnits, writeGenesisKeyDelegationCertificate, writeGovernanceActionId, writeI64, writeInputSet, writeMoveInstantaneousRewardsCertificate, writePlutusData, writePoolParameters, writePoolRegistrationCertificate, writePoolRetirementCertificate, writePoolVotingThresholds, writeProtocolParamUpdate, writeProtocolParameters, writeProtocolVersion, writeRedeemer, writeRedeemerList, writeRegistrationCertificate, writeResignCommitteeColdCertificate, writeScript, writeStakeDelegationCertificate, writeStakeDeregistrationCertificate, writeStakeRegistrationCertificate, writeStakeRegistrationDelegationCertificate, writeStakeVoteDelegationCertificate, writeStakeVoteRegistrationDelegationCertificate, writeStringToMemory, writeTransactionToCbor, writeTxIn, writeTxOut, writeUnitInterval, writeUnitIntervalAsDouble, writeUnregistrationCertificate, writeUpdateDRepCertificate, writeUtxo, writeUtxoList, writeValue, writeVkeyWitnessSet, writeVoteDelegationCertificate, writeVoteRegistrationDelegationCertificate, writeVoter, writeVotingProcedure, writeWithdrawalMap };