@meshsdk/common 1.7.19 → 1.7.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.d.cts CHANGED
@@ -584,194 +584,36 @@ type DeserializedScript = {
584
584
  scriptCbor?: string;
585
585
  };
586
586
 
587
- declare const DEFAULT_PROTOCOL_PARAMETERS: Protocol;
588
- declare const DREP_DEPOSIT = "500000000";
589
- declare const resolveTxFees: (txSize: number, minFeeA?: number, minFeeB?: number) => string;
590
-
591
- declare const SUPPORTED_WALLETS: string[];
592
-
593
- declare const DEFAULT_V1_COST_MODEL_LIST: number[];
594
- declare const DEFAULT_V2_COST_MODEL_LIST: number[];
595
-
596
- declare const SUPPORTED_LANGUAGE_VIEWS: Record<Era, Partial<Record<keyof typeof LANGUAGE_VERSIONS, string>>>;
597
- declare const resolveLanguageView: (era: Era, version: LanguageVersion) => string | undefined;
598
-
599
- declare const DEFAULT_REDEEMER_BUDGET: Budget;
600
- declare const POLICY_ID_LENGTH = 56;
601
- declare const LANGUAGE_VERSIONS: {
602
- V1: string;
603
- V2: string;
604
- V3: string;
605
- };
606
- declare const HARDENED_KEY_START = 2147483648;
607
- declare const SUPPORTED_CLOCKS: Record<Network, [
608
- epoch: string,
609
- slot: string,
610
- systemStart: string,
611
- epochLength: string
612
- ]>;
613
- declare const SUPPORTED_HANDLES: Record<number, string>;
614
- declare const SUPPORTED_OGMIOS_LINKS: Record<Network, string>;
615
- declare const SUPPORTED_TOKENS: {
616
- LQ: string;
617
- MIN: string;
618
- NTX: string;
619
- iBTC: string;
620
- iETH: string;
621
- iUSD: string;
622
- MILK: string;
623
- AGIX: string;
624
- MELD: string;
625
- INDY: string;
626
- CLAY: string;
627
- MCOS: string;
628
- DING: string;
629
- GERO: string;
630
- NMKR: string;
631
- PAVIA: string;
632
- HOSKY: string;
633
- YUMMI: string;
634
- C3: string;
635
- GIMBAL: string;
636
- SUNDAE: string;
637
- GREENS: string;
638
- GENS: string;
639
- SOCIETY: string;
640
- DJED: string;
641
- SHEN: string;
642
- WMT: string;
643
- COPI: string;
644
- };
645
- /**
646
- * The utility function to append the bytes for CIP-68 100 token in front of the token hex
647
- * @param tokenNameHex The hex of the token name
648
- * @returns The hex of the token name with the CIP-68 100 bytes appended
649
- */
650
- declare const CIP68_100: (tokenNameHex: string) => string;
651
- /**
652
- * The utility function to append the bytes for CIP-68 222 token in front of the token hex
653
- * @param tokenNameHex The hex of the token name
654
- * @returns The hex of the token name with the CIP-68 222 bytes appended
655
- */
656
- declare const CIP68_222: (tokenNameHex: string) => string;
657
-
658
- /**
659
- * Fetcher interface defines end points to query blockchain data.
660
- */
661
- interface IFetcher {
662
- fetchAccountInfo(address: string): Promise<AccountInfo>;
663
- fetchAddressUTxOs(address: string, asset?: string): Promise<UTxO[]>;
664
- fetchAssetAddresses(asset: string): Promise<{
665
- address: string;
666
- quantity: string;
667
- }[]>;
668
- fetchAssetMetadata(asset: string): Promise<AssetMetadata>;
669
- fetchBlockInfo(hash: string): Promise<BlockInfo>;
670
- fetchCollectionAssets(policyId: string, cursor?: number | string): Promise<{
671
- assets: Asset[];
672
- next?: string | number | null;
673
- }>;
674
- fetchHandle(handle: string): Promise<object>;
675
- fetchHandleAddress(handle: string): Promise<string>;
676
- fetchProtocolParameters(epoch: number): Promise<Protocol>;
677
- fetchTxInfo(hash: string): Promise<TransactionInfo>;
678
- fetchUTxOs(hash: string, index?: number): Promise<UTxO[]>;
679
- get(url: string): Promise<any>;
680
- }
681
-
682
- interface IInitiator {
683
- getChangeAddress(): SometimesPromise$1<string>;
684
- getCollateral(): SometimesPromise$1<UTxO[]>;
685
- getUtxos(): SometimesPromise$1<UTxO[]>;
686
- }
687
- type SometimesPromise$1<T> = Promise<T> | T;
688
-
689
- interface IListener {
690
- onTxConfirmed(txHash: string, callback: () => void, limit?: number): void;
691
- }
692
-
693
- interface ISubmitter {
694
- submitTx(tx: string): Promise<string>;
695
- }
696
-
697
- interface IMeshTxSerializer {
698
- verbose: boolean;
699
- serializeTxBody(txBuilderBody: MeshTxBuilderBody, protocolParams: Protocol): string;
700
- addSigningKeys(txHex: string, signingKeys: string[]): string;
701
- resolver: IResolver;
702
- deserializer: IDeserializer;
703
- serializeData(data: BuilderData): string;
704
- serializeAddress(address: DeserializedAddress, networkId?: 0 | 1): string;
705
- serializePoolId(hash: string): string;
706
- serializeRewardAddress(stakeKeyHash: string, isScriptHash?: boolean, network_id?: 0 | 1): string;
707
- }
708
- interface IResolver {
709
- keys: {
710
- resolvePrivateKey(words: string[]): string;
711
- resolveRewardAddress(bech32: string): string;
712
- resolveEd25519KeyHash(bech32: string): string;
713
- resolveStakeKeyHash(bech32: string): string;
714
- };
715
- tx: {
716
- resolveTxHash(txHex: string): string;
717
- };
718
- data: {
719
- resolveDataHash(data: Data): string;
720
- };
721
- script: {
722
- resolveScriptRef(script: NativeScript | PlutusScript): string;
723
- };
724
- }
725
- interface IDeserializer {
726
- key: {
727
- deserializeAddress(bech32: string): DeserializedAddress;
728
- };
729
- script: {
730
- deserializeNativeScript(script: NativeScript): DeserializedScript;
731
- deserializePlutusScript(script: PlutusScript): DeserializedScript;
732
- };
733
- cert: {
734
- deserializePoolId(poolId: string): string;
735
- };
736
- }
737
-
738
- interface ISigner {
739
- signData(address: string, payload: string): SometimesPromise<DataSignature>;
740
- signTx(unsignedTx: string, partialSign: boolean): SometimesPromise<string>;
741
- signTxs(unsignedTxs: string[], partialSign: boolean): SometimesPromise<string[]>;
742
- }
743
- type SometimesPromise<T> = Promise<T> | T;
744
-
745
- interface IEvaluator {
746
- evaluateTx(tx: string): Promise<Omit<Action, "data">[]>;
747
- }
748
-
749
587
  /**
750
588
  * The Mesh Data constructor object, representing custom data type
751
589
  */
752
- type MConStr<T = any> = {
753
- alternative: number;
590
+ type MConStr<N = 0, T = any> = {
591
+ alternative: N;
754
592
  fields: T;
755
593
  };
756
594
  /**
757
595
  * The Mesh Data index 0 constructor object, representing custom data type
758
596
  */
759
- type MConStr0<T = any> = MConStr<T>;
597
+ type MConStr0<T = any> = MConStr<0, T>;
760
598
  /**
761
599
  * The Mesh Data index 1 constructor object, representing custom data type
762
600
  */
763
- type MConStr1<T = any> = MConStr<T>;
601
+ type MConStr1<T = any> = MConStr<1, T>;
764
602
  /**
765
603
  * The Mesh Data index 2 constructor object, representing custom data type
766
604
  */
767
- type MConStr2<T = any> = MConStr<T>;
605
+ type MConStr2<T = any> = MConStr<2, T>;
606
+ /**
607
+ * The Mesh Data index 3 constructor object, representing custom data type
608
+ */
609
+ type MConStr3<T = any> = MConStr<3, T>;
768
610
  /**
769
611
  * The utility function to create a Mesh Data constructor object, representing custom data type
770
612
  * @param alternative The constructor index number
771
613
  * @param fields The items in array
772
614
  * @returns The Mesh Data constructor object
773
615
  */
774
- declare const mConStr: <T extends Data[]>(alternative: number, fields: T) => MConStr<T>;
616
+ declare const mConStr: <N extends number, T extends Data[]>(alternative: N, fields: T) => MConStr<N, T>;
775
617
  /**
776
618
  * The utility function to create a Mesh Data index 0 constructor object, representing custom data type
777
619
  * @param fields The items in array
@@ -790,6 +632,12 @@ declare const mConStr1: <T extends Data[]>(fields: T) => MConStr1<T>;
790
632
  * @returns The Mesh Data constructor object
791
633
  */
792
634
  declare const mConStr2: <T extends Data[]>(fields: T) => MConStr2<T>;
635
+ /**
636
+ * The utility function to create a Mesh Data index 3 constructor object, representing custom data type
637
+ * @param fields The items in array
638
+ * @returns The Mesh Data constructor object
639
+ */
640
+ declare const mConStr3: <T extends Data[]>(fields: T) => MConStr3<T>;
793
641
 
794
642
  /**
795
643
  * PlutusTx alias
@@ -811,6 +659,21 @@ type MTxOutRef = MConStr0<[MConStr0<[string]>, number]>;
811
659
  * The Mesh Data tuple
812
660
  */
813
661
  type MTuple<K, V> = [K, V];
662
+ /**
663
+ * Aiken alias
664
+ * The Mesh Data Option type
665
+ */
666
+ type MOption<T> = MSome<T> | MNone;
667
+ /**
668
+ * Aiken alias
669
+ * The Mesh Data Option - Some type
670
+ */
671
+ type MSome<T> = MConStr0<[T]>;
672
+ /**
673
+ * Aiken alias
674
+ * The Mesh Data Option - None type
675
+ */
676
+ type MNone = MConStr1<[]>;
814
677
  /**
815
678
  * The utility function to create a Mesh Data asset class
816
679
  * @param currencySymbolHex The currency symbol in hex
@@ -839,6 +702,23 @@ declare const mTxOutRef: (txHash: string, index: number) => MTxOutRef;
839
702
  * @returns The Mesh Data tuple object
840
703
  */
841
704
  declare const mTuple: <K, V>(key: K, value: V) => MTuple<K, V>;
705
+ /**
706
+ * The utility function to create a Mesh Data Option type in Mesh Data type
707
+ * @param value The value of the option
708
+ * @returns The Mesh Data Option object
709
+ */
710
+ declare const mOption: <T extends Data>(value?: T) => MOption<T>;
711
+ /**
712
+ * The utility function to create a Mesh Data Option type in Mesh Data type
713
+ * @param value The value of the option
714
+ * @returns The Mesh Data Option object
715
+ */
716
+ declare const mSome: <T extends Data>(value: T) => MSome<T>;
717
+ /**
718
+ * The utility function to create a Mesh Data Option - None type in Mesh Data type
719
+ * @returns The Mesh Data Option - None object
720
+ */
721
+ declare const mNone: () => MNone;
842
722
 
843
723
  /**
844
724
  * The Mesh Data staking credential
@@ -855,26 +735,26 @@ type MScriptAddress = MConStr0<[MConStr1<[string]>, MMaybeStakingHash]>;
855
735
  /**
856
736
  * The utility function to create a Mesh Data staking hash
857
737
  * @param stakeCredential The staking credential in hex
858
- * @param isScriptCredential The flag to indicate if the credential is a script credential
738
+ * @param isStakeScriptCredential The flag to indicate if the credential is a script credential
859
739
  * @returns The Mesh Data staking hash object
860
740
  */
861
- declare const mMaybeStakingHash: (stakeCredential: string, isScriptCredential?: boolean) => MMaybeStakingHash;
741
+ declare const mMaybeStakingHash: (stakeCredential: string, isStakeScriptCredential?: boolean) => MMaybeStakingHash;
862
742
  /**
863
743
  * The utility function to create a Mesh Data public key address
864
744
  * @param bytes The public key hash in hex
865
745
  * @param stakeCredential The staking credential in hex
866
- * @param isScriptCredential The flag to indicate if the credential is a script credential
746
+ * @param isStakeScriptCredential The flag to indicate if the credential is a script credential
867
747
  * @returns The Mesh Data public key address object
868
748
  */
869
- declare const mPubKeyAddress: (bytes: string, stakeCredential?: string, isScriptCredential?: boolean) => Data;
749
+ declare const mPubKeyAddress: (bytes: string, stakeCredential?: string, isStakeScriptCredential?: boolean) => Data;
870
750
  /**
871
751
  * The utility function to create a Mesh Data script address
872
752
  * @param bytes The validator hash in hex
873
753
  * @param stakeCredential The staking credential in hex
874
- * @param isScriptCredential The flag to indicate if the credential is a script credential
754
+ * @param isStakeScriptCredential The flag to indicate if the credential is a script credential
875
755
  * @returns The Mesh Data script address object
876
756
  */
877
- declare const mScriptAddress: (bytes: string, stakeCredential?: string, isScriptCredential?: boolean) => Data;
757
+ declare const mScriptAddress: (bytes: string, stakeCredential?: string, isStakeScriptCredential?: boolean) => Data;
878
758
 
879
759
  /**
880
760
  * The Mesh Data boolean
@@ -902,29 +782,33 @@ declare const mPlutusBSArrayToString: (bsArray: string[]) => string;
902
782
  /**
903
783
  * The Plutus Data constructor object, representing custom data type in JSON
904
784
  */
905
- type ConStr<T = any> = {
906
- constructor: number;
785
+ type ConStr<N = 0, T = any> = {
786
+ constructor: N;
907
787
  fields: T;
908
788
  };
909
789
  /**
910
790
  * The Plutus Data index 0 constructor object, representing custom data type in JSON
911
791
  */
912
- type ConStr0<T = any> = ConStr<T>;
792
+ type ConStr0<T = any> = ConStr<0, T>;
913
793
  /**
914
794
  * The Plutus Data index 1 constructor object, representing custom data type in JSON
915
795
  */
916
- type ConStr1<T = any> = ConStr<T>;
796
+ type ConStr1<T = any> = ConStr<1, T>;
917
797
  /**
918
798
  * The Plutus Data index 2 constructor object, representing custom data type in JSON
919
799
  */
920
- type ConStr2<T = any> = ConStr<T>;
800
+ type ConStr2<T = any> = ConStr<2, T>;
801
+ /**
802
+ * The Plutus Data index 3 constructor object, representing custom data type in JSON
803
+ */
804
+ type ConStr3<T = any> = ConStr<3, T>;
921
805
  /**
922
806
  * The utility function to create a Plutus Data constructor object, representing custom data type in JSON
923
807
  * @param constructor The constructor index number
924
808
  * @param fields The items in array
925
809
  * @returns The Plutus Data constructor object
926
810
  */
927
- declare const conStr: <T>(constructor: number, fields: T) => ConStr<T>;
811
+ declare const conStr: <N extends number, T>(constructor: N, fields: T) => ConStr<N, T>;
928
812
  /**
929
813
  * The utility function to create a Plutus Data index 0 constructor object, representing custom data type in JSON
930
814
  * @param fields The items of in array
@@ -943,6 +827,12 @@ declare const conStr1: <T>(fields: T) => ConStr1<T>;
943
827
  * @returns The Plutus Data constructor object
944
828
  */
945
829
  declare const conStr2: <T>(fields: T) => ConStr2<T>;
830
+ /**
831
+ * The utility function to create a Plutus Data index 3 constructor object, representing custom data type in JSON
832
+ * @param fields The items of in array
833
+ * @returns The Plutus Data constructor object
834
+ */
835
+ declare const conStr3: <T>(fields: T) => ConStr3<T>;
946
836
 
947
837
  /**
948
838
  * The Plutus Data boolean in JSON
@@ -1112,6 +1002,21 @@ type Dict<V> = {
1112
1002
  type Tuple<K, V> = {
1113
1003
  list: [K, V];
1114
1004
  };
1005
+ /**
1006
+ * Aiken alias
1007
+ * The Plutus Data Option in JSON
1008
+ */
1009
+ type Option<T> = Some<T> | None;
1010
+ /**
1011
+ * Aiken alias
1012
+ * The Plutus Data Option - Some in JSON
1013
+ */
1014
+ type Some<T> = ConStr0<[T]>;
1015
+ /**
1016
+ * Aiken alias
1017
+ * The Plutus Data Option - None in JSON
1018
+ */
1019
+ type None = ConStr1<[]>;
1115
1020
  /**
1116
1021
  * Internal utility function to create a Plutus Data byte string in JSON, checking correct length
1117
1022
  * @param bytes The byte string in hex
@@ -1196,6 +1101,23 @@ declare const dict: <V>(itemsMap: [ByteString, V][]) => Dict<V>;
1196
1101
  * @returns The Plutus Data tuple object
1197
1102
  */
1198
1103
  declare const tuple: <K = PlutusData, V = PlutusData>(key: K, value: V) => Tuple<K, V>;
1104
+ /**
1105
+ * The utility function to create a Plutus Data Option in JSON
1106
+ * @param value The optional value of the option
1107
+ * @returns Return None constructor if the value is not provided, otherwise return Some constructor with the value
1108
+ */
1109
+ declare const option: <T>(value?: T) => Option<T>;
1110
+ /**
1111
+ * The utility function to create a Plutus Data Option - Some in JSON
1112
+ * @param value The value of the option
1113
+ * @returns The Plutus Data Option - Some object
1114
+ */
1115
+ declare const some: <T>(value: T) => Some<T>;
1116
+ /**
1117
+ * The utility function to create a Plutus Data Option - None in JSON
1118
+ * @returns The Plutus Data Option - None object
1119
+ */
1120
+ declare const none: () => None;
1199
1121
 
1200
1122
  /**
1201
1123
  * The Plutus Data staking credential in JSON
@@ -1212,26 +1134,26 @@ type ScriptAddress = ConStr0<[ConStr1<[ScriptHash]>, MaybeStakingHash]>;
1212
1134
  /**
1213
1135
  * The utility function to create a Plutus Data staking hash in JSON
1214
1136
  * @param stakeCredential The staking credential in hex
1215
- * @param isScriptCredential The flag to indicate if the credential is a script credential
1137
+ * @param isStakeScriptCredential The flag to indicate if the credential is a script credential
1216
1138
  * @returns The Plutus Data staking hash object
1217
1139
  */
1218
- declare const maybeStakingHash: (stakeCredential: string, isScriptCredential?: boolean) => MaybeStakingHash;
1140
+ declare const maybeStakingHash: (stakeCredential: string, isStakeScriptCredential?: boolean) => MaybeStakingHash;
1219
1141
  /**
1220
1142
  * The utility function to create a Plutus Data public key address in JSON
1221
1143
  * @param bytes The public key hash in hex
1222
1144
  * @param stakeCredential The staking credential in hex
1223
- * @param isScriptCredential The flag to indicate if the credential is a script credential
1145
+ * @param isStakeScriptCredential The flag to indicate if the credential is a script credential
1224
1146
  * @returns The Plutus Data public key address object
1225
1147
  */
1226
- declare const pubKeyAddress: (bytes: string, stakeCredential?: string, isScriptCredential?: boolean) => PubKeyAddress;
1148
+ declare const pubKeyAddress: (bytes: string, stakeCredential?: string, isStakeScriptCredential?: boolean) => PubKeyAddress;
1227
1149
  /**
1228
1150
  * The utility function to create a Plutus Data script address in JSON
1229
1151
  * @param bytes The validator hash in hex
1230
1152
  * @param stakeCredential The staking credential in hex
1231
- * @param isScriptCredential The flag to indicate if the credential is a script credential
1153
+ * @param isStakeScriptCredential The flag to indicate if the stake credential is a script credential
1232
1154
  * @returns The Plutus Data script address object
1233
1155
  */
1234
- declare const scriptAddress: (bytes: string, stakeCredential?: string, isScriptCredential?: boolean) => ScriptAddress;
1156
+ declare const scriptAddress: (bytes: string, stakeCredential?: string, isStakeScriptCredential?: boolean) => ScriptAddress;
1235
1157
 
1236
1158
  type PlutusData = ConStr | Bool | ByteString | Integer | List | AssocMap | MaybeStakingHash | PubKeyAddress | ScriptAddress | AssetClass | OutputReference | PubKeyHash | POSIXTime | Dict<any> | Tuple<any, any>;
1237
1159
 
@@ -1455,6 +1377,201 @@ declare class MeshValue {
1455
1377
  toJSON: () => Value;
1456
1378
  }
1457
1379
 
1380
+ type PlutusDataType = "Mesh" | "JSON" | "CBOR";
1381
+
1382
+ interface IMintingBlueprint {
1383
+ version: LanguageVersion;
1384
+ cbor: string;
1385
+ hash: string;
1386
+ paramScript(compiledCode: string, params: string[], paramsType: PlutusDataType): this;
1387
+ noParamScript(compiledCode: string): this;
1388
+ }
1389
+
1390
+ interface ISpendingBlueprint {
1391
+ version: LanguageVersion;
1392
+ networkId: number;
1393
+ cbor: string;
1394
+ hash: string;
1395
+ address: string;
1396
+ stakeHash?: string;
1397
+ isStakeScriptCredential: boolean;
1398
+ paramScript(compiledCode: string, params: string[], paramsType: PlutusDataType): this;
1399
+ noParamScript(compiledCode: string): this;
1400
+ }
1401
+
1402
+ interface IWithdrawalBlueprint {
1403
+ version: LanguageVersion;
1404
+ networkId: number;
1405
+ cbor: string;
1406
+ hash: string;
1407
+ address: string;
1408
+ isStakeScriptCredential: boolean;
1409
+ paramScript(compiledCode: string, params: string[], paramsType: PlutusDataType): this;
1410
+ noParamScript(compiledCode: string): this;
1411
+ }
1412
+
1413
+ declare const DEFAULT_PROTOCOL_PARAMETERS: Protocol;
1414
+ declare const DREP_DEPOSIT = "500000000";
1415
+ declare const resolveTxFees: (txSize: number, minFeeA?: number, minFeeB?: number) => string;
1416
+
1417
+ declare const SUPPORTED_WALLETS: string[];
1418
+
1419
+ declare const DEFAULT_V1_COST_MODEL_LIST: number[];
1420
+ declare const DEFAULT_V2_COST_MODEL_LIST: number[];
1421
+
1422
+ declare const SUPPORTED_LANGUAGE_VIEWS: Record<Era, Partial<Record<keyof typeof LANGUAGE_VERSIONS, string>>>;
1423
+ declare const resolveLanguageView: (era: Era, version: LanguageVersion) => string | undefined;
1424
+
1425
+ declare const DEFAULT_REDEEMER_BUDGET: Budget;
1426
+ declare const POLICY_ID_LENGTH = 56;
1427
+ declare const LANGUAGE_VERSIONS: {
1428
+ V1: string;
1429
+ V2: string;
1430
+ V3: string;
1431
+ };
1432
+ declare const HARDENED_KEY_START = 2147483648;
1433
+ declare const SUPPORTED_CLOCKS: Record<Network, [
1434
+ epoch: string,
1435
+ slot: string,
1436
+ systemStart: string,
1437
+ epochLength: string
1438
+ ]>;
1439
+ declare const SUPPORTED_HANDLES: Record<number, string>;
1440
+ declare const SUPPORTED_OGMIOS_LINKS: Record<Network, string>;
1441
+ declare const SUPPORTED_TOKENS: {
1442
+ LQ: string;
1443
+ MIN: string;
1444
+ NTX: string;
1445
+ iBTC: string;
1446
+ iETH: string;
1447
+ iUSD: string;
1448
+ MILK: string;
1449
+ AGIX: string;
1450
+ MELD: string;
1451
+ INDY: string;
1452
+ CLAY: string;
1453
+ MCOS: string;
1454
+ DING: string;
1455
+ GERO: string;
1456
+ NMKR: string;
1457
+ PAVIA: string;
1458
+ HOSKY: string;
1459
+ YUMMI: string;
1460
+ C3: string;
1461
+ GIMBAL: string;
1462
+ SUNDAE: string;
1463
+ GREENS: string;
1464
+ GENS: string;
1465
+ SOCIETY: string;
1466
+ DJED: string;
1467
+ SHEN: string;
1468
+ WMT: string;
1469
+ COPI: string;
1470
+ };
1471
+ /**
1472
+ * The utility function to append the bytes for CIP-68 100 token in front of the token hex
1473
+ * @param tokenNameHex The hex of the token name
1474
+ * @returns The hex of the token name with the CIP-68 100 bytes appended
1475
+ */
1476
+ declare const CIP68_100: (tokenNameHex: string) => string;
1477
+ /**
1478
+ * The utility function to append the bytes for CIP-68 222 token in front of the token hex
1479
+ * @param tokenNameHex The hex of the token name
1480
+ * @returns The hex of the token name with the CIP-68 222 bytes appended
1481
+ */
1482
+ declare const CIP68_222: (tokenNameHex: string) => string;
1483
+
1484
+ /**
1485
+ * Fetcher interface defines end points to query blockchain data.
1486
+ */
1487
+ interface IFetcher {
1488
+ fetchAccountInfo(address: string): Promise<AccountInfo>;
1489
+ fetchAddressUTxOs(address: string, asset?: string): Promise<UTxO[]>;
1490
+ fetchAssetAddresses(asset: string): Promise<{
1491
+ address: string;
1492
+ quantity: string;
1493
+ }[]>;
1494
+ fetchAssetMetadata(asset: string): Promise<AssetMetadata>;
1495
+ fetchBlockInfo(hash: string): Promise<BlockInfo>;
1496
+ fetchCollectionAssets(policyId: string, cursor?: number | string): Promise<{
1497
+ assets: Asset[];
1498
+ next?: string | number | null;
1499
+ }>;
1500
+ fetchHandle(handle: string): Promise<object>;
1501
+ fetchHandleAddress(handle: string): Promise<string>;
1502
+ fetchProtocolParameters(epoch: number): Promise<Protocol>;
1503
+ fetchTxInfo(hash: string): Promise<TransactionInfo>;
1504
+ fetchUTxOs(hash: string, index?: number): Promise<UTxO[]>;
1505
+ get(url: string): Promise<any>;
1506
+ }
1507
+
1508
+ interface IInitiator {
1509
+ getChangeAddress(): SometimesPromise$1<string>;
1510
+ getCollateral(): SometimesPromise$1<UTxO[]>;
1511
+ getUtxos(): SometimesPromise$1<UTxO[]>;
1512
+ }
1513
+ type SometimesPromise$1<T> = Promise<T> | T;
1514
+
1515
+ interface IListener {
1516
+ onTxConfirmed(txHash: string, callback: () => void, limit?: number): void;
1517
+ }
1518
+
1519
+ interface ISubmitter {
1520
+ submitTx(tx: string): Promise<string>;
1521
+ }
1522
+
1523
+ interface IMeshTxSerializer {
1524
+ verbose: boolean;
1525
+ serializeTxBody(txBuilderBody: MeshTxBuilderBody, protocolParams: Protocol): string;
1526
+ addSigningKeys(txHex: string, signingKeys: string[]): string;
1527
+ resolver: IResolver;
1528
+ deserializer: IDeserializer;
1529
+ serializeData(data: BuilderData): string;
1530
+ serializeAddress(address: DeserializedAddress, networkId?: 0 | 1): string;
1531
+ serializePoolId(hash: string): string;
1532
+ serializeRewardAddress(stakeKeyHash: string, isScriptHash?: boolean, network_id?: 0 | 1): string;
1533
+ }
1534
+ interface IResolver {
1535
+ keys: {
1536
+ resolvePrivateKey(words: string[]): string;
1537
+ resolveRewardAddress(bech32: string): string;
1538
+ resolveEd25519KeyHash(bech32: string): string;
1539
+ resolveStakeKeyHash(bech32: string): string;
1540
+ };
1541
+ tx: {
1542
+ resolveTxHash(txHex: string): string;
1543
+ };
1544
+ data: {
1545
+ resolveDataHash(data: Data): string;
1546
+ };
1547
+ script: {
1548
+ resolveScriptRef(script: NativeScript | PlutusScript): string;
1549
+ };
1550
+ }
1551
+ interface IDeserializer {
1552
+ key: {
1553
+ deserializeAddress(bech32: string): DeserializedAddress;
1554
+ };
1555
+ script: {
1556
+ deserializeNativeScript(script: NativeScript): DeserializedScript;
1557
+ deserializePlutusScript(script: PlutusScript): DeserializedScript;
1558
+ };
1559
+ cert: {
1560
+ deserializePoolId(poolId: string): string;
1561
+ };
1562
+ }
1563
+
1564
+ interface ISigner {
1565
+ signData(address: string, payload: string): SometimesPromise<DataSignature>;
1566
+ signTx(unsignedTx: string, partialSign: boolean): SometimesPromise<string>;
1567
+ signTxs(unsignedTxs: string[], partialSign: boolean): SometimesPromise<string[]>;
1568
+ }
1569
+ type SometimesPromise<T> = Promise<T> | T;
1570
+
1571
+ interface IEvaluator {
1572
+ evaluateTx(tx: string): Promise<Omit<Action, "data">[]>;
1573
+ }
1574
+
1458
1575
  declare const resolveFingerprint: (policyId: string, assetName: string) => string;
1459
1576
  declare class AssetFingerprint {
1460
1577
  readonly hashBuf: Uint8Array;
@@ -1486,4 +1603,4 @@ declare const hashDrepAnchor: (jsonLD: object) => string;
1486
1603
 
1487
1604
  declare function getFile(url: string): string;
1488
1605
 
1489
- 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 CurrencySymbol, DEFAULT_PROTOCOL_PARAMETERS, DEFAULT_REDEEMER_BUDGET, DEFAULT_V1_COST_MODEL_LIST, DEFAULT_V2_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, HARDENED_KEY_START, type IDeserializer, type IEvaluator, type IFetcher, type IInitiator, type IListener, type IMeshTxSerializer, type IResolver, type ISigner, type ISubmitter, type ImageAssetMetadata, type Integer, LANGUAGE_VERSIONS, type LanguageVersion, type List, type MAssetClass, type MBool, type MConStr, type MConStr0, type MConStr1, type MConStr2, type MMaybeStakingHash, type MOutputReference, type MPubKeyAddress, type MScriptAddress, type MTuple, type MTxOutRef, type MValue, type MaybeStakingHash, type MeshTxBuilderBody, MeshValue, type Message, type Metadata, type Mint, type MintItem, type NativeScript, type Network, type NonFungibleAssetMetadata, type Output, type OutputReference, POLICY_ID_LENGTH, type POSIXTime, type PlutusData, 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 Token, type TokenName, type TransactionInfo, type Tuple, type TxIn, type TxInParameter, 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, currencySymbol, dict, emptyTxBuilderBody, experimentalSelectUtxos, fromUTF8, fungibleAssetKeys, getFile, hashByteString, hashDrepAnchor, hexToBytes, hexToString, integer, isNetwork, keepRelevant, largestFirst, largestFirstMultiAsset, list, mAssetClass, mBool, mConStr, mConStr0, mConStr1, mConStr2, mMaybeStakingHash, mOutputReference, mPlutusBSArrayToString, mPubKeyAddress, mScriptAddress, mStringToPlutusBSArray, mTuple, mTxOutRef, mValue, maybeStakingHash, mergeAssets, metadataStandardKeys, metadataToCip68, outputReference, parseAssetUnit, plutusBSArrayToString, policyId, posixTime, pubKeyAddress, pubKeyHash, resolveEpochNo, resolveFingerprint, resolveLanguageView, resolveSlotNo, resolveTxFees, royaltiesStandardKeys, scriptAddress, scriptHash, slotToBeginUnixTime, stringToBSArray, stringToHex, toBytes, toUTF8, tokenName, tuple, txOutRef, unixTimeToEnclosingSlot, validityRangeToObj, value };
1606
+ 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, DREP_DEPOSIT, type DRep, type Data, type DataSignature, type DatumSource, type DeserializedAddress, type DeserializedScript, type Dict, type DictItem, type Era, type Files, type FungibleAssetMetadata, 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 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 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 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, txOutRef, unixTimeToEnclosingSlot, validityRangeToObj, value };