Type alias ProviderEvents<Addr>

ProviderEvents<Addr>: {
    connected: Record<string, never>;
    disconnected: Error;
    transactionsFound: {
        address: Addr;
        transactions: Transaction<Addr>[];
        info: TransactionsBatchInfo;
    };
    contractStateChanged: {
        address: Addr;
        state: ContractState;
    };
    messageStatusUpdated: {
        address: Addr;
        hash: string;
        transaction?: Transaction<Addr>;
    };
    networkChanged: {
        selectedConnection: string;
        networkId: number;
    };
    permissionsChanged: {
        permissions: Partial<Permissions<Addr>>;
    };
    loggedOut: Record<string, never>;
}

Type Parameters

Type declaration

  • connected: Record<string, never>

    Called when inpage provider connects to the extension

  • disconnected: Error

    Called when inpage provider disconnects from extension

  • transactionsFound: {
        address: Addr;
        transactions: Transaction<Addr>[];
        info: TransactionsBatchInfo;
    }

    Called on each new transactions batch, received on subscription

    • address: Addr

      Contract address

    • transactions: Transaction<Addr>[]

      Guaranteed to be non-empty and ordered by descending lt

    • info: TransactionsBatchInfo

      Describes transactions lt rage

  • contractStateChanged: {
        address: Addr;
        state: ContractState;
    }

    Called every time contract state changes

    • address: Addr

      Contract address

    • state: ContractState

      New contract state

  • messageStatusUpdated: {
        address: Addr;
        hash: string;
        transaction?: Transaction<Addr>;
    }

    Called every time a delayed message was delivered or expired

    • address: Addr

      Account address

    • hash: string

      Message hash

    • Optional transaction?: Transaction<Addr>

      If not null, the transaction of the delivered message. Otherwise, the message has expired.

  • networkChanged: {
        selectedConnection: string;
        networkId: number;
    }

    Called each time the user changes network

    • selectedConnection: string

      Network group name

      Deprecated

      networkId should be used instead

    • networkId: number

      Numeric network id

  • permissionsChanged: {
        permissions: Partial<Permissions<Addr>>;
    }

    Called when permissions are changed. Mostly when account has been removed from the current accountInteraction permission, or disconnect method was called

  • loggedOut: Record<string, never>

    Called when the user logs out of the extension