UNPKG

nimiq-rpc-client-ts

Version:
215 lines (212 loc) 7.04 kB
import { m as BlockchainState } from './nimiq-rpc-client-ts.BvvqdQ38.cjs'; declare enum LogType { PayFee = "pay-fee", Transfer = "transfer", HtlcCreate = "htlc-create", HtlcTimeoutResolve = "htlc-timeout-resolve", HtlcRegularTransfer = "htlc-regular-transfer", HtlcEarlyResolve = "htlc-early-resolve", VestingCreate = "vesting-create", CreateValidator = "create-validator", UpdateValidator = "update-validator", ValidatorFeeDeduction = "validator-fee-deduction", DeactivateValidator = "deactivate-validator", ReactivateValidator = "reactivate-validator", RetireValidator = "retire-validator", DeleteValidator = "delete-validator", CreateStaker = "create-staker", Stake = "stake", UpdateStaker = "update-staker", SetActiveStake = "set-active-stake", RetireStake = "retire-stake", RemoveStake = "remove-stake", DeleteStaker = "delete-staker", StakerFeeDeduction = "staker-fee-deduction", PayoutReward = "payout-reward", Penalize = "penalize", JailValidator = "jail-validator", RevertContract = "revert-contract", FailedTransaction = "failed-transaction" } interface PayFeeLog { type: LogType.PayFee; from: string; fee: number; } interface TransferLog { type: LogType.Transfer; from: string; to: string; amount: number; data?: Uint8Array; } interface HtlcCreateLog { type: LogType.HtlcCreate; contractAddress: string; sender: string; recipient: string; hashRoot: string; hashCount: number; timeout: bigint; totalAmount: number; } interface HtlcTimeoutResolveLog { type: LogType.HtlcTimeoutResolve; contractAddress: string; } interface HtlcRegularTransferLog { type: LogType.HtlcRegularTransfer; contractAddress: string; preImage: string; hashDepth: number; } interface HtlcEarlyResolveLog { type: LogType.HtlcEarlyResolve; contractAddress: string; } interface VestingCreateLog { type: LogType.VestingCreate; contractAddress: string; owner: string; vestingStartTime: bigint; vestingTimeStep: bigint; vestingStepAmount: number; vestingTotalAmount: number; } interface CreateValidatorLog { type: LogType.CreateValidator; validatorAddress: string; rewardAddress: string; } interface UpdateValidatorLog { type: LogType.UpdateValidator; validatorAddress: string; oldRewardAddress: string; newRewardAddress: string | null; } interface ValidatorFeeDeductionLog { type: LogType.ValidatorFeeDeduction; validatorAddress: string; fee: number; } interface DeactivateValidatorLog { type: LogType.DeactivateValidator; validatorAddress: string; inactiveFrom: number; } interface ReactivateValidatorLog { type: LogType.ReactivateValidator; validatorAddress: string; } interface RetireValidatorLog { type: LogType.RetireValidator; validatorAddress: string; } interface DeleteValidatorLog { type: LogType.DeleteValidator; validatorAddress: string; rewardAddress: string; } interface CreateStakerLog { type: LogType.CreateStaker; stakerAddress: string; validatorAddress: string | null; value: number; } interface StakeLog { type: LogType.Stake; stakerAddress: string; validatorAddress: string | null; value: number; } interface UpdateStakerLog { type: LogType.UpdateStaker; stakerAddress: string; oldValidatorAddress: string | null; newValidatorAddress: string | null; activeBalance: number; inactiveFrom: number | null; } interface SetActiveStakeLog { type: LogType.SetActiveStake; stakerAddress: string; validatorAddress: string | null; activeBalance: number; inactiveBalance: number; inactiveFrom: number | null; } interface RetireStakeLog { type: LogType.RetireStake; stakerAddress: string; validatorAddress: string | null; inactiveBalance: number; inactiveFrom: number | null; retiredBalance: number; } interface RemoveStakeLog { type: LogType.RemoveStake; stakerAddress: string; validatorAddress: string | null; value: number; } interface DeleteStakerLog { type: LogType.DeleteStaker; stakerAddress: string; validatorAddress: string | null; } interface StakerFeeDeductionLog { type: LogType.StakerFeeDeduction; stakerAddress: string; fee: number; } interface PayoutRewardLog { type: LogType.PayoutReward; to: string; value: number; } interface PenalizeLog { type: LogType.Penalize; validatorAddress: string; offenseEventBlock: number; slot: number; newlyDeactivated: boolean; } interface JailValidatorLog { type: LogType.JailValidator; validatorAddress: string; jailedFrom: number; } interface RevertContractLog { type: LogType.RevertContract; contractAddress: string; } interface FailedTransactionLog { type: LogType.FailedTransaction; from: string; to: string; failureReason: string; } type Log = PayFeeLog | TransferLog | HtlcCreateLog | HtlcTimeoutResolveLog | HtlcRegularTransferLog | HtlcEarlyResolveLog | VestingCreateLog | CreateValidatorLog | UpdateValidatorLog | ValidatorFeeDeductionLog | DeactivateValidatorLog | ReactivateValidatorLog | RetireValidatorLog | DeleteValidatorLog | CreateStakerLog | StakeLog | UpdateStakerLog | SetActiveStakeLog | RetireStakeLog | RemoveStakeLog | DeleteStakerLog | StakerFeeDeductionLog | PayoutRewardLog | PenalizeLog | JailValidatorLog | RevertContractLog | FailedTransactionLog; interface TransactionLog { hash: string; logs: Log[]; failed: boolean; } interface BlockLog { inherents: Log[]; transactions: TransactionLog[]; } interface AppliedBlockLog extends BlockLog { type: 'applied-block'; timestamp: bigint; } interface RevertedBlockLog extends BlockLog { type: 'reverted-block'; } type BlockLogType = AppliedBlockLog | RevertedBlockLog; interface RPCData<T, M> { data: T; metadata: M; } type BlockLogResponse = RPCData<BlockLogType, BlockchainState>; export { type AppliedBlockLog as A, type BlockLog as B, type CreateValidatorLog as C, type DeactivateValidatorLog as D, type FailedTransactionLog as F, type HtlcCreateLog as H, type JailValidatorLog as J, LogType as L, type PayFeeLog as P, type ReactivateValidatorLog as R, type StakeLog as S, type TransferLog as T, type UpdateValidatorLog as U, type VestingCreateLog as V, type HtlcTimeoutResolveLog as a, type HtlcRegularTransferLog as b, type HtlcEarlyResolveLog as c, type ValidatorFeeDeductionLog as d, type RetireValidatorLog as e, type DeleteValidatorLog as f, type CreateStakerLog as g, type UpdateStakerLog as h, type SetActiveStakeLog as i, type RetireStakeLog as j, type RemoveStakeLog as k, type DeleteStakerLog as l, type StakerFeeDeductionLog as m, type PayoutRewardLog as n, type PenalizeLog as o, type RevertContractLog as p, type Log as q, type TransactionLog as r, type RevertedBlockLog as s, type BlockLogType as t, type RPCData as u, type BlockLogResponse as v };