{"version":3,"file":"controllers.cjs","sourceRoot":"","sources":["../../src/types/controllers.ts"],"names":[],"mappings":"","sourcesContent":["import type { ControllerStateChangeEvent } from '@metamask/base-controller';\nimport type { Hex, Json } from '@metamask/utils';\n\n// Partial types that should overlap with types from controllers.\nexport type TransactionMeta = {\n  /**\n   * Generated UUID associated with this transaction.\n   */\n  id: string;\n\n  /**\n   * Network code as per EIP-155 for this transaction.\n   */\n  chainId: Hex;\n\n  /**\n   * Origin this transaction was sent from.\n   */\n  origin?: string;\n\n  /**\n   * Underlying Transaction object.\n   */\n  txParams: TransactionParams;\n\n  /**\n   * The status of the transaction.\n   */\n  status: string;\n};\n\n/**\n * Standard data concerning a transaction to be processed by the blockchain.\n */\nexport type TransactionParams = {\n  /**\n   * Chain ID as per EIP-155.\n   */\n  chainId?: Hex;\n\n  /**\n   * Data to pass with this transaction.\n   */\n  data?: string;\n\n  /**\n   * Error message for gas estimation failure.\n   */\n  estimateGasError?: string;\n\n  /**\n   * Estimated base fee for this transaction.\n   */\n  estimatedBaseFee?: string;\n\n  /**\n   * Which estimate level that the API suggested.\n   */\n  estimateSuggested?: string;\n\n  /**\n   * Which estimate level was used\n   */\n  estimateUsed?: string;\n\n  /**\n   * Address to send this transaction from.\n   */\n  from: string;\n\n  /**\n   * same as gasLimit?\n   */\n  gas?: string;\n\n  /**\n   * Maximum number of units of gas to use for this transaction.\n   */\n  gasLimit?: string;\n\n  /**\n   * Price per gas for legacy txs\n   */\n  gasPrice?: string;\n\n  /**\n   * Gas used in the transaction.\n   */\n  gasUsed?: string;\n\n  /**\n   * Maximum amount per gas to pay for the transaction, including the priority\n   * fee.\n   */\n  maxFeePerGas?: string;\n\n  /**\n   * Maximum amount per gas to give to validator as incentive.\n   */\n  maxPriorityFeePerGas?: string;\n\n  /**\n   * Unique number to prevent replay attacks.\n   */\n  nonce?: string;\n\n  /**\n   * Address to send this transaction to.\n   */\n  to?: string;\n\n  /**\n   * Value associated with this transaction.\n   */\n  value?: string;\n\n  /**\n   * Type of transaction.\n   * 0x0 indicates a legacy transaction.\n   */\n  type?: string;\n};\n\nexport type TransactionControllerUnapprovedTransactionAddedEvent = {\n  type: `TransactionController:unapprovedTransactionAdded`;\n  payload: [transactionMeta: TransactionMeta];\n};\n\nexport type TransactionControllerTransactionStatusUpdatedEvent = {\n  type: `TransactionController:transactionStatusUpdated`;\n  payload: [\n    {\n      transactionMeta: TransactionMeta;\n    },\n  ];\n};\n\nexport type StateSignatureParams = {\n  from: string;\n  origin?: string;\n  deferSetAsSigned?: boolean;\n  data: string | Record<string, Json>;\n  signatureMethod: string;\n};\n\nexport type StateSignature = {\n  id: string;\n  msgParams: StateSignatureParams;\n};\n\nexport type SignatureControllerState = {\n  unapprovedPersonalMsgs: Record<string, StateSignature>;\n  unapprovedTypedMessages: Record<string, StateSignature>;\n  unapprovedPersonalMsgCount: number;\n  unapprovedTypedMessagesCount: number;\n};\n\nexport type SignatureControllerStateChangeEvent = ControllerStateChangeEvent<\n  'SignatureController',\n  SignatureControllerState\n>;\n"]}