@meshsdk/contract 1.9.0-beta.102 → 1.9.0-beta.103

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
@@ -1,5 +1,5 @@
1
1
  import * as _meshsdk_common from '@meshsdk/common';
2
- import { ConStr1, PubKeyAddress, Value, ConStr0 as ConStr0$1, Integer as Integer$1, CurrencySymbol, TokenName, AssetMetadata, Asset as Asset$1, UTxO as UTxO$1, BuiltinByteString as BuiltinByteString$1 } from '@meshsdk/common';
2
+ import { ConStr0 as ConStr0$1, PubKeyAddress, Value, ConStr1, Integer as Integer$1, CurrencySymbol, TokenName, AssetMetadata, Asset as Asset$1, UTxO as UTxO$1, BuiltinByteString as BuiltinByteString$1, PlutusScript, TxInput as TxInput$1 } from '@meshsdk/common';
3
3
  import { MeshTxBuilder, IFetcher, IWallet, LanguageVersion, UTxO, ConStr0, BuiltinByteString, ScriptAddress, Integer, NativeScript, Asset } from '@meshsdk/core';
4
4
 
5
5
  type MeshTxInitiatorInput = {
@@ -531,4 +531,157 @@ declare class MeshVestingContract extends MeshTxInitiator {
531
531
  getUtxoByTxHash: (txHash: string) => Promise<UTxO | undefined>;
532
532
  }
533
533
 
534
- export { type ActiveEscrowDatum, type HelloWorldDatum, type InitiationDatum, type MarketplaceDatum, MeshContentOwnershipContract, MeshEscrowContract, MeshGiftCardContract, MeshHelloWorldContract, MeshMarketplaceContract, MeshPaymentSplitterContract, MeshPlutusNFTContract, MeshSwapContract, MeshVestingContract, type RecipientDepositRedeemer, type SwapDatum, type VestingDatum, activeEscrowDatum, initiateEscrowDatum, marketplaceDatum, recipientDepositRedeemer };
534
+ type smartWalletAddress = string & {
535
+ readonly __brand: "SmartWalletAddress";
536
+ };
537
+ type stakeCredential = string & {
538
+ readonly __brand: "StakeCredential";
539
+ };
540
+ type BlacklistDatum = {
541
+ key: string;
542
+ next: string;
543
+ };
544
+ type RegistryCredential = {
545
+ hash: string;
546
+ index: number;
547
+ };
548
+ type RegistryDatum = {
549
+ key: string;
550
+ next: string;
551
+ transferScript: RegistryCredential;
552
+ thirdPartyScript: RegistryCredential;
553
+ metadata: string;
554
+ };
555
+ type TxInput = {
556
+ txHash: string;
557
+ outputIndex: number;
558
+ };
559
+ type ProtocolParams = {
560
+ txInput: TxInput;
561
+ scriptHash: string;
562
+ alwaysFailScriptHash: string;
563
+ };
564
+ type ProgrammableLogicGlobalParams = {
565
+ protocolParamsScriptHash: string;
566
+ scriptHash: string;
567
+ };
568
+ type ProgrammableLogicBaseParams = {
569
+ programmableLogicGlobalScriptHash: string;
570
+ scriptHash: string;
571
+ };
572
+ type IssuanceParams = {
573
+ txInput: TxInput;
574
+ scriptHash: string;
575
+ alwaysFailScriptHash: string;
576
+ };
577
+ type DirectoryMintParams = {
578
+ txInput: TxInput;
579
+ issuanceScriptHash: string;
580
+ scriptHash: string;
581
+ };
582
+ type DirectorySpendParams = {
583
+ protocolParamsPolicyId: string;
584
+ scriptHash: string;
585
+ };
586
+ type BlacklistMintBootstrap = {
587
+ txInput: TxInput;
588
+ adminPubKeyHash: string;
589
+ scriptHash: string;
590
+ };
591
+ type BlacklistSpendBootstrap = {
592
+ blacklistMintScriptHash: string;
593
+ scriptHash: string;
594
+ };
595
+ type BlacklistBootstrap = {
596
+ blacklistMintBootstrap: BlacklistMintBootstrap;
597
+ blacklistSpendBootstrap: BlacklistSpendBootstrap;
598
+ };
599
+ type ProtocolBootstrapParams = {
600
+ protocolParams: ProtocolParams;
601
+ programmableLogicGlobalPrams: ProgrammableLogicGlobalParams;
602
+ programmableLogicBaseParams: ProgrammableLogicBaseParams;
603
+ issuanceParams: IssuanceParams;
604
+ directoryMintParams: DirectoryMintParams;
605
+ directorySpendParams: DirectorySpendParams;
606
+ programmableBaseRefInput: TxInput;
607
+ programmableGlobalRefInput: TxInput;
608
+ txHash: string;
609
+ };
610
+ type TokenScripts = {
611
+ mintingLogic: PlutusScript;
612
+ transferLogic: PlutusScript;
613
+ globalStateLogic?: PlutusScript;
614
+ thirdPartyLogic?: PlutusScript;
615
+ };
616
+ type RegisterTokenParams = {
617
+ assetName: string;
618
+ scripts: TokenScripts;
619
+ transferRedeemerValue: any;
620
+ recipientAddress?: string;
621
+ };
622
+ type MintTokensParams = {
623
+ assetName: string;
624
+ scripts: {
625
+ mintingLogic: PlutusScript;
626
+ transferLogic: PlutusScript;
627
+ };
628
+ transferRedeemerValue: any;
629
+ recipientAddress?: string | null;
630
+ };
631
+ type TransferTokenParams = {
632
+ unit: string;
633
+ quantity: string;
634
+ recipientAddress: string;
635
+ transferLogic: PlutusScript;
636
+ transferRedeemerValue: any;
637
+ };
638
+
639
+ declare class ProgrammableTokenContract extends MeshTxInitiator {
640
+ private inputs;
641
+ private _blacklistBootstrap;
642
+ private _params;
643
+ constructor(inputs: MeshTxInitiatorInput, blacklistBootstrap?: BlacklistBootstrap);
644
+ get protocolParams(): ProtocolBootstrapParams;
645
+ mintToken: (assetName: string, quantity: string, issuerAdminPkh: string, recepientSmartAddress: smartWalletAddress) => Promise<string>;
646
+ burnToken: (assetName: string, quantity: string, txhash: string, outputIndex: number, issuerAdminPkh: string) => Promise<string>;
647
+ transferToken: (unit: string, quantity: string, senderSmartWallet: smartWalletAddress, recipientSmartWallet: smartWalletAddress) => Promise<string>;
648
+ blacklistSmartWalletAddress: (smartWalletAddress: smartWalletAddress) => Promise<string>;
649
+ whitelistSmartWalletAddress: (smartWalletAddress: smartWalletAddress) => Promise<string>;
650
+ seizeToken: (unit: string, txHash: string, outputIndex: number, issuerAdminPkh: string, recipientSmartWallet: smartWalletAddress) => Promise<string>;
651
+ initializeBlacklist: (adminPubKeyHash: string) => Promise<{
652
+ txHex: string;
653
+ bootstrap: BlacklistBootstrap;
654
+ }>;
655
+ }
656
+
657
+ /**
658
+ * Resolves the programmable smart wallet address for a given base address.
659
+ */
660
+ declare const resolveSmartWalletAddress: (address: string, networkId: 0 | 1) => Promise<smartWalletAddress>;
661
+ /**
662
+ * Resolves the stake credential hash from a bech32 address.
663
+ */
664
+ declare const resolveStakeCredential: (address: string) => stakeCredential;
665
+ /**
666
+ * Resolves the blacklist mint and spend scripts.
667
+ */
668
+ declare function resolveBlacklistScripts(networkId: 0 | 1, blacklistMintBootstrapTxInput: TxInput$1, blacklistAdminPkh: string): Promise<{
669
+ blacklistMint: {
670
+ cbor: string;
671
+ plutusScript: _meshsdk_common.PlutusScript;
672
+ policyId: string;
673
+ rewardAddress: any;
674
+ };
675
+ blacklistSpend: {
676
+ cbor: string;
677
+ plutusScript: _meshsdk_common.PlutusScript;
678
+ address: any;
679
+ policyId: string;
680
+ };
681
+ }>;
682
+ /**
683
+ * Resolves the blacklist script address.
684
+ */
685
+ declare const resolveBlacklistAddress: (blacklistMintScriptHash: string, networkId: number) => Promise<string>;
686
+
687
+ export { type ActiveEscrowDatum, type BlacklistBootstrap, type BlacklistDatum, type BlacklistMintBootstrap, type BlacklistSpendBootstrap, type DirectoryMintParams, type DirectorySpendParams, type HelloWorldDatum, type InitiationDatum, type IssuanceParams, type MarketplaceDatum, MeshContentOwnershipContract, MeshEscrowContract, MeshGiftCardContract, MeshHelloWorldContract, MeshMarketplaceContract, MeshPaymentSplitterContract, MeshPlutusNFTContract, MeshSwapContract, MeshVestingContract, type MintTokensParams, type ProgrammableLogicBaseParams, type ProgrammableLogicGlobalParams, ProgrammableTokenContract, type ProtocolBootstrapParams, type ProtocolParams, type RecipientDepositRedeemer, type RegisterTokenParams, type RegistryCredential, type RegistryDatum, type SwapDatum, type TokenScripts, type TransferTokenParams, type TxInput, type VestingDatum, activeEscrowDatum, initiateEscrowDatum, marketplaceDatum, recipientDepositRedeemer, resolveBlacklistAddress, resolveBlacklistScripts, resolveSmartWalletAddress, resolveStakeCredential, type smartWalletAddress, type stakeCredential };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _meshsdk_common from '@meshsdk/common';
2
- import { ConStr1, PubKeyAddress, Value, ConStr0 as ConStr0$1, Integer as Integer$1, CurrencySymbol, TokenName, AssetMetadata, Asset as Asset$1, UTxO as UTxO$1, BuiltinByteString as BuiltinByteString$1 } from '@meshsdk/common';
2
+ import { ConStr0 as ConStr0$1, PubKeyAddress, Value, ConStr1, Integer as Integer$1, CurrencySymbol, TokenName, AssetMetadata, Asset as Asset$1, UTxO as UTxO$1, BuiltinByteString as BuiltinByteString$1, PlutusScript, TxInput as TxInput$1 } from '@meshsdk/common';
3
3
  import { MeshTxBuilder, IFetcher, IWallet, LanguageVersion, UTxO, ConStr0, BuiltinByteString, ScriptAddress, Integer, NativeScript, Asset } from '@meshsdk/core';
4
4
 
5
5
  type MeshTxInitiatorInput = {
@@ -531,4 +531,157 @@ declare class MeshVestingContract extends MeshTxInitiator {
531
531
  getUtxoByTxHash: (txHash: string) => Promise<UTxO | undefined>;
532
532
  }
533
533
 
534
- export { type ActiveEscrowDatum, type HelloWorldDatum, type InitiationDatum, type MarketplaceDatum, MeshContentOwnershipContract, MeshEscrowContract, MeshGiftCardContract, MeshHelloWorldContract, MeshMarketplaceContract, MeshPaymentSplitterContract, MeshPlutusNFTContract, MeshSwapContract, MeshVestingContract, type RecipientDepositRedeemer, type SwapDatum, type VestingDatum, activeEscrowDatum, initiateEscrowDatum, marketplaceDatum, recipientDepositRedeemer };
534
+ type smartWalletAddress = string & {
535
+ readonly __brand: "SmartWalletAddress";
536
+ };
537
+ type stakeCredential = string & {
538
+ readonly __brand: "StakeCredential";
539
+ };
540
+ type BlacklistDatum = {
541
+ key: string;
542
+ next: string;
543
+ };
544
+ type RegistryCredential = {
545
+ hash: string;
546
+ index: number;
547
+ };
548
+ type RegistryDatum = {
549
+ key: string;
550
+ next: string;
551
+ transferScript: RegistryCredential;
552
+ thirdPartyScript: RegistryCredential;
553
+ metadata: string;
554
+ };
555
+ type TxInput = {
556
+ txHash: string;
557
+ outputIndex: number;
558
+ };
559
+ type ProtocolParams = {
560
+ txInput: TxInput;
561
+ scriptHash: string;
562
+ alwaysFailScriptHash: string;
563
+ };
564
+ type ProgrammableLogicGlobalParams = {
565
+ protocolParamsScriptHash: string;
566
+ scriptHash: string;
567
+ };
568
+ type ProgrammableLogicBaseParams = {
569
+ programmableLogicGlobalScriptHash: string;
570
+ scriptHash: string;
571
+ };
572
+ type IssuanceParams = {
573
+ txInput: TxInput;
574
+ scriptHash: string;
575
+ alwaysFailScriptHash: string;
576
+ };
577
+ type DirectoryMintParams = {
578
+ txInput: TxInput;
579
+ issuanceScriptHash: string;
580
+ scriptHash: string;
581
+ };
582
+ type DirectorySpendParams = {
583
+ protocolParamsPolicyId: string;
584
+ scriptHash: string;
585
+ };
586
+ type BlacklistMintBootstrap = {
587
+ txInput: TxInput;
588
+ adminPubKeyHash: string;
589
+ scriptHash: string;
590
+ };
591
+ type BlacklistSpendBootstrap = {
592
+ blacklistMintScriptHash: string;
593
+ scriptHash: string;
594
+ };
595
+ type BlacklistBootstrap = {
596
+ blacklistMintBootstrap: BlacklistMintBootstrap;
597
+ blacklistSpendBootstrap: BlacklistSpendBootstrap;
598
+ };
599
+ type ProtocolBootstrapParams = {
600
+ protocolParams: ProtocolParams;
601
+ programmableLogicGlobalPrams: ProgrammableLogicGlobalParams;
602
+ programmableLogicBaseParams: ProgrammableLogicBaseParams;
603
+ issuanceParams: IssuanceParams;
604
+ directoryMintParams: DirectoryMintParams;
605
+ directorySpendParams: DirectorySpendParams;
606
+ programmableBaseRefInput: TxInput;
607
+ programmableGlobalRefInput: TxInput;
608
+ txHash: string;
609
+ };
610
+ type TokenScripts = {
611
+ mintingLogic: PlutusScript;
612
+ transferLogic: PlutusScript;
613
+ globalStateLogic?: PlutusScript;
614
+ thirdPartyLogic?: PlutusScript;
615
+ };
616
+ type RegisterTokenParams = {
617
+ assetName: string;
618
+ scripts: TokenScripts;
619
+ transferRedeemerValue: any;
620
+ recipientAddress?: string;
621
+ };
622
+ type MintTokensParams = {
623
+ assetName: string;
624
+ scripts: {
625
+ mintingLogic: PlutusScript;
626
+ transferLogic: PlutusScript;
627
+ };
628
+ transferRedeemerValue: any;
629
+ recipientAddress?: string | null;
630
+ };
631
+ type TransferTokenParams = {
632
+ unit: string;
633
+ quantity: string;
634
+ recipientAddress: string;
635
+ transferLogic: PlutusScript;
636
+ transferRedeemerValue: any;
637
+ };
638
+
639
+ declare class ProgrammableTokenContract extends MeshTxInitiator {
640
+ private inputs;
641
+ private _blacklistBootstrap;
642
+ private _params;
643
+ constructor(inputs: MeshTxInitiatorInput, blacklistBootstrap?: BlacklistBootstrap);
644
+ get protocolParams(): ProtocolBootstrapParams;
645
+ mintToken: (assetName: string, quantity: string, issuerAdminPkh: string, recepientSmartAddress: smartWalletAddress) => Promise<string>;
646
+ burnToken: (assetName: string, quantity: string, txhash: string, outputIndex: number, issuerAdminPkh: string) => Promise<string>;
647
+ transferToken: (unit: string, quantity: string, senderSmartWallet: smartWalletAddress, recipientSmartWallet: smartWalletAddress) => Promise<string>;
648
+ blacklistSmartWalletAddress: (smartWalletAddress: smartWalletAddress) => Promise<string>;
649
+ whitelistSmartWalletAddress: (smartWalletAddress: smartWalletAddress) => Promise<string>;
650
+ seizeToken: (unit: string, txHash: string, outputIndex: number, issuerAdminPkh: string, recipientSmartWallet: smartWalletAddress) => Promise<string>;
651
+ initializeBlacklist: (adminPubKeyHash: string) => Promise<{
652
+ txHex: string;
653
+ bootstrap: BlacklistBootstrap;
654
+ }>;
655
+ }
656
+
657
+ /**
658
+ * Resolves the programmable smart wallet address for a given base address.
659
+ */
660
+ declare const resolveSmartWalletAddress: (address: string, networkId: 0 | 1) => Promise<smartWalletAddress>;
661
+ /**
662
+ * Resolves the stake credential hash from a bech32 address.
663
+ */
664
+ declare const resolveStakeCredential: (address: string) => stakeCredential;
665
+ /**
666
+ * Resolves the blacklist mint and spend scripts.
667
+ */
668
+ declare function resolveBlacklistScripts(networkId: 0 | 1, blacklistMintBootstrapTxInput: TxInput$1, blacklistAdminPkh: string): Promise<{
669
+ blacklistMint: {
670
+ cbor: string;
671
+ plutusScript: _meshsdk_common.PlutusScript;
672
+ policyId: string;
673
+ rewardAddress: any;
674
+ };
675
+ blacklistSpend: {
676
+ cbor: string;
677
+ plutusScript: _meshsdk_common.PlutusScript;
678
+ address: any;
679
+ policyId: string;
680
+ };
681
+ }>;
682
+ /**
683
+ * Resolves the blacklist script address.
684
+ */
685
+ declare const resolveBlacklistAddress: (blacklistMintScriptHash: string, networkId: number) => Promise<string>;
686
+
687
+ export { type ActiveEscrowDatum, type BlacklistBootstrap, type BlacklistDatum, type BlacklistMintBootstrap, type BlacklistSpendBootstrap, type DirectoryMintParams, type DirectorySpendParams, type HelloWorldDatum, type InitiationDatum, type IssuanceParams, type MarketplaceDatum, MeshContentOwnershipContract, MeshEscrowContract, MeshGiftCardContract, MeshHelloWorldContract, MeshMarketplaceContract, MeshPaymentSplitterContract, MeshPlutusNFTContract, MeshSwapContract, MeshVestingContract, type MintTokensParams, type ProgrammableLogicBaseParams, type ProgrammableLogicGlobalParams, ProgrammableTokenContract, type ProtocolBootstrapParams, type ProtocolParams, type RecipientDepositRedeemer, type RegisterTokenParams, type RegistryCredential, type RegistryDatum, type SwapDatum, type TokenScripts, type TransferTokenParams, type TxInput, type VestingDatum, activeEscrowDatum, initiateEscrowDatum, marketplaceDatum, recipientDepositRedeemer, resolveBlacklistAddress, resolveBlacklistScripts, resolveSmartWalletAddress, resolveStakeCredential, type smartWalletAddress, type stakeCredential };