"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
    for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Order = exports.ModuleName = exports.TxTags = exports.CalendarUnit = exports.TransferRestrictionType = exports.TransactionArgumentType = exports.PermissionGroupType = exports.PermissionType = exports.TxGroup = exports.SignerType = exports.PayingAccountType = exports.TransferError = exports.TransferStatus = exports.ErrorCode = exports.ConditionType = exports.ClaimType = exports.ScopeType = exports.ConditionTarget = exports.AuthorizationType = exports.SecurityIdentifierType = exports.KnownAssetType = exports.RoleType = exports.TransactionQueueStatus = exports.TransactionStatus = void 0;
const types_1 = require("../polkadot/types");
Object.defineProperty(exports, "ModuleName", { enumerable: true, get: function () { return types_1.ModuleName; } });
Object.defineProperty(exports, "TxTags", { enumerable: true, get: function () { return types_1.TxTags; } });
__exportStar(require("../generated/types"), exports);
var TransactionStatus;
(function (TransactionStatus) {
    /**
     * the transaction is prepped to run
     */
    TransactionStatus["Idle"] = "Idle";
    /**
     * the transaction is waiting for the user's signature
     */
    TransactionStatus["Unapproved"] = "Unapproved";
    /**
     * the transaction is being executed
     */
    TransactionStatus["Running"] = "Running";
    /**
     * the transaction was rejected by the signer
     */
    TransactionStatus["Rejected"] = "Rejected";
    /**
     * the transaction was run successfully
     */
    TransactionStatus["Succeeded"] = "Succeeded";
    /**
     * the transaction's execution failed due to a revert
     */
    TransactionStatus["Failed"] = "Failed";
    /**
     * the transaction couldn't be broadcast. It was either dropped, usurped or invalidated
     * see https://github.com/paritytech/substrate/blob/master/primitives/transaction-pool/src/pool.rs#L58-L110
     */
    TransactionStatus["Aborted"] = "Aborted";
})(TransactionStatus = exports.TransactionStatus || (exports.TransactionStatus = {}));
var TransactionQueueStatus;
(function (TransactionQueueStatus) {
    /**
     * the queue is prepped to run
     */
    TransactionQueueStatus["Idle"] = "Idle";
    /**
     * transactions in the queue are being executed
     */
    TransactionQueueStatus["Running"] = "Running";
    /**
     * a critical transaction's execution failed.
     * This might mean the transaction was rejected,
     * failed due to a revert or never entered a block
     */
    TransactionQueueStatus["Failed"] = "Failed";
    /**
     * the queue finished running all of its transactions. Non-critical transactions
     * might still have failed
     */
    TransactionQueueStatus["Succeeded"] = "Succeeded";
})(TransactionQueueStatus = exports.TransactionQueueStatus || (exports.TransactionQueueStatus = {}));
// Roles
var RoleType;
(function (RoleType) {
    RoleType["TickerOwner"] = "TickerOwner";
    RoleType["CddProvider"] = "CddProvider";
    RoleType["VenueOwner"] = "VenueOwner";
    RoleType["PortfolioCustodian"] = "PortfolioCustodian";
    RoleType["CorporateActionsAgent"] = "CorporateActionsAgent";
    // eslint-disable-next-line @typescript-eslint/no-shadow
    RoleType["Identity"] = "Identity";
})(RoleType = exports.RoleType || (exports.RoleType = {}));
var KnownAssetType;
(function (KnownAssetType) {
    KnownAssetType["EquityCommon"] = "EquityCommon";
    KnownAssetType["EquityPreferred"] = "EquityPreferred";
    KnownAssetType["Commodity"] = "Commodity";
    KnownAssetType["FixedIncome"] = "FixedIncome";
    KnownAssetType["Reit"] = "Reit";
    KnownAssetType["Fund"] = "Fund";
    KnownAssetType["RevenueShareAgreement"] = "RevenueShareAgreement";
    KnownAssetType["StructuredProduct"] = "StructuredProduct";
    KnownAssetType["Derivative"] = "Derivative";
    KnownAssetType["StableCoin"] = "StableCoin";
})(KnownAssetType = exports.KnownAssetType || (exports.KnownAssetType = {}));
var SecurityIdentifierType;
(function (SecurityIdentifierType) {
    SecurityIdentifierType["Isin"] = "Isin";
    SecurityIdentifierType["Cusip"] = "Cusip";
    SecurityIdentifierType["Cins"] = "Cins";
    SecurityIdentifierType["Lei"] = "Lei";
})(SecurityIdentifierType = exports.SecurityIdentifierType || (exports.SecurityIdentifierType = {}));
/**
 * Type of Authorization Request
 */
var AuthorizationType;
(function (AuthorizationType) {
    AuthorizationType["AttestPrimaryKeyRotation"] = "AttestPrimaryKeyRotation";
    AuthorizationType["RotatePrimaryKey"] = "RotatePrimaryKey";
    AuthorizationType["TransferTicker"] = "TransferTicker";
    AuthorizationType["AddMultiSigSigner"] = "AddMultiSigSigner";
    AuthorizationType["TransferAssetOwnership"] = "TransferAssetOwnership";
    AuthorizationType["JoinIdentity"] = "JoinIdentity";
    AuthorizationType["PortfolioCustody"] = "PortfolioCustody";
    AuthorizationType["BecomeAgent"] = "BecomeAgent";
    AuthorizationType["AddRelayerPayingKey"] = "AddRelayerPayingKey";
    AuthorizationType["RotatePrimaryKeyToSecondary"] = "RotatePrimaryKeyToSecondary";
})(AuthorizationType = exports.AuthorizationType || (exports.AuthorizationType = {}));
var ConditionTarget;
(function (ConditionTarget) {
    ConditionTarget["Sender"] = "Sender";
    ConditionTarget["Receiver"] = "Receiver";
    ConditionTarget["Both"] = "Both";
})(ConditionTarget = exports.ConditionTarget || (exports.ConditionTarget = {}));
var ScopeType;
(function (ScopeType) {
    // eslint-disable-next-line @typescript-eslint/no-shadow
    ScopeType["Identity"] = "Identity";
    ScopeType["Ticker"] = "Ticker";
    ScopeType["Custom"] = "Custom";
})(ScopeType = exports.ScopeType || (exports.ScopeType = {}));
var ClaimType;
(function (ClaimType) {
    ClaimType["Accredited"] = "Accredited";
    ClaimType["Affiliate"] = "Affiliate";
    ClaimType["BuyLockup"] = "BuyLockup";
    ClaimType["SellLockup"] = "SellLockup";
    ClaimType["CustomerDueDiligence"] = "CustomerDueDiligence";
    ClaimType["KnowYourCustomer"] = "KnowYourCustomer";
    ClaimType["Jurisdiction"] = "Jurisdiction";
    ClaimType["Exempted"] = "Exempted";
    ClaimType["Blocked"] = "Blocked";
    ClaimType["InvestorUniqueness"] = "InvestorUniqueness";
    ClaimType["NoData"] = "NoData";
    ClaimType["InvestorUniquenessV2"] = "InvestorUniquenessV2";
})(ClaimType = exports.ClaimType || (exports.ClaimType = {}));
var ConditionType;
(function (ConditionType) {
    ConditionType["IsPresent"] = "IsPresent";
    ConditionType["IsAbsent"] = "IsAbsent";
    ConditionType["IsAnyOf"] = "IsAnyOf";
    ConditionType["IsNoneOf"] = "IsNoneOf";
    ConditionType["IsExternalAgent"] = "IsExternalAgent";
    ConditionType["IsIdentity"] = "IsIdentity";
})(ConditionType = exports.ConditionType || (exports.ConditionType = {}));
/**
 * Specifies possible types of errors in the SDK
 */
var ErrorCode;
(function (ErrorCode) {
    /**
     * transaction removed from the tx pool
     */
    ErrorCode["TransactionAborted"] = "TransactionAborted";
    /**
     * user rejected the transaction in their wallet
     */
    ErrorCode["TransactionRejectedByUser"] = "TransactionRejectedByUser";
    /**
     * transaction failed due to an on-chain error. This is a business logic error,
     *   and it should be caught by the SDK before being sent to the chain.
     *   Please report it to the Polymath team
     */
    ErrorCode["TransactionReverted"] = "TransactionReverted";
    /**
     * error that should cause termination of the calling application
     */
    ErrorCode["FatalError"] = "FatalError";
    /**
     * user input error. This means that one or more inputs passed by the user
     *   do not conform to expected value ranges or types
     */
    ErrorCode["ValidationError"] = "ValidationError";
    /**
     * user does not have the required roles/permissions to perform an operation
     */
    ErrorCode["NotAuthorized"] = "NotAuthorized";
    /**
     * errors encountered when interacting with the historic data middleware (GQL server)
     */
    ErrorCode["MiddlewareError"] = "MiddlewareError";
    /**
     * the data that is being fetched does not exist on-chain, or relies on non-existent data. There are
     *   some cases where the data did exist at some point, but has been deleted to save storage space
     */
    ErrorCode["DataUnavailable"] = "DataUnavailable";
    /**
     * the data that is being written to the chain is the same data that is already in place. This would result
     *   in a redundant/useless transaction being executed
     */
    ErrorCode["NoDataChange"] = "NoDataChange";
    /**
     * the data that is being written to the chain would result in some limit being exceeded. For example, adding a transfer
     *   restriction when the maximum possible amount has already been added
     */
    ErrorCode["LimitExceeded"] = "LimitExceeded";
    /**
     * one or more base prerequisites for a transaction to be successful haven't been met. For example, reserving a ticker requires
     *   said ticker to not be already reserved. Attempting to reserve a ticker without that prerequisite being met would result in this
     *   type of error. Attempting to create an entity that already exists would also fall into this category,
     *   if the entity in question is supposed to be unique
     */
    ErrorCode["UnmetPrerequisite"] = "UnmetPrerequisite";
    /**
     * this type of error is thrown when attempting to delete/modify an entity which has other entities depending on it. For example, deleting
     *   a Portfolio that still holds assets, or removing a Checkpoint Schedule that is being referenced by a Corporate Action
     */
    ErrorCode["EntityInUse"] = "EntityInUse";
    /**
     * one or more parties involved in the transaction do not have enough balance to perform it
     */
    ErrorCode["InsufficientBalance"] = "InsufficientBalance";
    /**
     * errors that are the result of something unforeseen.
     *   These should generally be reported to the Polymath team
     */
    ErrorCode["UnexpectedError"] = "UnexpectedError";
    /**
     * general purpose errors that don't fit well into the other categories
     */
    ErrorCode["General"] = "General";
})(ErrorCode = exports.ErrorCode || (exports.ErrorCode = {}));
/**
 * ERC1400 compliant transfer status
 */
var TransferStatus;
(function (TransferStatus) {
    TransferStatus["Failure"] = "Failure";
    TransferStatus["Success"] = "Success";
    TransferStatus["InsufficientBalance"] = "InsufficientBalance";
    TransferStatus["InsufficientAllowance"] = "InsufficientAllowance";
    TransferStatus["TransfersHalted"] = "TransfersHalted";
    TransferStatus["FundsLocked"] = "FundsLocked";
    TransferStatus["InvalidSenderAddress"] = "InvalidSenderAddress";
    TransferStatus["InvalidReceiverAddress"] = "InvalidReceiverAddress";
    TransferStatus["InvalidOperator"] = "InvalidOperator";
    TransferStatus["InvalidSenderIdentity"] = "InvalidSenderIdentity";
    TransferStatus["InvalidReceiverIdentity"] = "InvalidReceiverIdentity";
    TransferStatus["ComplianceFailure"] = "ComplianceFailure";
    TransferStatus["SmartExtensionFailure"] = "SmartExtensionFailure";
    TransferStatus["InvalidGranularity"] = "InvalidGranularity";
    TransferStatus["VolumeLimitReached"] = "VolumeLimitReached";
    TransferStatus["BlockedTransaction"] = "BlockedTransaction";
    TransferStatus["FundsLimitReached"] = "FundsLimitReached";
    TransferStatus["PortfolioFailure"] = "PortfolioFailure";
    TransferStatus["CustodianError"] = "CustodianError";
    TransferStatus["ScopeClaimMissing"] = "ScopeClaimMissing";
    TransferStatus["TransferRestrictionFailure"] = "TransferRestrictionFailure";
})(TransferStatus = exports.TransferStatus || (exports.TransferStatus = {}));
/**
 * Akin to TransferStatus, these are a bit more granular and specific. Every TransferError translates to
 *   a [[TransferStatus]], but two or more TransferErrors can represent the same TransferStatus, and
 *   not all Transfer Statuses are represented by a TransferError
 */
var TransferError;
(function (TransferError) {
    /**
     * translates to TransferStatus.InvalidGranularity
     *
     * occurs if attempting to transfer decimal amounts of a non-divisible token
     */
    TransferError["InvalidGranularity"] = "InvalidGranularity";
    /**
     * translates to TransferStatus.InvalidReceiverIdentity
     *
     * occurs if the origin and destination Identities are the same
     */
    TransferError["SelfTransfer"] = "SelfTransfer";
    /**
     * translates to TransferStatus.InvalidReceiverIdentity
     *
     * occurs if the receiver Identity doesn't have a valid CDD claim
     */
    TransferError["InvalidReceiverCdd"] = "InvalidReceiverCdd";
    /**
     * translates to TransferStatus.InvalidSenderIdentity
     *
     * occurs if the receiver Identity doesn't have a valid CDD claim
     */
    TransferError["InvalidSenderCdd"] = "InvalidSenderCdd";
    /**
     * translates to TransferStatus.ScopeClaimMissing
     *
     * occurs if one of the participants doesn't have a valid Investor Uniqueness Claim for
     *   the Asset
     */
    TransferError["ScopeClaimMissing"] = "ScopeClaimMissing";
    /**
     * translates to TransferStatus.InsufficientBalance
     *
     * occurs if the sender Identity does not have enough balance to cover the amount
     */
    TransferError["InsufficientBalance"] = "InsufficientBalance";
    /**
     * translates to TransferStatus.TransfersHalted
     *
     * occurs if the Asset's transfers are frozen
     */
    TransferError["TransfersFrozen"] = "TransfersFrozen";
    /**
     * translates to TransferStatus.PortfolioFailure
     *
     * occurs if the sender Portfolio doesn't exist
     */
    TransferError["InvalidSenderPortfolio"] = "InvalidSenderPortfolio";
    /**
     * translates to TransferStatus.PortfolioFailure
     *
     * occurs if the receiver Portfolio doesn't exist
     */
    TransferError["InvalidReceiverPortfolio"] = "InvalidReceiverPortfolio";
    /**
     * translates to TransferStatus.PortfolioFailure
     *
     * occurs if the sender Portfolio does not have enough balance to cover the amount
     */
    TransferError["InsufficientPortfolioBalance"] = "InsufficientPortfolioBalance";
})(TransferError = exports.TransferError || (exports.TransferError = {}));
/**
 * Type of relationship between a paying account and a beneficiary
 */
var PayingAccountType;
(function (PayingAccountType) {
    /**
     * the paying Account is currently subsidizing the caller
     */
    PayingAccountType["Subsidy"] = "Subsidy";
    /**
     * the paying Account is paying for a specific transaction because of
     *   chain-specific constraints (i.e. the caller is accepting an invitation to an Identity
     *   and cannot have any funds to pay for it by definition)
     */
    PayingAccountType["Other"] = "Other";
})(PayingAccountType = exports.PayingAccountType || (exports.PayingAccountType = {}));
var SignerType;
(function (SignerType) {
    /* eslint-disable @typescript-eslint/no-shadow */
    SignerType["Identity"] = "Identity";
    SignerType["Account"] = "Account";
    /* eslint-enable @typescript-eslint/no-shadow */
})(SignerType = exports.SignerType || (exports.SignerType = {}));
/**
 * Transaction Groups (for permissions purposes)
 */
var TxGroup;
(function (TxGroup) {
    /**
     * - TxTags.identity.AddInvestorUniquenessClaim
     * - TxTags.portfolio.MovePortfolioFunds
     * - TxTags.settlement.AddInstruction
     * - TxTags.settlement.AddAndAffirmInstruction
     * - TxTags.settlement.AffirmInstruction
     * - TxTags.settlement.RejectInstruction
     * - TxTags.settlement.CreateVenue
     */
    TxGroup["PortfolioManagement"] = "PortfolioManagement";
    /**
     * - TxTags.asset.MakeDivisible
     * - TxTags.asset.RenameAsset
     * - TxTags.asset.SetFundingRound
     * - TxTags.asset.AddDocuments
     * - TxTags.asset.RemoveDocuments
     */
    TxGroup["AssetManagement"] = "AssetManagement";
    /**
     * - TxTags.asset.Freeze
     * - TxTags.asset.Unfreeze
     * - TxTags.identity.AddAuthorization
     * - TxTags.identity.RemoveAuthorization
     */
    TxGroup["AdvancedAssetManagement"] = "AdvancedAssetManagement";
    /**
     * - TxTags.identity.AddInvestorUniquenessClaim
     * - TxTags.settlement.CreateVenue
     * - TxTags.settlement.AddInstruction
     * - TxTags.settlement.AddAndAffirmInstruction
     */
    TxGroup["Distribution"] = "Distribution";
    /**
     * - TxTags.asset.Issue
     */
    TxGroup["Issuance"] = "Issuance";
    /**
     * - TxTags.complianceManager.AddDefaultTrustedClaimIssuer
     * - TxTags.complianceManager.RemoveDefaultTrustedClaimIssuer
     */
    TxGroup["TrustedClaimIssuersManagement"] = "TrustedClaimIssuersManagement";
    /**
     * - TxTags.identity.AddClaim
     * - TxTags.identity.RevokeClaim
     */
    TxGroup["ClaimsManagement"] = "ClaimsManagement";
    /**
     * - TxTags.complianceManager.AddComplianceRequirement
     * - TxTags.complianceManager.RemoveComplianceRequirement
     * - TxTags.complianceManager.PauseAssetCompliance
     * - TxTags.complianceManager.ResumeAssetCompliance
     * - TxTags.complianceManager.ResetAssetCompliance
     */
    TxGroup["ComplianceRequirementsManagement"] = "ComplianceRequirementsManagement";
    /**
     * - TxTags.checkpoint.CreateSchedule,
     * - TxTags.checkpoint.RemoveSchedule,
     * - TxTags.checkpoint.CreateCheckpoint,
     * - TxTags.corporateAction.InitiateCorporateAction,
     * - TxTags.capitalDistribution.Distribute,
     * - TxTags.capitalDistribution.Claim,
     * - TxTags.identity.AddInvestorUniquenessClaim,
     */
    TxGroup["CorporateActionsManagement"] = "CorporateActionsManagement";
    /**
     * - TxTags.sto.CreateFundraiser,
     * - TxTags.sto.FreezeFundraiser,
     * - TxTags.sto.Invest,
     * - TxTags.sto.ModifyFundraiserWindow,
     * - TxTags.sto.Stop,
     * - TxTags.sto.UnfreezeFundraiser,
     * - TxTags.identity.AddInvestorUniquenessClaim,
     * - TxTags.asset.Issue,
     * - TxTags.settlement.CreateVenue
     */
    TxGroup["StoManagement"] = "StoManagement";
})(TxGroup = exports.TxGroup || (exports.TxGroup = {}));
var PermissionType;
(function (PermissionType) {
    PermissionType["Include"] = "Include";
    PermissionType["Exclude"] = "Exclude";
})(PermissionType = exports.PermissionType || (exports.PermissionType = {}));
var PermissionGroupType;
(function (PermissionGroupType) {
    /**
     * all transactions authorized
     */
    PermissionGroupType["Full"] = "Full";
    /**
     * not authorized:
     *   - externalAgents
     */
    PermissionGroupType["ExceptMeta"] = "ExceptMeta";
    /**
     * authorized:
     *   - corporateAction
     *   - corporateBallot
     *   - capitalDistribution
     */
    PermissionGroupType["PolymeshV1Caa"] = "PolymeshV1Caa";
    /**
     * authorized:
     *   - asset.issue
     *   - asset.redeem
     *   - asset.controllerTransfer
     *   - sto (except for sto.invest)
     */
    PermissionGroupType["PolymeshV1Pia"] = "PolymeshV1Pia";
})(PermissionGroupType = exports.PermissionGroupType || (exports.PermissionGroupType = {}));
var TransactionArgumentType;
(function (TransactionArgumentType) {
    TransactionArgumentType["Did"] = "Did";
    TransactionArgumentType["Address"] = "Address";
    TransactionArgumentType["Text"] = "Text";
    TransactionArgumentType["Boolean"] = "Boolean";
    TransactionArgumentType["Number"] = "Number";
    TransactionArgumentType["Balance"] = "Balance";
    TransactionArgumentType["Date"] = "Date";
    TransactionArgumentType["Array"] = "Array";
    TransactionArgumentType["Tuple"] = "Tuple";
    TransactionArgumentType["SimpleEnum"] = "SimpleEnum";
    TransactionArgumentType["RichEnum"] = "RichEnum";
    TransactionArgumentType["Object"] = "Object";
    TransactionArgumentType["Unknown"] = "Unknown";
    TransactionArgumentType["Null"] = "Null";
})(TransactionArgumentType = exports.TransactionArgumentType || (exports.TransactionArgumentType = {}));
var TransferRestrictionType;
(function (TransferRestrictionType) {
    TransferRestrictionType["Count"] = "Count";
    TransferRestrictionType["Percentage"] = "Percentage";
})(TransferRestrictionType = exports.TransferRestrictionType || (exports.TransferRestrictionType = {}));
var CalendarUnit;
(function (CalendarUnit) {
    CalendarUnit["Second"] = "second";
    CalendarUnit["Minute"] = "minute";
    CalendarUnit["Hour"] = "hour";
    CalendarUnit["Day"] = "day";
    CalendarUnit["Week"] = "week";
    CalendarUnit["Month"] = "month";
    CalendarUnit["Year"] = "year";
})(CalendarUnit = exports.CalendarUnit || (exports.CalendarUnit = {}));
__exportStar(require("../api/entities/types"), exports);
__exportStar(require("../base/types"), exports);
var types_2 = require("../middleware/types");
Object.defineProperty(exports, "Order", { enumerable: true, get: function () { return types_2.Order; } });
//# sourceMappingURL=index.js.map