@biglup/cometa 1.0.7006 → 1.1.901
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/cjs/index.d.mts +647 -361
- package/dist/cjs/index.d.ts +647 -361
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.d.mts +647 -361
- package/dist/esm/index.d.ts +647 -361
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/iife/index.global.js +2 -2
- package/dist/iife/index.global.js.map +1 -1
- package/package.json +1 -1
package/dist/esm/index.d.ts
CHANGED
|
@@ -1004,6 +1004,13 @@ declare const uint8ArrayToHex: (byteArray: Uint8Array) => string;
|
|
|
1004
1004
|
* @returns {Uint8Array} The converted Uint8Array.
|
|
1005
1005
|
*/
|
|
1006
1006
|
declare const utf8ToUint8Array: (str: string) => Uint8Array;
|
|
1007
|
+
/**
|
|
1008
|
+
* Converts a UTF-8 string to its hex string representation.
|
|
1009
|
+
*
|
|
1010
|
+
* @param {string} str - The UTF-8 string to convert.
|
|
1011
|
+
* @returns {string} The hex string representation of the UTF-8 string.
|
|
1012
|
+
*/
|
|
1013
|
+
declare const utf8ToHex: (str: string) => string;
|
|
1007
1014
|
/**
|
|
1008
1015
|
* Converts a Uint8Array to a UTF-8 string.
|
|
1009
1016
|
*
|
|
@@ -1038,11 +1045,11 @@ interface Anchor {
|
|
|
1038
1045
|
*/
|
|
1039
1046
|
declare enum Vote {
|
|
1040
1047
|
/** A vote against the governance action. */
|
|
1041
|
-
|
|
1048
|
+
No = 0,
|
|
1042
1049
|
/** A vote in favor of the governance action. */
|
|
1043
|
-
|
|
1050
|
+
Yes = 1,
|
|
1044
1051
|
/** A vote to abstain, neither for nor against the action. */
|
|
1045
|
-
|
|
1052
|
+
Abstain = 2
|
|
1046
1053
|
}
|
|
1047
1054
|
/**
|
|
1048
1055
|
* Encapsulates a single voting action, including the vote itself
|
|
@@ -1123,6 +1130,49 @@ declare const isDRepNoConfidence: (drep: DRep) => drep is AlwaysNoConfidence;
|
|
|
1123
1130
|
* @returns {boolean} True if the DRep is of the 'Credential' type.
|
|
1124
1131
|
*/
|
|
1125
1132
|
declare const isDRepCredential: (drep: DRep) => drep is Credential;
|
|
1133
|
+
/**
|
|
1134
|
+
* Deserializes a Bech32-encoded governance action ID string into a GovernanceActionId object.
|
|
1135
|
+
*
|
|
1136
|
+
* This function parses a governance action ID string (e.g., "gov_action1...") according to the
|
|
1137
|
+
* [CIP-129](https://cips.cardano.org/cip/CIP-129) specification and returns a structured object
|
|
1138
|
+
* containing the transaction ID and action index.
|
|
1139
|
+
*
|
|
1140
|
+
* @param {string} bech32 - The CIP-129 formatted, Bech32-encoded governance action ID string.
|
|
1141
|
+
* @returns {GovernanceActionId} A structured object representing the governance action ID.
|
|
1142
|
+
* @throws {Error} Throws an error if the Bech32 string is malformed or invalid.
|
|
1143
|
+
* @see {@link https://cips.cardano.org/cip/CIP-129|CIP-129} for the official specification.
|
|
1144
|
+
* @example
|
|
1145
|
+
* const bech32Id = 'gov_action1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqpzklpgpf';
|
|
1146
|
+
* const govActionId = govActionIdFromBech32(bech32Id);
|
|
1147
|
+
*
|
|
1148
|
+
* console.log(govActionId.id);
|
|
1149
|
+
* //-> "0000000000000000000000000000000000000000000000000000000000000000"
|
|
1150
|
+
*
|
|
1151
|
+
* console.log(govActionId.actionIndex);
|
|
1152
|
+
* //-> 11
|
|
1153
|
+
*/
|
|
1154
|
+
declare const govActionIdFromBech32: (bech32: string) => GovernanceActionId;
|
|
1155
|
+
/**
|
|
1156
|
+
* Serializes a GovernanceActionId object into its Bech32 string representation.
|
|
1157
|
+
*
|
|
1158
|
+
* This function converts a structured GovernanceActionId object (containing a transaction ID
|
|
1159
|
+
* and action index) into its CIP-129 formatted Bech32 string (e.g., "gov_action1...").
|
|
1160
|
+
*
|
|
1161
|
+
* @param {GovernanceActionId} govActionId - The structured object to serialize.
|
|
1162
|
+
* @returns {string} The Bech32-encoded governance action ID string.
|
|
1163
|
+
* @throws {Error} Throws an error if the serialization fails.
|
|
1164
|
+
* @see {@link https://cips.cardano.org/cip/CIP-129|CIP-129} for the official specification.
|
|
1165
|
+
* @example
|
|
1166
|
+
* const govActionId = {
|
|
1167
|
+
* id: '0000000000000000000000000000000000000000000000000000000000000000',
|
|
1168
|
+
* actionIndex: 11
|
|
1169
|
+
* };
|
|
1170
|
+
* const bech32Id = govActionIdToBech32(govActionId);
|
|
1171
|
+
*
|
|
1172
|
+
* console.log(bech32Id);
|
|
1173
|
+
* //-> "gov_action1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqpzklpgpf"
|
|
1174
|
+
*/
|
|
1175
|
+
declare const govActionIdToBech32: (govActionId: GovernanceActionId) => string;
|
|
1126
1176
|
|
|
1127
1177
|
/**
|
|
1128
1178
|
* This relay points to a single host via its ipv4/ipv6 address and a given port.
|
|
@@ -1572,6 +1622,291 @@ interface CostModel {
|
|
|
1572
1622
|
costs: number[];
|
|
1573
1623
|
}
|
|
1574
1624
|
|
|
1625
|
+
/** Plutus script type. */
|
|
1626
|
+
declare enum ScriptType {
|
|
1627
|
+
Native = "native",
|
|
1628
|
+
Plutus = "plutus"
|
|
1629
|
+
}
|
|
1630
|
+
/** native script kind. */
|
|
1631
|
+
declare enum NativeScriptKind {
|
|
1632
|
+
RequireSignature = 0,
|
|
1633
|
+
RequireAllOf = 1,
|
|
1634
|
+
RequireAnyOf = 2,
|
|
1635
|
+
RequireNOf = 3,
|
|
1636
|
+
RequireTimeAfter = 4,
|
|
1637
|
+
RequireTimeBefore = 5
|
|
1638
|
+
}
|
|
1639
|
+
/**
|
|
1640
|
+
* This script evaluates to true if the transaction also includes a valid key witness
|
|
1641
|
+
* where the witness verification key hashes to the given hash.
|
|
1642
|
+
*
|
|
1643
|
+
* In other words, this checks that the transaction is signed by a particular key, identified by its verification
|
|
1644
|
+
* key hash.
|
|
1645
|
+
*/
|
|
1646
|
+
interface RequireSignatureScript {
|
|
1647
|
+
/** Script type. */
|
|
1648
|
+
type: ScriptType.Native;
|
|
1649
|
+
/** The hash of a verification key. */
|
|
1650
|
+
keyHash: string;
|
|
1651
|
+
/** The native script kind. */
|
|
1652
|
+
kind: NativeScriptKind.RequireSignature;
|
|
1653
|
+
}
|
|
1654
|
+
/**
|
|
1655
|
+
* This script evaluates to true if all the sub-scripts evaluate to true.
|
|
1656
|
+
*
|
|
1657
|
+
* If the list of sub-scripts is empty, this script evaluates to true.
|
|
1658
|
+
*/
|
|
1659
|
+
interface RequireAllOfScript {
|
|
1660
|
+
/** Script type. */
|
|
1661
|
+
type: ScriptType.Native;
|
|
1662
|
+
/** The list of sub-scripts. */
|
|
1663
|
+
scripts: NativeScript[];
|
|
1664
|
+
/** The native script kind. */
|
|
1665
|
+
kind: NativeScriptKind.RequireAllOf;
|
|
1666
|
+
}
|
|
1667
|
+
/**
|
|
1668
|
+
* This script evaluates to true if any the sub-scripts evaluate to true. That is, if one
|
|
1669
|
+
* or more evaluate to true.
|
|
1670
|
+
*
|
|
1671
|
+
* If the list of sub-scripts is empty, this script evaluates to false.
|
|
1672
|
+
*/
|
|
1673
|
+
interface RequireAnyOfScript {
|
|
1674
|
+
/** Script type. */
|
|
1675
|
+
type: ScriptType.Native;
|
|
1676
|
+
/** The list of sub-scripts. */
|
|
1677
|
+
scripts: NativeScript[];
|
|
1678
|
+
/** The native script kind. */
|
|
1679
|
+
kind: NativeScriptKind.RequireAnyOf;
|
|
1680
|
+
}
|
|
1681
|
+
/** This script evaluates to true if at least M (required field) of the sub-scripts evaluate to true. */
|
|
1682
|
+
interface RequireAtLeastScript {
|
|
1683
|
+
/** Script type. */
|
|
1684
|
+
type: ScriptType.Native;
|
|
1685
|
+
/** The number of sub-scripts that must evaluate to true for this script to evaluate to true. */
|
|
1686
|
+
required: number;
|
|
1687
|
+
/** The list of sub-scripts. */
|
|
1688
|
+
scripts: NativeScript[];
|
|
1689
|
+
/** The native script kind. */
|
|
1690
|
+
kind: NativeScriptKind.RequireNOf;
|
|
1691
|
+
}
|
|
1692
|
+
/**
|
|
1693
|
+
* This script evaluates to true if the upper bound of the transaction validity interval is a
|
|
1694
|
+
* slot number Y, and X <= Y.
|
|
1695
|
+
*
|
|
1696
|
+
* This condition guarantees that the actual slot number in which the transaction is included is
|
|
1697
|
+
* (strictly) less than slot number X.
|
|
1698
|
+
*/
|
|
1699
|
+
interface RequireTimeBeforeScript {
|
|
1700
|
+
/** Script type. */
|
|
1701
|
+
type: ScriptType.Native;
|
|
1702
|
+
/** The slot number specifying the upper bound of the validity interval. */
|
|
1703
|
+
slot: number;
|
|
1704
|
+
/** The native script kind. */
|
|
1705
|
+
kind: NativeScriptKind.RequireTimeBefore;
|
|
1706
|
+
}
|
|
1707
|
+
/**
|
|
1708
|
+
* This script evaluates to true if the lower bound of the transaction validity interval is a
|
|
1709
|
+
* slot number Y, and Y <= X.
|
|
1710
|
+
*
|
|
1711
|
+
* This condition guarantees that the actual slot number in which the transaction is included
|
|
1712
|
+
* is greater than or equal to slot number X.
|
|
1713
|
+
*/
|
|
1714
|
+
interface RequireTimeAfterScript {
|
|
1715
|
+
/** Script type. */
|
|
1716
|
+
type: ScriptType.Native;
|
|
1717
|
+
/** The slot number specifying the lower bound of the validity interval. */
|
|
1718
|
+
slot: number;
|
|
1719
|
+
/** The native script kind. */
|
|
1720
|
+
kind: NativeScriptKind.RequireTimeAfter;
|
|
1721
|
+
}
|
|
1722
|
+
/**
|
|
1723
|
+
* The Native scripts form an expression tree, the evaluation of the script produces either true or false.
|
|
1724
|
+
*
|
|
1725
|
+
* Note that it is recursive. There are no constraints on the nesting or size, except that imposed by the overall
|
|
1726
|
+
* transaction size limit (given that the script must be included in the transaction in a script witnesses).
|
|
1727
|
+
*/
|
|
1728
|
+
type NativeScript = RequireAllOfScript | RequireSignatureScript | RequireAnyOfScript | RequireAtLeastScript | RequireTimeBeforeScript | RequireTimeAfterScript;
|
|
1729
|
+
/**
|
|
1730
|
+
* The Cardano ledger tags scripts with a language that determines what the ledger will do with the script.
|
|
1731
|
+
*
|
|
1732
|
+
* In most cases this language will be very similar to the ones that came before, we refer to these as
|
|
1733
|
+
* 'Plutus language versions'. However, from the ledger’s perspective they are entirely unrelated and there
|
|
1734
|
+
* is generally no requirement that they be similar or compatible in any way.
|
|
1735
|
+
*/
|
|
1736
|
+
declare enum PlutusLanguageVersion {
|
|
1737
|
+
/** V1 was the initial version of Plutus, introduced in the Alonzo hard fork. */
|
|
1738
|
+
V1 = 0,
|
|
1739
|
+
/**
|
|
1740
|
+
* V2 was introduced in the Vasil hard fork.
|
|
1741
|
+
*
|
|
1742
|
+
* The main changes in V2 of Plutus were to the interface to scripts. The ScriptContext was extended
|
|
1743
|
+
* to include the following information:
|
|
1744
|
+
*
|
|
1745
|
+
* - The full “redeemers” structure, which contains all the redeemers used in the transaction
|
|
1746
|
+
* - Reference inputs in the transaction (proposed in CIP-31)
|
|
1747
|
+
* - Inline datums in the transaction (proposed in CIP-32)
|
|
1748
|
+
* - Reference scripts in the transaction (proposed in CIP-33)
|
|
1749
|
+
*/
|
|
1750
|
+
V2 = 1,
|
|
1751
|
+
/**
|
|
1752
|
+
* V3 was introduced in the Conway hard fork.
|
|
1753
|
+
*
|
|
1754
|
+
* The main changes in V3 of Plutus introduce:
|
|
1755
|
+
*
|
|
1756
|
+
* - The value of costmdls map at key 2 is encoded as a definite length list.
|
|
1757
|
+
*/
|
|
1758
|
+
V3 = 2
|
|
1759
|
+
}
|
|
1760
|
+
/**
|
|
1761
|
+
* Plutus scripts are pieces of code that implement pure functions with True or False outputs. These functions take
|
|
1762
|
+
* several inputs such as Datum, Redeemer and the transaction context to decide whether an output can be spent or not.
|
|
1763
|
+
*/
|
|
1764
|
+
interface PlutusScript {
|
|
1765
|
+
type: ScriptType.Plutus;
|
|
1766
|
+
bytes: string;
|
|
1767
|
+
version: PlutusLanguageVersion;
|
|
1768
|
+
}
|
|
1769
|
+
/** Program that decides whether the transaction that spends the output is authorized to do so. */
|
|
1770
|
+
type Script = NativeScript | PlutusScript;
|
|
1771
|
+
/**
|
|
1772
|
+
* Predicate that returns true if the given core script is a native script.
|
|
1773
|
+
*
|
|
1774
|
+
* @param script The Script to check.
|
|
1775
|
+
*/
|
|
1776
|
+
declare const isNativeScript: (script: Script) => script is NativeScript;
|
|
1777
|
+
/**
|
|
1778
|
+
* Predicate that returns true if the given core script is a plutus script.
|
|
1779
|
+
*
|
|
1780
|
+
* @param script The Script to check.
|
|
1781
|
+
*/
|
|
1782
|
+
declare const isPlutusScript: (script: Script) => script is PlutusScript;
|
|
1783
|
+
/**
|
|
1784
|
+
* Performs a deep equality check on two Script.
|
|
1785
|
+
*
|
|
1786
|
+
* @param a The first Script object.
|
|
1787
|
+
* @param b The second Script object.
|
|
1788
|
+
* @returns True if the objects are deeply equal, false otherwise.
|
|
1789
|
+
*/
|
|
1790
|
+
declare const deepEqualsScript: (a: Script, b: Script) => boolean;
|
|
1791
|
+
/**
|
|
1792
|
+
* Computes the hash of a Script object.
|
|
1793
|
+
*
|
|
1794
|
+
* This function calculates the Blake2b hash of the provided Script.
|
|
1795
|
+
*
|
|
1796
|
+
* @param script The Script object to hash.
|
|
1797
|
+
* @returns The hexadecimal string representation of the hash.
|
|
1798
|
+
*/
|
|
1799
|
+
declare const computeScriptHash: (script: Script) => string;
|
|
1800
|
+
/**
|
|
1801
|
+
* Derives a script address (enterprise address) from a script.
|
|
1802
|
+
*
|
|
1803
|
+
* This function calculates the script's hash, creates a script credential from it,
|
|
1804
|
+
* and then constructs an enterprise address for the specified network.
|
|
1805
|
+
*
|
|
1806
|
+
* @param {Script} script The script (Native or Plutus) from which to derive the address.
|
|
1807
|
+
* @param {NetworkId} networkId The network identifier (e.g., Mainnet or Testnet).
|
|
1808
|
+
* @returns {Address} An Address object representing the script address.
|
|
1809
|
+
* @throws {Error} If any step of the address creation process fails.
|
|
1810
|
+
*/
|
|
1811
|
+
declare const getScriptAddress: (script: Script, networkId: NetworkId) => Address;
|
|
1812
|
+
/**
|
|
1813
|
+
* Serializes a Script object into its CBOR hexadecimal string representation.
|
|
1814
|
+
*
|
|
1815
|
+
* @param data The Script object to serialize.
|
|
1816
|
+
* @returns A hex-encoded CBOR string.
|
|
1817
|
+
*/
|
|
1818
|
+
declare const scriptToCbor: (data: Script) => string;
|
|
1819
|
+
/**
|
|
1820
|
+
* Deserializes a CBOR hexadecimal string into a Script object.
|
|
1821
|
+
*
|
|
1822
|
+
* @param cborHex The hex-encoded CBOR string to deserialize.
|
|
1823
|
+
* @returns The deserialized Script object.
|
|
1824
|
+
*/
|
|
1825
|
+
declare const cborToScript: (cborHex: string) => Script;
|
|
1826
|
+
/**
|
|
1827
|
+
* Converts a json representation of a native script into a NativeScript.
|
|
1828
|
+
*
|
|
1829
|
+
* @param json The JSON representation of a native script. The JSON must conform
|
|
1830
|
+
* to the following format:
|
|
1831
|
+
*
|
|
1832
|
+
* https://github.com/input-output-hk/cardano-node/blob/master/doc/reference/simple-scripts.md
|
|
1833
|
+
*/
|
|
1834
|
+
declare const jsonToNativeScript: (json: any) => NativeScript;
|
|
1835
|
+
/**
|
|
1836
|
+
* Converts a NativeScript into its json representation.
|
|
1837
|
+
*
|
|
1838
|
+
* @param script The native script to be converted to JSON following the format described at:
|
|
1839
|
+
*
|
|
1840
|
+
* https://github.com/input-output-hk/cardano-node/blob/master/doc/reference/simple-scripts.md
|
|
1841
|
+
*/
|
|
1842
|
+
declare const nativeScriptToJson: (script: NativeScript) => any;
|
|
1843
|
+
|
|
1844
|
+
/**
|
|
1845
|
+
* Build a **CIP-105** DRep ID from a governance credential.
|
|
1846
|
+
*
|
|
1847
|
+
* @param credential - Credential containing `type` and hex `hash`.
|
|
1848
|
+
* @returns Bech32-encoded CIP-105 DRep ID (`drep1...` or `drep_script1...`).
|
|
1849
|
+
*/
|
|
1850
|
+
declare const cip105DRepFromCredential: (credential: Credential) => string;
|
|
1851
|
+
/**
|
|
1852
|
+
* Build a **CIP-129** DRep ID from a governance credential.
|
|
1853
|
+
*
|
|
1854
|
+
* Prepends the appropriate 1-byte header (0x22 for key-hash, 0x23 for script-hash)
|
|
1855
|
+
* before Bech32-encoding with HRP `drep`.
|
|
1856
|
+
*
|
|
1857
|
+
* @param credential - Credential containing `type` and hex `hash`.
|
|
1858
|
+
* @returns Bech32-encoded CIP-129 DRep ID (`drep1...`).
|
|
1859
|
+
*/
|
|
1860
|
+
declare const cip129DRepFromCredential: (credential: Credential) => string;
|
|
1861
|
+
/**
|
|
1862
|
+
* Construct a **CIP-129** DRep ID from a public key.
|
|
1863
|
+
* @param publicKey - Hex-encoded Ed25519 public key.
|
|
1864
|
+
*/
|
|
1865
|
+
declare const cip129DRepFromPublicKey: (publicKey: string) => string;
|
|
1866
|
+
/**
|
|
1867
|
+
* Construct a **CIP-129** DRep ID from a script.
|
|
1868
|
+
* @param script - Script that controls the DRep credential.
|
|
1869
|
+
*/
|
|
1870
|
+
declare const cip129DRepFromScript: (script: Script) => string;
|
|
1871
|
+
/**
|
|
1872
|
+
* Decode a DRep ID (CIP-105 or CIP-129) back to a governance credential.
|
|
1873
|
+
*
|
|
1874
|
+
* - For **CIP-105**, the credential type is inferred from the HRP (`drep` vs `drep_script`).
|
|
1875
|
+
* - For **CIP-129**, the credential type is inferred from the header byte.
|
|
1876
|
+
*
|
|
1877
|
+
* @param drepId - Bech32-encoded DRep ID (`drep1...` or `drep_script1...`).
|
|
1878
|
+
* @returns The extracted `Credential` (`{ hash, type }`).
|
|
1879
|
+
* @throws Error if the payload length is not `CIP_105_DREP_ID_LENGTH` or `CIP_129_DREP_ID_LENGTH`,
|
|
1880
|
+
* or if a CIP-129 header does not indicate a DRep governance credential.
|
|
1881
|
+
* @see toCip105DRepID
|
|
1882
|
+
* @see toCip129DRepID
|
|
1883
|
+
*/
|
|
1884
|
+
declare const dRepToCredential: (drepId: string) => Credential;
|
|
1885
|
+
/**
|
|
1886
|
+
* Convert any DRep ID (CIP-105 or CIP-129) to **CIP-105** form.
|
|
1887
|
+
*
|
|
1888
|
+
* @param drepId - Bech32 DRep ID.
|
|
1889
|
+
* @returns CIP-105 DRep ID (`drep1...` or `drep_script1...`).
|
|
1890
|
+
*/
|
|
1891
|
+
declare const toCip105DRepID: (drepId: string) => string;
|
|
1892
|
+
/**
|
|
1893
|
+
* Convert any DRep ID (CIP-105 or CIP-129) to **CIP-129** form.
|
|
1894
|
+
*
|
|
1895
|
+
* @param drepId - Bech32 DRep ID.
|
|
1896
|
+
* @returns CIP-129 DRep ID (`drep1...`).
|
|
1897
|
+
*/
|
|
1898
|
+
declare const toCip129DRepID: (drepId: string) => string;
|
|
1899
|
+
/**
|
|
1900
|
+
* Construct a **mainnet enterprise address** from a DRep ID, if possible.
|
|
1901
|
+
*
|
|
1902
|
+
* Uses the extracted governance credential (key-hash or script-hash) as the payment credential.
|
|
1903
|
+
*
|
|
1904
|
+
* @param drepId - Bech32 DRep ID.
|
|
1905
|
+
* @returns A mainnet `EnterpriseAddress`, or `undefined` if construction fails upstream.
|
|
1906
|
+
* @note This always uses `NetworkId.Mainnet`. If you need testnet, create a variant that accepts a `NetworkId`.
|
|
1907
|
+
*/
|
|
1908
|
+
declare const dRepToAddress: (drepId: string) => EnterpriseAddress | undefined;
|
|
1909
|
+
|
|
1575
1910
|
/**
|
|
1576
1911
|
* Interface representing a unit interval, which is a fraction with a numerator and denominator.
|
|
1577
1912
|
*/
|
|
@@ -1746,350 +2081,131 @@ interface ExUnitsPrices {
|
|
|
1746
2081
|
}
|
|
1747
2082
|
|
|
1748
2083
|
/**
|
|
1749
|
-
*
|
|
2084
|
+
* Enumerates the available Cardano network environments.
|
|
1750
2085
|
*
|
|
1751
2086
|
* This enumeration defines the different network environments that can be used
|
|
1752
2087
|
* with the Cardano provider.
|
|
1753
|
-
*/
|
|
1754
|
-
declare enum NetworkMagic {
|
|
1755
|
-
/**
|
|
1756
|
-
* \brief The Pre-Production test network.
|
|
1757
|
-
*
|
|
1758
|
-
* The Pre-Production network is a Cardano testnet used for testing features
|
|
1759
|
-
* before they are deployed to the Mainnet. It closely mirrors the Mainnet
|
|
1760
|
-
* environment, providing a final testing ground for applications.
|
|
1761
|
-
*/
|
|
1762
|
-
Preprod = 1,
|
|
1763
|
-
/**
|
|
1764
|
-
* \brief The Preview test network.
|
|
1765
|
-
*
|
|
1766
|
-
* The Preview network is a Cardano testnet used for testing upcoming features
|
|
1767
|
-
* before they are released to the Pre-Production network. It allows developers
|
|
1768
|
-
* to experiment with new functionalities in a controlled environment.
|
|
1769
|
-
*/
|
|
1770
|
-
Preview = 2,
|
|
1771
|
-
/**
|
|
1772
|
-
* \brief The SanchoNet test network.
|
|
1773
|
-
*
|
|
1774
|
-
* SanchoNet is the testnet for rolling out governance features for the Cardano blockchain,
|
|
1775
|
-
* aligning with the comprehensive CIP-1694 specifications.
|
|
1776
|
-
*/
|
|
1777
|
-
Sanchonet = 4,
|
|
1778
|
-
/**
|
|
1779
|
-
* \brief The Mainnet network.
|
|
1780
|
-
*
|
|
1781
|
-
* The Mainnet is the live Cardano network where real transactions occur.
|
|
1782
|
-
* Applications interacting with the Mainnet are dealing with actual ADA and
|
|
1783
|
-
* other assets. Caution should be exercised to ensure correctness and security.
|
|
1784
|
-
*/
|
|
1785
|
-
Mainnet = 764824073
|
|
1786
|
-
}
|
|
1787
|
-
|
|
1788
|
-
/**
|
|
1789
|
-
* Interface representing the voting thresholds for various governance actions that
|
|
1790
|
-
* pool operators can participate in.
|
|
1791
|
-
*/
|
|
1792
|
-
interface PoolVotingThresholds {
|
|
1793
|
-
motionNoConfidence: UnitInterval;
|
|
1794
|
-
committeeNormal: UnitInterval;
|
|
1795
|
-
committeeNoConfidence: UnitInterval;
|
|
1796
|
-
hardForkInitiation: UnitInterval;
|
|
1797
|
-
securityRelevantParamVotingThreshold: UnitInterval;
|
|
1798
|
-
}
|
|
1799
|
-
|
|
1800
|
-
/**
|
|
1801
|
-
* Interface representing a protocol version with major and minor numbers.
|
|
1802
|
-
*/
|
|
1803
|
-
interface ProtocolVersion {
|
|
1804
|
-
major: number;
|
|
1805
|
-
minor: number;
|
|
1806
|
-
}
|
|
1807
|
-
|
|
1808
|
-
/**
|
|
1809
|
-
* Interface representing the protocol parameters of the Cardano blockchain.
|
|
1810
|
-
* These parameters define the rules and limits for transactions, blocks, and governance actions.
|
|
1811
|
-
*/
|
|
1812
|
-
interface ProtocolParameters {
|
|
1813
|
-
minFeeA: number;
|
|
1814
|
-
minFeeB: number;
|
|
1815
|
-
maxBlockBodySize: number;
|
|
1816
|
-
maxTxSize: number;
|
|
1817
|
-
maxBlockHeaderSize: number;
|
|
1818
|
-
keyDeposit: number;
|
|
1819
|
-
poolDeposit: number;
|
|
1820
|
-
maxEpoch: number;
|
|
1821
|
-
nOpt: number;
|
|
1822
|
-
poolPledgeInfluence: UnitInterval;
|
|
1823
|
-
treasuryGrowthRate: UnitInterval;
|
|
1824
|
-
expansionRate: UnitInterval;
|
|
1825
|
-
decentralisationParam: UnitInterval;
|
|
1826
|
-
extraEntropy: string | null;
|
|
1827
|
-
protocolVersion: ProtocolVersion;
|
|
1828
|
-
minPoolCost: number;
|
|
1829
|
-
adaPerUtxoByte: number;
|
|
1830
|
-
costModels: CostModel[];
|
|
1831
|
-
executionCosts: ExUnitsPrices;
|
|
1832
|
-
maxTxExUnits: ExUnits;
|
|
1833
|
-
maxBlockExUnits: ExUnits;
|
|
1834
|
-
maxValueSize: number;
|
|
1835
|
-
collateralPercent: number;
|
|
1836
|
-
maxCollateralInputs: number;
|
|
1837
|
-
poolVotingThresholds: PoolVotingThresholds;
|
|
1838
|
-
drepVotingThresholds: DRepThresholds;
|
|
1839
|
-
minCommitteeSize: number;
|
|
1840
|
-
committeeTermLimit: number;
|
|
1841
|
-
governanceActionValidityPeriod: number;
|
|
1842
|
-
governanceActionDeposit: number;
|
|
1843
|
-
drepDeposit: number;
|
|
1844
|
-
drepInactivityPeriod: number;
|
|
1845
|
-
refScriptCostPerByte: UnitInterval;
|
|
1846
|
-
}
|
|
1847
|
-
/**
|
|
1848
|
-
* Type representing an update to the protocol parameters.
|
|
1849
|
-
* This allows for partial updates to the existing protocol parameters.
|
|
1850
|
-
*/
|
|
1851
|
-
type ProtocolParametersUpdate = Partial<ProtocolParameters>;
|
|
1852
|
-
|
|
1853
|
-
/**
|
|
1854
|
-
* Enum representing the purpose of a redeemer in a Plutus script.
|
|
1855
|
-
* Each purpose corresponds to a specific action that the redeemer is intended to perform.
|
|
1856
|
-
*/
|
|
1857
|
-
declare enum RedeemerPurpose {
|
|
1858
|
-
spend = "spend",
|
|
1859
|
-
mint = "mint",
|
|
1860
|
-
certificate = "certificate",
|
|
1861
|
-
withdrawal = "withdrawal",
|
|
1862
|
-
propose = "propose",
|
|
1863
|
-
vote = "vote"
|
|
1864
|
-
}
|
|
1865
|
-
/**
|
|
1866
|
-
* Interface representing a redeemer for a Plutus script.
|
|
1867
|
-
*/
|
|
1868
|
-
interface Redeemer {
|
|
1869
|
-
index: number;
|
|
1870
|
-
purpose: RedeemerPurpose;
|
|
1871
|
-
data: PlutusData;
|
|
1872
|
-
executionUnits: ExUnits;
|
|
1873
|
-
}
|
|
1874
|
-
|
|
1875
|
-
/** Plutus script type. */
|
|
1876
|
-
declare enum ScriptType {
|
|
1877
|
-
Native = "native",
|
|
1878
|
-
Plutus = "plutus"
|
|
1879
|
-
}
|
|
1880
|
-
/** native script kind. */
|
|
1881
|
-
declare enum NativeScriptKind {
|
|
1882
|
-
RequireSignature = 0,
|
|
1883
|
-
RequireAllOf = 1,
|
|
1884
|
-
RequireAnyOf = 2,
|
|
1885
|
-
RequireNOf = 3,
|
|
1886
|
-
RequireTimeAfter = 4,
|
|
1887
|
-
RequireTimeBefore = 5
|
|
1888
|
-
}
|
|
1889
|
-
/**
|
|
1890
|
-
* This script evaluates to true if the transaction also includes a valid key witness
|
|
1891
|
-
* where the witness verification key hashes to the given hash.
|
|
1892
|
-
*
|
|
1893
|
-
* In other words, this checks that the transaction is signed by a particular key, identified by its verification
|
|
1894
|
-
* key hash.
|
|
1895
|
-
*/
|
|
1896
|
-
interface RequireSignatureScript {
|
|
1897
|
-
/** Script type. */
|
|
1898
|
-
__type: ScriptType.Native;
|
|
1899
|
-
/** The hash of a verification key. */
|
|
1900
|
-
keyHash: string;
|
|
1901
|
-
/** The native script kind. */
|
|
1902
|
-
kind: NativeScriptKind.RequireSignature;
|
|
1903
|
-
}
|
|
1904
|
-
/**
|
|
1905
|
-
* This script evaluates to true if all the sub-scripts evaluate to true.
|
|
1906
|
-
*
|
|
1907
|
-
* If the list of sub-scripts is empty, this script evaluates to true.
|
|
1908
|
-
*/
|
|
1909
|
-
interface RequireAllOfScript {
|
|
1910
|
-
/** Script type. */
|
|
1911
|
-
__type: ScriptType.Native;
|
|
1912
|
-
/** The list of sub-scripts. */
|
|
1913
|
-
scripts: NativeScript[];
|
|
1914
|
-
/** The native script kind. */
|
|
1915
|
-
kind: NativeScriptKind.RequireAllOf;
|
|
1916
|
-
}
|
|
1917
|
-
/**
|
|
1918
|
-
* This script evaluates to true if any the sub-scripts evaluate to true. That is, if one
|
|
1919
|
-
* or more evaluate to true.
|
|
1920
|
-
*
|
|
1921
|
-
* If the list of sub-scripts is empty, this script evaluates to false.
|
|
1922
|
-
*/
|
|
1923
|
-
interface RequireAnyOfScript {
|
|
1924
|
-
/** Script type. */
|
|
1925
|
-
__type: ScriptType.Native;
|
|
1926
|
-
/** The list of sub-scripts. */
|
|
1927
|
-
scripts: NativeScript[];
|
|
1928
|
-
/** The native script kind. */
|
|
1929
|
-
kind: NativeScriptKind.RequireAnyOf;
|
|
1930
|
-
}
|
|
1931
|
-
/** This script evaluates to true if at least M (required field) of the sub-scripts evaluate to true. */
|
|
1932
|
-
interface RequireAtLeastScript {
|
|
1933
|
-
/** Script type. */
|
|
1934
|
-
__type: ScriptType.Native;
|
|
1935
|
-
/** The number of sub-scripts that must evaluate to true for this script to evaluate to true. */
|
|
1936
|
-
required: number;
|
|
1937
|
-
/** The list of sub-scripts. */
|
|
1938
|
-
scripts: NativeScript[];
|
|
1939
|
-
/** The native script kind. */
|
|
1940
|
-
kind: NativeScriptKind.RequireNOf;
|
|
1941
|
-
}
|
|
1942
|
-
/**
|
|
1943
|
-
* This script evaluates to true if the upper bound of the transaction validity interval is a
|
|
1944
|
-
* slot number Y, and X <= Y.
|
|
1945
|
-
*
|
|
1946
|
-
* This condition guarantees that the actual slot number in which the transaction is included is
|
|
1947
|
-
* (strictly) less than slot number X.
|
|
1948
|
-
*/
|
|
1949
|
-
interface RequireTimeBeforeScript {
|
|
1950
|
-
/** Script type. */
|
|
1951
|
-
__type: ScriptType.Native;
|
|
1952
|
-
/** The slot number specifying the upper bound of the validity interval. */
|
|
1953
|
-
slot: number;
|
|
1954
|
-
/** The native script kind. */
|
|
1955
|
-
kind: NativeScriptKind.RequireTimeBefore;
|
|
1956
|
-
}
|
|
1957
|
-
/**
|
|
1958
|
-
* This script evaluates to true if the lower bound of the transaction validity interval is a
|
|
1959
|
-
* slot number Y, and Y <= X.
|
|
1960
|
-
*
|
|
1961
|
-
* This condition guarantees that the actual slot number in which the transaction is included
|
|
1962
|
-
* is greater than or equal to slot number X.
|
|
1963
|
-
*/
|
|
1964
|
-
interface RequireTimeAfterScript {
|
|
1965
|
-
/** Script type. */
|
|
1966
|
-
__type: ScriptType.Native;
|
|
1967
|
-
/** The slot number specifying the lower bound of the validity interval. */
|
|
1968
|
-
slot: number;
|
|
1969
|
-
/** The native script kind. */
|
|
1970
|
-
kind: NativeScriptKind.RequireTimeAfter;
|
|
1971
|
-
}
|
|
1972
|
-
/**
|
|
1973
|
-
* The Native scripts form an expression tree, the evaluation of the script produces either true or false.
|
|
1974
|
-
*
|
|
1975
|
-
* Note that it is recursive. There are no constraints on the nesting or size, except that imposed by the overall
|
|
1976
|
-
* transaction size limit (given that the script must be included in the transaction in a script witnesses).
|
|
1977
|
-
*/
|
|
1978
|
-
type NativeScript = RequireAllOfScript | RequireSignatureScript | RequireAnyOfScript | RequireAtLeastScript | RequireTimeBeforeScript | RequireTimeAfterScript;
|
|
1979
|
-
/**
|
|
1980
|
-
* The Cardano ledger tags scripts with a language that determines what the ledger will do with the script.
|
|
1981
|
-
*
|
|
1982
|
-
* In most cases this language will be very similar to the ones that came before, we refer to these as
|
|
1983
|
-
* 'Plutus language versions'. However, from the ledger’s perspective they are entirely unrelated and there
|
|
1984
|
-
* is generally no requirement that they be similar or compatible in any way.
|
|
1985
|
-
*/
|
|
1986
|
-
declare enum PlutusLanguageVersion {
|
|
1987
|
-
/** V1 was the initial version of Plutus, introduced in the Alonzo hard fork. */
|
|
1988
|
-
V1 = 0,
|
|
2088
|
+
*/
|
|
2089
|
+
declare enum NetworkMagic {
|
|
1989
2090
|
/**
|
|
1990
|
-
*
|
|
2091
|
+
* The Pre-Production test network.
|
|
1991
2092
|
*
|
|
1992
|
-
* The
|
|
1993
|
-
* to
|
|
2093
|
+
* The Pre-Production network is a Cardano testnet used for testing features
|
|
2094
|
+
* before they are deployed to the Mainnet. It closely mirrors the Mainnet
|
|
2095
|
+
* environment, providing a final testing ground for applications.
|
|
2096
|
+
*/
|
|
2097
|
+
Preprod = 1,
|
|
2098
|
+
/**
|
|
2099
|
+
* The Preview test network.
|
|
1994
2100
|
*
|
|
1995
|
-
*
|
|
1996
|
-
*
|
|
1997
|
-
*
|
|
1998
|
-
* - Reference scripts in the transaction (proposed in CIP-33)
|
|
2101
|
+
* The Preview network is a Cardano testnet used for testing upcoming features
|
|
2102
|
+
* before they are released to the Pre-Production network. It allows developers
|
|
2103
|
+
* to experiment with new functionalities in a controlled environment.
|
|
1999
2104
|
*/
|
|
2000
|
-
|
|
2105
|
+
Preview = 2,
|
|
2001
2106
|
/**
|
|
2002
|
-
*
|
|
2107
|
+
* The SanchoNet test network.
|
|
2003
2108
|
*
|
|
2004
|
-
*
|
|
2109
|
+
* SanchoNet is the testnet for rolling out governance features for the Cardano blockchain,
|
|
2110
|
+
* aligning with the comprehensive CIP-1694 specifications.
|
|
2111
|
+
*/
|
|
2112
|
+
Sanchonet = 4,
|
|
2113
|
+
/**
|
|
2114
|
+
* The Mainnet network.
|
|
2005
2115
|
*
|
|
2006
|
-
*
|
|
2116
|
+
* The Mainnet is the live Cardano network where real transactions occur.
|
|
2117
|
+
* Applications interacting with the Mainnet are dealing with actual ADA and
|
|
2118
|
+
* other assets. Caution should be exercised to ensure correctness and security.
|
|
2007
2119
|
*/
|
|
2008
|
-
|
|
2120
|
+
Mainnet = 764824073
|
|
2009
2121
|
}
|
|
2122
|
+
|
|
2010
2123
|
/**
|
|
2011
|
-
*
|
|
2012
|
-
*
|
|
2124
|
+
* Interface representing the voting thresholds for various governance actions that
|
|
2125
|
+
* pool operators can participate in.
|
|
2013
2126
|
*/
|
|
2014
|
-
interface
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2127
|
+
interface PoolVotingThresholds {
|
|
2128
|
+
motionNoConfidence: UnitInterval;
|
|
2129
|
+
committeeNormal: UnitInterval;
|
|
2130
|
+
committeeNoConfidence: UnitInterval;
|
|
2131
|
+
hardForkInitiation: UnitInterval;
|
|
2132
|
+
securityRelevantParamVotingThreshold: UnitInterval;
|
|
2018
2133
|
}
|
|
2019
|
-
|
|
2020
|
-
type Script = NativeScript | PlutusScript;
|
|
2021
|
-
/**
|
|
2022
|
-
* Predicate that returns true if the given core script is a native script.
|
|
2023
|
-
*
|
|
2024
|
-
* @param script The Script to check.
|
|
2025
|
-
*/
|
|
2026
|
-
declare const isNativeScript: (script: Script) => script is NativeScript;
|
|
2027
|
-
/**
|
|
2028
|
-
* Predicate that returns true if the given core script is a plutus script.
|
|
2029
|
-
*
|
|
2030
|
-
* @param script The Script to check.
|
|
2031
|
-
*/
|
|
2032
|
-
declare const isPlutusScript: (script: Script) => script is PlutusScript;
|
|
2033
|
-
/**
|
|
2034
|
-
* Performs a deep equality check on two Script.
|
|
2035
|
-
*
|
|
2036
|
-
* @param a The first Script object.
|
|
2037
|
-
* @param b The second Script object.
|
|
2038
|
-
* @returns True if the objects are deeply equal, false otherwise.
|
|
2039
|
-
*/
|
|
2040
|
-
declare const deepEqualsScript: (a: Script, b: Script) => boolean;
|
|
2041
|
-
/**
|
|
2042
|
-
* Computes the hash of a Script object.
|
|
2043
|
-
*
|
|
2044
|
-
* This function calculates the Blake2b hash of the provided Script.
|
|
2045
|
-
*
|
|
2046
|
-
* @param script The Script object to hash.
|
|
2047
|
-
* @returns The hexadecimal string representation of the hash.
|
|
2048
|
-
*/
|
|
2049
|
-
declare const computeScriptHash: (script: Script) => string;
|
|
2134
|
+
|
|
2050
2135
|
/**
|
|
2051
|
-
*
|
|
2052
|
-
*
|
|
2053
|
-
* This function calculates the script's hash, creates a script credential from it,
|
|
2054
|
-
* and then constructs an enterprise address for the specified network.
|
|
2055
|
-
*
|
|
2056
|
-
* @param {Script} script The script (Native or Plutus) from which to derive the address.
|
|
2057
|
-
* @param {NetworkId} networkId The network identifier (e.g., Mainnet or Testnet).
|
|
2058
|
-
* @returns {Address} An Address object representing the script address.
|
|
2059
|
-
* @throws {Error} If any step of the address creation process fails.
|
|
2136
|
+
* Interface representing a protocol version with major and minor numbers.
|
|
2060
2137
|
*/
|
|
2061
|
-
|
|
2138
|
+
interface ProtocolVersion {
|
|
2139
|
+
major: number;
|
|
2140
|
+
minor: number;
|
|
2141
|
+
}
|
|
2142
|
+
|
|
2062
2143
|
/**
|
|
2063
|
-
*
|
|
2064
|
-
*
|
|
2065
|
-
* @param data The Script object to serialize.
|
|
2066
|
-
* @returns A hex-encoded CBOR string.
|
|
2144
|
+
* Interface representing the protocol parameters of the Cardano blockchain.
|
|
2145
|
+
* These parameters define the rules and limits for transactions, blocks, and governance actions.
|
|
2067
2146
|
*/
|
|
2068
|
-
|
|
2147
|
+
interface ProtocolParameters {
|
|
2148
|
+
minFeeA: number;
|
|
2149
|
+
minFeeB: number;
|
|
2150
|
+
maxBlockBodySize: number;
|
|
2151
|
+
maxTxSize: number;
|
|
2152
|
+
maxBlockHeaderSize: number;
|
|
2153
|
+
keyDeposit: number;
|
|
2154
|
+
poolDeposit: number;
|
|
2155
|
+
maxEpoch: number;
|
|
2156
|
+
nOpt: number;
|
|
2157
|
+
poolPledgeInfluence: UnitInterval;
|
|
2158
|
+
treasuryGrowthRate: UnitInterval;
|
|
2159
|
+
expansionRate: UnitInterval;
|
|
2160
|
+
decentralisationParam: UnitInterval;
|
|
2161
|
+
extraEntropy: string | null;
|
|
2162
|
+
protocolVersion: ProtocolVersion;
|
|
2163
|
+
minPoolCost: number;
|
|
2164
|
+
adaPerUtxoByte: number;
|
|
2165
|
+
costModels: CostModel[];
|
|
2166
|
+
executionCosts: ExUnitsPrices;
|
|
2167
|
+
maxTxExUnits: ExUnits;
|
|
2168
|
+
maxBlockExUnits: ExUnits;
|
|
2169
|
+
maxValueSize: number;
|
|
2170
|
+
collateralPercent: number;
|
|
2171
|
+
maxCollateralInputs: number;
|
|
2172
|
+
poolVotingThresholds: PoolVotingThresholds;
|
|
2173
|
+
drepVotingThresholds: DRepThresholds;
|
|
2174
|
+
minCommitteeSize: number;
|
|
2175
|
+
committeeTermLimit: number;
|
|
2176
|
+
governanceActionValidityPeriod: number;
|
|
2177
|
+
governanceActionDeposit: number;
|
|
2178
|
+
drepDeposit: number;
|
|
2179
|
+
drepInactivityPeriod: number;
|
|
2180
|
+
refScriptCostPerByte: UnitInterval;
|
|
2181
|
+
}
|
|
2069
2182
|
/**
|
|
2070
|
-
*
|
|
2071
|
-
*
|
|
2072
|
-
* @param cborHex The hex-encoded CBOR string to deserialize.
|
|
2073
|
-
* @returns The deserialized Script object.
|
|
2183
|
+
* Type representing an update to the protocol parameters.
|
|
2184
|
+
* This allows for partial updates to the existing protocol parameters.
|
|
2074
2185
|
*/
|
|
2075
|
-
|
|
2186
|
+
type ProtocolParametersUpdate = Partial<ProtocolParameters>;
|
|
2187
|
+
|
|
2076
2188
|
/**
|
|
2077
|
-
*
|
|
2078
|
-
*
|
|
2079
|
-
* @param json The JSON representation of a native script. The JSON must conform
|
|
2080
|
-
* to the following format:
|
|
2081
|
-
*
|
|
2082
|
-
* https://github.com/input-output-hk/cardano-node/blob/master/doc/reference/simple-scripts.md
|
|
2189
|
+
* Enum representing the purpose of a redeemer in a Plutus script.
|
|
2190
|
+
* Each purpose corresponds to a specific action that the redeemer is intended to perform.
|
|
2083
2191
|
*/
|
|
2084
|
-
declare
|
|
2192
|
+
declare enum RedeemerPurpose {
|
|
2193
|
+
spend = "spend",
|
|
2194
|
+
mint = "mint",
|
|
2195
|
+
certificate = "certificate",
|
|
2196
|
+
withdrawal = "withdrawal",
|
|
2197
|
+
propose = "propose",
|
|
2198
|
+
vote = "vote"
|
|
2199
|
+
}
|
|
2085
2200
|
/**
|
|
2086
|
-
*
|
|
2087
|
-
*
|
|
2088
|
-
* @param script The native script to be converted to JSON following the format described at:
|
|
2089
|
-
*
|
|
2090
|
-
* https://github.com/input-output-hk/cardano-node/blob/master/doc/reference/simple-scripts.md
|
|
2201
|
+
* Interface representing a redeemer for a Plutus script.
|
|
2091
2202
|
*/
|
|
2092
|
-
|
|
2203
|
+
interface Redeemer {
|
|
2204
|
+
index: number;
|
|
2205
|
+
purpose: RedeemerPurpose;
|
|
2206
|
+
data: PlutusData;
|
|
2207
|
+
executionUnits: ExUnits;
|
|
2208
|
+
}
|
|
2093
2209
|
|
|
2094
2210
|
/**
|
|
2095
2211
|
* Interface representing a transaction input in the Cardano blockchain.
|
|
@@ -4603,12 +4719,9 @@ declare const readBlake2bHashData: (bufferPtr: number, freeNativeObject?: boolea
|
|
|
4603
4719
|
* and their corresponding WASM memory representations.
|
|
4604
4720
|
*/
|
|
4605
4721
|
declare const bridgeCallbacks: {
|
|
4606
|
-
get_provider_from_registry(objectId: number): any;
|
|
4607
4722
|
get_coin_selector_from_registry(objectId: number): any;
|
|
4723
|
+
get_provider_from_registry(objectId: number): any;
|
|
4608
4724
|
get_tx_evaluator_from_registry(objectId: number): any;
|
|
4609
|
-
report_provider_bridge_error(objectId: number, exception: any): void;
|
|
4610
|
-
report_coin_selector_bridge_error(objectId: number, exception: any): void;
|
|
4611
|
-
report_tx_evaluator_bridge_error(objectId: number, exception: any): void;
|
|
4612
4725
|
marshal_blake2b_hash_from_hex(jsHexString: string): number;
|
|
4613
4726
|
marshal_plutus_data(jsPlutusDataCborHex: string): number;
|
|
4614
4727
|
marshal_protocol_parameters(params: ProtocolParameters): number;
|
|
@@ -4617,8 +4730,11 @@ declare const bridgeCallbacks: {
|
|
|
4617
4730
|
marshal_utxo_list(jsUtxoArray: UTxO[]): number;
|
|
4618
4731
|
marshall_address(addressPtr: number): string;
|
|
4619
4732
|
marshall_asset_id(assetIdPtr: number): string;
|
|
4733
|
+
report_coin_selector_bridge_error(objectId: number, exception: any): void;
|
|
4620
4734
|
marshall_blake2b_hash(hashPtr: number): string;
|
|
4735
|
+
report_provider_bridge_error(objectId: number, exception: any): void;
|
|
4621
4736
|
marshall_reward_address(rewardAddressPtr: number): string;
|
|
4737
|
+
report_tx_evaluator_bridge_error(objectId: number, exception: any): void;
|
|
4622
4738
|
marshall_transaction_to_cbor_hex(txPtr: number): string;
|
|
4623
4739
|
marshall_tx_input_set(inputSetPtr: number): TxIn[];
|
|
4624
4740
|
marshall_utxo_list_to_js(utxoListPtr: number): UTxO[];
|
|
@@ -5593,6 +5709,16 @@ declare const utf8ByteLen: (str: string) => number;
|
|
|
5593
5709
|
* @returns {string} A human-readable string describing the error, or `'Unknown error'` if the conversion fails.
|
|
5594
5710
|
*/
|
|
5595
5711
|
declare const getErrorString: (error: number) => string;
|
|
5712
|
+
/**
|
|
5713
|
+
* Reads a null-terminated UTF-8 string from the WebAssembly memory.
|
|
5714
|
+
*
|
|
5715
|
+
* @param {number} ptr - The pointer to the beginning of the string in Wasm memory.
|
|
5716
|
+
* @returns {string} The resulting JavaScript string.
|
|
5717
|
+
* @remarks
|
|
5718
|
+
* This function only reads the string; it does not free the pointer. The caller is
|
|
5719
|
+
* responsible for managing the memory of the C string if it was dynamically allocated.
|
|
5720
|
+
*/
|
|
5721
|
+
declare const readStringFromMemory: (ptr: number) => string;
|
|
5596
5722
|
|
|
5597
5723
|
/**
|
|
5598
5724
|
* @hidden
|
|
@@ -5612,6 +5738,21 @@ declare const writeTransactionToCbor: (transactionPtr: number) => string;
|
|
|
5612
5738
|
* @throws {Error} Throws an error if the deserialization fails, including a descriptive message from the CBOR parser.
|
|
5613
5739
|
*/
|
|
5614
5740
|
declare const readTransactionFromCbor: (transactionCbor: string) => number;
|
|
5741
|
+
/**
|
|
5742
|
+
* @hidden
|
|
5743
|
+
* Extracts the unique set of public key hashes (signers) required to authorize a Cardano transaction.
|
|
5744
|
+
*
|
|
5745
|
+
* This function computes the required signers by analyzing the transaction body and a list of
|
|
5746
|
+
* resolved input UTxOs.
|
|
5747
|
+
*
|
|
5748
|
+
* @param {string} transactionCbor - The CBOR representation of the transaction as a hex string.
|
|
5749
|
+
* @param {UTxO[]} utxos - An array of resolved UTxO objects that are spent by the transaction. If
|
|
5750
|
+
* empty, the function won't resolve signers from inputs or collateral inputs. Additionally if the resolved
|
|
5751
|
+
* inputs are provided, they must account for all inputs and collateral inputs in the transaction or the function will fail.
|
|
5752
|
+
* @returns {string[]} An array of unique public key hashes (signers) as hex strings.
|
|
5753
|
+
* @throws {Error} Throws an error if any part of the process fails.
|
|
5754
|
+
*/
|
|
5755
|
+
declare const getUniqueSigners: (transactionCbor: string, utxos: UTxO[]) => string[];
|
|
5615
5756
|
|
|
5616
5757
|
/**
|
|
5617
5758
|
* @hidden
|
|
@@ -5846,12 +5987,13 @@ declare const writeVoter: (voter: Voter) => number;
|
|
|
5846
5987
|
declare const readGovernanceActionId: (ptr: number) => GovernanceActionId;
|
|
5847
5988
|
/**
|
|
5848
5989
|
* @hidden
|
|
5849
|
-
* Serializes a JavaScript `GovernanceActionId` object
|
|
5990
|
+
* Serializes a JavaScript `GovernanceActionId` object or Bech32 string into a
|
|
5991
|
+
* native `cardano_governance_action_id_t` object pointer.
|
|
5850
5992
|
*
|
|
5851
|
-
* @param {GovernanceActionId} govActionId - The `GovernanceActionId` object to serialize.
|
|
5993
|
+
* @param {GovernanceActionId | string} govActionId - The `GovernanceActionId` object or Bech32 string to serialize.
|
|
5852
5994
|
* @returns {number} A pointer to the newly created native `cardano_governance_action_id_t` object.
|
|
5853
5995
|
*/
|
|
5854
|
-
declare const writeGovernanceActionId: (govActionId: GovernanceActionId) => number;
|
|
5996
|
+
declare const writeGovernanceActionId: (govActionId: GovernanceActionId | string) => number;
|
|
5855
5997
|
/**
|
|
5856
5998
|
* @hidden
|
|
5857
5999
|
* Deserializes a native `cardano_voting_procedure_t` object into a JavaScript `VotingProcedure` object.
|
|
@@ -6405,25 +6547,75 @@ declare class TransactionBuilder {
|
|
|
6405
6547
|
* This function marks the transaction as invalid if it is not included in a block
|
|
6406
6548
|
* before the specified time.
|
|
6407
6549
|
*
|
|
6408
|
-
* @param {number | bigint
|
|
6409
|
-
*
|
|
6410
|
-
|
|
6550
|
+
* @param {number | bigint} slot The absolute **slot number** after which this transaction will be invalid.
|
|
6551
|
+
* @returns {TransactionBuilder} The builder instance for chaining.
|
|
6552
|
+
*/
|
|
6553
|
+
setInvalidAfter(slot: number | bigint): TransactionBuilder;
|
|
6554
|
+
/**
|
|
6555
|
+
* Sets the transaction to be valid for a specific duration from now.
|
|
6556
|
+
*
|
|
6557
|
+
* This is a convenience method that calculates a future expiration date and sets it.
|
|
6558
|
+
* The transaction will be marked as invalid if it is not included in a block
|
|
6559
|
+
* within the specified duration.
|
|
6560
|
+
*
|
|
6561
|
+
* @param {number} seconds - The number of seconds from now that the transaction should remain valid.
|
|
6562
|
+
* @returns {TransactionBuilder} The builder instance for chaining.
|
|
6563
|
+
*
|
|
6564
|
+
* @example
|
|
6565
|
+
* // Set the transaction to expire in 3 minutes (180 seconds) from now.
|
|
6566
|
+
* txBuilder.setValidFor(180);
|
|
6567
|
+
*/
|
|
6568
|
+
expiresIn(seconds: number): TransactionBuilder;
|
|
6569
|
+
/**
|
|
6570
|
+
* Sets the transaction's expiration to a specific, absolute date and time.
|
|
6571
|
+
*
|
|
6572
|
+
* This function marks the transaction as invalid if it is not included in a block
|
|
6573
|
+
* before the specified date.
|
|
6574
|
+
*
|
|
6575
|
+
* @param {Date} date - The absolute date and time after which the transaction will be invalid.
|
|
6411
6576
|
* @returns {TransactionBuilder} The builder instance for chaining.
|
|
6577
|
+
*
|
|
6578
|
+
* @example
|
|
6579
|
+
* // Set the transaction to expire on New Year's Day, 2026.
|
|
6580
|
+
* const expiryDate = new Date('2026-01-01T00:00:00Z');
|
|
6581
|
+
* txBuilder.expiresAfter(expiryDate);
|
|
6412
6582
|
*/
|
|
6413
|
-
|
|
6583
|
+
expiresAfter(date: Date): TransactionBuilder;
|
|
6414
6584
|
/**
|
|
6415
|
-
* Sets the transaction's validity start time.
|
|
6585
|
+
* Sets the transaction's validity start time using an absolute slot number.
|
|
6416
6586
|
*
|
|
6417
6587
|
* This function marks the transaction as invalid if it is included in a block
|
|
6418
|
-
* created before the specified
|
|
6419
|
-
* the transaction can be processed.
|
|
6588
|
+
* created before the specified slot.
|
|
6420
6589
|
*
|
|
6421
|
-
* @param {number | bigint
|
|
6422
|
-
* - If a `number` or `bigint` is provided, it is treated as an absolute **slot number**.
|
|
6423
|
-
* - If a `Date` object is provided, it is converted to a **Unix timestamp** (in seconds).
|
|
6590
|
+
* @param {number | bigint} slot The absolute slot number before which this transaction is invalid.
|
|
6424
6591
|
* @returns {TransactionBuilder} The builder instance for chaining.
|
|
6425
6592
|
*/
|
|
6426
|
-
setInvalidBefore(
|
|
6593
|
+
setInvalidBefore(slot: number | bigint): TransactionBuilder;
|
|
6594
|
+
/**
|
|
6595
|
+
* Sets the transaction's validity start time to a specific, absolute date and time.
|
|
6596
|
+
* The transaction will be invalid if processed before this date.
|
|
6597
|
+
*
|
|
6598
|
+
* @param {Date} date The absolute date and time from which the transaction will be valid.
|
|
6599
|
+
* @returns {TransactionBuilder} The builder instance for chaining.
|
|
6600
|
+
*
|
|
6601
|
+
* @example
|
|
6602
|
+
* // Make the transaction valid starting on New Year's Day, 2026.
|
|
6603
|
+
* const startDate = new Date('2026-01-01T00:00:00Z');
|
|
6604
|
+
* txBuilder.validFromDate(startDate);
|
|
6605
|
+
*/
|
|
6606
|
+
validFromDate(date: Date): TransactionBuilder;
|
|
6607
|
+
/**
|
|
6608
|
+
* Sets the transaction to become valid only after a specified duration from now.
|
|
6609
|
+
* This is a convenience method that calculates a future start date.
|
|
6610
|
+
*
|
|
6611
|
+
* @param {number} seconds The number of seconds from now to wait before the transaction becomes valid.
|
|
6612
|
+
* @returns {TransactionBuilder} The builder instance for chaining.
|
|
6613
|
+
*
|
|
6614
|
+
* @example
|
|
6615
|
+
* // Make the transaction valid only after 1 hour (3600 seconds) has passed.
|
|
6616
|
+
* txBuilder.validAfter(3600);
|
|
6617
|
+
*/
|
|
6618
|
+
validAfter(seconds: number): TransactionBuilder;
|
|
6427
6619
|
/**
|
|
6428
6620
|
* Adds a reference input to the transaction.
|
|
6429
6621
|
*
|
|
@@ -6600,12 +6792,12 @@ declare class TransactionBuilder {
|
|
|
6600
6792
|
* stake credentials.
|
|
6601
6793
|
*
|
|
6602
6794
|
* @param {Object} params - The parameters for the function.
|
|
6603
|
-
* @param {string | RewardAddress} params.
|
|
6795
|
+
* @param {string | RewardAddress} params.rewardAddress The stake address to register, as a bech32 string or a RewardAddress object.
|
|
6604
6796
|
* @param {PlutusData} [params.redeemer] Optional. The redeemer for a script-controlled stake credential.
|
|
6605
6797
|
* @returns {TransactionBuilder} The builder instance for chaining.
|
|
6606
6798
|
*/
|
|
6607
|
-
registerStakeAddress({
|
|
6608
|
-
|
|
6799
|
+
registerStakeAddress({ rewardAddress, redeemer }: {
|
|
6800
|
+
rewardAddress: string | RewardAddress;
|
|
6609
6801
|
redeemer?: PlutusData;
|
|
6610
6802
|
}): TransactionBuilder;
|
|
6611
6803
|
/**
|
|
@@ -6615,12 +6807,12 @@ declare class TransactionBuilder {
|
|
|
6615
6807
|
* An optional redeemer can be provided for script-controlled stake credentials.
|
|
6616
6808
|
*
|
|
6617
6809
|
* @param {Object} params - The parameters for the function.
|
|
6618
|
-
* @param {string | RewardAddress} params.
|
|
6810
|
+
* @param {string | RewardAddress} params.rewardAddress - The stake address to deregister, as a bech32 string or a RewardAddress object.
|
|
6619
6811
|
* @param {PlutusData} [params.redeemer] - Optional. The redeemer for a script-controlled stake credential.
|
|
6620
6812
|
* @returns {TransactionBuilder} The builder instance for chaining.
|
|
6621
6813
|
*/
|
|
6622
|
-
deregisterStakeAddress({
|
|
6623
|
-
|
|
6814
|
+
deregisterStakeAddress({ rewardAddress, redeemer }: {
|
|
6815
|
+
rewardAddress: string | RewardAddress;
|
|
6624
6816
|
redeemer?: PlutusData;
|
|
6625
6817
|
}): TransactionBuilder;
|
|
6626
6818
|
/**
|
|
@@ -6630,13 +6822,13 @@ declare class TransactionBuilder {
|
|
|
6630
6822
|
* An optional redeemer can be provided for script-controlled stake credentials.
|
|
6631
6823
|
*
|
|
6632
6824
|
* @param {Object} params - The parameters for the function.
|
|
6633
|
-
* @param {string | RewardAddress} params.
|
|
6825
|
+
* @param {string | RewardAddress} params.rewardAddress The bech32-encoded stake address to delegate from.
|
|
6634
6826
|
* @param {string} params.poolId The bech32-encoded ID of the stake pool to delegate to.
|
|
6635
6827
|
* @param {PlutusData} [params.redeemer] Optional. The redeemer for a script-controlled stake credential.
|
|
6636
6828
|
* @returns {TransactionBuilder} The builder instance for chaining.
|
|
6637
6829
|
*/
|
|
6638
|
-
delegateStake({
|
|
6639
|
-
|
|
6830
|
+
delegateStake({ rewardAddress, poolId, redeemer }: {
|
|
6831
|
+
rewardAddress: string | RewardAddress;
|
|
6640
6832
|
poolId: string;
|
|
6641
6833
|
redeemer?: PlutusData;
|
|
6642
6834
|
}): TransactionBuilder;
|
|
@@ -6647,14 +6839,14 @@ declare class TransactionBuilder {
|
|
|
6647
6839
|
* (Decentralized Representative) for on-chain governance.
|
|
6648
6840
|
*
|
|
6649
6841
|
* @param {Object} params - The parameters for the function.
|
|
6650
|
-
* @param {string | RewardAddress} params.
|
|
6842
|
+
* @param {string | RewardAddress} params.rewardAddress The bech32-encoded stake address to delegate from.
|
|
6651
6843
|
* @param {string} params.drepId The bech32-encoded ID of the DRep to delegate to. The DRep ID can be
|
|
6652
6844
|
* in CIP-129 format or CIP-105 format.
|
|
6653
6845
|
* @param {PlutusData} [params.redeemer] Optional. The redeemer for a script-controlled stake credential.
|
|
6654
6846
|
* @returns {TransactionBuilder} The builder instance for chaining.
|
|
6655
6847
|
*/
|
|
6656
|
-
delegateVotingPower({
|
|
6657
|
-
|
|
6848
|
+
delegateVotingPower({ rewardAddress, drepId, redeemer }: {
|
|
6849
|
+
rewardAddress: string | RewardAddress;
|
|
6658
6850
|
drepId: string;
|
|
6659
6851
|
redeemer?: PlutusData;
|
|
6660
6852
|
}): TransactionBuilder;
|
|
@@ -6719,7 +6911,7 @@ declare class TransactionBuilder {
|
|
|
6719
6911
|
*/
|
|
6720
6912
|
vote({ voter, actionId, votingProcedure, redeemer }: {
|
|
6721
6913
|
voter: Voter;
|
|
6722
|
-
actionId: GovernanceActionId;
|
|
6914
|
+
actionId: GovernanceActionId | string;
|
|
6723
6915
|
votingProcedure: VotingProcedure;
|
|
6724
6916
|
redeemer?: PlutusData;
|
|
6725
6917
|
}): TransactionBuilder;
|
|
@@ -7101,6 +7293,38 @@ interface Cip30Wallet {
|
|
|
7101
7293
|
* @remarks Collateral is required for transactions that interact with Plutus smart contracts to cover potential script execution failure fees.
|
|
7102
7294
|
*/
|
|
7103
7295
|
getCollateral(): Promise<string[]>;
|
|
7296
|
+
/**
|
|
7297
|
+
* Namespace for CIP-142 methods.
|
|
7298
|
+
* @see {@link https://cips.cardano.org/cip/CIP-142}
|
|
7299
|
+
*/
|
|
7300
|
+
cip142: {
|
|
7301
|
+
/**
|
|
7302
|
+
* Returns the "network magic," a unique number identifying the Cardano network.
|
|
7303
|
+
* @returns {Promise<number>} A promise that resolves to the network magic number (e.g., Mainnet: `764824073`, Preprod: `1`).
|
|
7304
|
+
*/
|
|
7305
|
+
getNetworkMagic: () => Promise<number>;
|
|
7306
|
+
};
|
|
7307
|
+
/**
|
|
7308
|
+
* Namespace for CIP-95 governance methods, supporting the Voltaire era.
|
|
7309
|
+
* @see {@link https://cips.cardano.org/cip/CIP-95}
|
|
7310
|
+
*/
|
|
7311
|
+
cip95: {
|
|
7312
|
+
/**
|
|
7313
|
+
* Returns the wallet's active public DRep (Delegated Representative) key.
|
|
7314
|
+
* @returns {Promise<string>} A promise that resolves to the hex-encoded public DRep key.
|
|
7315
|
+
*/
|
|
7316
|
+
getPubDRepKey: () => Promise<string>;
|
|
7317
|
+
/**
|
|
7318
|
+
* Returns public stake keys from the wallet that are currently registered for on-chain governance voting.
|
|
7319
|
+
* @returns {Promise<string[]>} A promise that resolves to an array of hex-encoded public stake keys.
|
|
7320
|
+
*/
|
|
7321
|
+
getRegisteredPubStakeKeys: () => Promise<string[]>;
|
|
7322
|
+
/**
|
|
7323
|
+
* Returns public stake keys from the wallet that are NOT yet registered for on-chain governance voting.
|
|
7324
|
+
* @returns {Promise<string[]>} A promise that resolves to an array of hex-encoded public stake keys.
|
|
7325
|
+
*/
|
|
7326
|
+
getUnregisteredPubStakeKeys: () => Promise<string[]>;
|
|
7327
|
+
};
|
|
7104
7328
|
}
|
|
7105
7329
|
|
|
7106
7330
|
/**
|
|
@@ -7177,6 +7401,26 @@ interface Wallet {
|
|
|
7177
7401
|
* @remarks Collateral is required for transactions that interact with Plutus smart contracts to cover potential script execution failure fees.
|
|
7178
7402
|
*/
|
|
7179
7403
|
getCollateral(): Promise<UTxO[]>;
|
|
7404
|
+
/**
|
|
7405
|
+
* Returns the "network magic," a unique number identifying the Cardano network.
|
|
7406
|
+
* @returns {Promise<number>} A promise that resolves to the network magic number (e.g., Mainnet: `764824073`, Preprod: `1`).
|
|
7407
|
+
*/
|
|
7408
|
+
getNetworkMagic: () => Promise<number>;
|
|
7409
|
+
/**
|
|
7410
|
+
* Returns the wallet's active public DRep (Delegated Representative) key.
|
|
7411
|
+
* @returns {Promise<string>} A promise that resolves to the hex-encoded public DRep key.
|
|
7412
|
+
*/
|
|
7413
|
+
getPubDRepKey: () => Promise<string>;
|
|
7414
|
+
/**
|
|
7415
|
+
* Returns public stake keys from the wallet that are currently registered for on-chain governance voting.
|
|
7416
|
+
* @returns {Promise<string[]>} A promise that resolves to an array of hex-encoded public stake keys.
|
|
7417
|
+
*/
|
|
7418
|
+
getRegisteredPubStakeKeys: () => Promise<string[]>;
|
|
7419
|
+
/**
|
|
7420
|
+
* Returns public stake keys from the wallet that are NOT yet registered for on-chain governance voting.
|
|
7421
|
+
* @returns {Promise<string[]>} A promise that resolves to an array of hex-encoded public stake keys.
|
|
7422
|
+
*/
|
|
7423
|
+
getUnregisteredPubStakeKeys: () => Promise<string[]>;
|
|
7180
7424
|
/**
|
|
7181
7425
|
* Creates and initializes a new transaction builder with the wallet's current state.
|
|
7182
7426
|
*
|
|
@@ -7197,11 +7441,13 @@ interface Wallet {
|
|
|
7197
7441
|
* @property {number} account - The account index.
|
|
7198
7442
|
* @property {number} paymentIndex - The address index for the payment key (role 0).
|
|
7199
7443
|
* @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.
|
|
7444
|
+
* @property {number} [drepIndex] - The address index for the DRep key (role 3). If not provided, 0 will be assumed.
|
|
7200
7445
|
*/
|
|
7201
7446
|
type SingleAddressCredentialsConfig = {
|
|
7202
7447
|
account: number;
|
|
7203
7448
|
paymentIndex: number;
|
|
7204
7449
|
stakingIndex?: number;
|
|
7450
|
+
drepIndex?: number;
|
|
7205
7451
|
};
|
|
7206
7452
|
/**
|
|
7207
7453
|
* Configuration for creating a `SingleAddressWallet` instance from pre-existing key objects.
|
|
@@ -7248,6 +7494,7 @@ declare class SingleAddressWallet implements Wallet {
|
|
|
7248
7494
|
private accountRootPublicKey;
|
|
7249
7495
|
private paymentAddress;
|
|
7250
7496
|
private rewardAddress;
|
|
7497
|
+
private drepPubKey;
|
|
7251
7498
|
private protocolParams;
|
|
7252
7499
|
/**
|
|
7253
7500
|
* Constructs a new instance of the SingleAddressWallet.
|
|
@@ -7288,6 +7535,7 @@ declare class SingleAddressWallet implements Wallet {
|
|
|
7288
7535
|
/**
|
|
7289
7536
|
* Fetches and parses all unused addresses controlled by the wallet.
|
|
7290
7537
|
* @returns {Promise<Address[]>} A promise that resolves to an array of parsed `Address` objects.
|
|
7538
|
+
* @remarks This method is currently not supported and always returns an empty array.
|
|
7291
7539
|
*/
|
|
7292
7540
|
getUnusedAddresses(): Promise<Address[]>;
|
|
7293
7541
|
/**
|
|
@@ -7303,14 +7551,10 @@ declare class SingleAddressWallet implements Wallet {
|
|
|
7303
7551
|
/**
|
|
7304
7552
|
* Requests a signature for a transaction using the wallet's keys.
|
|
7305
7553
|
* @param {string} txCbor - The transaction to be signed, provided as a CBOR hex string.
|
|
7306
|
-
* @param {boolean}
|
|
7554
|
+
* @param {boolean} _partialSign - A flag to control which credentials are used for signing.
|
|
7307
7555
|
* @returns {Promise<VkeyWitnessSet>} A promise that resolves to the deserialized `VkeyWitnessSet`.
|
|
7308
|
-
* @remarks
|
|
7309
|
-
* For this type of wallet, we are going to hijack this flag and break the interface contract:
|
|
7310
|
-
* - When `partialSign` is `true`, the transaction is signed **only** with the payment credential.
|
|
7311
|
-
* - When `partialSign` is `false`, the transaction is signed with **both** the payment and staking credentials.
|
|
7312
7556
|
*/
|
|
7313
|
-
signTransaction(txCbor: string,
|
|
7557
|
+
signTransaction(txCbor: string, _partialSign: boolean): Promise<VkeyWitnessSet>;
|
|
7314
7558
|
/**
|
|
7315
7559
|
* Requests a CIP-8 compliant data signature from the wallet.
|
|
7316
7560
|
* @param {Address | string} _address - The address to sign with (as an `Address` object or Bech32 string).
|
|
@@ -7330,9 +7574,31 @@ declare class SingleAddressWallet implements Wallet {
|
|
|
7330
7574
|
/**
|
|
7331
7575
|
* Fetches and deserializes the wallet's collateral UTxOs.
|
|
7332
7576
|
* @returns {Promise<TxOut[]>} A promise that resolves to an array of collateral `TxOut` objects.
|
|
7333
|
-
* @remarks
|
|
7577
|
+
* @remarks This method is currently not supported and always returns an empty array.
|
|
7334
7578
|
*/
|
|
7335
7579
|
getCollateral(): Promise<UTxO[]>;
|
|
7580
|
+
/**
|
|
7581
|
+
* Returns the "network magic," a unique number identifying the Cardano network.
|
|
7582
|
+
* @returns {Promise<number>} A promise that resolves to the network magic number (e.g., Mainnet: `764824073`, Preprod: `1`).
|
|
7583
|
+
*/
|
|
7584
|
+
getNetworkMagic(): Promise<NetworkMagic>;
|
|
7585
|
+
/**
|
|
7586
|
+
* Returns the wallet's active public DRep (Delegated Representative) key.
|
|
7587
|
+
* @returns {Promise<string>} A promise that resolves to the hex-encoded public DRep key.
|
|
7588
|
+
*/
|
|
7589
|
+
getPubDRepKey(): Promise<string>;
|
|
7590
|
+
/**
|
|
7591
|
+
* Returns public stake keys from the wallet that are currently registered for on-chain governance voting.
|
|
7592
|
+
* @returns {Promise<string[]>} A promise that resolves to an array of hex-encoded public stake keys.
|
|
7593
|
+
* @remarks This method is currently not supported and always returns an empty array.
|
|
7594
|
+
*/
|
|
7595
|
+
getRegisteredPubStakeKeys(): Promise<string[]>;
|
|
7596
|
+
/**
|
|
7597
|
+
* Returns public stake keys from the wallet that are NOT yet registered for on-chain governance voting.
|
|
7598
|
+
* @returns {Promise<string[]>} A promise that resolves to an array of hex-encoded public stake keys.
|
|
7599
|
+
* @remarks This method is currently not supported and always returns an empty array.
|
|
7600
|
+
*/
|
|
7601
|
+
getUnregisteredPubStakeKeys(): Promise<string[]>;
|
|
7336
7602
|
/**
|
|
7337
7603
|
* Creates and initializes a new transaction builder with the wallet's current state.
|
|
7338
7604
|
*
|
|
@@ -7436,6 +7702,26 @@ declare class BrowserExtensionWallet implements Wallet {
|
|
|
7436
7702
|
* @remarks Collateral is required for transactions involving Plutus smart contracts.
|
|
7437
7703
|
*/
|
|
7438
7704
|
getCollateral(): Promise<UTxO[]>;
|
|
7705
|
+
/**
|
|
7706
|
+
* Returns the "network magic," a unique number identifying the Cardano network.
|
|
7707
|
+
* @returns {Promise<number>} A promise that resolves to the network magic number (e.g., Mainnet: `764824073`, Preprod: `1`).
|
|
7708
|
+
*/
|
|
7709
|
+
getNetworkMagic(): Promise<NetworkMagic>;
|
|
7710
|
+
/**
|
|
7711
|
+
* Returns the wallet's active public DRep (Delegated Representative) key.
|
|
7712
|
+
* @returns {Promise<string>} A promise that resolves to the hex-encoded public DRep key.
|
|
7713
|
+
*/
|
|
7714
|
+
getPubDRepKey(): Promise<string>;
|
|
7715
|
+
/**
|
|
7716
|
+
* Returns public stake keys from the wallet that are currently registered for on-chain governance voting.
|
|
7717
|
+
* @returns {Promise<string[]>} A promise that resolves to an array of hex-encoded public stake keys.
|
|
7718
|
+
*/
|
|
7719
|
+
getRegisteredPubStakeKeys(): Promise<string[]>;
|
|
7720
|
+
/**
|
|
7721
|
+
* Returns public stake keys from the wallet that are NOT yet registered for on-chain governance voting.
|
|
7722
|
+
* @returns {Promise<string[]>} A promise that resolves to an array of hex-encoded public stake keys.
|
|
7723
|
+
*/
|
|
7724
|
+
getUnregisteredPubStakeKeys(): Promise<string[]>;
|
|
7439
7725
|
/**
|
|
7440
7726
|
* Creates and initializes a new transaction builder with the wallet's current state.
|
|
7441
7727
|
*
|
|
@@ -7451,4 +7737,4 @@ declare class BrowserExtensionWallet implements Wallet {
|
|
|
7451
7737
|
createTransactionBuilder(): Promise<TransactionBuilder>;
|
|
7452
7738
|
}
|
|
7453
7739
|
|
|
7454
|
-
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, BrowserExtensionWallet, 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, readVkeyWitnessSetFromWitnessSetCbor, 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 };
|
|
7740
|
+
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, BrowserExtensionWallet, 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, cip105DRepFromCredential, cip129DRepFromCredential, cip129DRepFromPublicKey, cip129DRepFromScript, computeScriptHash, dRepToAddress, dRepToCredential, deepEqualsPlutusData, deepEqualsScript, derefCostModel, derefCostModels, derefDRepVotingThresholds, derefExUnitPrices, derefExUnits, derefPoolVotingThresholds, derefProtocolParameters, derefProtocolVersion, derefUnitInterval, entropyToMnemonic, finalizationRegistry, getErrorString, getFromInstanceRegistry, getLibCardanoCVersion, getModule, getScriptAddress, getUniqueSigners, govActionIdFromBech32, govActionIdToBech32, 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, readStringFromMemory, readTransactionFromCbor, readTxIn, readTxOut, readTxOutFromCbor, readUTxOtFromCbor, readUnitIntervalAsDouble, readUnregistrationCertificate, readUpdateDRepCertificate, readUtxo, readUtxoList, readValue, readValueFromCbor, readVkeyWitnessSet, readVkeyWitnessSetFromWitnessSetCbor, readVoteDelegationCertificate, readVoteRegistrationDelegationCertificate, readVoter, readVotingProcedure, readWithdrawalMap, ready, registerBridgeErrorHandler, registerInstance, reportBridgeError, scriptToCbor, splitToLowHigh64bit, toCip105DRepID, toCip129DRepID, toUnitInterval, uint8ArrayToHex, uint8ArrayToUtf8, unrefObject, unregisterBridgeErrorHandler, unregisterInstance, utf8ByteLen, utf8ToHex, 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 };
|