@meshsdk/common 1.9.0-beta.2 → 1.9.0-beta.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +17 -868
- package/dist/index.d.cts +52 -20
- package/dist/index.d.ts +52 -20
- package/dist/index.js +14 -891
- package/package.json +4 -3
package/dist/index.d.cts
CHANGED
|
@@ -216,18 +216,6 @@ declare const castProtocol: (data: Partial<Record<keyof Protocol, any>>) => Prot
|
|
|
216
216
|
|
|
217
217
|
type Token = keyof typeof SUPPORTED_TOKENS;
|
|
218
218
|
|
|
219
|
-
type TransactionInfo = {
|
|
220
|
-
index: number;
|
|
221
|
-
block: string;
|
|
222
|
-
hash: string;
|
|
223
|
-
slot: string;
|
|
224
|
-
fees: string;
|
|
225
|
-
size: number;
|
|
226
|
-
deposit: string;
|
|
227
|
-
invalidBefore: string;
|
|
228
|
-
invalidAfter: string;
|
|
229
|
-
};
|
|
230
|
-
|
|
231
219
|
type UTxO = {
|
|
232
220
|
input: {
|
|
233
221
|
outputIndex: number;
|
|
@@ -243,6 +231,22 @@ type UTxO = {
|
|
|
243
231
|
};
|
|
244
232
|
};
|
|
245
233
|
|
|
234
|
+
type TransactionInfo = {
|
|
235
|
+
index: number;
|
|
236
|
+
block: string;
|
|
237
|
+
hash: string;
|
|
238
|
+
slot: string;
|
|
239
|
+
fees: string;
|
|
240
|
+
size: number;
|
|
241
|
+
deposit: string;
|
|
242
|
+
invalidBefore: string;
|
|
243
|
+
invalidAfter: string;
|
|
244
|
+
inputs: UTxO[];
|
|
245
|
+
outputs: UTxO[];
|
|
246
|
+
blockHeight?: number;
|
|
247
|
+
blockTime?: number;
|
|
248
|
+
};
|
|
249
|
+
|
|
246
250
|
type Wallet = {
|
|
247
251
|
id: string;
|
|
248
252
|
name: string;
|
|
@@ -472,7 +476,7 @@ type ScriptTxIn = {
|
|
|
472
476
|
};
|
|
473
477
|
declare const txInToUtxo: (txIn: TxInParameter) => UTxO;
|
|
474
478
|
|
|
475
|
-
type Credential = {
|
|
479
|
+
type Credential$1 = {
|
|
476
480
|
type: "ScriptHash";
|
|
477
481
|
scriptHash: string;
|
|
478
482
|
} | {
|
|
@@ -503,7 +507,7 @@ type VoteType = {
|
|
|
503
507
|
};
|
|
504
508
|
type Voter = {
|
|
505
509
|
type: "ConstitutionalCommittee";
|
|
506
|
-
hotCred: Credential;
|
|
510
|
+
hotCred: Credential$1;
|
|
507
511
|
} | {
|
|
508
512
|
type: "DRep";
|
|
509
513
|
drepId: string;
|
|
@@ -739,6 +743,10 @@ type MPubKeyAddress = MConStr0<[MConStr0<[string]>, MMaybeStakingHash]>;
|
|
|
739
743
|
* The Mesh Data script address
|
|
740
744
|
*/
|
|
741
745
|
type MScriptAddress = MConStr0<[MConStr1<[string]>, MMaybeStakingHash]>;
|
|
746
|
+
/**
|
|
747
|
+
* The Mesh Data credential
|
|
748
|
+
*/
|
|
749
|
+
type MCredential = MConStr0<[string]> | MConStr1<[string]>;
|
|
742
750
|
/**
|
|
743
751
|
* The utility function to create a Mesh Data staking hash
|
|
744
752
|
* @param stakeCredential The staking credential in hex
|
|
@@ -762,6 +770,13 @@ declare const mPubKeyAddress: (bytes: string, stakeCredential?: string, isStakeS
|
|
|
762
770
|
* @returns The Mesh Data script address object
|
|
763
771
|
*/
|
|
764
772
|
declare const mScriptAddress: (bytes: string, stakeCredential?: string, isStakeScriptCredential?: boolean) => MScriptAddress;
|
|
773
|
+
/**
|
|
774
|
+
* The utility function to create a Mesh Data credential
|
|
775
|
+
* @param hash The pub key hash or script hash
|
|
776
|
+
* @param isScriptCredential Indicate if the credential is script hash (false for pub key hash)
|
|
777
|
+
* @returns Mesh Data credential object
|
|
778
|
+
*/
|
|
779
|
+
declare const mCredential: (hash: string, isScriptCredential?: boolean) => MCredential;
|
|
765
780
|
|
|
766
781
|
/**
|
|
767
782
|
* The Mesh Data boolean
|
|
@@ -1138,6 +1153,10 @@ type PubKeyAddress = ConStr0<[ConStr0<[PubKeyHash]>, MaybeStakingHash]>;
|
|
|
1138
1153
|
* The Plutus Data script address in JSON
|
|
1139
1154
|
*/
|
|
1140
1155
|
type ScriptAddress = ConStr0<[ConStr1<[ScriptHash]>, MaybeStakingHash]>;
|
|
1156
|
+
/**
|
|
1157
|
+
* The Plutus Data credential in JSON
|
|
1158
|
+
*/
|
|
1159
|
+
type Credential = ConStr0<[PubKeyHash]> | ConStr1<[ScriptHash]>;
|
|
1141
1160
|
/**
|
|
1142
1161
|
* The utility function to create a Plutus Data staking hash in JSON
|
|
1143
1162
|
* @param stakeCredential The staking credential in hex
|
|
@@ -1161,6 +1180,13 @@ declare const pubKeyAddress: (bytes: string, stakeCredential?: string, isStakeSc
|
|
|
1161
1180
|
* @returns The Plutus Data script address object
|
|
1162
1181
|
*/
|
|
1163
1182
|
declare const scriptAddress: (bytes: string, stakeCredential?: string, isStakeScriptCredential?: boolean) => ScriptAddress;
|
|
1183
|
+
/**
|
|
1184
|
+
* The utility function to create a Plutus Data credential in JSON
|
|
1185
|
+
* @param hash The pub key hash or script hash
|
|
1186
|
+
* @param isScriptCredential Indicate if the credential is script hash (false for pub key hash)
|
|
1187
|
+
* @returns Plutus Data credential object
|
|
1188
|
+
*/
|
|
1189
|
+
declare const credential: (hash: string, isScriptCredential?: boolean) => Credential;
|
|
1164
1190
|
|
|
1165
1191
|
type PlutusData = ConStr | Bool | ByteString | Integer | List | AssocMap | MaybeStakingHash | PubKeyAddress | ScriptAddress | AssetClass | OutputReference | PubKeyHash | POSIXTime | Dict<any> | Tuple<any, any>;
|
|
1166
1192
|
|
|
@@ -1504,12 +1530,19 @@ declare const CIP68_100: (tokenNameHex: string) => string;
|
|
|
1504
1530
|
*/
|
|
1505
1531
|
declare const CIP68_222: (tokenNameHex: string) => string;
|
|
1506
1532
|
|
|
1533
|
+
type IFetcherOptions = {
|
|
1534
|
+
maxPage?: number;
|
|
1535
|
+
order?: "asc" | "desc";
|
|
1536
|
+
[key: string]: any;
|
|
1537
|
+
};
|
|
1538
|
+
declare const DEFAULT_FETCHER_OPTIONS: IFetcherOptions;
|
|
1507
1539
|
/**
|
|
1508
1540
|
* Fetcher interface defines end points to query blockchain data.
|
|
1509
1541
|
*/
|
|
1510
1542
|
interface IFetcher {
|
|
1511
1543
|
fetchAccountInfo(address: string): Promise<AccountInfo>;
|
|
1512
1544
|
fetchAddressUTxOs(address: string, asset?: string): Promise<UTxO[]>;
|
|
1545
|
+
fetchAddressTxs(address: string, options?: IFetcherOptions): Promise<TransactionInfo[]>;
|
|
1513
1546
|
fetchAssetAddresses(asset: string): Promise<{
|
|
1514
1547
|
address: string;
|
|
1515
1548
|
quantity: string;
|
|
@@ -1528,11 +1561,10 @@ interface IFetcher {
|
|
|
1528
1561
|
}
|
|
1529
1562
|
|
|
1530
1563
|
interface IInitiator {
|
|
1531
|
-
getChangeAddress():
|
|
1532
|
-
getCollateral():
|
|
1533
|
-
getUtxos():
|
|
1564
|
+
getChangeAddress(): Promise<string>;
|
|
1565
|
+
getCollateral(): Promise<UTxO[]>;
|
|
1566
|
+
getUtxos(): Promise<UTxO[]>;
|
|
1534
1567
|
}
|
|
1535
|
-
type SometimesPromise<T> = Promise<T> | T;
|
|
1536
1568
|
|
|
1537
1569
|
interface IListener {
|
|
1538
1570
|
onTxConfirmed(txHash: string, callback: () => void, limit?: number): void;
|
|
@@ -1544,7 +1576,7 @@ interface ISubmitter {
|
|
|
1544
1576
|
|
|
1545
1577
|
interface IMeshTxSerializer {
|
|
1546
1578
|
verbose: boolean;
|
|
1547
|
-
serializeTxBody(txBuilderBody: MeshTxBuilderBody, protocolParams: Protocol): string;
|
|
1579
|
+
serializeTxBody(txBuilderBody: MeshTxBuilderBody, protocolParams: Protocol, balanced: Boolean): string;
|
|
1548
1580
|
addSigningKeys(txHex: string, signingKeys: string[]): string;
|
|
1549
1581
|
resolver: IResolver;
|
|
1550
1582
|
deserializer: IDeserializer;
|
|
@@ -1650,4 +1682,4 @@ declare const hashDrepAnchor: (jsonLD: object) => string;
|
|
|
1650
1682
|
|
|
1651
1683
|
declare function getFile(url: string): string;
|
|
1652
1684
|
|
|
1653
|
-
export { type AccountInfo, type Action, type Anchor, type Asset, type AssetClass, type AssetExtended, AssetFingerprint, type AssetMetadata, type AssetName, type AssocMap, type AssocMapItem, type BasicVote, BigNum, type BlockInfo, type Bool, type Budget, type BuilderData, type BuiltinByteString, type ByteString, CIP68_100, CIP68_222, type Certificate, type CertificateType, type ConStr, type ConStr0, type ConStr1, type ConStr2, type ConStr3, type CurrencySymbol, DEFAULT_PROTOCOL_PARAMETERS, DEFAULT_REDEEMER_BUDGET, DEFAULT_V1_COST_MODEL_LIST, DEFAULT_V2_COST_MODEL_LIST, DEFAULT_V3_COST_MODEL_LIST, DREP_DEPOSIT, type DRep, type Data, type DataSignature, type DatumSource, type DeserializedAddress, type DeserializedScript, type Dict, type DictItem, type Era, type Files, type FungibleAssetMetadata, type GovernanceProposalInfo, HARDENED_KEY_START, type IDeserializer, type IEvaluator, type IFetcher, type IInitiator, type IListener, type IMeshTxSerializer, type IMintingBlueprint, type IResolver, type ISigner, type ISpendingBlueprint, type ISubmitter, type IWallet, type IWithdrawalBlueprint, type ImageAssetMetadata, type Integer, LANGUAGE_VERSIONS, type LanguageVersion, type List, type MAssetClass, type MBool, type MConStr, type MConStr0, type MConStr1, type MConStr2, type MConStr3, type MMaybeStakingHash, type MNone, type MOption, type MOutputReference, type MPubKeyAddress, type MScriptAddress, type MSome, type MTuple, type MTxOutRef, type MValue, type MaybeStakingHash, type MeshTxBuilderBody, MeshValue, type Message, type Metadata, type Metadatum, type MetadatumMap, type Mint, type MintItem, type NativeScript, type Network, type NonFungibleAssetMetadata, type None, type Option, type Output, type OutputReference, POLICY_ID_LENGTH, type POSIXTime, type PlutusData, type PlutusDataType, type PlutusScript, type PolicyId, type PoolMetadata, type PoolParams, type Protocol, type PubKeyAddress, type PubKeyHash, type PubKeyTxIn, type PubKeyWithdrawal, type Quantity, type Recipient, type Redeemer, type RedeemerTagType, type RefTxIn, type Relay, type RequiredWith, type RoyaltiesStandard, SLOT_CONFIG_NETWORK, SUPPORTED_CLOCKS, SUPPORTED_HANDLES, SUPPORTED_LANGUAGE_VIEWS, SUPPORTED_OGMIOS_LINKS, SUPPORTED_TOKENS, SUPPORTED_WALLETS, type ScriptAddress, type ScriptHash, type ScriptSource, type ScriptTxIn, type ScriptTxInParameter, type ScriptVote, type ScriptWithdrawal, type SimpleScriptSourceInfo, type SimpleScriptTxIn, type SimpleScriptTxInParameter, type SimpleScriptVote, type SimpleScriptWithdrawal, type SlotConfig, type Some, type Token, type TokenName, type TransactionInfo, type Tuple, type TxIn, type TxInParameter, type TxMetadata, type TxOutRef, type UTxO, type Unit, UtxoSelection, type UtxoSelectionStrategy, type ValidityRange, type Value, type Vote, type VoteKind, type VoteType, type Voter, type VotingProcedure, type Wallet, type Withdrawal, assetClass, assetName, assocMap, bool, builtinByteString, byteString, bytesToHex, castProtocol, conStr, conStr0, conStr1, conStr2, conStr3, currencySymbol, dict, emptyTxBuilderBody, experimentalSelectUtxos, fromUTF8, fungibleAssetKeys, getFile, hashByteString, hashDrepAnchor, hexToBytes, hexToString, integer, isNetwork, keepRelevant, largestFirst, largestFirstMultiAsset, list, mAssetClass, mBool, mConStr, mConStr0, mConStr1, mConStr2, mConStr3, mMaybeStakingHash, mNone, mOption, mOutputReference, mPlutusBSArrayToString, mPubKeyAddress, mScriptAddress, mSome, mStringToPlutusBSArray, mTuple, mTxOutRef, mValue, maybeStakingHash, mergeAssets, metadataStandardKeys, metadataToCip68, none, option, outputReference, parseAssetUnit, plutusBSArrayToString, policyId, posixTime, pubKeyAddress, pubKeyHash, resolveEpochNo, resolveFingerprint, resolveLanguageView, resolveSlotNo, resolveTxFees, royaltiesStandardKeys, scriptAddress, scriptHash, slotToBeginUnixTime, some, stringToBSArray, stringToHex, toBytes, toUTF8, tokenName, tuple, txInToUtxo, txOutRef, unixTimeToEnclosingSlot, validityRangeToObj, value };
|
|
1685
|
+
export { type AccountInfo, type Action, type Anchor, type Asset, type AssetClass, type AssetExtended, AssetFingerprint, type AssetMetadata, type AssetName, type AssocMap, type AssocMapItem, type BasicVote, BigNum, type BlockInfo, type Bool, type Budget, type BuilderData, type BuiltinByteString, type ByteString, CIP68_100, CIP68_222, type Certificate, type CertificateType, type ConStr, type ConStr0, type ConStr1, type ConStr2, type ConStr3, type Credential, type CurrencySymbol, DEFAULT_FETCHER_OPTIONS, DEFAULT_PROTOCOL_PARAMETERS, DEFAULT_REDEEMER_BUDGET, DEFAULT_V1_COST_MODEL_LIST, DEFAULT_V2_COST_MODEL_LIST, DEFAULT_V3_COST_MODEL_LIST, DREP_DEPOSIT, type DRep, type Data, type DataSignature, type DatumSource, type DeserializedAddress, type DeserializedScript, type Dict, type DictItem, type Era, type Files, type FungibleAssetMetadata, type GovernanceProposalInfo, HARDENED_KEY_START, type IDeserializer, type IEvaluator, type IFetcher, type IFetcherOptions, type IInitiator, type IListener, type IMeshTxSerializer, type IMintingBlueprint, type IResolver, type ISigner, type ISpendingBlueprint, type ISubmitter, type IWallet, type IWithdrawalBlueprint, type ImageAssetMetadata, type Integer, LANGUAGE_VERSIONS, type LanguageVersion, type List, type MAssetClass, type MBool, type MConStr, type MConStr0, type MConStr1, type MConStr2, type MConStr3, type MCredential, type MMaybeStakingHash, type MNone, type MOption, type MOutputReference, type MPubKeyAddress, type MScriptAddress, type MSome, type MTuple, type MTxOutRef, type MValue, type MaybeStakingHash, type MeshTxBuilderBody, MeshValue, type Message, type Metadata, type Metadatum, type MetadatumMap, type Mint, type MintItem, type NativeScript, type Network, type NonFungibleAssetMetadata, type None, type Option, type Output, type OutputReference, POLICY_ID_LENGTH, type POSIXTime, type PlutusData, type PlutusDataType, type PlutusScript, type PolicyId, type PoolMetadata, type PoolParams, type Protocol, type PubKeyAddress, type PubKeyHash, type PubKeyTxIn, type PubKeyWithdrawal, type Quantity, type Recipient, type Redeemer, type RedeemerTagType, type RefTxIn, type Relay, type RequiredWith, type RoyaltiesStandard, SLOT_CONFIG_NETWORK, SUPPORTED_CLOCKS, SUPPORTED_HANDLES, SUPPORTED_LANGUAGE_VIEWS, SUPPORTED_OGMIOS_LINKS, SUPPORTED_TOKENS, SUPPORTED_WALLETS, type ScriptAddress, type ScriptHash, type ScriptSource, type ScriptTxIn, type ScriptTxInParameter, type ScriptVote, type ScriptWithdrawal, type SimpleScriptSourceInfo, type SimpleScriptTxIn, type SimpleScriptTxInParameter, type SimpleScriptVote, type SimpleScriptWithdrawal, type SlotConfig, type Some, type Token, type TokenName, type TransactionInfo, type Tuple, type TxIn, type TxInParameter, type TxMetadata, type TxOutRef, type UTxO, type Unit, UtxoSelection, type UtxoSelectionStrategy, type ValidityRange, type Value, type Vote, type VoteKind, type VoteType, type Voter, type VotingProcedure, type Wallet, type Withdrawal, assetClass, assetName, assocMap, bool, builtinByteString, byteString, bytesToHex, castProtocol, conStr, conStr0, conStr1, conStr2, conStr3, credential, currencySymbol, dict, emptyTxBuilderBody, experimentalSelectUtxos, fromUTF8, fungibleAssetKeys, getFile, hashByteString, hashDrepAnchor, hexToBytes, hexToString, integer, isNetwork, keepRelevant, largestFirst, largestFirstMultiAsset, list, mAssetClass, mBool, mConStr, mConStr0, mConStr1, mConStr2, mConStr3, mCredential, mMaybeStakingHash, mNone, mOption, mOutputReference, mPlutusBSArrayToString, mPubKeyAddress, mScriptAddress, mSome, mStringToPlutusBSArray, mTuple, mTxOutRef, mValue, maybeStakingHash, mergeAssets, metadataStandardKeys, metadataToCip68, none, option, outputReference, parseAssetUnit, plutusBSArrayToString, policyId, posixTime, pubKeyAddress, pubKeyHash, resolveEpochNo, resolveFingerprint, resolveLanguageView, resolveSlotNo, resolveTxFees, royaltiesStandardKeys, scriptAddress, scriptHash, slotToBeginUnixTime, some, stringToBSArray, stringToHex, toBytes, toUTF8, tokenName, tuple, txInToUtxo, txOutRef, unixTimeToEnclosingSlot, validityRangeToObj, value };
|
package/dist/index.d.ts
CHANGED
|
@@ -216,18 +216,6 @@ declare const castProtocol: (data: Partial<Record<keyof Protocol, any>>) => Prot
|
|
|
216
216
|
|
|
217
217
|
type Token = keyof typeof SUPPORTED_TOKENS;
|
|
218
218
|
|
|
219
|
-
type TransactionInfo = {
|
|
220
|
-
index: number;
|
|
221
|
-
block: string;
|
|
222
|
-
hash: string;
|
|
223
|
-
slot: string;
|
|
224
|
-
fees: string;
|
|
225
|
-
size: number;
|
|
226
|
-
deposit: string;
|
|
227
|
-
invalidBefore: string;
|
|
228
|
-
invalidAfter: string;
|
|
229
|
-
};
|
|
230
|
-
|
|
231
219
|
type UTxO = {
|
|
232
220
|
input: {
|
|
233
221
|
outputIndex: number;
|
|
@@ -243,6 +231,22 @@ type UTxO = {
|
|
|
243
231
|
};
|
|
244
232
|
};
|
|
245
233
|
|
|
234
|
+
type TransactionInfo = {
|
|
235
|
+
index: number;
|
|
236
|
+
block: string;
|
|
237
|
+
hash: string;
|
|
238
|
+
slot: string;
|
|
239
|
+
fees: string;
|
|
240
|
+
size: number;
|
|
241
|
+
deposit: string;
|
|
242
|
+
invalidBefore: string;
|
|
243
|
+
invalidAfter: string;
|
|
244
|
+
inputs: UTxO[];
|
|
245
|
+
outputs: UTxO[];
|
|
246
|
+
blockHeight?: number;
|
|
247
|
+
blockTime?: number;
|
|
248
|
+
};
|
|
249
|
+
|
|
246
250
|
type Wallet = {
|
|
247
251
|
id: string;
|
|
248
252
|
name: string;
|
|
@@ -472,7 +476,7 @@ type ScriptTxIn = {
|
|
|
472
476
|
};
|
|
473
477
|
declare const txInToUtxo: (txIn: TxInParameter) => UTxO;
|
|
474
478
|
|
|
475
|
-
type Credential = {
|
|
479
|
+
type Credential$1 = {
|
|
476
480
|
type: "ScriptHash";
|
|
477
481
|
scriptHash: string;
|
|
478
482
|
} | {
|
|
@@ -503,7 +507,7 @@ type VoteType = {
|
|
|
503
507
|
};
|
|
504
508
|
type Voter = {
|
|
505
509
|
type: "ConstitutionalCommittee";
|
|
506
|
-
hotCred: Credential;
|
|
510
|
+
hotCred: Credential$1;
|
|
507
511
|
} | {
|
|
508
512
|
type: "DRep";
|
|
509
513
|
drepId: string;
|
|
@@ -739,6 +743,10 @@ type MPubKeyAddress = MConStr0<[MConStr0<[string]>, MMaybeStakingHash]>;
|
|
|
739
743
|
* The Mesh Data script address
|
|
740
744
|
*/
|
|
741
745
|
type MScriptAddress = MConStr0<[MConStr1<[string]>, MMaybeStakingHash]>;
|
|
746
|
+
/**
|
|
747
|
+
* The Mesh Data credential
|
|
748
|
+
*/
|
|
749
|
+
type MCredential = MConStr0<[string]> | MConStr1<[string]>;
|
|
742
750
|
/**
|
|
743
751
|
* The utility function to create a Mesh Data staking hash
|
|
744
752
|
* @param stakeCredential The staking credential in hex
|
|
@@ -762,6 +770,13 @@ declare const mPubKeyAddress: (bytes: string, stakeCredential?: string, isStakeS
|
|
|
762
770
|
* @returns The Mesh Data script address object
|
|
763
771
|
*/
|
|
764
772
|
declare const mScriptAddress: (bytes: string, stakeCredential?: string, isStakeScriptCredential?: boolean) => MScriptAddress;
|
|
773
|
+
/**
|
|
774
|
+
* The utility function to create a Mesh Data credential
|
|
775
|
+
* @param hash The pub key hash or script hash
|
|
776
|
+
* @param isScriptCredential Indicate if the credential is script hash (false for pub key hash)
|
|
777
|
+
* @returns Mesh Data credential object
|
|
778
|
+
*/
|
|
779
|
+
declare const mCredential: (hash: string, isScriptCredential?: boolean) => MCredential;
|
|
765
780
|
|
|
766
781
|
/**
|
|
767
782
|
* The Mesh Data boolean
|
|
@@ -1138,6 +1153,10 @@ type PubKeyAddress = ConStr0<[ConStr0<[PubKeyHash]>, MaybeStakingHash]>;
|
|
|
1138
1153
|
* The Plutus Data script address in JSON
|
|
1139
1154
|
*/
|
|
1140
1155
|
type ScriptAddress = ConStr0<[ConStr1<[ScriptHash]>, MaybeStakingHash]>;
|
|
1156
|
+
/**
|
|
1157
|
+
* The Plutus Data credential in JSON
|
|
1158
|
+
*/
|
|
1159
|
+
type Credential = ConStr0<[PubKeyHash]> | ConStr1<[ScriptHash]>;
|
|
1141
1160
|
/**
|
|
1142
1161
|
* The utility function to create a Plutus Data staking hash in JSON
|
|
1143
1162
|
* @param stakeCredential The staking credential in hex
|
|
@@ -1161,6 +1180,13 @@ declare const pubKeyAddress: (bytes: string, stakeCredential?: string, isStakeSc
|
|
|
1161
1180
|
* @returns The Plutus Data script address object
|
|
1162
1181
|
*/
|
|
1163
1182
|
declare const scriptAddress: (bytes: string, stakeCredential?: string, isStakeScriptCredential?: boolean) => ScriptAddress;
|
|
1183
|
+
/**
|
|
1184
|
+
* The utility function to create a Plutus Data credential in JSON
|
|
1185
|
+
* @param hash The pub key hash or script hash
|
|
1186
|
+
* @param isScriptCredential Indicate if the credential is script hash (false for pub key hash)
|
|
1187
|
+
* @returns Plutus Data credential object
|
|
1188
|
+
*/
|
|
1189
|
+
declare const credential: (hash: string, isScriptCredential?: boolean) => Credential;
|
|
1164
1190
|
|
|
1165
1191
|
type PlutusData = ConStr | Bool | ByteString | Integer | List | AssocMap | MaybeStakingHash | PubKeyAddress | ScriptAddress | AssetClass | OutputReference | PubKeyHash | POSIXTime | Dict<any> | Tuple<any, any>;
|
|
1166
1192
|
|
|
@@ -1504,12 +1530,19 @@ declare const CIP68_100: (tokenNameHex: string) => string;
|
|
|
1504
1530
|
*/
|
|
1505
1531
|
declare const CIP68_222: (tokenNameHex: string) => string;
|
|
1506
1532
|
|
|
1533
|
+
type IFetcherOptions = {
|
|
1534
|
+
maxPage?: number;
|
|
1535
|
+
order?: "asc" | "desc";
|
|
1536
|
+
[key: string]: any;
|
|
1537
|
+
};
|
|
1538
|
+
declare const DEFAULT_FETCHER_OPTIONS: IFetcherOptions;
|
|
1507
1539
|
/**
|
|
1508
1540
|
* Fetcher interface defines end points to query blockchain data.
|
|
1509
1541
|
*/
|
|
1510
1542
|
interface IFetcher {
|
|
1511
1543
|
fetchAccountInfo(address: string): Promise<AccountInfo>;
|
|
1512
1544
|
fetchAddressUTxOs(address: string, asset?: string): Promise<UTxO[]>;
|
|
1545
|
+
fetchAddressTxs(address: string, options?: IFetcherOptions): Promise<TransactionInfo[]>;
|
|
1513
1546
|
fetchAssetAddresses(asset: string): Promise<{
|
|
1514
1547
|
address: string;
|
|
1515
1548
|
quantity: string;
|
|
@@ -1528,11 +1561,10 @@ interface IFetcher {
|
|
|
1528
1561
|
}
|
|
1529
1562
|
|
|
1530
1563
|
interface IInitiator {
|
|
1531
|
-
getChangeAddress():
|
|
1532
|
-
getCollateral():
|
|
1533
|
-
getUtxos():
|
|
1564
|
+
getChangeAddress(): Promise<string>;
|
|
1565
|
+
getCollateral(): Promise<UTxO[]>;
|
|
1566
|
+
getUtxos(): Promise<UTxO[]>;
|
|
1534
1567
|
}
|
|
1535
|
-
type SometimesPromise<T> = Promise<T> | T;
|
|
1536
1568
|
|
|
1537
1569
|
interface IListener {
|
|
1538
1570
|
onTxConfirmed(txHash: string, callback: () => void, limit?: number): void;
|
|
@@ -1544,7 +1576,7 @@ interface ISubmitter {
|
|
|
1544
1576
|
|
|
1545
1577
|
interface IMeshTxSerializer {
|
|
1546
1578
|
verbose: boolean;
|
|
1547
|
-
serializeTxBody(txBuilderBody: MeshTxBuilderBody, protocolParams: Protocol): string;
|
|
1579
|
+
serializeTxBody(txBuilderBody: MeshTxBuilderBody, protocolParams: Protocol, balanced: Boolean): string;
|
|
1548
1580
|
addSigningKeys(txHex: string, signingKeys: string[]): string;
|
|
1549
1581
|
resolver: IResolver;
|
|
1550
1582
|
deserializer: IDeserializer;
|
|
@@ -1650,4 +1682,4 @@ declare const hashDrepAnchor: (jsonLD: object) => string;
|
|
|
1650
1682
|
|
|
1651
1683
|
declare function getFile(url: string): string;
|
|
1652
1684
|
|
|
1653
|
-
export { type AccountInfo, type Action, type Anchor, type Asset, type AssetClass, type AssetExtended, AssetFingerprint, type AssetMetadata, type AssetName, type AssocMap, type AssocMapItem, type BasicVote, BigNum, type BlockInfo, type Bool, type Budget, type BuilderData, type BuiltinByteString, type ByteString, CIP68_100, CIP68_222, type Certificate, type CertificateType, type ConStr, type ConStr0, type ConStr1, type ConStr2, type ConStr3, type CurrencySymbol, DEFAULT_PROTOCOL_PARAMETERS, DEFAULT_REDEEMER_BUDGET, DEFAULT_V1_COST_MODEL_LIST, DEFAULT_V2_COST_MODEL_LIST, DEFAULT_V3_COST_MODEL_LIST, DREP_DEPOSIT, type DRep, type Data, type DataSignature, type DatumSource, type DeserializedAddress, type DeserializedScript, type Dict, type DictItem, type Era, type Files, type FungibleAssetMetadata, type GovernanceProposalInfo, HARDENED_KEY_START, type IDeserializer, type IEvaluator, type IFetcher, type IInitiator, type IListener, type IMeshTxSerializer, type IMintingBlueprint, type IResolver, type ISigner, type ISpendingBlueprint, type ISubmitter, type IWallet, type IWithdrawalBlueprint, type ImageAssetMetadata, type Integer, LANGUAGE_VERSIONS, type LanguageVersion, type List, type MAssetClass, type MBool, type MConStr, type MConStr0, type MConStr1, type MConStr2, type MConStr3, type MMaybeStakingHash, type MNone, type MOption, type MOutputReference, type MPubKeyAddress, type MScriptAddress, type MSome, type MTuple, type MTxOutRef, type MValue, type MaybeStakingHash, type MeshTxBuilderBody, MeshValue, type Message, type Metadata, type Metadatum, type MetadatumMap, type Mint, type MintItem, type NativeScript, type Network, type NonFungibleAssetMetadata, type None, type Option, type Output, type OutputReference, POLICY_ID_LENGTH, type POSIXTime, type PlutusData, type PlutusDataType, type PlutusScript, type PolicyId, type PoolMetadata, type PoolParams, type Protocol, type PubKeyAddress, type PubKeyHash, type PubKeyTxIn, type PubKeyWithdrawal, type Quantity, type Recipient, type Redeemer, type RedeemerTagType, type RefTxIn, type Relay, type RequiredWith, type RoyaltiesStandard, SLOT_CONFIG_NETWORK, SUPPORTED_CLOCKS, SUPPORTED_HANDLES, SUPPORTED_LANGUAGE_VIEWS, SUPPORTED_OGMIOS_LINKS, SUPPORTED_TOKENS, SUPPORTED_WALLETS, type ScriptAddress, type ScriptHash, type ScriptSource, type ScriptTxIn, type ScriptTxInParameter, type ScriptVote, type ScriptWithdrawal, type SimpleScriptSourceInfo, type SimpleScriptTxIn, type SimpleScriptTxInParameter, type SimpleScriptVote, type SimpleScriptWithdrawal, type SlotConfig, type Some, type Token, type TokenName, type TransactionInfo, type Tuple, type TxIn, type TxInParameter, type TxMetadata, type TxOutRef, type UTxO, type Unit, UtxoSelection, type UtxoSelectionStrategy, type ValidityRange, type Value, type Vote, type VoteKind, type VoteType, type Voter, type VotingProcedure, type Wallet, type Withdrawal, assetClass, assetName, assocMap, bool, builtinByteString, byteString, bytesToHex, castProtocol, conStr, conStr0, conStr1, conStr2, conStr3, currencySymbol, dict, emptyTxBuilderBody, experimentalSelectUtxos, fromUTF8, fungibleAssetKeys, getFile, hashByteString, hashDrepAnchor, hexToBytes, hexToString, integer, isNetwork, keepRelevant, largestFirst, largestFirstMultiAsset, list, mAssetClass, mBool, mConStr, mConStr0, mConStr1, mConStr2, mConStr3, mMaybeStakingHash, mNone, mOption, mOutputReference, mPlutusBSArrayToString, mPubKeyAddress, mScriptAddress, mSome, mStringToPlutusBSArray, mTuple, mTxOutRef, mValue, maybeStakingHash, mergeAssets, metadataStandardKeys, metadataToCip68, none, option, outputReference, parseAssetUnit, plutusBSArrayToString, policyId, posixTime, pubKeyAddress, pubKeyHash, resolveEpochNo, resolveFingerprint, resolveLanguageView, resolveSlotNo, resolveTxFees, royaltiesStandardKeys, scriptAddress, scriptHash, slotToBeginUnixTime, some, stringToBSArray, stringToHex, toBytes, toUTF8, tokenName, tuple, txInToUtxo, txOutRef, unixTimeToEnclosingSlot, validityRangeToObj, value };
|
|
1685
|
+
export { type AccountInfo, type Action, type Anchor, type Asset, type AssetClass, type AssetExtended, AssetFingerprint, type AssetMetadata, type AssetName, type AssocMap, type AssocMapItem, type BasicVote, BigNum, type BlockInfo, type Bool, type Budget, type BuilderData, type BuiltinByteString, type ByteString, CIP68_100, CIP68_222, type Certificate, type CertificateType, type ConStr, type ConStr0, type ConStr1, type ConStr2, type ConStr3, type Credential, type CurrencySymbol, DEFAULT_FETCHER_OPTIONS, DEFAULT_PROTOCOL_PARAMETERS, DEFAULT_REDEEMER_BUDGET, DEFAULT_V1_COST_MODEL_LIST, DEFAULT_V2_COST_MODEL_LIST, DEFAULT_V3_COST_MODEL_LIST, DREP_DEPOSIT, type DRep, type Data, type DataSignature, type DatumSource, type DeserializedAddress, type DeserializedScript, type Dict, type DictItem, type Era, type Files, type FungibleAssetMetadata, type GovernanceProposalInfo, HARDENED_KEY_START, type IDeserializer, type IEvaluator, type IFetcher, type IFetcherOptions, type IInitiator, type IListener, type IMeshTxSerializer, type IMintingBlueprint, type IResolver, type ISigner, type ISpendingBlueprint, type ISubmitter, type IWallet, type IWithdrawalBlueprint, type ImageAssetMetadata, type Integer, LANGUAGE_VERSIONS, type LanguageVersion, type List, type MAssetClass, type MBool, type MConStr, type MConStr0, type MConStr1, type MConStr2, type MConStr3, type MCredential, type MMaybeStakingHash, type MNone, type MOption, type MOutputReference, type MPubKeyAddress, type MScriptAddress, type MSome, type MTuple, type MTxOutRef, type MValue, type MaybeStakingHash, type MeshTxBuilderBody, MeshValue, type Message, type Metadata, type Metadatum, type MetadatumMap, type Mint, type MintItem, type NativeScript, type Network, type NonFungibleAssetMetadata, type None, type Option, type Output, type OutputReference, POLICY_ID_LENGTH, type POSIXTime, type PlutusData, type PlutusDataType, type PlutusScript, type PolicyId, type PoolMetadata, type PoolParams, type Protocol, type PubKeyAddress, type PubKeyHash, type PubKeyTxIn, type PubKeyWithdrawal, type Quantity, type Recipient, type Redeemer, type RedeemerTagType, type RefTxIn, type Relay, type RequiredWith, type RoyaltiesStandard, SLOT_CONFIG_NETWORK, SUPPORTED_CLOCKS, SUPPORTED_HANDLES, SUPPORTED_LANGUAGE_VIEWS, SUPPORTED_OGMIOS_LINKS, SUPPORTED_TOKENS, SUPPORTED_WALLETS, type ScriptAddress, type ScriptHash, type ScriptSource, type ScriptTxIn, type ScriptTxInParameter, type ScriptVote, type ScriptWithdrawal, type SimpleScriptSourceInfo, type SimpleScriptTxIn, type SimpleScriptTxInParameter, type SimpleScriptVote, type SimpleScriptWithdrawal, type SlotConfig, type Some, type Token, type TokenName, type TransactionInfo, type Tuple, type TxIn, type TxInParameter, type TxMetadata, type TxOutRef, type UTxO, type Unit, UtxoSelection, type UtxoSelectionStrategy, type ValidityRange, type Value, type Vote, type VoteKind, type VoteType, type Voter, type VotingProcedure, type Wallet, type Withdrawal, assetClass, assetName, assocMap, bool, builtinByteString, byteString, bytesToHex, castProtocol, conStr, conStr0, conStr1, conStr2, conStr3, credential, currencySymbol, dict, emptyTxBuilderBody, experimentalSelectUtxos, fromUTF8, fungibleAssetKeys, getFile, hashByteString, hashDrepAnchor, hexToBytes, hexToString, integer, isNetwork, keepRelevant, largestFirst, largestFirstMultiAsset, list, mAssetClass, mBool, mConStr, mConStr0, mConStr1, mConStr2, mConStr3, mCredential, mMaybeStakingHash, mNone, mOption, mOutputReference, mPlutusBSArrayToString, mPubKeyAddress, mScriptAddress, mSome, mStringToPlutusBSArray, mTuple, mTxOutRef, mValue, maybeStakingHash, mergeAssets, metadataStandardKeys, metadataToCip68, none, option, outputReference, parseAssetUnit, plutusBSArrayToString, policyId, posixTime, pubKeyAddress, pubKeyHash, resolveEpochNo, resolveFingerprint, resolveLanguageView, resolveSlotNo, resolveTxFees, royaltiesStandardKeys, scriptAddress, scriptHash, slotToBeginUnixTime, some, stringToBSArray, stringToHex, toBytes, toUTF8, tokenName, tuple, txInToUtxo, txOutRef, unixTimeToEnclosingSlot, validityRangeToObj, value };
|