import { AugmentedEvents, AugmentedSubmittable, QueryableConsts, QueryableStorage, SubmittableExtrinsic, SubmittableExtrinsics } from '@polkadot/api/types'; import { ISubmittableResult, Signer as PolkadotSigner } from '@polkadot/types/types'; import BigNumber from 'bignumber.js'; import { DocumentNode } from 'graphql'; import { Identity, PostTransactionValue } from "../internal"; import { CallIdEnum, ModuleIdEnum } from "../middleware/types"; import { CustomAssetTypeId, TxTag } from "../polkadot"; import { CalendarPeriod, KnownAssetType, PermissionGroupType, Role, SignerValue, SimplePermissions } from "./"; /** * Polkadot's `tx` submodule */ export declare type Extrinsics = SubmittableExtrinsics<'promise'>; /** * Polkadot's events */ export declare type Events = AugmentedEvents<'promise'>; /** * Polkadot's `query` submodule */ export declare type Queries = QueryableStorage<'promise'>; /** * Polkadot's `consts` submodule */ export declare type Consts = QueryableConsts<'promise'>; /** * Transform a tuple of types into an array of {@link PostTransactionValue}. * For each type in the tuple, the corresponding {@link PostTransactionValue} resolves to that type * * @param Values - types of the values to be wrapped */ export declare type PostTransactionValueArray = { [P in keyof Values]: PostTransactionValue; }; /** * Either a specific type or a {@link PostTransactionValue} that wraps a value of that type */ export declare type MaybePostTransactionValue = PostTransactionValue | T; /** * Apply the {@link MaybePostTransactionValue} type to all members of a tuple */ export declare type MapMaybePostTransactionValue = { [K in keyof T]: MaybePostTransactionValue; }; /** * Low level transaction method in the polkadot API * * @param Args - arguments of the transaction */ export declare type PolymeshTx = AugmentedSubmittable<(...args: Args) => SubmittableExtrinsic<'promise'>>; interface BaseTx { /** * underlying polkadot transaction object */ transaction: PolymeshTx; /** * amount by which the protocol fees should be multiplied (only applicable to transactions where the input size impacts the total fees) */ feeMultiplier?: BigNumber; } /** * Object containing a low level transaction and its respective arguments */ export declare type TxWithArgs = BaseTx & (Args extends [] ? { args?: undefined; } : { /** * arguments that the transaction will receive (some of them can be {@link PostTransactionValue} from an earlier transaction) */ args: MapMaybePostTransactionValue; }); /** * Transaction data for display purposes */ export interface TxData { /** * transaction string identifier */ tag: TxTag; /** * arguments with which the transaction will be called */ args: Args; } export declare type TxDataWithFees = TxData & Omit, 'args'>; /** * Apply the {@link PolymeshTx} type to all args in an array */ export declare type MapPolymeshTx = { [K in keyof ArgsArray]: ArgsArray[K] extends unknown[] ? PolymeshTx : never; }; /** * Apply the {@link TxWithArgs} type to all args in an array */ export declare type MapTxWithArgs = { [K in keyof ArgsArray]: ArgsArray[K] extends unknown[] ? TxWithArgs : never; }; /** * Apply the {@link TxData} type to all args in an array */ export declare type MapTxData = { [K in keyof ArgsArray]: ArgsArray[K] extends unknown[] ? TxData : never; }; /** * Apply the {@link TxDataWithFees} type to all args in an array */ export declare type MapTxDataWithFees = { [K in keyof ArgsArray]: ArgsArray[K] extends unknown[] ? TxDataWithFees : never; }; /** * Transform a tuple of types into an array of resolver functions. For each type in the tuple, the corresponding resolver function returns that type wrapped in a promise */ export declare type ResolverFunctionArray = { [K in keyof Values]: (receipt: ISubmittableResult) => Promise | Values[K]; }; /** * Base Transaction Schema * * @param Args - arguments of the transaction * @param Values - values that will be returned wrapped in {@link PostTransactionValue} after the transaction runs */ export interface BaseTransactionSpec { /** * wrapped values that will be returned after this transaction is run */ postTransactionValues?: PostTransactionValueArray; /** * Account that will sign the transaction */ signingAddress: string; /** * object that handles the payload signing logic */ signer: PolkadotSigner; /** * whether this tx failing makes the entire tx queue fail or not */ isCritical: boolean; /** * any protocol fees associated with running the transaction (not gas) */ fee?: BigNumber; /** * third party Identity that will pay for the transaction (for example when joining an Identity/multisig as a secondary key). * This is separate from a subsidy, and takes precedence over it. If the signing Account is being subsidized and * they try to execute a transaction with `paidForBy` set, the fees will be paid for by the `paidForBy` Identity */ paidForBy?: Identity; } /** * Schema of a transaction batch * * @param Args - arguments of the transaction * @param Values - values that will be returned wrapped in {@link PostTransactionValue} after the transaction runs */ export interface BatchTransactionSpec extends BaseTransactionSpec { /** * transactions in the batch with their respective arguments */ transactions: MapTxWithArgs; } /** * Schema of a specific transaction * * @param Args - arguments of the transaction * @param Values - values that will be returned wrapped in {@link PostTransactionValue} after the transaction runs */ export declare type TransactionSpec = BaseTransactionSpec & TxWithArgs; /** * Common args for `addTransaction` and `addBatchTransaction` */ export interface AddTransactionArgsBase { /** * value in POLYX of the transaction (should only be set manually in special cases, * otherwise it is fetched automatically from the chain). Fee multipliers have no effect on this value */ fee?: BigNumber; /** * asynchronous callbacks used to return runtime data after the transaction has finished successfully */ resolvers?: ResolverFunctionArray; /** * whether this transaction failing should make the entire queue fail or not. Defaults to true */ isCritical?: boolean; /** * third party Identity that will pay for the transaction fees. No value means that the caller pays */ paidForBy?: Identity; } /** * Args for `addBatchTransaction` */ export interface AddBatchTransactionArgs extends AddTransactionArgsBase { /** * list of transactions to be added to the batch, with their respective arguments and fee multipliers */ transactions: MapTxWithArgs<[...ArgsArray]>; } /** * Args for `addTransaction` */ export declare type AddTransactionArgs = AddTransactionArgsBase & TxWithArgs; export interface AuthTarget { target: SignerValue; authId: BigNumber; } export interface GraphqlQuery { query: DocumentNode; variables: Variables; } export declare enum ClaimOperation { Revoke = "Revoke", Add = "Add", Edit = "Edit" } export declare enum TrustedClaimIssuerOperation { Remove = "Remove", Add = "Add", Set = "Set" } export interface ExtrinsicIdentifier { moduleId: ModuleIdEnum; callId: CallIdEnum; } export interface PortfolioId { did: string; number?: BigNumber; } export declare enum InstructionAffirmationOperation { Affirm = "Affirm", Withdraw = "Withdraw", Reject = "Reject" } export interface ScheduleSpec { start: Date | null; period: CalendarPeriod | null; repetitions: BigNumber | null; } export interface ScopeClaimProof { proofScopeIdWellFormed: string; proofScopeIdCddIdMatch: { challengeResponses: [string, string]; subtractExpressionsRes: string; blindedScopeDidHash: string; }; } export interface CorporateActionIdentifier { ticker: string; localId: BigNumber; } /** * Represents the permissions that a signer must have in order to run a Procedure. In some cases, this must be determined * in a special way for the specific Procedure. In those cases, the resulting value will either be `true` if the signer can * run the procedure, or a string message indicating why the signer *CAN'T* run the Procedure */ export interface ProcedureAuthorization { /** * general permissions that apply to both Secondary Key Accounts and External * Agent Identities. Overridden by `signerPermissions` and `agentPermissions` respectively */ permissions?: SimplePermissions | true | string; /** * permissions specific to secondary Accounts. This value takes precedence over `permissions` for * secondary Accounts */ signerPermissions?: SimplePermissions | true | string; /** * permissions specific to External Agent Identities. This value takes precedence over `permissions` for * External Agents */ agentPermissions?: Omit | true | string; roles?: Role[] | true | string; } export declare type Falsyable = T | null | undefined; export declare type PermissionsEnum

= 'Whole' | { These: P[]; } | { Except: P[]; }; export declare type PalletPermissions = { pallet_name: string; dispatchable_names: PermissionsEnum; }; export declare enum InstructionStatus { Pending = "Pending", Unknown = "Unknown", Failed = "Failed" } /** * Determines the subset of permissions an Agent has over an Asset */ export declare type PermissionGroupIdentifier = PermissionGroupType | { custom: BigNumber; }; export declare type InternalAssetType = KnownAssetType | { Custom: CustomAssetTypeId; }; export declare enum AllowanceOperation { Set = "Set", Increase = "Increase", Decrease = "Decrease" } export {}; //# sourceMappingURL=internal.d.ts.map